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

# Updating Configuration Mid-Stream

> Update streaming session parameters without reconnecting using the UpdateConfiguration message.

Send an `UpdateConfiguration` message during an active streaming session to change session parameters without reconnecting. Every field is optional — include only the parameters you want to change.

```json theme={null}
{
  "type": "UpdateConfiguration",
  "keyterms_prompt": ["account number", "routing number"],
  "max_turn_silence": 5000
}
```

## Supported fields

### Mode

| Field | Type | Models |
| - | - | - |
| `mode` | `"min_latency"` \| `"balanced"` \| `"max_accuracy"` \| `"manual"` | All (`manual` takes effect only on `assemblyai-stt-3-7-realtime-agent`) |

Switch between accuracy/latency trade-off modes mid-session. See [Optimizing accuracy and latency](https://assemblyai.com/docs/streaming/getting-started/optimizing-accuracy-and-latency.md). You can also switch to or from `manual`, which only `assemblyai-stt-3-7-realtime-agent` supports. On other models, a switch to `manual` is ignored. See [Manual mode](https://assemblyai.com/docs/streaming/turn-detection.md#manual-mode).

### Turn detection

| Field | Type | Models |
| - | - | - |
| `min_turn_silence` | int (ms) | All |
| `max_turn_silence` | int (ms) | All |
| `interruption_delay` | int (ms) | `assemblyai-stt-3-7-realtime-agent`, `universal-3-6-pro` (no effect on `assemblyai-stt-3-7-realtime`) |

* `min_turn_silence` — Minimum silence in ms before an end-of-turn check fires. Lower values produce faster turn endings; higher values reduce entity splitting on numbers and proper nouns.
* `max_turn_silence` — Maximum silence in ms before forcing a turn to end, regardless of confidence. Increase for moments where you expect a longer pause (caller reading out a number, address, etc.).
* `interruption_delay` — How quickly the first partial is emitted. Lower values produce faster TTFT for aggressive barge-in; higher values produce more confident first partials. See [Tuning interruption sensitivity](https://assemblyai.com/docs/streaming/turn-detection.md#tuning-interruption-sensitivity).

### VAD

| Field | Type | Models |
| - | - | - |
| `vad_threshold` | float (0–1) | All |

* `vad_threshold` — Confidence threshold for classifying audio frames as speech. Increase for noisy environments to reduce false speech detection.

### Prompting and context

| Field | Type | Models |
| - | - | - |
| `prompt` | string | All |
| `keyterms_prompt` | string\[] | All |
| `agent_context` | string | All |
| `language_codes` | string\[] | All |

* `prompt` — Update the contextual prompt mid-stream as your application learns more about the conversation. See [Prompting guide](https://assemblyai.com/docs/streaming/prompting-and-keyterms.md).
* `keyterms_prompt` — Replace the current keyterms list. The most effective way to improve recognition accuracy mid-stream — dynamically swap the list as your voice agent moves between conversation stages. See [Keyterms prompting](https://assemblyai.com/docs/streaming/prompting-and-keyterms.md).
* `agent_context` — Pass your voice agent's most recent spoken reply so the model has it as context for the next user turn. See [Context carryover](https://assemblyai.com/docs/streaming/universal-3-5-pro/context-carryover.md#passing-your-agents-reply-as-context).
* `language_codes` — Update the set of languages transcription is steered toward; takes effect from the next turn. Pass an empty list to clear steering and return to native code-switching.

## Example

Set the keyterms for a caller-identification stage of a voice agent flow:

> [tab] Python
>
> ```python theme={null}
> websocket.send(json.dumps({
>     "type": "UpdateConfiguration",
>     "keyterms_prompt": ["Kelly Byrne-Donoghue", "date of birth", "January", "February"],
> }))
> ```

> [tab] Python SDK
>
> ```python theme={null}
> client.update_configuration(
>     keyterms_prompt=["Kelly Byrne-Donoghue", "date of birth", "January", "February"],
> )
> ```

> [tab] Javascript
>
> ```javascript theme={null}
> ws.send(JSON.stringify({
>   type: "UpdateConfiguration",
>   keyterms_prompt: ["Kelly Byrne-Donoghue", "date of birth", "January", "February"],
> }));
> ```

> [tab] JavaScript SDK
>
> ```javascript theme={null}
> transcriber.updateConfiguration({
>   keytermsPrompt: ["Kelly Byrne-Donoghue", "date of birth", "January", "February"],
> });
> ```

## Behavior notes

* `UpdateConfiguration` is a delta. Fields you omit keep their current values.
