mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-03 17:29:01 +00:00
test turn overrides in unit tests
This commit is contained in:
parent
854fef7478
commit
67b35613bb
1 changed files with 13 additions and 0 deletions
|
@ -12,6 +12,7 @@ from llama_models.llama3.api.datatypes import BuiltinTool
|
||||||
|
|
||||||
from llama_stack.apis.agents import (
|
from llama_stack.apis.agents import (
|
||||||
AgentConfig,
|
AgentConfig,
|
||||||
|
AgentToolGroupWithArgs,
|
||||||
AgentTurnCreateRequest,
|
AgentTurnCreateRequest,
|
||||||
AgentTurnResponseTurnCompletePayload,
|
AgentTurnResponseTurnCompletePayload,
|
||||||
StepType,
|
StepType,
|
||||||
|
@ -478,3 +479,15 @@ async def test_chat_agent_tools(
|
||||||
assert MEMORY_QUERY_TOOL in tool_defs
|
assert MEMORY_QUERY_TOOL in tool_defs
|
||||||
if expected_code_interpreter:
|
if expected_code_interpreter:
|
||||||
assert BuiltinTool.code_interpreter in tool_defs
|
assert BuiltinTool.code_interpreter in tool_defs
|
||||||
|
if expected_memory and expected_code_interpreter:
|
||||||
|
# override the tools for turn
|
||||||
|
new_tool_defs, _ = await chat_agent._get_tool_defs(
|
||||||
|
toolgroups_for_turn=[
|
||||||
|
AgentToolGroupWithArgs(
|
||||||
|
name=MEMORY_TOOLGROUP,
|
||||||
|
args={"memory_banks": ["test_memory_bank"]},
|
||||||
|
)
|
||||||
|
]
|
||||||
|
)
|
||||||
|
assert MEMORY_QUERY_TOOL in new_tool_defs
|
||||||
|
assert BuiltinTool.code_interpreter not in new_tool_defs
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue