File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ from utu .agents import SimpleAgent
2+ from utu .config import ConfigLoader
3+
4+
5+ async def main ():
6+ config = ConfigLoader .load_agent_config ("simple/base_search" )
7+ config .stop_at_tool_names = ["search" ]
8+ async with SimpleAgent (config = config ) as agent :
9+ res = await agent .chat_streamed ("Search for Gemini 3." )
10+ print (f"res.final_output: { res .final_output } " )
11+
12+
13+ if __name__ == "__main__" :
14+ import asyncio
15+
16+ asyncio .run (main ())
Original file line number Diff line number Diff line change @@ -55,6 +55,8 @@ def __init__(
5555 self .config .agent .name = name
5656 if instructions :
5757 self .config .agent .instructions = instructions
58+ if self .config .stop_at_tool_names :
59+ tool_use_behavior = StopAtTools (stop_at_tool_names = self .config .stop_at_tool_names )
5860 self .model = self ._get_model (self .config , model )
5961 self .model_settings = self ._get_model_settings (self .config , model_settings )
6062 self .tools : list [Tool ] = tools or []
Original file line number Diff line number Diff line change @@ -68,6 +68,8 @@ class AgentConfig(ConfigBaseModel):
6868 """Toolkits config"""
6969 max_turns : int = 50
7070 """Max turns for simple agent. This param is derived from @openai-agents"""
71+ stop_at_tool_names : list [str ] | None = None
72+ """Stop at tools for simple agent. This param is derived from @openai-agents"""
7173
7274 # orchestra agent config
7375 planner_model : ModelConfigs = Field (default_factory = ModelConfigs )
You can’t perform that action at this time.
0 commit comments