{ "$defs": { "BlobPart": { "description": "Represents blob binary data sent inline to the model", "properties": { "type": { "const": "blob", "description": "The type of the content captured in this part.", "title": "Type", "type": "string" }, "mime_type": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The IANA MIME type of the attached data.", "title": "Mime Type" }, "modality": { "anyOf": [ { "$ref": "#/$defs/Modality" }, { "type": "string" } ], "description": "The general modality of the data if it is known. Instrumentations SHOULD also set the mimeType field if the specific type is known.", "title": "Modality" }, "content": { "anyOf": [ { "format": "binary", "type": "string" }, { "type": "null" } ], "default": null, "description": "Raw bytes of the attached data.", "title": "Content" } }, "required": [ "type", "modality" ], "title": "BlobPart", "type": "object" }, "CompactionPart": { "additionalProperties": true, "description": "Represents compacted conversation state sent to or received from the model.", "properties": { "type": { "const": "compaction", "description": "The type of the content captured in this part.", "title": "Type", "type": "string" }, "id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "Provider-assigned identifier for the compaction item or block.", "title": "Id" }, "content": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The unencrypted compacted conversation summary, when available.", "title": "Content" } }, "required": [ "type" ], "title": "CompactionPart", "type": "object" }, "FilePart": { "additionalProperties": true, "description": "Represents an external referenced file sent to the model by file id", "properties": { "type": { "const": "file", "description": "The type of the content captured in this part.", "title": "Type", "type": "string" }, "mime_type": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The IANA MIME type of the attached data.", "title": "Mime Type" }, "modality": { "anyOf": [ { "$ref": "#/$defs/Modality" }, { "type": "string" } ], "description": "The general modality of the data if it is known. Instrumentations SHOULD also set the mimeType field if the specific type is known.", "title": "Modality" }, "file_id": { "description": "An identifier referencing a file that was pre-uploaded to the provider.", "title": "File Id", "type": "string" } }, "required": [ "type", "modality", "file_id" ], "title": "FilePart", "type": "object" }, "FinishReason": { "description": "Represents the reason for finishing the generation.", "enum": [ "stop", "length", "content_filter", "tool_call", "compaction", "error" ], "title": "FinishReason", "type": "string" }, "GenericPart": { "additionalProperties": true, "description": "Fallback for consumers when a message part has a `type` not defined by this\nversion of semantic conventions. When the instrumented API sends or returns\ncontent that none of the defined part types fit, record the part keeping\nthe provider's fields. Consumers SHOULD expect parts with `type` values\nthey don't recognize, including provider-specific parts and part types\nadded in newer versions of semantic conventions.", "properties": { "type": { "description": "The type of the content captured in this part. When recording a provider-specific part, it is RECOMMENDED to prefix the value with `gen_ai.provider.name` (for example `anthropic.search_result`) to avoid name collisions with current or future part types defined by semantic conventions.", "not": { "enum": [ "text", "tool_call", "tool_call_response", "server_tool_call", "server_tool_call_response", "blob", "file", "uri", "transcription", "reasoning", "compaction" ] }, "title": "Type", "type": "string" } }, "required": [ "type" ], "title": "GenericPart", "type": "object" }, "GenericServerToolCall": { "additionalProperties": true, "description": "Represents an arbitrary server tool call with any type and properties.\nThis allows for extensibility with custom server tool types.", "properties": { "type": { "description": "Type identifier for the server tool call.", "title": "Type", "type": "string" } }, "required": [ "type" ], "title": "GenericServerToolCall", "type": "object" }, "GenericServerToolCallResponse": { "additionalProperties": true, "description": "Represents an arbitrary server tool call response with any type and properties.\nThis allows for extensibility with custom server tool response types.", "properties": { "type": { "description": "Type identifier for the server tool call response.", "title": "Type", "type": "string" } }, "required": [ "type" ], "title": "GenericServerToolCallResponse", "type": "object" }, "Modality": { "enum": [ "image", "video", "audio", "document" ], "title": "Modality", "type": "string" }, "OutputMessage": { "additionalProperties": true, "description": "Represents an output message generated by the model or agent. The output message captures\nspecific response (choice, candidate).", "properties": { "role": { "anyOf": [ { "$ref": "#/$defs/Role" }, { "type": "string" } ], "description": "Role of the entity that created the message.", "title": "Role" }, "parts": { "description": "List of message parts that make up the message content.", "items": { "anyOf": [ { "$ref": "#/$defs/TextPart" }, { "$ref": "#/$defs/ToolCallRequestPart" }, { "$ref": "#/$defs/ToolCallResponsePart" }, { "$ref": "#/$defs/ServerToolCallPart" }, { "$ref": "#/$defs/ServerToolCallResponsePart" }, { "$ref": "#/$defs/BlobPart" }, { "$ref": "#/$defs/FilePart" }, { "$ref": "#/$defs/UriPart" }, { "$ref": "#/$defs/TranscriptionPart" }, { "$ref": "#/$defs/ReasoningPart" }, { "$ref": "#/$defs/CompactionPart" }, { "$ref": "#/$defs/GenericPart" } ] }, "title": "Parts", "type": "array" }, "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The name of the participant.", "title": "Name" }, "finish_reason": { "anyOf": [ { "$ref": "#/$defs/FinishReason" }, { "type": "string" }, { "type": "null" } ], "default": null, "deprecated": true, "description": "Deprecated: report finish reasons in `gen_ai.response.finish_reasons` instead. Reason for finishing the generation.", "title": "Finish Reason" } }, "required": [ "role", "parts" ], "title": "OutputMessage", "type": "object" }, "ReasoningPart": { "additionalProperties": true, "description": "Represents reasoning/thinking content received from the model.", "properties": { "type": { "const": "reasoning", "description": "The type of the content captured in this part.", "title": "Type", "type": "string" }, "content": { "description": "Reasoning/thinking content received from the model.", "title": "Content", "type": "string" } }, "required": [ "type", "content" ], "title": "ReasoningPart", "type": "object" }, "Role": { "enum": [ "system", "user", "assistant", "tool" ], "title": "Role", "type": "string" }, "ServerToolCallPart": { "additionalProperties": true, "description": "Represents a server-side tool call invocation. Server tool calls are executed by the model provider on the server side rather than by the client application. Provider-specific tools (e.g., code_interpreter, web_search) can have well-defined schemas defined by the respective providers.", "properties": { "type": { "const": "server_tool_call", "description": "The type of the content captured in this part.", "title": "Type", "type": "string" }, "id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "Unique identifier for the server tool call.", "title": "Id" }, "name": { "description": "Name of the server tool.", "title": "Name", "type": "string" }, "server_tool_call": { "$ref": "#/$defs/GenericServerToolCall", "description": "Polymorphic server tool call details with type discriminator. The structure varies based on the tool type." } }, "required": [ "type", "name", "server_tool_call" ], "title": "ServerToolCallPart", "type": "object" }, "ServerToolCallResponsePart": { "additionalProperties": true, "description": "Represents a server-side tool call response. Contains the outcome and details of a server tool execution. Provider-specific tools (e.g., code_interpreter, web_search) can have well-defined response schemas defined by the respective providers.", "properties": { "type": { "const": "server_tool_call_response", "description": "The type of the content captured in this part.", "title": "Type", "type": "string" }, "id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "Unique server tool call identifier matching the original call.", "title": "Id" }, "server_tool_call_response": { "$ref": "#/$defs/GenericServerToolCallResponse", "description": "Polymorphic server tool call response with type discriminator. The structure varies based on the tool type." } }, "required": [ "type", "server_tool_call_response" ], "title": "ServerToolCallResponsePart", "type": "object" }, "TextPart": { "additionalProperties": true, "description": "Represents text content sent to or received from the model.", "properties": { "type": { "const": "text", "description": "The type of the content captured in this part.", "title": "Type", "type": "string" }, "content": { "description": "Text content sent to or received from the model.", "title": "Content", "type": "string" } }, "required": [ "type", "content" ], "title": "TextPart", "type": "object" }, "ToolCallRequestPart": { "additionalProperties": true, "description": "Represents a tool call requested by the model.", "properties": { "type": { "const": "tool_call", "description": "The type of the content captured in this part.", "title": "Type", "type": "string" }, "id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "Unique identifier for the tool call.", "title": "Id" }, "name": { "description": "Name of the tool.", "title": "Name", "type": "string" }, "arguments": { "default": null, "description": "Arguments for the tool call.", "title": "Arguments" } }, "required": [ "type", "name" ], "title": "ToolCallRequestPart", "type": "object" }, "ToolCallResponsePart": { "additionalProperties": true, "description": "Represents a tool call result sent to the model or a built-in tool call outcome and details.", "properties": { "type": { "const": "tool_call_response", "description": "The type of the content captured in this part.", "title": "Type", "type": "string" }, "id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "Unique tool call identifier.", "title": "Id" }, "response": { "description": "Tool call response.", "title": "Response" } }, "required": [ "type", "response" ], "title": "ToolCallResponsePart", "type": "object" }, "TranscriptionPart": { "additionalProperties": true, "description": "Represents a text transcript of spoken audio, captured as a standalone part.", "properties": { "type": { "const": "transcription", "description": "The type of the content captured in this part.", "title": "Type", "type": "string" }, "content": { "description": "The text transcript of spoken audio. For input audio this is the transcription of the user's speech; for output audio it is the transcript of the model's spoken response.", "title": "Content", "type": "string" } }, "required": [ "type", "content" ], "title": "TranscriptionPart", "type": "object" }, "UriPart": { "additionalProperties": true, "description": "Represents an external referenced file sent to the model by URI", "properties": { "type": { "const": "uri", "description": "The type of the content captured in this part.", "title": "Type", "type": "string" }, "mime_type": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The IANA MIME type of the attached data.", "title": "Mime Type" }, "modality": { "anyOf": [ { "$ref": "#/$defs/Modality" }, { "type": "string" } ], "description": "The general modality of the data if it is known. Instrumentations SHOULD also set the mimeType field if the specific type is known.", "title": "Modality" }, "uri": { "description": "A URI referencing attached data. It should not be a base64 data URL, which should use the `blob` part instead. The URI may use a scheme known to the provider api (e.g. `gs://bucket/object.png`), or be a publicly accessible location.", "title": "Uri", "type": "string" } }, "required": [ "type", "modality", "uri" ], "title": "UriPart", "type": "object" } }, "description": "Represents the list of output messages generated by the model or agent.", "items": { "$ref": "#/$defs/OutputMessage" }, "title": "OutputMessages", "type": "array" }