Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.4.0-alpha.7"
".": "0.4.0-alpha.8"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 96
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/llamastack%2Fllama-stack-client-ec32c74fc91569d09bb78aa3cdd8ebc65ed6c83bbd845fb79676e37c1711eda2.yml
openapi_spec_hash: 88f8449f767bd696985306c5dda5d026
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/llamastack%2Fllama-stack-client-602ce64aa309cc15fa09388d99c9f298795686fc37605237cbc03c39d29aabf6.yml
openapi_spec_hash: fc6995247b2555e8660bc9291eb10415
config_hash: e8a35d9d37cb4774b4b0fe1b167dc156
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 0.4.0-alpha.8 (2025-11-14)

Full Changelog: [v0.4.0-alpha.7...v0.4.0-alpha.8](https://github.com/llamastack/llama-stack-client-python/compare/v0.4.0-alpha.7...v0.4.0-alpha.8)

### Features

* **ci:** add integration tests workflow ([#300](https://github.com/llamastack/llama-stack-client-python/issues/300)) ([32cb959](https://github.com/llamastack/llama-stack-client-python/commit/32cb9594b4e7ddf79c3b613f4dc026de01bac892))


### Bug Fixes

* MCP authorization parameter implementation ([0b552c6](https://github.com/llamastack/llama-stack-client-python/commit/0b552c666e7e071d115f9611bae9ca64d10e9211))

## 0.4.0-alpha.7 (2025-11-13)

Full Changelog: [v0.4.0-alpha.6...v0.4.0-alpha.7](https://github.com/llamastack/llama-stack-client-python/compare/v0.4.0-alpha.6...v0.4.0-alpha.7)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "llama_stack_client"
version = "0.4.0-alpha.7"
version = "0.4.0-alpha.8"
description = "The official Python library for the llama-stack-client API"
dynamic = ["readme"]
license = "MIT"
Expand Down
16 changes: 16 additions & 0 deletions src/llama_stack_client/resources/tool_runtime/tool_runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def invoke_tool(
*,
kwargs: Dict[str, Union[bool, float, str, Iterable[object], object, None]],
tool_name: str,
authorization: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand All @@ -71,6 +72,8 @@ def invoke_tool(

tool_name: The name of the tool to invoke.

authorization: (Optional) OAuth access token for authenticating with the MCP server.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -85,6 +88,7 @@ def invoke_tool(
{
"kwargs": kwargs,
"tool_name": tool_name,
"authorization": authorization,
},
tool_runtime_invoke_tool_params.ToolRuntimeInvokeToolParams,
),
Expand All @@ -97,6 +101,7 @@ def invoke_tool(
def list_tools(
self,
*,
authorization: str | Omit = omit,
mcp_endpoint: tool_runtime_list_tools_params.McpEndpoint | Omit = omit,
tool_group_id: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand All @@ -110,6 +115,8 @@ def list_tools(
List all tools in the runtime.

Args:
authorization: (Optional) OAuth access token for authenticating with the MCP server.

mcp_endpoint: The MCP endpoint to use for the tool group.

tool_group_id: The ID of the tool group to list tools for.
Expand All @@ -131,6 +138,7 @@ def list_tools(
timeout=timeout,
query=maybe_transform(
{
"authorization": authorization,
"mcp_endpoint": mcp_endpoint,
"tool_group_id": tool_group_id,
},
Expand Down Expand Up @@ -167,6 +175,7 @@ async def invoke_tool(
*,
kwargs: Dict[str, Union[bool, float, str, Iterable[object], object, None]],
tool_name: str,
authorization: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
Expand All @@ -182,6 +191,8 @@ async def invoke_tool(

tool_name: The name of the tool to invoke.

authorization: (Optional) OAuth access token for authenticating with the MCP server.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request
Expand All @@ -196,6 +207,7 @@ async def invoke_tool(
{
"kwargs": kwargs,
"tool_name": tool_name,
"authorization": authorization,
},
tool_runtime_invoke_tool_params.ToolRuntimeInvokeToolParams,
),
Expand All @@ -208,6 +220,7 @@ async def invoke_tool(
async def list_tools(
self,
*,
authorization: str | Omit = omit,
mcp_endpoint: tool_runtime_list_tools_params.McpEndpoint | Omit = omit,
tool_group_id: str | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
Expand All @@ -221,6 +234,8 @@ async def list_tools(
List all tools in the runtime.

Args:
authorization: (Optional) OAuth access token for authenticating with the MCP server.

mcp_endpoint: The MCP endpoint to use for the tool group.

tool_group_id: The ID of the tool group to list tools for.
Expand All @@ -242,6 +257,7 @@ async def list_tools(
timeout=timeout,
query=await async_maybe_transform(
{
"authorization": authorization,
"mcp_endpoint": mcp_endpoint,
"tool_group_id": tool_group_id,
},
Expand Down
3 changes: 3 additions & 0 deletions src/llama_stack_client/types/response_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,9 @@ class ToolOpenAIResponseInputToolMcp(TypedDict, total=False):
allowed_tools: ToolOpenAIResponseInputToolMcpAllowedTools
"""(Optional) Restriction on which tools can be used from this server"""

authorization: str
"""(Optional) OAuth access token for authenticating with the MCP server"""

headers: Dict[str, Union[bool, float, str, Iterable[object], object, None]]
"""(Optional) HTTP headers to include when connecting to the server"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ class ToolRuntimeInvokeToolParams(TypedDict, total=False):

tool_name: Required[str]
"""The name of the tool to invoke."""

authorization: str
"""(Optional) OAuth access token for authenticating with the MCP server."""
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@


class ToolRuntimeListToolsParams(TypedDict, total=False):
authorization: str
"""(Optional) OAuth access token for authenticating with the MCP server."""

mcp_endpoint: McpEndpoint
"""The MCP endpoint to use for the tool group."""

Expand Down
20 changes: 20 additions & 0 deletions tests/api_resources/test_tool_runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ def test_method_invoke_tool(self, client: LlamaStackClient) -> None:
)
assert_matches_type(ToolInvocationResult, tool_runtime, path=["response"])

@parametrize
def test_method_invoke_tool_with_all_params(self, client: LlamaStackClient) -> None:
tool_runtime = client.tool_runtime.invoke_tool(
kwargs={"foo": True},
tool_name="tool_name",
authorization="authorization",
)
assert_matches_type(ToolInvocationResult, tool_runtime, path=["response"])

@parametrize
def test_raw_response_invoke_tool(self, client: LlamaStackClient) -> None:
response = client.tool_runtime.with_raw_response.invoke_tool(
Expand Down Expand Up @@ -68,6 +77,7 @@ def test_method_list_tools(self, client: LlamaStackClient) -> None:
@parametrize
def test_method_list_tools_with_all_params(self, client: LlamaStackClient) -> None:
tool_runtime = client.tool_runtime.list_tools(
authorization="authorization",
mcp_endpoint={"uri": "uri"},
tool_group_id="tool_group_id",
)
Expand Down Expand Up @@ -107,6 +117,15 @@ async def test_method_invoke_tool(self, async_client: AsyncLlamaStackClient) ->
)
assert_matches_type(ToolInvocationResult, tool_runtime, path=["response"])

@parametrize
async def test_method_invoke_tool_with_all_params(self, async_client: AsyncLlamaStackClient) -> None:
tool_runtime = await async_client.tool_runtime.invoke_tool(
kwargs={"foo": True},
tool_name="tool_name",
authorization="authorization",
)
assert_matches_type(ToolInvocationResult, tool_runtime, path=["response"])

@parametrize
async def test_raw_response_invoke_tool(self, async_client: AsyncLlamaStackClient) -> None:
response = await async_client.tool_runtime.with_raw_response.invoke_tool(
Expand Down Expand Up @@ -141,6 +160,7 @@ async def test_method_list_tools(self, async_client: AsyncLlamaStackClient) -> N
@parametrize
async def test_method_list_tools_with_all_params(self, async_client: AsyncLlamaStackClient) -> None:
tool_runtime = await async_client.tool_runtime.list_tools(
authorization="authorization",
mcp_endpoint={"uri": "uri"},
tool_group_id="tool_group_id",
)
Expand Down
Loading