Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 27 additions & 27 deletions agent-client-protocol-schema/src/v2/content.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,13 @@ fn other_content_block_schema(schema: &mut Schema) {
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)]
#[non_exhaustive]
pub struct TextContent {
/// Text payload carried by this content block.
pub text: String,
/// Optional annotations that help clients decide how to display or route this content.
#[serde_as(deserialize_as = "DefaultOnError")]
#[schemars(extend("x-deserialize-default-on-error" = true))]
#[serde(default)]
pub annotations: Option<Annotations>,
/// Text payload carried by this content block.
pub text: String,
/// The _meta property is reserved by ACP to allow clients and agents to attach additional
/// metadata to their interactions. Implementations MUST NOT make assumptions about values at
/// these keys.
Expand Down Expand Up @@ -211,11 +211,6 @@ impl<T: Into<String>> From<T> for ContentBlock {
#[serde(rename_all = "camelCase")]
#[non_exhaustive]
pub struct ImageContent {
/// Optional annotations that help clients decide how to display or route this content.
#[serde_as(deserialize_as = "DefaultOnError")]
#[schemars(extend("x-deserialize-default-on-error" = true))]
#[serde(default)]
pub annotations: Option<Annotations>,
/// Base64-encoded media payload.
pub data: String,
/// MIME type describing the encoded media payload.
Expand All @@ -225,6 +220,11 @@ pub struct ImageContent {
#[schemars(extend("x-deserialize-default-on-error" = true))]
#[serde(default)]
pub uri: Option<String>,
/// Optional annotations that help clients decide how to display or route this content.
#[serde_as(deserialize_as = "DefaultOnError")]
#[schemars(extend("x-deserialize-default-on-error" = true))]
#[serde(default)]
pub annotations: Option<Annotations>,
/// The _meta property is reserved by ACP to allow clients and agents to attach additional
/// metadata to their interactions. Implementations MUST NOT make assumptions about values at
/// these keys.
Expand Down Expand Up @@ -283,15 +283,15 @@ impl ImageContent {
#[serde(rename_all = "camelCase")]
#[non_exhaustive]
pub struct AudioContent {
/// Base64-encoded media payload.
pub data: String,
/// MIME type describing the encoded media payload.
pub mime_type: String,
/// Optional annotations that help clients decide how to display or route this content.
#[serde_as(deserialize_as = "DefaultOnError")]
#[schemars(extend("x-deserialize-default-on-error" = true))]
#[serde(default)]
pub annotations: Option<Annotations>,
/// Base64-encoded media payload.
pub data: String,
/// MIME type describing the encoded media payload.
pub mime_type: String,
/// The _meta property is reserved by ACP to allow clients and agents to attach additional
/// metadata to their interactions. Implementations MUST NOT make assumptions about values at
/// these keys.
Expand Down Expand Up @@ -341,13 +341,13 @@ impl AudioContent {
#[derive(Debug, Clone, PartialEq, Deserialize, Serialize, JsonSchema)]
#[non_exhaustive]
pub struct EmbeddedResource {
/// Embedded resource payload, either text or binary data.
pub resource: EmbeddedResourceResource,
/// Optional annotations that help clients decide how to display or route this content.
#[serde_as(deserialize_as = "DefaultOnError")]
#[schemars(extend("x-deserialize-default-on-error" = true))]
#[serde(default)]
pub annotations: Option<Annotations>,
/// Embedded resource payload, either text or binary data.
pub resource: EmbeddedResourceResource,
/// The _meta property is reserved by ACP to allow clients and agents to attach additional
/// metadata to their interactions. Implementations MUST NOT make assumptions about values at
/// these keys.
Expand Down Expand Up @@ -408,15 +408,15 @@ pub enum EmbeddedResourceResource {
#[serde(rename_all = "camelCase")]
#[non_exhaustive]
pub struct TextResourceContents {
/// Text payload carried by this content block.
pub text: String,
/// URI associated with this resource or media payload.
pub uri: String,
/// MIME type describing the encoded media payload.
#[serde_as(deserialize_as = "DefaultOnError")]
#[schemars(extend("x-deserialize-default-on-error" = true))]
#[serde(default)]
pub mime_type: Option<String>,
/// Text payload carried by this content block.
pub text: String,
/// URI associated with this resource or media payload.
pub uri: String,
/// The _meta property is reserved by ACP to allow clients and agents to attach additional
/// metadata to their interactions. Implementations MUST NOT make assumptions about values at
/// these keys.
Expand Down Expand Up @@ -469,13 +469,13 @@ impl TextResourceContents {
pub struct BlobResourceContents {
/// Base64-encoded bytes for a binary resource payload.
pub blob: String,
/// URI associated with this resource or media payload.
pub uri: String,
/// MIME type describing the encoded media payload.
#[serde_as(deserialize_as = "DefaultOnError")]
#[schemars(extend("x-deserialize-default-on-error" = true))]
#[serde(default)]
pub mime_type: Option<String>,
/// URI associated with this resource or media payload.
pub uri: String,
/// The _meta property is reserved by ACP to allow clients and agents to attach additional
/// metadata to their interactions. Implementations MUST NOT make assumptions about values at
/// these keys.
Expand Down Expand Up @@ -526,11 +526,15 @@ impl BlobResourceContents {
#[serde(rename_all = "camelCase")]
#[non_exhaustive]
pub struct ResourceLink {
/// Optional annotations that help clients decide how to display or route this content.
/// Human-readable name shown for this protocol object.
pub name: String,
/// URI associated with this resource or media payload.
pub uri: String,
/// Optional display title for end-user UI.
#[serde_as(deserialize_as = "DefaultOnError")]
#[schemars(extend("x-deserialize-default-on-error" = true))]
#[serde(default)]
pub annotations: Option<Annotations>,
pub title: Option<String>,
/// Optional human-readable details shown with this protocol object.
#[serde_as(deserialize_as = "DefaultOnError")]
#[schemars(extend("x-deserialize-default-on-error" = true))]
Expand All @@ -541,20 +545,16 @@ pub struct ResourceLink {
#[schemars(extend("x-deserialize-default-on-error" = true))]
#[serde(default)]
pub mime_type: Option<String>,
/// Human-readable name shown for this protocol object.
pub name: String,
/// Optional size of the linked resource in bytes, if known.
#[serde_as(deserialize_as = "DefaultOnError")]
#[schemars(extend("x-deserialize-default-on-error" = true))]
#[serde(default)]
pub size: Option<i64>,
/// Optional display title for end-user UI.
/// Optional annotations that help clients decide how to display or route this content.
#[serde_as(deserialize_as = "DefaultOnError")]
#[schemars(extend("x-deserialize-default-on-error" = true))]
#[serde(default)]
pub title: Option<String>,
/// URI associated with this resource or media payload.
pub uri: String,
pub annotations: Option<Annotations>,
/// The _meta property is reserved by ACP to allow clients and agents to attach additional
/// metadata to their interactions. Implementations MUST NOT make assumptions about values at
/// these keys.
Expand Down
124 changes: 62 additions & 62 deletions schema/v2/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -980,6 +980,10 @@
"description": "Text provided to or from an LLM.",
"type": "object",
"properties": {
"text": {
"description": "Text payload carried by this content block.",
"type": "string"
},
"annotations": {
"description": "Optional annotations that help clients decide how to display or route this content.",
"anyOf": [
Expand All @@ -992,10 +996,6 @@
],
"x-deserialize-default-on-error": true
},
"text": {
"description": "Text payload carried by this content block.",
"type": "string"
},
"_meta": {
"description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/extensibility)",
"type": ["object", "null"],
Expand All @@ -1009,18 +1009,6 @@
"description": "An image provided to or from an LLM.",
"type": "object",
"properties": {
"annotations": {
"description": "Optional annotations that help clients decide how to display or route this content.",
"anyOf": [
{
"$ref": "#/$defs/Annotations"
},
{
"type": "null"
}
],
"x-deserialize-default-on-error": true
},
"data": {
"description": "Base64-encoded media payload.",
"type": "string"
Expand All @@ -1034,6 +1022,18 @@
"type": ["string", "null"],
"x-deserialize-default-on-error": true
},
"annotations": {
"description": "Optional annotations that help clients decide how to display or route this content.",
"anyOf": [
{
"$ref": "#/$defs/Annotations"
},
{
"type": "null"
}
],
"x-deserialize-default-on-error": true
},
"_meta": {
"description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/extensibility)",
"type": ["object", "null"],
Expand All @@ -1047,6 +1047,14 @@
"description": "Audio provided to or from an LLM.",
"type": "object",
"properties": {
"data": {
"description": "Base64-encoded media payload.",
"type": "string"
},
"mimeType": {
"description": "MIME type describing the encoded media payload.",
"type": "string"
},
"annotations": {
"description": "Optional annotations that help clients decide how to display or route this content.",
"anyOf": [
Expand All @@ -1059,14 +1067,6 @@
],
"x-deserialize-default-on-error": true
},
"data": {
"description": "Base64-encoded media payload.",
"type": "string"
},
"mimeType": {
"description": "MIME type describing the encoded media payload.",
"type": "string"
},
"_meta": {
"description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/extensibility)",
"type": ["object", "null"],
Expand All @@ -1080,16 +1080,17 @@
"description": "A resource that the server is capable of reading, included in a prompt or tool call result.",
"type": "object",
"properties": {
"annotations": {
"description": "Optional annotations that help clients decide how to display or route this content.",
"anyOf": [
{
"$ref": "#/$defs/Annotations"
},
{
"type": "null"
}
],
"name": {
"description": "Human-readable name shown for this protocol object.",
"type": "string"
},
"uri": {
"description": "URI associated with this resource or media payload.",
"type": "string"
},
"title": {
"description": "Optional display title for end-user UI.",
"type": ["string", "null"],
"x-deserialize-default-on-error": true
},
"description": {
Expand All @@ -1102,25 +1103,24 @@
"type": ["string", "null"],
"x-deserialize-default-on-error": true
},
"name": {
"description": "Human-readable name shown for this protocol object.",
"type": "string"
},
"size": {
"description": "Optional size of the linked resource in bytes, if known.",
"type": ["integer", "null"],
"format": "int64",
"x-deserialize-default-on-error": true
},
"title": {
"description": "Optional display title for end-user UI.",
"type": ["string", "null"],
"annotations": {
"description": "Optional annotations that help clients decide how to display or route this content.",
"anyOf": [
{
"$ref": "#/$defs/Annotations"
},
{
"type": "null"
}
],
"x-deserialize-default-on-error": true
},
"uri": {
"description": "URI associated with this resource or media payload.",
"type": "string"
},
"_meta": {
"description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/extensibility)",
"type": ["object", "null"],
Expand Down Expand Up @@ -1157,11 +1157,6 @@
"description": "Text-based resource contents.",
"type": "object",
"properties": {
"mimeType": {
"description": "MIME type describing the encoded media payload.",
"type": ["string", "null"],
"x-deserialize-default-on-error": true
},
"text": {
"description": "Text payload carried by this content block.",
"type": "string"
Expand All @@ -1170,6 +1165,11 @@
"description": "URI associated with this resource or media payload.",
"type": "string"
},
"mimeType": {
"description": "MIME type describing the encoded media payload.",
"type": ["string", "null"],
"x-deserialize-default-on-error": true
},
"_meta": {
"description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/extensibility)",
"type": ["object", "null"],
Expand All @@ -1187,15 +1187,15 @@
"description": "Base64-encoded bytes for a binary resource payload.",
"type": "string"
},
"uri": {
"description": "URI associated with this resource or media payload.",
"type": "string"
},
"mimeType": {
"description": "MIME type describing the encoded media payload.",
"type": ["string", "null"],
"x-deserialize-default-on-error": true
},
"uri": {
"description": "URI associated with this resource or media payload.",
"type": "string"
},
"_meta": {
"description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/extensibility)",
"type": ["object", "null"],
Expand All @@ -1209,6 +1209,14 @@
"description": "The contents of a resource, embedded into a prompt or tool call result.",
"type": "object",
"properties": {
"resource": {
"description": "Embedded resource payload, either text or binary data.",
"allOf": [
{
"$ref": "#/$defs/EmbeddedResourceResource"
}
]
},
"annotations": {
"description": "Optional annotations that help clients decide how to display or route this content.",
"anyOf": [
Expand All @@ -1221,14 +1229,6 @@
],
"x-deserialize-default-on-error": true
},
"resource": {
"description": "Embedded resource payload, either text or binary data.",
"allOf": [
{
"$ref": "#/$defs/EmbeddedResourceResource"
}
]
},
"_meta": {
"description": "The _meta property is reserved by ACP to allow clients and agents to attach additional\nmetadata to their interactions. Implementations MUST NOT make assumptions about values at\nthese keys.\n\nSee protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/v2/extensibility)",
"type": ["object", "null"],
Expand Down
Loading
Loading