Skip to content

Commit 83bb4d8

Browse files
michieldwitteMichiel De Witte
andauthored
Fix instructions not being applied (#1688)
Co-authored-by: Michiel De Witte <[email protected]>
1 parent 329806a commit 83bb4d8

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/agents/realtime/session.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -622,9 +622,6 @@ async def _get_updated_model_settings_from_agent(
622622
# Start with run config model settings as base
623623
run_config_settings = self._run_config.get("model_settings", {})
624624
updated_settings: RealtimeSessionModelSettings = run_config_settings.copy()
625-
# Apply starting settings (from model config) next
626-
if starting_settings:
627-
updated_settings.update(starting_settings)
628625

629626
instructions, tools, handoffs = await asyncio.gather(
630627
agent.get_system_prompt(self._context_wrapper),
@@ -635,6 +632,10 @@ async def _get_updated_model_settings_from_agent(
635632
updated_settings["tools"] = tools or []
636633
updated_settings["handoffs"] = handoffs or []
637634

635+
# Apply starting settings (from model config) next
636+
if starting_settings:
637+
updated_settings.update(starting_settings)
638+
638639
disable_tracing = self._run_config.get("tracing_disabled", False)
639640
if disable_tracing:
640641
updated_settings["tracing"] = None

0 commit comments

Comments
 (0)