diff --git a/run_agent.py b/run_agent.py index 6e9fc2c38..295106e3d 100644 --- a/run_agent.py +++ b/run_agent.py @@ -1781,6 +1781,7 @@ class AIAgent: allowed_keys = { "model", "instructions", "input", "tools", "store", "reasoning", "include", "max_output_tokens", "temperature", + "tool_choice", "parallel_tool_calls", "prompt_cache_key", } normalized: Dict[str, Any] = { "model": model, @@ -1806,6 +1807,12 @@ class AIAgent: if isinstance(temperature, (int, float)): normalized["temperature"] = float(temperature) + # Pass through tool_choice, parallel_tool_calls, prompt_cache_key + for passthrough_key in ("tool_choice", "parallel_tool_calls", "prompt_cache_key"): + val = api_kwargs.get(passthrough_key) + if val is not None: + normalized[passthrough_key] = val + if allow_stream: stream = api_kwargs.get("stream") if stream is not None and stream is not True: