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§
- Chat
Request - A provider-neutral chat request.
- Chat
Response - A fully collected response.
- Invalid
Tool Arguments - Tool-call arguments that are not a JSON object.
- Message
- A chat message.
- Tool
Call - A tool call requested by the model.
argumentsis the raw JSON text.
Enums§
- Chat
Delta - One streamed increment.
- Content
Part - One piece of message content.
- Finish
Reason - Why generation stopped.
- Response
Format - Requested output format.
- Role
- Author of a message.
- Tool
Choice - How the model may use tools.
Constants§
- RESERVED_
EXTRA_ KEYS - Body keys owned by the providers;
ChatRequest::extramust not set them.
Traits§
- Chat
Model - A chat-capable model endpoint.
Functions§
- check_
extra - Reject
extrakeys that would silently override provider-managed fields. CustomChatModelimplementations should call this before building a body. - collect
- Collect a delta stream.
on_deltasees every delta as it arrives (used for streaming chunks to the run’s event stream).
Type Aliases§
- Chat
Stream - Stream of deltas returned by
ChatModel::chat.