Crate rig_extra

Source

Modules§

agent
This module contains the implementation of the Agent struct and its builder.
cli_chatbot
client
This module provides traits for defining and creating provider clients. Clients are used to create models for completion, embeddings, etc. Dyn-compatible traits have been provided to allow for more provider-agnostic code.
completion
embeddings
This module provides functionality for working with embeddings. Embeddings are numerical representations of documents or other objects, typically used in natural language processing (NLP) tasks such as text classification, information retrieval, and document similarity.
error
extra_providers
extractor
This module provides high-level abstractions for extracting structured data from text using LLMs.
loaders
This module provides utility structs for loading and preprocessing files.
one_or_many
pipeline
This module defines a flexible pipeline API for defining a sequence of operations that may or may not use AI components (e.g.: semantic search, LLMs prompting, etc).
prelude
providers
This module contains clients for the different LLM providers that Rig supports.
rand_agent
RandAgent - 多代理随机选择器
simple_rand_builder
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.
thread_safe_rand_agent
多线程使用示例
tool
Module defining tool related structs and traits.
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

Macros§

conditional
Creates an Op that conditionally dispatches to one of multiple sub-ops based on the variant of the input enum.
impl_audio_generation
impl_conversion_traits
Implements the conversion traits for a given struct
impl_image_generation
parallel
parallel_internal
parallel_op
try_conditional
Creates a TryOp that conditionally dispatches to one of multiple sub-ops based on the variant of the input enum, returning a Result.
try_parallel
try_parallel_internal
tuple_pattern

Structs§

AgentInfo
EmptyListError
Error type for when trying to create a OneOrMany object with an empty vector.
OneOrMany
Struct containing either a single item or a list of items of type T. If a single item is present, first will contain it and rest will be empty. If multiple items are present, first will contain the first item and rest will 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().

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.