Expand description
High-level prompting traits and runtime errors for the classic agent runtime.
Modules§
Structs§
- Completion
Request - Struct representing a general completion request that can be sent to a completion model provider.
- Completion
Request Builder - Builder struct for constructing a completion request.
- Completion
Response - General completion response struct: the completion choice plus normalized response metadata. The completion choice contains one or more assistant content items.
- Document
- Provider
Capabilities - Provider behavior that affects how runtimes prepare completion requests.
- Provider
Tool Definition - Provider-native tool definition.
- Response
Identity - Response identity metadata for one completed model call: which provider
objects this exact attempt produced. The three axes stay distinct —
message-scoped, response-scoped, and transport — and every field is
Nonewhen the provider did not report it: a documented outcome, never an error. - Tool
Definition - Usage
- Struct representing the token usage for a completion request.
If tokens used are
0, then the provider failed to supply token usage metrics.
Enums§
- Assistant
Content - Describes responses from a provider which is either text or a tool call.
- Completion
Error - Errors returned by completion models.
- Finish
Reason - Why the model stopped generating, normalized across providers.
- Message
- A provider-agnostic chat message.
- Message
Error - Error type to represent issues with converting messages to and from specific provider messages.
- Prompt
Error - Errors from classic agent prompting.
- Structured
Output Error - Errors returned by typed structured prompting.
Traits§
- Chat
- High-level prompting with caller-owned canonical chat history.
- Completion
Model - Trait defining a completion model that can be used to generate completion responses. This trait is meant to be implemented by the user to define a custom completion model, either from a third party provider (e.g.: OpenAI) or a local model.
- Normalize
Completion Response - Convert a provider’s own completion payload into the normalized
CompletionResponse. - Prompt
- High-level one-shot prompting for the classic runtime.
- Typed
Prompt - High-level typed structured prompting for the classic runtime.