File tree 1 file changed +1
-4
lines changed
1 file changed +1
-4
lines changed Original file line number Diff line number Diff line change @@ -216,22 +216,19 @@ async def execute_tools_and_side_effects(
216
216
run_config .model_settings and
217
217
cls ._should_reset_tool_choice (run_config .model_settings , tools )
218
218
):
219
- # Also update the run_config model settings with a copy
219
+ # update the run_config model settings with a copy
220
220
new_run_config_settings = dataclasses .replace (
221
221
run_config .model_settings ,
222
222
tool_choice = "auto"
223
223
)
224
- # Create a new run_config with the new settings
225
224
run_config = dataclasses .replace (run_config , model_settings = new_run_config_settings )
226
225
227
- # Only reset in the problematic scenarios where loops are likely unintentional
228
226
if cls ._should_reset_tool_choice (agent .model_settings , tools ):
229
227
# Create a modified copy instead of modifying the original agent
230
228
new_model_settings = dataclasses .replace (
231
229
agent .model_settings ,
232
230
tool_choice = "auto"
233
231
)
234
- # Create a new internal agent with updated settings
235
232
agent = dataclasses .replace (agent , model_settings = new_model_settings )
236
233
237
234
# Second, check if there are any handoffs
You can’t perform that action at this time.
0 commit comments