Skip to content

Commit a7d787f

Browse files
stainless-app[bot]meorphis
authored andcommitted
feat(api): manual updates
1 parent 44e5dec commit a7d787f

File tree

9 files changed

+157
-186
lines changed

9 files changed

+157
-186
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 104
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/llamastack%2Fllama-stack-client-fcaa960dc2de2029f4f67f13ff1d0fc1ff70e683810ed9739be805debef1673d.yml
3-
openapi_spec_hash: a25e7616ad6230f872b46c2cb6fa0a96
4-
config_hash: ff421daf28f90ad4bd4e13f374b18a00
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/llamastack%2Fllama-stack-client-97b91eca4a3ff251edc02636b1a638866675d6c1abd46cd9fc18bc50a1de9656.yml
3+
openapi_spec_hash: 7302f1aa50090e3de78e34c184371267
4+
config_hash: 364c8cc514fe5aa69bd24c7f3721985b

api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ from llama_stack_client.types.conversations import (
132132
Methods:
133133

134134
- <code title="post /v1/conversations/{conversation_id}/items">client.conversations.items.<a href="./src/llama_stack_client/resources/conversations/items.py">create</a>(conversation_id, \*\*<a href="src/llama_stack_client/types/conversations/item_create_params.py">params</a>) -> <a href="./src/llama_stack_client/types/conversations/item_create_response.py">ItemCreateResponse</a></code>
135-
- <code title="get /v1/conversations/{conversation_id}/items">client.conversations.items.<a href="./src/llama_stack_client/resources/conversations/items.py">list</a>(conversation_id, \*\*<a href="src/llama_stack_client/types/conversations/item_list_params.py">params</a>) -> <a href="./src/llama_stack_client/types/conversations/item_list_response.py">ItemListResponse</a></code>
135+
- <code title="get /v1/conversations/{conversation_id}/items">client.conversations.items.<a href="./src/llama_stack_client/resources/conversations/items.py">list</a>(conversation_id, \*\*<a href="src/llama_stack_client/types/conversations/item_list_params.py">params</a>) -> <a href="./src/llama_stack_client/types/conversations/item_list_response.py">SyncOpenAICursorPage[ItemListResponse]</a></code>
136136
- <code title="get /v1/conversations/{conversation_id}/items/{item_id}">client.conversations.items.<a href="./src/llama_stack_client/resources/conversations/items.py">get</a>(item_id, \*, conversation_id) -> <a href="./src/llama_stack_client/types/conversations/item_get_response.py">ItemGetResponse</a></code>
137137

138138
# Inspect

src/llama_stack_client/resources/conversations/items.py

Lines changed: 44 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88

99
from __future__ import annotations
1010

11-
from typing import Any, List, Union, Iterable, cast
11+
from typing import Any, List, Iterable, cast
1212
from typing_extensions import Literal
1313

1414
import httpx
1515

16-
from ..._types import Body, Query, Headers, NotGiven, not_given
16+
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
1717
from ..._utils import maybe_transform, async_maybe_transform
1818
from ..._compat import cached_property
1919
from ..._resource import SyncAPIResource, AsyncAPIResource
@@ -23,7 +23,8 @@
2323
async_to_raw_response_wrapper,
2424
async_to_streamed_response_wrapper,
2525
)
26-
from ..._base_client import make_request_options
26+
from ...pagination import SyncOpenAICursorPage, AsyncOpenAICursorPage
27+
from ..._base_client import AsyncPaginator, make_request_options
2728
from ...types.conversations import item_list_params, item_create_params
2829
from ...types.conversations.item_get_response import ItemGetResponse
2930
from ...types.conversations.item_list_response import ItemListResponse
@@ -94,29 +95,28 @@ def list(
9495
self,
9596
conversation_id: str,
9697
*,
97-
after: Union[str, object],
98-
include: Union[
99-
List[
100-
Literal[
101-
"code_interpreter_call.outputs",
102-
"computer_call_output.output.image_url",
103-
"file_search_call.results",
104-
"message.input_image.image_url",
105-
"message.output_text.logprobs",
106-
"reasoning.encrypted_content",
107-
]
108-
],
109-
object,
110-
],
111-
limit: Union[int, object],
112-
order: Union[Literal["asc", "desc"], object],
98+
after: str | Omit = omit,
99+
include: List[
100+
Literal[
101+
"web_search_call.action.sources",
102+
"code_interpreter_call.outputs",
103+
"computer_call_output.output.image_url",
104+
"file_search_call.results",
105+
"message.input_image.image_url",
106+
"message.output_text.logprobs",
107+
"reasoning.encrypted_content",
108+
]
109+
]
110+
| Omit = omit,
111+
limit: int | Omit = omit,
112+
order: Literal["asc", "desc"] | Omit = omit,
113113
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
114114
# The extra values given here take precedence over values defined on the client or passed to this method.
115115
extra_headers: Headers | None = None,
116116
extra_query: Query | None = None,
117117
extra_body: Body | None = None,
118118
timeout: float | httpx.Timeout | None | NotGiven = not_given,
119-
) -> ItemListResponse:
119+
) -> SyncOpenAICursorPage[ItemListResponse]:
120120
"""List items.
121121
122122
List items in the conversation.
@@ -140,8 +140,9 @@ def list(
140140
"""
141141
if not conversation_id:
142142
raise ValueError(f"Expected a non-empty value for `conversation_id` but received {conversation_id!r}")
143-
return self._get(
143+
return self._get_api_list(
144144
f"/v1/conversations/{conversation_id}/items",
145+
page=SyncOpenAICursorPage[ItemListResponse],
145146
options=make_request_options(
146147
extra_headers=extra_headers,
147148
extra_query=extra_query,
@@ -157,7 +158,7 @@ def list(
157158
item_list_params.ItemListParams,
158159
),
159160
),
160-
cast_to=ItemListResponse,
161+
model=cast(Any, ItemListResponse), # Union types cannot be passed in as arguments in the type system
161162
)
162163

163164
def get(
@@ -259,33 +260,32 @@ async def create(
259260
cast_to=ItemCreateResponse,
260261
)
261262

262-
async def list(
263+
def list(
263264
self,
264265
conversation_id: str,
265266
*,
266-
after: Union[str, object],
267-
include: Union[
268-
List[
269-
Literal[
270-
"code_interpreter_call.outputs",
271-
"computer_call_output.output.image_url",
272-
"file_search_call.results",
273-
"message.input_image.image_url",
274-
"message.output_text.logprobs",
275-
"reasoning.encrypted_content",
276-
]
277-
],
278-
object,
279-
],
280-
limit: Union[int, object],
281-
order: Union[Literal["asc", "desc"], object],
267+
after: str | Omit = omit,
268+
include: List[
269+
Literal[
270+
"web_search_call.action.sources",
271+
"code_interpreter_call.outputs",
272+
"computer_call_output.output.image_url",
273+
"file_search_call.results",
274+
"message.input_image.image_url",
275+
"message.output_text.logprobs",
276+
"reasoning.encrypted_content",
277+
]
278+
]
279+
| Omit = omit,
280+
limit: int | Omit = omit,
281+
order: Literal["asc", "desc"] | Omit = omit,
282282
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
283283
# The extra values given here take precedence over values defined on the client or passed to this method.
284284
extra_headers: Headers | None = None,
285285
extra_query: Query | None = None,
286286
extra_body: Body | None = None,
287287
timeout: float | httpx.Timeout | None | NotGiven = not_given,
288-
) -> ItemListResponse:
288+
) -> AsyncPaginator[ItemListResponse, AsyncOpenAICursorPage[ItemListResponse]]:
289289
"""List items.
290290
291291
List items in the conversation.
@@ -309,14 +309,15 @@ async def list(
309309
"""
310310
if not conversation_id:
311311
raise ValueError(f"Expected a non-empty value for `conversation_id` but received {conversation_id!r}")
312-
return await self._get(
312+
return self._get_api_list(
313313
f"/v1/conversations/{conversation_id}/items",
314+
page=AsyncOpenAICursorPage[ItemListResponse],
314315
options=make_request_options(
315316
extra_headers=extra_headers,
316317
extra_query=extra_query,
317318
extra_body=extra_body,
318319
timeout=timeout,
319-
query=await async_maybe_transform(
320+
query=maybe_transform(
320321
{
321322
"after": after,
322323
"include": include,
@@ -326,7 +327,7 @@ async def list(
326327
item_list_params.ItemListParams,
327328
),
328329
),
329-
cast_to=ItemListResponse,
330+
model=cast(Any, ItemListResponse), # Union types cannot be passed in as arguments in the type system
330331
)
331332

332333
async def get(

src/llama_stack_client/resources/models/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def register(
126126
*,
127127
model_id: str,
128128
metadata: Dict[str, Union[bool, float, str, Iterable[object], object, None]] | Omit = omit,
129-
model_type: Literal["llm", "embedding"] | Omit = omit,
129+
model_type: Literal["llm", "embedding", "rerank"] | Omit = omit,
130130
provider_id: str | Omit = omit,
131131
provider_model_id: str | Omit = omit,
132132
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -299,7 +299,7 @@ async def register(
299299
*,
300300
model_id: str,
301301
metadata: Dict[str, Union[bool, float, str, Iterable[object], object, None]] | Omit = omit,
302-
model_type: Literal["llm", "embedding"] | Omit = omit,
302+
model_type: Literal["llm", "embedding", "rerank"] | Omit = omit,
303303
provider_id: str | Omit = omit,
304304
provider_model_id: str | Omit = omit,
305305
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.

src/llama_stack_client/types/conversations/item_list_params.py

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,35 +8,31 @@
88

99
from __future__ import annotations
1010

11-
from typing import List, Union
12-
from typing_extensions import Literal, Required, TypedDict
11+
from typing import List
12+
from typing_extensions import Literal, TypedDict
1313

1414
__all__ = ["ItemListParams"]
1515

1616

1717
class ItemListParams(TypedDict, total=False):
18-
after: Required[Union[str, object]]
18+
after: str
1919
"""An item ID to list items after, used in pagination."""
2020

21-
include: Required[
22-
Union[
23-
List[
24-
Literal[
25-
"code_interpreter_call.outputs",
26-
"computer_call_output.output.image_url",
27-
"file_search_call.results",
28-
"message.input_image.image_url",
29-
"message.output_text.logprobs",
30-
"reasoning.encrypted_content",
31-
]
32-
],
33-
object,
21+
include: List[
22+
Literal[
23+
"web_search_call.action.sources",
24+
"code_interpreter_call.outputs",
25+
"computer_call_output.output.image_url",
26+
"file_search_call.results",
27+
"message.input_image.image_url",
28+
"message.output_text.logprobs",
29+
"reasoning.encrypted_content",
3430
]
3531
]
3632
"""Specify additional output data to include in the response."""
3733

38-
limit: Required[Union[int, object]]
34+
limit: int
3935
"""A limit on the number of objects to be returned (1-100, default 20)."""
4036

41-
order: Required[Union[Literal["asc", "desc"], object]]
37+
order: Literal["asc", "desc"]
4238
"""The order to return items in (asc or desc, default desc)."""

0 commit comments

Comments
 (0)