Expand description
Direct access to portable provider, data, memory, and tool contracts.
This explicit namespace is also the stable expansion root for portable
#[rig_tool] functions in crates that depend on rig-agent without a
separate direct rig-core dependency.
Portable rig-core root items are reachable here, but deliberately not
at the rig_agent crate root — adding a root export to rig-core must not
silently add one to rig-agent. A stable rig-core root export
(rig_core::OneOrMany) demonstrates both halves of that invariant (the
two doctests below enforce it):
// Reachable through the explicit `core` namespace.
use rig_agent::core::OneOrMany;
let _reachable: Option<OneOrMany<u8>> = None;ⓘ
// NOT reachable at the `rig_agent` crate root.
use rig_agent::OneOrMany as _;Modules§
- audio_
generation audio - Everything related to audio generation (ie, Text To Speech). Rig abstracts over a number of different providers using the AudioGenerationModel trait.
- client
- This module provides traits for defining and creating provider clients. Clients are used to create models for completion, embeddings, etc.
- completion
- Provider-agnostic completion and chat abstractions.
- embeddings
- Provider-agnostic embedding abstractions.
- http_
client - id
- Lightweight generation of short, unique, URL-safe identifiers.
- image_
generation image - Everything related to core image generation abstractions in Rig. Rig allows calling a number of different providers (that support image generation) using the ImageGenerationModel trait.
- loaders
- File loading utilities for preparing local documents as model or embedding input.
- markers
- Common marker traits and structs for type-safe builders.
- memory
- Conversation memory: Rig-managed persistent conversation history for agents.
- model
- Model metadata returned by providers with model listing support.
- one_
or_ many - prelude
- The
rigprelude. - providers
- Provider integrations included in
rig-core. - rerank
- Provider-agnostic reranking abstractions.
- schemars
- Schemars
- serde
- Serde
- streaming
- This module provides functionality for working with streaming completion models. It provides traits and types for generating streaming completion requests and handling streaming completion responses.
- telemetry
- This module primarily concerns being able to orchestrate telemetry across a given pipeline or workflow. This includes tracing, being able to send traces to an OpenTelemetry collector, setting up your agents with the correct tracing style so you can emit the right traces for platforms like Langfuse, and more.
- test_
utils test-utils - Test utilities for deterministic completion-model tests.
- tool
- Portable tool contracts and canonical execution values.
- transcription
- This module provides functionality for working with audio transcription models. It provides traits, structs, and enums for generating audio transcription requests, handling transcription responses, and defining transcription models.
- vector_
store - Vector store abstractions for semantic search and retrieval.
- wasm_
compat
Macros§
- completion_
parent_ span - Declare a completion-parent span conforming to the adoption contract.
- if_
not_ wasm - if_wasm
Structs§
- Empty
List Error - Error type for when trying to create a OneOrMany object with an empty vector.
- 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(). - Provider
Response Error - A raw error response preserved from a provider.
Traits§
- 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.
Attribute Macros§
- rig_
tool - A procedural macro that transforms a function into a portable
rig_core::tool::PortableTool, or into the classic contextualrig::tool::Toolwhen the function accepts classic runtime context. - tool_
macro - A procedural macro that transforms a function into a portable
rig_core::tool::PortableTool, or into the classic contextualrig::tool::Toolwhen the function accepts classic runtime context.
Derive Macros§
- Embed
- A macro that allows you to implement the
rig::embedding::Embedtrait by deriving it. Usage can be found below: