Skip to main content

EmbeddingConfig

Defined in the embedding module.
Rust AI Agent SDK Configuration for embedding generation.

Fields

NameTypeDescription
dimensionsOption<usize>Number of dimensions for the embedding (model-dependent)
format"float" or "base64"-
encoding_formatStringEncoding format: “float” or “base64”
timeoutu64Timeout in seconds
api_baseOption<String>Custom API base URL
api_keyOption<String>API key for authentication

Methods

new

fn new() -> Self
Create a new EmbeddingConfig with defaults

dimensions

fn dimensions(mut self, dimensions: usize) -> Self
Set dimensions Parameters:
NameType
dimensionsusize

encoding_format

fn encoding_format(mut self, format: impl Into<String>) -> Self
Set encoding format Parameters:
NameType
formatimpl Into&lt;String&gt;

timeout

fn timeout(mut self, timeout: u64) -> Self
Set timeout Parameters:
NameType
timeoutu64

api_base

fn api_base(mut self, url: impl Into<String>) -> Self
Set API base URL Parameters:
NameType
urlimpl Into&lt;String&gt;

api_key

fn api_key(mut self, key: impl Into<String>) -> Self
Set API key Parameters:
NameType
keyimpl Into&lt;String&gt;

Source

View on GitHub

praisonai/src/embedding/mod.rs at line 27