***

title: update_settings
slug: /reference/python/agents/function-result/update-settings
description: Update AI runtime settings dynamically during a call.
max-toc-depth: 3
---------------------

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

[functionresult]: /docs/server-sdks/reference/python/agents/function-result

Update AI runtime settings dynamically during a call. Changes take effect
for subsequent LLM turns.

## **Parameters**

<ParamField path="settings" type="dict[str, Any]" required={true} toc={true}>
  Dictionary of settings to update. Supported keys:

  | Key                 | Type    | Range                       |
  | ------------------- | ------- | --------------------------- |
  | `frequency-penalty` | `float` | -2.0 to 2.0                 |
  | `presence-penalty`  | `float` | -2.0 to 2.0                 |
  | `max-tokens`        | `int`   | 0 to 4096                   |
  | `top-p`             | `float` | 0.0 to 1.0                  |
  | `confidence`        | `float` | 0.0 to 1.0                  |
  | `barge-confidence`  | `float` | 0.0 to 1.0                  |
  | `temperature`       | `float` | 0.0 to 2.0 (clamped to 1.5) |
</ParamField>

## **Returns**

[`FunctionResult`][functionresult] — self, for chaining.

## **Example**

```python {11}
from signalwire import AgentBase
from signalwire import FunctionResult

agent = AgentBase(name="my-agent", route="/agent")
agent.set_prompt_text("You are a helpful assistant.")

@agent.tool(name="adjust_for_technical_discussion", description="Adjust AI settings for technical topics")
def adjust_for_technical_discussion(args, raw_data):
    return (
        FunctionResult("Adjusting response parameters.")
        .update_settings({
            "temperature": 0.3,
            "confidence": 0.9,
            "barge-confidence": 0.8
        })
    )

agent.serve()
```