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
annotations
class-attribute
instance-attribute
¶
annotations: Annotations | MISSING | None = MISSING
Display and routing hints.
BlobResourceContents
¶
Bases: AnnotatedObject
Binary contents of a resource.
Source code in src/aclientp/schema/v2/content.py
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
annotations
class-attribute
instance-attribute
¶
annotations: Annotations | MISSING | None = MISSING
Display and routing hints.
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
annotations
class-attribute
instance-attribute
¶
annotations: Annotations | MISSING | None = MISSING
Display and routing hints.
uri
class-attribute
instance-attribute
¶
URI associated with the image.
ResourceLink
¶
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
annotations
class-attribute
instance-attribute
¶
annotations: Annotations | MISSING | None = MISSING
Display and routing hints.
description
class-attribute
instance-attribute
¶
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.
size
class-attribute
instance-attribute
¶
Size of the resource in bytes.
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
name
instance-attribute
¶
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
annotations
class-attribute
instance-attribute
¶
annotations: Annotations | MISSING | None = MISSING
Display and routing hints.
TextResourceContents
¶
Bases: AnnotatedObject
Text contents of a resource.