Crate rig_extra

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
多线程使用示例
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.
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
BlockingRetry
导出 backon 实现失败重试 Retry structure generated by BlockingRetryable.
BlockingRetryWithContext
导出 backon 实现失败重试 Retry structure generated by BlockingRetryableWithContext.
ConstantBuilder
导出 backon 实现失败重试 ConstantBuilder is used to create a [ConstantBackoff], providing a steady delay with a fixed number of retries.
EmptyListError
Error type for when trying to create a OneOrMany object with an empty vector.
ExponentialBuilder
导出 backon 实现失败重试 ExponentialBuilder is used to construct an [ExponentialBackoff] that offers delays with exponential retries.
FibonacciBuilder
导出 backon 实现失败重试 FibonacciBuilder is used to build a [FibonacciBackoff] which offers a delay with Fibonacci-based retries.
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().
Retry
导出 backon 实现失败重试 Struct generated by Retryable.
RetryWithContext
导出 backon 实现失败重试 Retry struct generated by RetryableWithContext.
StdSleeper
导出 backon 实现失败重试 The implementation of StdSleeper uses std::thread::sleep.
TokioSleeper
导出 backon 实现失败重试 The default implementation of Sleeper uses tokio::time::sleep.

Traits§

Backoff
导出 backon 实现失败重试 Backoff is an Iterator that returns Duration.
BackoffBuilder
导出 backon 实现失败重试 BackoffBuilder is utilized to construct a new backoff.
BlockingRetryable
导出 backon 实现失败重试 BlockingRetryable adds retry support for blocking functions.
BlockingRetryableWithContext
导出 backon 实现失败重试 BlockingRetryableWithContext adds retry support for blocking functions.
BlockingSleeper
导出 backon 实现失败重试 A sleeper is used sleep for a specified duration.
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.
Retryable
导出 backon 实现失败重试 Retryable will add retry support for functions that produce futures with results.
RetryableWithContext
导出 backon 实现失败重试 RetryableWithContext adds retry support for functions that produce futures with results and context.
Sleeper
导出 backon 实现失败重试 A sleeper is used to generate a future that completes after a specified duration.

Type Aliases§

DefaultBlockingSleeper
导出 backon 实现失败重试 The default implementation of Sleeper while feature std-blocking-sleep enabled.
DefaultSleeper
导出 backon 实现失败重试 The default implementation of Sleeper while feature tokio-sleep enabled.