mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-03 18:00:36 +00:00
using llama stack client's list_tools
This commit is contained in:
parent
ddc18e568f
commit
8c595bebc1
2 changed files with 9 additions and 10 deletions
|
|
@ -38,13 +38,10 @@ def test_mcp_invocation(llama_stack_client, text_model_id, mcp_server):
|
|||
# Phase 2: Use the dedicated authorization parameter (no more provider_data headers)
|
||||
# This tests direct tool_runtime.invoke_tool API calls
|
||||
|
||||
# Without authorization, should get Unauthorized error
|
||||
with pytest.raises(Exception, match="Unauthorized"):
|
||||
llama_stack_client.tools.list(toolgroup_id=test_toolgroup_id)
|
||||
|
||||
# With authorization parameter, should succeed
|
||||
tools_list = llama_stack_client.tools.list(
|
||||
toolgroup_id=test_toolgroup_id,
|
||||
# Note: tools.list() is the ToolGroups API and doesn't have authorization parameter
|
||||
# Use tool_runtime.list_tools() for authorization support
|
||||
tools_list = llama_stack_client.tool_runtime.list_tools(
|
||||
tool_group_id=test_toolgroup_id,
|
||||
authorization=AUTH_TOKEN, # Use dedicated authorization parameter
|
||||
)
|
||||
assert len(tools_list) == 2
|
||||
|
|
|
|||
|
|
@ -343,9 +343,11 @@ class TestAgentWithMCPTools:
|
|||
mcp_endpoint=dict(uri=uri),
|
||||
)
|
||||
|
||||
# Use the dedicated authorization parameter
|
||||
tools_list = llama_stack_client.tools.list(
|
||||
toolgroup_id=test_toolgroup_id,
|
||||
# Phase 2: Use the dedicated authorization parameter
|
||||
# Note: tools.list() is the ToolGroups API and doesn't have authorization parameter
|
||||
# Use tool_runtime.list_tools() instead
|
||||
tools_list = llama_stack_client.tool_runtime.list_tools(
|
||||
tool_group_id=test_toolgroup_id,
|
||||
authorization=AUTH_TOKEN,
|
||||
)
|
||||
tool_defs = [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue