Expand description
This module enables the implementation of chat completion on LLM providers
The main trait to implement is ChatCompletion, which takes a ChatCompletionRequest and
returns a ChatCompletionResponse.
A chat completion request is comprised of a list of ChatMessage to complete, with
optionally tool specifications. The builder provides fluent helpers like message(...)
and tools(...) so you can accumulate messages and register tool instances directly
while still exposing tool_specs for compatibility.
Re-exports§
pub use traits::*;
Modules§
Structs§
- Chat
Completion Request - A chat completion request represents a series of chat messages and tool interactions that can be send to any LLM.
- Chat
Completion Request Builder - Builder for
ChatCompletionRequest. - Chat
Completion Response - A generic response from chat completions
- Chat
Completion Response Builder - Builder for
ChatCompletionResponse. - Chat
Completion Response Delta - Chat
Completion Response Delta Builder - Builder for
ChatCompletionResponseDelta. - Tool
Call - A tool call that can be executed by the executor
- Tool
Call Accum - Tool
Call Builder - Builder for
ToolCall. - Tool
Spec - A typed tool specification intended to be usable for multiple LLMs
- Tool
Spec Builder - Builder for
ToolSpec. - Usage
- Usage
Builder - Builder for
Usage.
Enums§
- Chat
Completion Request Builder Error - Error type for ChatCompletionRequestBuilder
- Chat
Completion Response Delta Builder Error - Error type for ChatCompletionResponseDeltaBuilder
- Chat
Message - Tool
Call Builder Error - Error type for ToolCallBuilder
- Tool
Output - Output of a
ToolCallwhich will be added as a message for the agent to use. - Tool
Spec Builder Error - Error type for ToolSpecBuilder
- Usage
Builder Error - Error type for UsageBuilder