Skip to content

content

Class info

Classes

Name Children Inherits
AudioContent
aclientp.schema.v2.content
Audio provided to or from an LLM. Requires the ``audio`` prompt capability.
    BlobResourceContents
    aclientp.schema.v2.content
    Binary contents of a resource.
      EmbeddedResource
      aclientp.schema.v2.content
      Resource contents embedded in a prompt or tool call result.
        ImageContent
        aclientp.schema.v2.content
        An image provided to or from an LLM. Requires the ``image`` prompt capability.
          ResourceLink
          aclientp.schema.v2.content
          A link to a resource the receiver may be able to read. All agents MUST support it.
            SkillReference
            aclientp.schema.v2.content
            **UNSTABLE**: A skill the user invokes with a prompt.
              TextContent
              aclientp.schema.v2.content
              Text provided to or from an LLM. All agents MUST support it in prompts.
                TextResourceContents
                aclientp.schema.v2.content
                Text contents of a resource.
                  UnknownContent
                  aclientp.schema.v2.content
                  A custom or future content block; ``type`` values starting with ``_`` are extensions.

                    🛈 DocStrings

                    v2 content blocks: text, media, resources and skill references.

                    ContentBlock module-attribute

                    ContentBlock = Annotated[
                        Annotated[TextContent, Tag("text")]
                        | Annotated[ImageContent, Tag("image")]
                        | Annotated[AudioContent, Tag("audio")]
                        | Annotated[ResourceLink, Tag("resource_link")]
                        | Annotated[EmbeddedResource, Tag("resource")]
                        | Annotated[SkillReference, Tag("skill")]
                        | Annotated[UnknownContent, Tag(OTHER_TAG)],
                        Discriminator(
                            open_discriminator(
                                "type", frozenset({"text", "image", "audio", "resource_link", "resource", "skill"})
                            )
                        ),
                    ]
                    

                    Displayable content: in prompts, model output, tool call results and more.

                    EmbeddedResourceResource module-attribute

                    EmbeddedResourceResource = TextResourceContents | BlobResourceContents
                    

                    Contents of an embedded resource: text or binary.

                    AudioContent

                    Bases: AnnotatedObject

                    Audio provided to or from an LLM. Requires the audio prompt capability.

                    Source code in src/aclientp/schema/v2/content.py
                    class AudioContent(AnnotatedObject):
                        """Audio provided to or from an LLM. Requires the ``audio`` prompt capability."""
                    
                        type: Literal["audio"] = Field(default="audio", init=False)
                    
                        data: str
                        """Base64-encoded audio data."""
                    
                        mime_type: MediaType
                        """MIME type of the audio."""
                    
                        annotations: Annotations | MISSING | None = MISSING
                        """Display and routing hints."""
                    

                    annotations class-attribute instance-attribute

                    annotations: Annotations | MISSING | None = MISSING
                    

                    Display and routing hints.

                    data instance-attribute

                    data: str
                    

                    Base64-encoded audio data.

                    mime_type instance-attribute

                    mime_type: MediaType
                    

                    MIME type of the audio.

                    BlobResourceContents

                    Bases: AnnotatedObject

                    Binary contents of a resource.

                    Source code in src/aclientp/schema/v2/content.py
                    class BlobResourceContents(AnnotatedObject):
                        """Binary contents of a resource."""
                    
                        blob: str
                        """Base64-encoded bytes."""
                    
                        uri: str
                        """URI of the resource."""
                    
                        mime_type: MediaType | MISSING | None = MISSING
                        """MIME type of the resource."""
                    

                    blob instance-attribute

                    blob: str
                    

                    Base64-encoded bytes.

                    mime_type class-attribute instance-attribute

                    mime_type: MediaType | MISSING | None = MISSING
                    

                    MIME type of the resource.

                    uri instance-attribute

                    uri: str
                    

                    URI of the resource.

                    EmbeddedResource

                    Bases: AnnotatedObject

                    Resource contents embedded in a prompt or tool call result.

                    Requires the embeddedContext prompt capability in prompts.

                    Source code in src/aclientp/schema/v2/content.py
                    class EmbeddedResource(AnnotatedObject):
                        """Resource contents embedded in a prompt or tool call result.
                    
                        Requires the ``embeddedContext`` prompt capability in prompts.
                        """
                    
                        type: Literal["resource"] = Field(default="resource", init=False)
                    
                        resource: EmbeddedResourceResource
                        """The embedded contents."""
                    
                        annotations: Annotations | MISSING | None = MISSING
                        """Display and routing hints."""
                    

                    annotations class-attribute instance-attribute

                    annotations: Annotations | MISSING | None = MISSING
                    

                    Display and routing hints.

                    resource instance-attribute

                    The embedded contents.

                    ImageContent

                    Bases: AnnotatedObject

                    An image provided to or from an LLM. Requires the image prompt capability.

                    Source code in src/aclientp/schema/v2/content.py
                    class ImageContent(AnnotatedObject):
                        """An image provided to or from an LLM. Requires the ``image`` prompt capability."""
                    
                        type: Literal["image"] = Field(default="image", init=False)
                    
                        data: str
                        """Base64-encoded image data."""
                    
                        mime_type: MediaType
                        """MIME type of the image."""
                    
                        uri: str | MISSING | None = MISSING
                        """URI associated with the image."""
                    
                        annotations: Annotations | MISSING | None = MISSING
                        """Display and routing hints."""
                    

                    annotations class-attribute instance-attribute

                    annotations: Annotations | MISSING | None = MISSING
                    

                    Display and routing hints.

                    data instance-attribute

                    data: str
                    

                    Base64-encoded image data.

                    mime_type instance-attribute

                    mime_type: MediaType
                    

                    MIME type of the image.

                    uri class-attribute instance-attribute

                    uri: str | MISSING | None = MISSING
                    

                    URI associated with the image.

                    Bases: AnnotatedObject

                    A link to a resource the receiver may be able to read. All agents MUST support it.

                    Source code in src/aclientp/schema/v2/content.py
                    class ResourceLink(AnnotatedObject):
                        """A link to a resource the receiver may be able to read. All agents MUST support it."""
                    
                        type: Literal["resource_link"] = Field(default="resource_link", init=False)
                    
                        name: str
                        """Human-readable name."""
                    
                        uri: str
                        """URI of the resource."""
                    
                        title: str | MISSING | None = MISSING
                        """Display title."""
                    
                        description: str | MISSING | None = MISSING
                        """Human-readable details."""
                    
                        icons: Sequence[Icon] | MISSING | None = MISSING
                        """Icons a user interface can show."""
                    
                        mime_type: MediaType | MISSING | None = MISSING
                        """MIME type of the resource."""
                    
                        size: int | MISSING | None = Field(default=MISSING, ge=0)
                        """Size of the resource in bytes."""
                    
                        annotations: Annotations | MISSING | None = MISSING
                        """Display and routing hints."""
                    

                    annotations class-attribute instance-attribute

                    annotations: Annotations | MISSING | None = MISSING
                    

                    Display and routing hints.

                    description class-attribute instance-attribute

                    description: str | MISSING | None = MISSING
                    

                    Human-readable details.

                    icons class-attribute instance-attribute

                    icons: Sequence[Icon] | MISSING | None = MISSING
                    

                    Icons a user interface can show.

                    mime_type class-attribute instance-attribute

                    mime_type: MediaType | MISSING | None = MISSING
                    

                    MIME type of the resource.

                    name instance-attribute

                    name: str
                    

                    Human-readable name.

                    size class-attribute instance-attribute

                    size: int | MISSING | None = Field(default=MISSING, ge=0)
                    

                    Size of the resource in bytes.

                    title class-attribute instance-attribute

                    title: str | MISSING | None = MISSING
                    

                    Display title.

                    uri instance-attribute

                    uri: str
                    

                    URI of the resource.

                    SkillReference

                    Bases: AnnotatedObject

                    UNSTABLE: A skill the user invokes with a prompt.

                    Names a skill entry of the session's command list. Requires the skill prompt capability.

                    Source code in src/aclientp/schema/v2/content.py
                    class SkillReference(AnnotatedObject):
                        """**UNSTABLE**: A skill the user invokes with a prompt.
                    
                        Names a ``skill`` entry of the session's command list. Requires the ``skill``
                        prompt capability.
                        """
                    
                        type: Literal["skill"] = Field(default="skill", init=False)
                    
                        name: str
                        """The ``name`` of a ``skill`` entry in the session's current command list."""
                    

                    name instance-attribute

                    name: str
                    

                    The name of a skill entry in the session's current command list.

                    TextContent

                    Bases: AnnotatedObject

                    Text provided to or from an LLM. All agents MUST support it in prompts.

                    Source code in src/aclientp/schema/v2/content.py
                    class TextContent(AnnotatedObject):
                        """Text provided to or from an LLM. All agents MUST support it in prompts."""
                    
                        type: Literal["text"] = Field(default="text", init=False)
                    
                        text: str
                        """The text; clients SHOULD render it as Markdown."""
                    
                        annotations: Annotations | MISSING | None = MISSING
                        """Display and routing hints."""
                    

                    annotations class-attribute instance-attribute

                    annotations: Annotations | MISSING | None = MISSING
                    

                    Display and routing hints.

                    text instance-attribute

                    text: str
                    

                    The text; clients SHOULD render it as Markdown.

                    TextResourceContents

                    Bases: AnnotatedObject

                    Text contents of a resource.

                    Source code in src/aclientp/schema/v2/content.py
                    class TextResourceContents(AnnotatedObject):
                        """Text contents of a resource."""
                    
                        text: str
                        """The text."""
                    
                        uri: str
                        """URI of the resource."""
                    
                        mime_type: MediaType | MISSING | None = MISSING
                        """MIME type of the resource."""
                    

                    mime_type class-attribute instance-attribute

                    mime_type: MediaType | MISSING | None = MISSING
                    

                    MIME type of the resource.

                    text instance-attribute

                    text: str
                    

                    The text.

                    uri instance-attribute

                    uri: str
                    

                    URI of the resource.

                    UnknownContent

                    Bases: Unknown

                    A custom or future content block; type values starting with _ are extensions.

                    Source code in src/aclientp/schema/v2/content.py
                    class UnknownContent(Unknown):
                        """A custom or future content block; ``type`` values starting with ``_`` are extensions."""
                    
                        type: str
                        """The content block type."""
                    

                    type instance-attribute

                    type: str
                    

                    The content block type.