Modules§
- config
- Configuration system for LLM providers.
- error
- Error handling for LLM providers.
- traits
- Core traits for LLM providers.
- types
- Core types for LLM requests and responses.
Structs§
- Chat
Request - A chat request containing messages and parameters.
- Chat
Request Builder - Builder for ChatRequest
- Completion
Request - A completion request for non-chat text generation.
- Date
Time - ISO 8601 combined date and time with time zone.
- Duration
- A
Duration
type to represent a span of time, typically used for system timeouts. - Embedding
- An embedding vector.
- Function
- Definition of a function that can be called.
- Function
Call - A function call within a tool call.
- Generated
Image - A generated image.
- HashMap
- A hash map implemented with quadratic probing and SIMD lookup.
- Http
Config - Common HTTP client configuration options.
- Image
Request - Request for image generation.
- Message
- A message in a conversation.
- Metadata
- Metadata for requests, including provider-specific extensions.
- Parameters
- Common parameters used across providers.
- Pool
Config - Connection pool configuration.
- Rate
Limit Config - Rate limiting configuration.
- Retry
Config - Retry configuration for failed requests.
- Secret
String - A secure string type for sensitive configuration values like API keys.
- Speech
ToText Request - Request for speech-to-text conversion.
- Text
ToSpeech Request - Request for text-to-speech conversion.
- Tool
- Definition of a tool/function that can be called.
- Tool
Call - A tool/function call made by the AI.
- Tool
Content - Tool-related message content.
- Usage
- Usage statistics for a request.
- Utc
- The UTC time zone. This is the most efficient time zone when you don’t need the local time. It is also used as an offset (which is also a dummy type).
Enums§
- Config
Error - Common configuration errors.
- Content
Part - A part of multimodal message content.
- Finish
Reason - Reason why the model stopped generating.
- Image
Source - LlmError
- A generic error type that can wrap any provider error.
- Message
Content - Content of a message, which can be text or multimodal.
- Network
Error - Common network errors.
- Request
Error - Common request errors.
- Response
Error - Common response errors.
- Role
- The role of a message sender.
- Value
- Represents any valid JSON value.
Traits§
- Chat
Provider - Base trait for chat-based LLM providers.
- Chat
Response - Trait for chat response types.
- Completion
Provider - Trait for providers that support text completion (non-chat).
- Completion
Response - Trait for completion response types.
- Config
Builder - Builder pattern helper for configuration types.
- Deserialize
- A data structure that can be deserialized from any data format supported by Serde.
- Embedding
Provider - Trait for providers that support text embeddings.
- Error
Error
is a trait representing the basic expectations for error values, i.e., values of typeE
inResult<T, E>
.- Image
Provider - Optional trait for providers that support image generation.
- Image
Response - Trait for image generation response types.
- Provider
Config - Trait for provider configuration types.
- Provider
Error - Common trait for all provider errors.
- Serialize
- A data structure that can be serialized into any data format supported by Serde.
- Speech
ToText Provider - Optional trait for providers that support speech-to-text.
- Speech
ToText Response - Trait for speech-to-text response types.
- Stream
- A stream of values produced asynchronously.
- Streaming
Provider - Optional trait for providers that support streaming responses.
- Text
ToSpeech Provider - Optional trait for providers that support text-to-speech.
- Text
ToSpeech Response - Trait for text-to-speech response types.
- Tool
Provider - Optional trait for providers that support tool/function calling.
Type Aliases§
- LlmResult
- Result type alias for LLM operations with generic error.
- Provider
Result - Result type alias for provider operations.