Skip to content

Commit 686a1ba

Browse files
move client_tools definition to only use AgentConfig
Signed-off-by: Michael Clifford <[email protected]>
1 parent 8cbef28 commit 686a1ba

File tree

1 file changed

+4
-5
lines changed
  • src/llama_stack_client/lib/agents

1 file changed

+4
-5
lines changed

src/llama_stack_client/lib/agents/agent.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
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

88
from llama_stack_client import LlamaStackClient
99

@@ -16,7 +16,6 @@
1616
)
1717
from llama_stack_client.types.shared.tool_call import ToolCall
1818

19-
from .client_tool import ClientTool
2019
from .tool_parser import ToolParser
2120

2221
DEFAULT_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

Comments
 (0)