Skip to content

Commit 4e24a76

Browse files
fix(api): fix the ToolDefParam updates
1 parent 67b3d02 commit 4e24a76

File tree

13 files changed

+46
-192
lines changed

13 files changed

+46
-192
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 93
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/llamastack%2Fllama-stack-client-41cb5d8049e6ffd933a7ad6bbbb76b2fef2e864d0d857c91799ee16e9a796883.yml
3-
openapi_spec_hash: 5e0bdf64563e020ef14b968ab724d2db
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/llamastack%2Fllama-stack-client-f26df77f0800baeaea40407776f6c1e618756037969411e29de209ce961655dd.yml
3+
openapi_spec_hash: e7c2329edc0f9f5aa1c78b6afb996e1c
44
config_hash: 0412cd40c0609550c1a47c69dd104e4f

api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ Methods:
4242
Types:
4343

4444
```python
45-
from llama_stack_client.types import ListToolsResponse, Tool, ToolListResponse
45+
from llama_stack_client.types import ToolListResponse
4646
```
4747

4848
Methods:
4949

5050
- <code title="get /v1/tools">client.tools.<a href="./src/llama_stack_client/resources/tools.py">list</a>(\*\*<a href="src/llama_stack_client/types/tool_list_params.py">params</a>) -> <a href="./src/llama_stack_client/types/tool_list_response.py">ToolListResponse</a></code>
51-
- <code title="get /v1/tools/{tool_name}">client.tools.<a href="./src/llama_stack_client/resources/tools.py">get</a>(tool_name) -> <a href="./src/llama_stack_client/types/tool.py">Tool</a></code>
51+
- <code title="get /v1/tools/{tool_name}">client.tools.<a href="./src/llama_stack_client/resources/tools.py">get</a>(tool_name) -> <a href="./src/llama_stack_client/types/tool_def.py">ToolDef</a></code>
5252

5353
# ToolRuntime
5454

src/llama_stack_client/resources/tools.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
async_to_streamed_response_wrapper,
1919
)
2020
from .._wrappers import DataWrapper
21-
from ..types.tool import Tool
2221
from .._base_client import make_request_options
22+
from ..types.tool_def import ToolDef
2323
from ..types.tool_list_response import ToolListResponse
2424

2525
__all__ = ["ToolsResource", "AsyncToolsResource"]
@@ -93,7 +93,7 @@ def get(
9393
extra_query: Query | None = None,
9494
extra_body: Body | None = None,
9595
timeout: float | httpx.Timeout | None | NotGiven = not_given,
96-
) -> Tool:
96+
) -> ToolDef:
9797
"""
9898
Get a tool by its name.
9999
@@ -113,7 +113,7 @@ def get(
113113
options=make_request_options(
114114
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
115115
),
116-
cast_to=Tool,
116+
cast_to=ToolDef,
117117
)
118118

119119

@@ -185,7 +185,7 @@ async def get(
185185
extra_query: Query | None = None,
186186
extra_body: Body | None = None,
187187
timeout: float | httpx.Timeout | None | NotGiven = not_given,
188-
) -> Tool:
188+
) -> ToolDef:
189189
"""
190190
Get a tool by its name.
191191
@@ -205,7 +205,7 @@ async def get(
205205
options=make_request_options(
206206
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
207207
),
208-
cast_to=Tool,
208+
cast_to=ToolDef,
209209
)
210210

211211

src/llama_stack_client/types/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
from __future__ import annotations
44

55
from .file import File as File
6-
from .tool import Tool as Tool
76
from .model import Model as Model
87
from .shared import (
98
Message as Message,
@@ -43,7 +42,6 @@
4342
from .file_create_params import FileCreateParams as FileCreateParams
4443
from .tool_list_response import ToolListResponse as ToolListResponse
4544
from .list_files_response import ListFilesResponse as ListFilesResponse
46-
from .list_tools_response import ListToolsResponse as ListToolsResponse
4745
from .model_list_response import ModelListResponse as ModelListResponse
4846
from .route_list_response import RouteListResponse as RouteListResponse
4947
from .run_shield_response import RunShieldResponse as RunShieldResponse

src/llama_stack_client/types/list_tools_response.py

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import Dict, List, Union, Optional
3+
from typing import Union
44
from typing_extensions import Literal
55

66
from ..._models import BaseModel
@@ -9,18 +9,8 @@
99

1010

1111
class ToolCall(BaseModel):
12-
arguments: Union[
13-
str,
14-
Dict[
15-
str,
16-
Union[
17-
str, float, bool, List[Union[str, float, bool, None]], Dict[str, Union[str, float, bool, None]], None
18-
],
19-
],
20-
]
12+
arguments: str
2113

2214
call_id: str
2315

2416
tool_name: Union[Literal["brave_search", "wolfram_alpha", "photogen", "code_interpreter"], str]
25-
26-
arguments_json: Optional[str] = None

src/llama_stack_client/types/shared_params/tool_call.py

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,15 @@
22

33
from __future__ import annotations
44

5-
from typing import Dict, Union
5+
from typing import Union
66
from typing_extensions import Literal, Required, TypedDict
77

8-
from ..._types import SequenceNotStr
9-
108
__all__ = ["ToolCall"]
119

1210

1311
class ToolCall(TypedDict, total=False):
14-
arguments: Required[
15-
Union[
16-
str,
17-
Dict[
18-
str,
19-
Union[
20-
str,
21-
float,
22-
bool,
23-
SequenceNotStr[Union[str, float, bool, None]],
24-
Dict[str, Union[str, float, bool, None]],
25-
None,
26-
],
27-
],
28-
]
29-
]
12+
arguments: Required[str]
3013

3114
call_id: Required[str]
3215

3316
tool_name: Required[Union[Literal["brave_search", "wolfram_alpha", "photogen", "code_interpreter"], str]]
34-
35-
arguments_json: str

src/llama_stack_client/types/tool.py

Lines changed: 0 additions & 54 deletions
This file was deleted.

src/llama_stack_client/types/tool_def.py

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,7 @@
44

55
from .._models import BaseModel
66

7-
__all__ = ["ToolDef", "Parameter"]
8-
9-
10-
class Parameter(BaseModel):
11-
description: str
12-
"""Human-readable description of what the parameter does"""
13-
14-
name: str
15-
"""Name of the parameter"""
16-
17-
parameter_type: str
18-
"""Type of the parameter (e.g., string, integer)"""
19-
20-
required: bool
21-
"""Whether this parameter is required for tool invocation"""
22-
23-
default: Union[bool, float, str, List[object], object, None] = None
24-
"""(Optional) Default value for the parameter if not provided"""
25-
26-
items: Optional[object] = None
27-
"""Type of the elements when parameter_type is array"""
28-
29-
title: Optional[str] = None
30-
"""(Optional) Title of the parameter"""
7+
__all__ = ["ToolDef"]
318

329

3310
class ToolDef(BaseModel):
@@ -37,8 +14,14 @@ class ToolDef(BaseModel):
3714
description: Optional[str] = None
3815
"""(Optional) Human-readable description of what the tool does"""
3916

17+
input_schema: Optional[Dict[str, Union[bool, float, str, List[object], object, None]]] = None
18+
"""(Optional) JSON Schema for tool inputs (MCP inputSchema)"""
19+
4020
metadata: Optional[Dict[str, Union[bool, float, str, List[object], object, None]]] = None
4121
"""(Optional) Additional metadata about the tool"""
4222

43-
parameters: Optional[List[Parameter]] = None
44-
"""(Optional) List of parameters this tool accepts"""
23+
output_schema: Optional[Dict[str, Union[bool, float, str, List[object], object, None]]] = None
24+
"""(Optional) JSON Schema for tool outputs (MCP outputSchema)"""
25+
26+
toolgroup_id: Optional[str] = None
27+
"""(Optional) ID of the tool group this tool belongs to"""

src/llama_stack_client/types/tool_def_param.py

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,7 @@
55
from typing import Dict, Union, Iterable
66
from typing_extensions import Required, TypedDict
77

8-
__all__ = ["ToolDefParam", "Parameter"]
9-
10-
11-
class Parameter(TypedDict, total=False):
12-
description: Required[str]
13-
"""Human-readable description of what the parameter does"""
14-
15-
name: Required[str]
16-
"""Name of the parameter"""
17-
18-
parameter_type: Required[str]
19-
"""Type of the parameter (e.g., string, integer)"""
20-
21-
required: Required[bool]
22-
"""Whether this parameter is required for tool invocation"""
23-
24-
default: Union[bool, float, str, Iterable[object], object, None]
25-
"""(Optional) Default value for the parameter if not provided"""
26-
27-
items: object
28-
"""Type of the elements when parameter_type is array"""
29-
30-
title: str
31-
"""(Optional) Title of the parameter"""
8+
__all__ = ["ToolDefParam"]
329

3310

3411
class ToolDefParam(TypedDict, total=False):
@@ -38,8 +15,14 @@ class ToolDefParam(TypedDict, total=False):
3815
description: str
3916
"""(Optional) Human-readable description of what the tool does"""
4017

18+
input_schema: Dict[str, Union[bool, float, str, Iterable[object], object, None]]
19+
"""(Optional) JSON Schema for tool inputs (MCP inputSchema)"""
20+
4121
metadata: Dict[str, Union[bool, float, str, Iterable[object], object, None]]
4222
"""(Optional) Additional metadata about the tool"""
4323

44-
parameters: Iterable[Parameter]
45-
"""(Optional) List of parameters this tool accepts"""
24+
output_schema: Dict[str, Union[bool, float, str, Iterable[object], object, None]]
25+
"""(Optional) JSON Schema for tool outputs (MCP outputSchema)"""
26+
27+
toolgroup_id: str
28+
"""(Optional) ID of the tool group this tool belongs to"""

0 commit comments

Comments
 (0)