Expand description
Core data model: content, messages, responses, and options.
This is the Rust equivalent of agent_framework._types.
Structs§
- Agent
Response - A full response from an agent run.
- Agent
Response Update - A single streaming chunk from an agent run.
- Annotation
- A citation annotation attached to content.
- Chat
Options - Common per-request settings for a chat/AI service.
- Chat
Response - A full (non-streaming) response from a chat client.
- Chat
Response Update - A single streaming chunk from a chat client.
- Continuation
Token - An opaque, provider-issued token that resumes a background / long-running run where it left off.
- Data
Content - Inline binary data encoded as a
data:URI. - Embedding
- A single embedding vector with metadata.
- Embedding
Generation Options - Common request settings for embedding generation.
- Error
Content - A non-fatal error surfaced as content.
- Finish
Reason - Reason a chat response finished. Open value wrapper, like
FinishReason. - Function
Approval Request Content - A request to the user to approve a function call (human-in-the-loop).
- Function
Approval Response Content - A user’s response approving or denying a function call.
- Function
Call Content - A request from the model to call a tool/function.
- Function
Result Content - The result of executing a tool/function.
- Generated
Embeddings - A batch of generated embeddings plus usage metadata.
- Hosted
File Content - A reference to a file hosted by the service.
- Hosted
Vector Store Content - A reference to a vector store hosted by the service.
- Message
- A single chat message: an author role plus an ordered list of content items.
- Role
- The role of a message author.
- Text
Content - Plain text content.
- Text
Reasoning Content - Reasoning / chain-of-thought text, distinct from user-facing text.
- Text
Span Region - An annotated region of text, addressed by index range.
- UriContent
- A reference to a remote resource by URI (not inline data).
- Usage
Content - Token usage carried inline as a content item.
- Usage
Details - Token usage counts for a request/response.
Enums§
- Annotation
Kind - The discriminator for an
Annotation. Upstream tags every annotation withtype: "citation"; this is the sole kind today. - Content
- The unified content union, discriminated by the
typetag. - Function
Arguments - Arguments to a function call: either a raw (possibly partial) string, or a parsed object.
- Response
Format - The requested structured-output format for a response.
- Tool
Mode - If and how tools may be used for a request. Mirrors the Python
ToolMode.
Traits§
- Into
Messages - Trait for values that can be turned into a list of chat messages, so the
public API can accept
&str,String,Message, or vectors thereof — mirroring the Pythonstr | Message | list[...]unions.
Functions§
- prepare_
function_ call_ results - Serialize content(s) into a JSON string suitable for a tool result payload.
- prepare_
messages - Normalize loosely-typed input into a list of chat messages, optionally
prepending a system instruction. Mirrors
prepare_messages.