Skip to main content

Module types

Module types 

Source
Expand description

Core data model: content, messages, responses, and options.

This is the Rust equivalent of agent_framework._types.

Structs§

AgentResponse
A full response from an agent run.
AgentResponseUpdate
A single streaming chunk from an agent run.
Annotation
A citation annotation attached to content.
ChatOptions
Common per-request settings for a chat/AI service.
ChatResponse
A full (non-streaming) response from a chat client.
ChatResponseUpdate
A single streaming chunk from a chat client.
ContinuationToken
An opaque, provider-issued token that resumes a background / long-running run where it left off.
DataContent
Inline binary data encoded as a data: URI.
Embedding
A single embedding vector with metadata.
EmbeddingGenerationOptions
Common request settings for embedding generation.
ErrorContent
A non-fatal error surfaced as content.
FinishReason
Reason a chat response finished. Open value wrapper, like FinishReason.
FunctionApprovalRequestContent
A request to the user to approve a function call (human-in-the-loop).
FunctionApprovalResponseContent
A user’s response approving or denying a function call.
FunctionCallContent
A request from the model to call a tool/function.
FunctionResultContent
The result of executing a tool/function.
GeneratedEmbeddings
A batch of generated embeddings plus usage metadata.
HostedFileContent
A reference to a file hosted by the service.
HostedVectorStoreContent
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.
TextContent
Plain text content.
TextReasoningContent
Reasoning / chain-of-thought text, distinct from user-facing text.
TextSpanRegion
An annotated region of text, addressed by index range.
UriContent
A reference to a remote resource by URI (not inline data).
UsageContent
Token usage carried inline as a content item.
UsageDetails
Token usage counts for a request/response.

Enums§

AnnotationKind
The discriminator for an Annotation. Upstream tags every annotation with type: "citation"; this is the sole kind today.
Content
The unified content union, discriminated by the type tag.
FunctionArguments
Arguments to a function call: either a raw (possibly partial) string, or a parsed object.
ResponseFormat
The requested structured-output format for a response.
ToolMode
If and how tools may be used for a request. Mirrors the Python ToolMode.

Traits§

IntoMessages
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 Python str | 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.