33#
44# This source code is licensed under the terms described in the LICENSE file in
55# the root directory of this source tree.
6- from typing import Iterator , List , Optional , Tuple , Union
6+ from typing import Iterator , List , Optional , Union
77
88from llama_stack_client import LlamaStackClient
99
1616)
1717from llama_stack_client .types .shared .tool_call import ToolCall
1818
19- from .client_tool import ClientTool
2019from .tool_parser import ToolParser
2120
2221DEFAULT_MAX_ITER = 10
@@ -27,14 +26,14 @@ def __init__(
2726 self ,
2827 client : LlamaStackClient ,
2928 agent_config : AgentConfig ,
30- client_tools : Tuple [ClientTool ] = (),
3129 tool_parser : Optional [ToolParser ] = None ,
3230 ):
3331 self .client = client
3432 self .agent_config = agent_config
35- self .agent_config ["client_tools" ] = [client_tool .get_tool_definition () for client_tool in client_tools ]
33+ if "client_tools" in agent_config .keys ():
34+ self .client_tools = {t .get_name (): t for t in agent_config ["client_tools" ]}
35+ self .agent_config ["client_tools" ] = [tool .get_tool_definition () for tool in agent_config ["client_tools" ]]
3636 self .agent_id = self ._create_agent (agent_config )
37- self .client_tools = {t .get_name (): t for t in client_tools }
3837 self .sessions = []
3938 self .tool_parser = tool_parser
4039 self .builtin_tools = {}
0 commit comments