diff --git a/.release-please-manifest.json b/.release-please-manifest.json index b9887e0e..89ed046f 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.4.0-alpha.7" + ".": "0.4.0-alpha.8" } diff --git a/.stats.yml b/.stats.yml index 6388bfde..c4e4ef9b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 98ca3cd4..1f7e8689 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/pyproject.toml b/pyproject.toml index bf8b64c8..2bdf6316 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" diff --git a/src/llama_stack_client/resources/tool_runtime/tool_runtime.py b/src/llama_stack_client/resources/tool_runtime/tool_runtime.py index b4cc863b..4acc4e96 100644 --- a/src/llama_stack_client/resources/tool_runtime/tool_runtime.py +++ b/src/llama_stack_client/resources/tool_runtime/tool_runtime.py @@ -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, @@ -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 @@ -85,6 +88,7 @@ def invoke_tool( { "kwargs": kwargs, "tool_name": tool_name, + "authorization": authorization, }, tool_runtime_invoke_tool_params.ToolRuntimeInvokeToolParams, ), @@ -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. @@ -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. @@ -131,6 +138,7 @@ def list_tools( timeout=timeout, query=maybe_transform( { + "authorization": authorization, "mcp_endpoint": mcp_endpoint, "tool_group_id": tool_group_id, }, @@ -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, @@ -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 @@ -196,6 +207,7 @@ async def invoke_tool( { "kwargs": kwargs, "tool_name": tool_name, + "authorization": authorization, }, tool_runtime_invoke_tool_params.ToolRuntimeInvokeToolParams, ), @@ -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. @@ -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. @@ -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, }, diff --git a/src/llama_stack_client/types/response_create_params.py b/src/llama_stack_client/types/response_create_params.py index d4d06276..e6f90efc 100644 --- a/src/llama_stack_client/types/response_create_params.py +++ b/src/llama_stack_client/types/response_create_params.py @@ -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""" diff --git a/src/llama_stack_client/types/tool_runtime_invoke_tool_params.py b/src/llama_stack_client/types/tool_runtime_invoke_tool_params.py index 1a299eba..1fc49629 100644 --- a/src/llama_stack_client/types/tool_runtime_invoke_tool_params.py +++ b/src/llama_stack_client/types/tool_runtime_invoke_tool_params.py @@ -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.""" diff --git a/src/llama_stack_client/types/tool_runtime_list_tools_params.py b/src/llama_stack_client/types/tool_runtime_list_tools_params.py index ce00936b..182bc2fb 100644 --- a/src/llama_stack_client/types/tool_runtime_list_tools_params.py +++ b/src/llama_stack_client/types/tool_runtime_list_tools_params.py @@ -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.""" diff --git a/tests/api_resources/test_tool_runtime.py b/tests/api_resources/test_tool_runtime.py index b25a41a7..46e1900a 100644 --- a/tests/api_resources/test_tool_runtime.py +++ b/tests/api_resources/test_tool_runtime.py @@ -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( @@ -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", ) @@ -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( @@ -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", )