> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Embedding Config • Rust AI Agent SDK

> EmbeddingConfig: Configuration for embedding generation.

# EmbeddingConfig

> Defined in the [**embedding**](../modules/embedding) module.

<Badge color="orange">Rust AI Agent SDK</Badge>

Configuration for embedding generation.

## Fields

| Name              | Type                   | Description                                              |
| ----------------- | ---------------------- | -------------------------------------------------------- |
| `dimensions`      | `Option&lt;usize&gt;`  | 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&lt;String&gt;` | Custom API base URL                                      |
| `api_key`         | `Option&lt;String&gt;` | API key for authentication                               |

## Methods

### `new`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn new() -> Self
```

Create a new EmbeddingConfig with defaults

### `dimensions`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn dimensions(mut self, dimensions: usize) -> Self
```

Set dimensions

**Parameters:**

| Name         | Type    |
| ------------ | ------- |
| `dimensions` | `usize` |

### `encoding_format`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn encoding_format(mut self, format: impl Into<String>) -> Self
```

Set encoding format

**Parameters:**

| Name     | Type                      |
| -------- | ------------------------- |
| `format` | `impl Into&lt;String&gt;` |

### `timeout`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn timeout(mut self, timeout: u64) -> Self
```

Set timeout

**Parameters:**

| Name      | Type  |
| --------- | ----- |
| `timeout` | `u64` |

### `api_base`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn api_base(mut self, url: impl Into<String>) -> Self
```

Set API base URL

**Parameters:**

| Name  | Type                      |
| ----- | ------------------------- |
| `url` | `impl Into&lt;String&gt;` |

### `api_key`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn api_key(mut self, key: impl Into<String>) -> Self
```

Set API key

**Parameters:**

| Name  | Type                      |
| ----- | ------------------------- |
| `key` | `impl Into&lt;String&gt;` |

## Source

<Card title="View on GitHub" icon="github" href="https://github.com/MervinPraison/PraisonAI/blob/main/src/praisonai-rust/praisonai/src/embedding/mod.rs#L27">
  `praisonai/src/embedding/mod.rs` at line 27
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Rust Configuration" icon="gear" href="/docs/rust/configuration" />

  <Card title="Rust Installation" icon="download" href="/docs/rust/installation" />

  <Card title="Rust Embeddings" icon="code" href="/docs/rust/embeddings" />

  <Card title="Rust Embedding" icon="code" href="/docs/rust/embedding" />

  <Card title="Rust Vector Store" icon="database" href="/docs/rust/vector-store" />
</CardGroup>
