> ## 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.

# Realtime Config • Rust AI Agent SDK

> RealtimeConfig: Configuration for realtime voice settings.

# RealtimeConfig

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

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

Configuration for realtime voice settings.

## Fields

| Name                         | Type                   | Description              |
| ---------------------------- | ---------------------- | ------------------------ |
| `voice`                      | `String`               | Voice for audio output   |
| `modalities`                 | `Vec&lt;String&gt;`    | Modalities (text, audio) |
| `turn_detection`             | `String`               | Turn detection mode      |
| `input_audio_format`         | `String`               | Input audio format       |
| `output_audio_format`        | `String`               | Output audio format      |
| `temperature`                | `f32`                  | Temperature              |
| `max_response_output_tokens` | `Option&lt;usize&gt;`  | Max response tokens      |
| `instructions`               | `Option&lt;String&gt;` | System instructions      |

## Methods

### `new`

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

Create a new config

### `voice`

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

Set voice

**Parameters:**

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

### `modalities`

```rust theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
fn modalities(mut self, modalities: Vec<String>) -> Self
```

Set modalities

**Parameters:**

| Name         | Type                |
| ------------ | ------------------- |
| `modalities` | `Vec&lt;String&gt;` |

### `turn_detection`

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

Set turn detection

**Parameters:**

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

### `temperature`

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

Set temperature

**Parameters:**

| Name   | Type  |
| ------ | ----- |
| `temp` | `f32` |

### `max_response_output_tokens`

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

Set max tokens

**Parameters:**

| Name     | Type    |
| -------- | ------- |
| `tokens` | `usize` |

### `instructions`

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

Set instructions

**Parameters:**

| Name           | Type                      |
| -------------- | ------------------------- |
| `instructions` | `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/agents/mod.rs#L1225">
  `praisonai/src/agents/mod.rs` at line 1225
</Card>

***

## Related Documentation

<CardGroup cols={2}>
  <Card title="Rust Realtime" icon="clock" href="/docs/rust/realtime" />

  <Card title="Rust Streaming" icon="wave-square" href="/docs/rust/streaming" />

  <Card title="Rust Configuration" icon="gear" href="/docs/rust/configuration" />

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