> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes. # setParams > Configure AI model parameters such as temperature, timeouts, and speech recognition settings. [ai-params]: /docs/swml/reference/calling/ai/params [swml-ai-params-reference]: /docs/swml/reference/calling/ai/params [ref-agentbase]: /docs/server-sdks/reference/typescript/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. ## **Parameters** **`params`** `Record` — required Object of parameter name/value pairs. --- ## **Returns** [`AgentBase`][ref-agentbase] -- Returns `this` for method chaining. --- ## **AI Parameter Reference** Parameters set via `setParams()` control the AI model, speech recognition, timing, and agent behavior. The fields below list commonly used parameters by category. > **Warning** > > Keys must use **snake\_case** to match the SWML wire format. For example, use > `end_of_speech_timeout`, not `endOfSpeechTimeout`. The SDK passes these keys > directly into the SWML `ai.params` object without transformation. > **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. ### LLM Parameters **`temperature`** `number` Output randomness. Range: `0.0` -- `2.0`. Lower values produce more deterministic responses. Platform default: `0.3`. --- **`top_p`** `number` Nucleus sampling threshold. Range: `0.0` -- `1.0`. Alternative to temperature for controlling randomness. Platform default: `1.0`. --- **`frequency_penalty`** `number` Repetition penalty. Range: `-2.0` -- `2.0`. Positive values reduce repetition of token sequences. Platform default: `0.1`. --- **`presence_penalty`** `number` Topic diversity. Range: `-2.0` -- `2.0`. Positive values encourage the model to explore new topics. Platform default: `0.1`. --- **`max_tokens`** `number` Maximum response tokens. Range: `1` -- `16385`. Platform default: `256`. --- **`ai_model`** `string` AI model to use (e.g., `"gpt-4o-mini"`, `"gpt-4.1-mini"`, `"nova-micro"`, `"nova-lite"`). Platform default: `"gpt-4o-mini"`. --- ### Timing Parameters **`end_of_speech_timeout`** `number` Silence duration in milliseconds to detect end of speech. Range: `250` -- `10000`. Platform default: `700`. --- **`attention_timeout`** `number` Idle delay in milliseconds before the AI re-prompts the caller. Range: `0` -- `600000`. Platform default: `5000`. --- **`inactivity_timeout`** `number` Inactivity delay in milliseconds before the call is automatically disconnected. Range: `10000` -- `3600000`. Platform default: `600000`. --- **`speech_timeout`** `number` Maximum speech duration in milliseconds before the input is finalized. Platform default: `60000`. --- ### Behavior Parameters **`wait_for_user`** `boolean` Wait for the caller to speak first before the AI begins talking. Platform default: `false`. --- **`conscience`** `boolean | string` Safety enforcement. When enabled, the AI applies content safety filters. Platform default: `true`. --- **`transparent_barge`** `boolean` Transparent barge-in mode. When enabled, caller speech interrupts the AI naturally without discarding context. Platform default: `true`. --- **`save_conversation`** `boolean` Persist the conversation summary after the call ends. Platform default: `false`. --- ### Audio Parameters **`ai_volume`** `number` AI voice volume adjustment. Range: `-50` -- `50`. Platform default: `0`. --- **`background_file`** `string` URL of an audio file to play as background audio during the conversation. --- **`hold_music`** `string` URL of hold music or a tone string (e.g., `"tone:440"`). --- ## **Example** ```typescript {5} import { AgentBase } from '@signalwire/sdk'; const agent = new AgentBase({ name: 'support', route: '/support' }); agent.setPromptText('You are a helpful assistant.'); agent.setParams({ temperature: 0.7, end_of_speech_timeout: 1000, attention_timeout: 10000, wait_for_user: true, }); await agent.serve(); ``` > Configure AI model parameters such as temperature, timeouts, and speech recognition settings.