Embedding Config • Rust AI Agent SDK
EmbeddingConfig: Configuration for embedding generation.
EmbeddingConfig
Defined in the embedding module.
Rust AI Agent SDK
Configuration for embedding generation.
Fields
| Name | Type | Description |
|---|---|---|
dimensions | Option<usize> | Number of dimensions for the embedding (model-dependent) |
format | "float" or "base64" | – |
encoding_format | String | Encoding format: “float” or “base64” |
timeout | u64 | Timeout in seconds |
api_base | Option<String> | Custom API base URL |
api_key | Option<String> | API key for authentication |
Methods
new
fn new() -> SelfCreate a new EmbeddingConfig with defaults
dimensions
fn dimensions(mut self, dimensions: usize) -> SelfSet dimensions
Parameters:
| Name | Type |
|---|---|
dimensions | usize |
encoding_format
fn encoding_format(mut self, format: impl Into<String>) -> SelfSet encoding format
Parameters:
| Name | Type |
|---|---|
format | impl Into<String> |
timeout
fn timeout(mut self, timeout: u64) -> SelfSet timeout
Parameters:
| Name | Type |
|---|---|
timeout | u64 |
api_base
fn api_base(mut self, url: impl Into<String>) -> SelfSet API base URL
Parameters:
| Name | Type |
|---|---|
url | impl Into<String> |
api_key
fn api_key(mut self, key: impl Into<String>) -> SelfSet API key
Parameters:
| Name | Type |
|---|---|
key | impl Into<String> |
Source
View on GitHubpraisonai/src/embedding/mod.rs at line 27