update_settings
update_settings
Update AI runtime settings dynamically during a call. Changes take effect for subsequent LLM turns.
Parameters
settings
Dictionary of settings to update. Supported keys:
Returns
FunctionResult — self, for chaining.
update_settings
Update AI runtime settings dynamically during a call. Changes take effect for subsequent LLM turns.
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) |
FunctionResult — self, for chaining.
1 from signalwire import AgentBase 2 from signalwire import FunctionResult 3 4 agent = AgentBase(name="my-agent", route="/agent") 5 agent.set_prompt_text("You are a helpful assistant.") 6 7 @agent.tool(name="adjust_for_technical_discussion", description="Adjust AI settings for technical topics") 8 def adjust_for_technical_discussion(args, raw_data): 9 return ( 10 FunctionResult("Adjusting response parameters.") 11 .update_settings({ 12 "temperature": 0.3, 13 "confidence": 0.9, 14 "barge-confidence": 0.8 15 }) 16 ) 17 18 agent.serve()