Skip to main content

Module types

Module types 

Source
Expand description

Provider-neutral chat types.

Every provider translates ChatRequest into its wire format and its streaming response into ChatDeltas. collect folds a delta stream into a ChatResponse.

Structs§

ChatRequest
A provider-neutral chat request.
ChatResponse
A fully collected response.
InvalidToolArguments
Tool-call arguments that are not a JSON object.
Message
A chat message.
ToolCall
A tool call requested by the model. arguments is the raw JSON text.

Enums§

ChatDelta
One streamed increment.
ContentPart
One piece of message content.
FinishReason
Why generation stopped.
ResponseFormat
Requested output format.
Role
Author of a message.
ToolChoice
How the model may use tools.

Constants§

RESERVED_EXTRA_KEYS
Body keys owned by the providers; ChatRequest::extra must not set them.

Traits§

ChatModel
A chat-capable model endpoint.

Functions§

check_extra
Reject extra keys that would silently override provider-managed fields. Custom ChatModel implementations should call this before building a body.
collect
Collect a delta stream. on_delta sees every delta as it arrives (used for streaming chunks to the run’s event stream).

Type Aliases§

ChatStream
Stream of deltas returned by ChatModel::chat.