Module chat_completion

Source
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 response optionally contains a message and zero or more tool calls.

Re-exports§

pub use traits::*;

Modules§

errors
traits

Structs§

ChatCompletionRequest
A chat completion request represents a series of chat messages and tool interactions that can be send to any LLM.
ChatCompletionRequestBuilder
Builder for ChatCompletionRequest.
ChatCompletionResponse
A generic response from chat completions
ChatCompletionResponseBuilder
Builder for ChatCompletionResponse.
ChatCompletionResponseDelta
ChatCompletionResponseDeltaBuilder
Builder for ChatCompletionResponseDelta.
ParamSpec
Parameters for tools
ParamSpecBuilder
Builder for ParamSpec.
ToolCall
A tool call that can be executed by the executor
ToolCallBuilder
Builder for ToolCall.
ToolSpec
A typed tool specification intended to be usable for multiple LLMs
ToolSpecBuilder
Builder for ToolSpec.
Usage
UsageBuilder
Builder for Usage.

Enums§

ChatCompletionRequestBuilderError
Error type for ChatCompletionRequestBuilder
ChatCompletionResponseDeltaBuilderError
Error type for ChatCompletionResponseDeltaBuilder
ChatMessage
InnerParamType
ParamSpecBuilderError
Error type for ParamSpecBuilder
ParamType
ToolCallBuilderError
Error type for ToolCallBuilder
ToolOutput
Output of a ToolCall which will be added as a message for the agent to use.
ToolSpecBuilderError
Error type for ToolSpecBuilder
UsageBuilderError
Error type for UsageBuilder