***

title: set_params
slug: /reference/python/agents/agent-base/set-params
description: Configure AI model parameters such as temperature, timeouts, and speech recognition settings.
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

[ai-params]: /docs/swml/reference/ai/params

[swml-ai-params-reference]: /docs/swml/reference/ai/params

[ref-agentbase]: /docs/server-sdks/reference/python/agents/agent-base

Set multiple AI parameters at once. Merges into any previously set parameters.

<Info>
  These parameters map to the SWML [`ai.params`][ai-params] object.
  See the [SWML AI params reference][swml-ai-params-reference] for the full list of
  supported fields.
</Info>

## **Parameters**

<ParamField path="params" type="dict[str, Any]" required={true} toc={true}>
  Dictionary of parameter name/value pairs.
</ParamField>

## **Returns**

[`AgentBase`][ref-agentbase] -- Returns self for method chaining.

***

## AI Parameter Reference

Parameters set via `set_params()` control the AI model, speech recognition, timing,
and agent behavior. The fields below list commonly used parameters by category.

<Note>
  Default values shown below are **server-side defaults** applied by the SignalWire
  platform. The SDK itself sends no defaults -- only parameters you explicitly set
  are included in the SWML document.
</Note>

### LLM Parameters

<ParamField path="temperature" type="float" default="0.3" toc={true}>
  Output randomness. Range: `0.0` -- `2.0`. Lower values produce more deterministic responses.
</ParamField>

<ParamField path="top_p" type="float" default="1.0" toc={true}>
  Nucleus sampling threshold. Range: `0.0` -- `1.0`. Alternative to temperature for controlling randomness.
</ParamField>

<ParamField path="frequency_penalty" type="float" default="0.1" toc={true}>
  Repetition penalty. Range: `-2.0` -- `2.0`. Positive values reduce repetition of token sequences.
</ParamField>

<ParamField path="presence_penalty" type="float" default="0.1" toc={true}>
  Topic diversity. Range: `-2.0` -- `2.0`. Positive values encourage the model to explore new topics.
</ParamField>

<ParamField path="max_tokens" type="int" default="256" toc={true}>
  Maximum response tokens. Range: `1` -- `16385`.
</ParamField>

<ParamField path="ai_model" type="str" default="gpt-4o-mini" toc={true}>
  AI model to use (e.g., `"gpt-4o-mini"`, `"gpt-4.1-mini"`, `"nova-micro"`, `"nova-lite"`).
</ParamField>

### Timing Parameters

<ParamField path="end_of_speech_timeout" type="int" default="700" toc={true}>
  Silence duration in milliseconds to detect end of speech. Range: `250` -- `10000`.
</ParamField>

<ParamField path="attention_timeout" type="int" default="5000" toc={true}>
  Idle delay in milliseconds before the AI re-prompts the caller. Range: `0` -- `600000`.
</ParamField>

<ParamField path="inactivity_timeout" type="int" default="600000" toc={true}>
  Inactivity delay in milliseconds before the call is automatically disconnected. Range: `10000` -- `3600000`.
</ParamField>

<ParamField path="speech_timeout" type="int" default="60000" toc={true}>
  Maximum speech duration in milliseconds before the input is finalized.
</ParamField>

### Behavior Parameters

<ParamField path="wait_for_user" type="bool" default="false" toc={true}>
  Wait for the caller to speak first before the AI begins talking.
</ParamField>

<ParamField path="conscience" type="bool | str" default="true" toc={true}>
  Safety enforcement. When enabled, the AI applies content safety filters.
</ParamField>

<ParamField path="transparent_barge" type="bool" default="true" toc={true}>
  Transparent barge-in mode. When enabled, caller speech interrupts the AI naturally without discarding context.
</ParamField>

<ParamField path="save_conversation" type="bool" default="false" toc={true}>
  Persist the conversation summary after the call ends.
</ParamField>

### Audio Parameters

<ParamField path="ai_volume" type="int" default="0" toc={true}>
  AI voice volume adjustment. Range: `-50` -- `50`.
</ParamField>

<ParamField path="background_file" type="str" toc={true}>
  URL of an audio file to play as background audio during the conversation.
</ParamField>

<ParamField path="hold_music" type="str" toc={true}>
  URL of hold music or a tone string (e.g., `"tone:440"`).
</ParamField>

## **Example**

```python {5}
from signalwire import AgentBase

agent = AgentBase(name="support", route="/support")
agent.set_prompt_text("You are a helpful assistant.")
agent.set_params({
    "temperature": 0.7,
    "end_of_speech_timeout": 1000,
    "attention_timeout": 10000,
    "wait_for_user": True
})
agent.serve()
```