Expand description
Common imports for Rig’s classic runtime.
Re-exports§
pub use crate::agent::Agent;pub use crate::agent::MultiTurnStreamItem;pub use crate::agent::StreamingResult;pub use crate::client::AgentClientExt;pub use crate::client::AgentModelExt;pub use crate::completion::Chat;pub use crate::completion::Prompt;pub use crate::completion::PromptError;pub use crate::completion::StructuredOutputError;pub use crate::completion::TypedPrompt;pub use crate::streaming::StreamingChat;pub use crate::streaming::StreamingPrompt;pub use crate::tool::Tool;pub use crate::tool::ToolSet;
Structs§
- Embeddings
Builder - Builder for creating embeddings from one or more documents of type
T. Note:Tcan be any type that implements the Embed trait. - InMemory
Vector Store - InMemoryVectorStore is a simple in-memory vector store that stores embeddings in-memory using a HashMap.
- OneOr
Many - Struct containing either a single item or a list of items of type T.
If a single item is present,
firstwill contain it andrestwill be empty. If multiple items are present,firstwill contain the first item andrestwill contain the rest. IMPORTANT: this struct cannot be created with an empty vector. OneOrMany objects can only be created using OneOrMany::from() or OneOrMany::try_from(). - Vector
Search Request - A vector search request for querying a
super::VectorStoreIndex.
Enums§
- Completion
Error - Errors returned by completion models.
- Message
- A provider-agnostic chat message.
- Verify
Error - Errors from provider client verification.
Traits§
- Audio
Generation Client audio - A provider client with audio generation capabilities. Clone is required for conversions between client types.
- Completion
Client - A provider client with completion capabilities. Clone is required for conversions between client types.
- Completion
Model - 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.
- Embed
- Derive this trait for objects that need to be converted to vector embeddings. The Embed::embed method accumulates string values that need to be embedded by adding them to the TextEmbedder. If an error occurs, the method should return EmbedError.
- Embedding
Model - Trait for embedding models that can generate embeddings for documents.
- Embeddings
Client - A provider client with embedding capabilities. Clone is required for conversions between client types.
- Image
Generation Client image - A provider client with image generation capabilities. Clone is required for conversions between client types.
- Model
Listing Client - A provider client with model listing capabilities.
- Provider
Client - Abstracts over the ability to instantiate a client, either via environment variables or some
Self::Input - Transcription
Client - A provider client with transcription capabilities. Clone is required for conversions between client types.
- Vector
Store Index - Trait for querying a vector store by similarity.
- Verify
Client - A provider client that can verify the configuration. Clone is required for conversions between client types.
Derive Macros§
- Embed
- A macro that allows you to implement the
rig::embedding::Embedtrait by deriving it. Usage can be found below: