Skip to content

Commit b8bfc9c

Browse files
chore(internal): codegen related update
1 parent 43443fe commit b8bfc9c

File tree

6 files changed

+20
-43
lines changed

6 files changed

+20
-43
lines changed

api.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -299,12 +299,6 @@ Methods:
299299

300300
## OpenAI
301301

302-
Types:
303-
304-
```python
305-
from llama_stack_client.types.models import OpenAIListResponse
306-
```
307-
308302
Methods:
309303

310304
- <code title="get /v1/models">client.models.openai.<a href="./src/llama_stack_client/resources/models/openai.py">list</a>() -> <a href="./src/llama_stack_client/types/model_list_response.py">ModelListResponse</a></code>
@@ -521,7 +515,7 @@ from llama_stack_client.types.alpha.post_training import (
521515

522516
Methods:
523517

524-
- <code title="get /v1alpha/post-training/jobs">client.alpha.post_training.job.<a href="./src/llama_stack_client/resources/alpha/post_training/job.py">list</a>() -> List[Data]</code>
518+
- <code title="get /v1alpha/post-training/jobs">client.alpha.post_training.job.<a href="./src/llama_stack_client/resources/alpha/post_training/job.py">list</a>() -> <a href="./src/llama_stack_client/types/alpha/post_training/job_list_response.py">JobListResponse</a></code>
525519
- <code title="get /v1alpha/post-training/job/artifacts">client.alpha.post_training.job.<a href="./src/llama_stack_client/resources/alpha/post_training/job.py">artifacts</a>(\*\*<a href="src/llama_stack_client/types/alpha/post_training/job_artifacts_params.py">params</a>) -> <a href="./src/llama_stack_client/types/alpha/post_training/job_artifacts_response.py">JobArtifactsResponse</a></code>
526520
- <code title="post /v1alpha/post-training/job/cancel">client.alpha.post_training.job.<a href="./src/llama_stack_client/resources/alpha/post_training/job.py">cancel</a>(\*\*<a href="src/llama_stack_client/types/alpha/post_training/job_cancel_params.py">params</a>) -> None</code>
527521
- <code title="get /v1alpha/post-training/job/status">client.alpha.post_training.job.<a href="./src/llama_stack_client/resources/alpha/post_training/job.py">status</a>(\*\*<a href="src/llama_stack_client/types/alpha/post_training/job_status_params.py">params</a>) -> <a href="./src/llama_stack_client/types/alpha/post_training/job_status_response.py">JobStatusResponse</a></code>

src/llama_stack_client/resources/alpha/post_training/job.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import List, Type, cast
5+
from typing import Type, cast
66

77
import httpx
88

@@ -19,7 +19,7 @@
1919
from ...._wrappers import DataWrapper
2020
from ...._base_client import make_request_options
2121
from ....types.alpha.post_training import job_cancel_params, job_status_params, job_artifacts_params
22-
from ....types.alpha.list_post_training_jobs_response import Data
22+
from ....types.alpha.post_training.job_list_response import JobListResponse
2323
from ....types.alpha.post_training.job_status_response import JobStatusResponse
2424
from ....types.alpha.post_training.job_artifacts_response import JobArtifactsResponse
2525

@@ -55,7 +55,7 @@ def list(
5555
extra_query: Query | None = None,
5656
extra_body: Body | None = None,
5757
timeout: float | httpx.Timeout | None | NotGiven = not_given,
58-
) -> List[Data]:
58+
) -> JobListResponse:
5959
"""Get all training jobs."""
6060
return self._get(
6161
"/v1alpha/post-training/jobs",
@@ -64,9 +64,9 @@ def list(
6464
extra_query=extra_query,
6565
extra_body=extra_body,
6666
timeout=timeout,
67-
post_parser=DataWrapper[List[Data]]._unwrapper,
67+
post_parser=DataWrapper[JobListResponse]._unwrapper,
6868
),
69-
cast_to=cast(Type[List[Data]], DataWrapper[Data]),
69+
cast_to=cast(Type[JobListResponse], DataWrapper[JobListResponse]),
7070
)
7171

7272
def artifacts(
@@ -208,7 +208,7 @@ async def list(
208208
extra_query: Query | None = None,
209209
extra_body: Body | None = None,
210210
timeout: float | httpx.Timeout | None | NotGiven = not_given,
211-
) -> List[Data]:
211+
) -> JobListResponse:
212212
"""Get all training jobs."""
213213
return await self._get(
214214
"/v1alpha/post-training/jobs",
@@ -217,9 +217,9 @@ async def list(
217217
extra_query=extra_query,
218218
extra_body=extra_body,
219219
timeout=timeout,
220-
post_parser=DataWrapper[List[Data]]._unwrapper,
220+
post_parser=DataWrapper[JobListResponse]._unwrapper,
221221
),
222-
cast_to=cast(Type[List[Data]], DataWrapper[Data]),
222+
cast_to=cast(Type[JobListResponse], DataWrapper[JobListResponse]),
223223
)
224224

225225
async def artifacts(
Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import List
4-
53
from ..._models import BaseModel
4+
from .post_training.job_list_response import JobListResponse
65

7-
__all__ = ["ListPostTrainingJobsResponse", "Data"]
8-
9-
10-
class Data(BaseModel):
11-
job_uuid: str
6+
__all__ = ["ListPostTrainingJobsResponse"]
127

138

149
class ListPostTrainingJobsResponse(BaseModel):
15-
data: List[Data]
10+
data: JobListResponse
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
from __future__ import annotations
4-
5-
from .openai_list_response import OpenAIListResponse as OpenAIListResponse

src/llama_stack_client/types/models/openai_list_response.py

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

tests/api_resources/alpha/post_training/test_job.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
from __future__ import annotations
44

55
import os
6-
from typing import Any, List, cast
6+
from typing import Any, cast
77

88
import pytest
99

1010
from tests.utils import assert_matches_type
1111
from llama_stack_client import LlamaStackClient, AsyncLlamaStackClient
1212
from llama_stack_client.types.alpha.post_training import (
13+
JobListResponse,
1314
JobStatusResponse,
1415
JobArtifactsResponse,
1516
)
16-
from llama_stack_client.types.alpha.list_post_training_jobs_response import Data
1717

1818
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
1919

@@ -24,7 +24,7 @@ class TestJob:
2424
@parametrize
2525
def test_method_list(self, client: LlamaStackClient) -> None:
2626
job = client.alpha.post_training.job.list()
27-
assert_matches_type(List[Data], job, path=["response"])
27+
assert_matches_type(JobListResponse, job, path=["response"])
2828

2929
@parametrize
3030
def test_raw_response_list(self, client: LlamaStackClient) -> None:
@@ -33,7 +33,7 @@ def test_raw_response_list(self, client: LlamaStackClient) -> None:
3333
assert response.is_closed is True
3434
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
3535
job = response.parse()
36-
assert_matches_type(List[Data], job, path=["response"])
36+
assert_matches_type(JobListResponse, job, path=["response"])
3737

3838
@parametrize
3939
def test_streaming_response_list(self, client: LlamaStackClient) -> None:
@@ -42,7 +42,7 @@ def test_streaming_response_list(self, client: LlamaStackClient) -> None:
4242
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
4343

4444
job = response.parse()
45-
assert_matches_type(List[Data], job, path=["response"])
45+
assert_matches_type(JobListResponse, job, path=["response"])
4646

4747
assert cast(Any, response.is_closed) is True
4848

@@ -148,7 +148,7 @@ class TestAsyncJob:
148148
@parametrize
149149
async def test_method_list(self, async_client: AsyncLlamaStackClient) -> None:
150150
job = await async_client.alpha.post_training.job.list()
151-
assert_matches_type(List[Data], job, path=["response"])
151+
assert_matches_type(JobListResponse, job, path=["response"])
152152

153153
@parametrize
154154
async def test_raw_response_list(self, async_client: AsyncLlamaStackClient) -> None:
@@ -157,7 +157,7 @@ async def test_raw_response_list(self, async_client: AsyncLlamaStackClient) -> N
157157
assert response.is_closed is True
158158
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
159159
job = await response.parse()
160-
assert_matches_type(List[Data], job, path=["response"])
160+
assert_matches_type(JobListResponse, job, path=["response"])
161161

162162
@parametrize
163163
async def test_streaming_response_list(self, async_client: AsyncLlamaStackClient) -> None:
@@ -166,7 +166,7 @@ async def test_streaming_response_list(self, async_client: AsyncLlamaStackClient
166166
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
167167

168168
job = await response.parse()
169-
assert_matches_type(List[Data], job, path=["response"])
169+
assert_matches_type(JobListResponse, job, path=["response"])
170170

171171
assert cast(Any, response.is_closed) is True
172172

0 commit comments

Comments
 (0)