Module completion

Source

Modules§

message
request
This module provides functionality for working with completion models. It provides traits, structs, and enums for generating completion requests, handling completion responses, and defining completion models.

Structs§

CompletionRequest
Struct representing a general completion request that can be sent to a completion model provider.
CompletionRequestBuilder
Builder struct for constructing a completion request.
CompletionResponse
General completion response struct that contains the high-level completion choice and the raw response. The completion choice contains one or more assistant content.
Document
ToolDefinition

Enums§

AssistantContent
Describes responses from a provider which is either text or a tool call.
CompletionError
Message
A message represents a run of input (user) and output (assistant). Each message type (based on it’s role) can contain a atleast one bit of content such as text, images, audio, documents, or tool related information. While each message type can contain multiple content, most often, you’ll only see one content type per message (an image w/ a description, etc).
MessageError
Error type to represent issues with converting messages to and from specific provider messages.
PromptError
Prompt errors

Traits§

Chat
Trait defining a high-level LLM chat interface (i.e.: prompt and chat history in, response out).
Completion
Trait defining a low-level LLM completion interface
CompletionModel
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.
CompletionModelDyn
Prompt
Trait defining a high-level LLM simple prompt interface (i.e.: prompt in, response out).