Skip to main content

Module completion

Module completion 

Source
Expand description

High-level prompting traits and runtime errors for the classic agent runtime.

Modules§

message
request
Completion request, response, and provider trait definitions.

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
ProviderToolDefinition
Provider-native tool definition.
ToolDefinition
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§

AssistantContent
Describes responses from a provider which is either text or a tool call.
CompletionError
Errors returned by completion models.
Message
A provider-agnostic chat message.
MessageError
Error type to represent issues with converting messages to and from specific provider messages.
PromptError
Errors from classic agent prompting.
StructuredOutputError
Errors returned by typed structured prompting.

Traits§

Chat
High-level prompting with caller-owned canonical chat history.
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.
GetTokenUsage
A trait for grabbing the token usage of a completion response.
Prompt
High-level one-shot prompting for the classic runtime.
TypedPrompt
High-level typed structured prompting for the classic runtime.