3
3
#
4
4
# This source code is licensed under the terms described in the LICENSE file in
5
5
# the root directory of this source tree.
6
- from typing import Iterator , List , Optional , Tuple , Union
6
+ from typing import Iterator , List , Optional , Union
7
7
8
8
from llama_stack_client import LlamaStackClient
9
9
16
16
)
17
17
from llama_stack_client .types .shared .tool_call import ToolCall
18
18
19
- from .client_tool import ClientTool
20
19
from .tool_parser import ToolParser
21
20
22
21
DEFAULT_MAX_ITER = 10
@@ -27,14 +26,14 @@ def __init__(
27
26
self ,
28
27
client : LlamaStackClient ,
29
28
agent_config : AgentConfig ,
30
- client_tools : Tuple [ClientTool ] = (),
31
29
tool_parser : Optional [ToolParser ] = None ,
32
30
):
33
31
self .client = client
34
32
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" ]]
36
36
self .agent_id = self ._create_agent (agent_config )
37
- self .client_tools = {t .get_name (): t for t in client_tools }
38
37
self .sessions = []
39
38
self .tool_parser = tool_parser
40
39
self .builtin_tools = {}
0 commit comments