Skip to content

Commit eac41f1

Browse files
feat(api): update via SDK Studio
1 parent 1fa7ebb commit eac41f1

File tree

7 files changed

+21
-34
lines changed

7 files changed

+21
-34
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 58
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fdigitalocean-genai-sdk-e40feaac59c85aace6aa42d2749b20e0955dbbae58b06c3a650bc03adafcd7b5.yml
33
openapi_spec_hash: 825c1a4816938e9f594b7a8c06692667
4-
config_hash: 01ce4f461115cf14fd2b26a7d08a3a6a
4+
config_hash: f8b4e76be8bb430b0a00d2fd04d71615

api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,12 +294,12 @@ Methods:
294294
Types:
295295

296296
```python
297-
from gradientai.types.inference import ModelRetrieveResponse, ModelListResponse
297+
from gradientai.types.inference import Model, ModelListResponse
298298
```
299299

300300
Methods:
301301

302-
- <code title="get /models/{model}">client.inference.models.<a href="./src/gradientai/resources/inference/models.py">retrieve</a>(model) -> <a href="./src/gradientai/types/inference/model_retrieve_response.py">ModelRetrieveResponse</a></code>
302+
- <code title="get /models/{model}">client.inference.models.<a href="./src/gradientai/resources/inference/models.py">retrieve</a>(model) -> <a href="./src/gradientai/types/inference/model.py">Model</a></code>
303303
- <code title="get /models">client.inference.models.<a href="./src/gradientai/resources/inference/models.py">list</a>() -> <a href="./src/gradientai/types/inference/model_list_response.py">ModelListResponse</a></code>
304304

305305
# Models

src/gradientai/resources/inference/models.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
async_to_streamed_response_wrapper,
1515
)
1616
from ..._base_client import make_request_options
17+
from ...types.inference.model import Model
1718
from ...types.inference.model_list_response import ModelListResponse
18-
from ...types.inference.model_retrieve_response import ModelRetrieveResponse
1919

2020
__all__ = ["ModelsResource", "AsyncModelsResource"]
2121

@@ -50,7 +50,7 @@ def retrieve(
5050
extra_query: Query | None = None,
5151
extra_body: Body | None = None,
5252
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
53-
) -> ModelRetrieveResponse:
53+
) -> Model:
5454
"""
5555
Retrieves a model instance, providing basic information about the model such as
5656
the owner and permissioning.
@@ -73,7 +73,7 @@ def retrieve(
7373
options=make_request_options(
7474
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
7575
),
76-
cast_to=ModelRetrieveResponse,
76+
cast_to=Model,
7777
)
7878

7979
def list(
@@ -129,7 +129,7 @@ async def retrieve(
129129
extra_query: Query | None = None,
130130
extra_body: Body | None = None,
131131
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
132-
) -> ModelRetrieveResponse:
132+
) -> Model:
133133
"""
134134
Retrieves a model instance, providing basic information about the model such as
135135
the owner and permissioning.
@@ -152,7 +152,7 @@ async def retrieve(
152152
options=make_request_options(
153153
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
154154
),
155-
cast_to=ModelRetrieveResponse,
155+
cast_to=Model,
156156
)
157157

158158
async def list(

src/gradientai/types/inference/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from __future__ import annotations
44

5+
from .model import Model as Model
56
from .api_key_list_params import APIKeyListParams as APIKeyListParams
67
from .model_list_response import ModelListResponse as ModelListResponse
78
from .api_key_create_params import APIKeyCreateParams as APIKeyCreateParams
@@ -11,5 +12,4 @@
1112
from .api_key_create_response import APIKeyCreateResponse as APIKeyCreateResponse
1213
from .api_key_delete_response import APIKeyDeleteResponse as APIKeyDeleteResponse
1314
from .api_key_update_response import APIKeyUpdateResponse as APIKeyUpdateResponse
14-
from .model_retrieve_response import ModelRetrieveResponse as ModelRetrieveResponse
1515
from .api_key_update_regenerate_response import APIKeyUpdateRegenerateResponse as APIKeyUpdateRegenerateResponse

src/gradientai/types/inference/model_retrieve_response.py renamed to src/gradientai/types/inference/model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
from ..._models import BaseModel
66

7-
__all__ = ["ModelRetrieveResponse"]
7+
__all__ = ["Model"]
88

99

10-
class ModelRetrieveResponse(BaseModel):
10+
class Model(BaseModel):
1111
id: str
1212
"""The model identifier, which can be referenced in the API endpoints."""
1313

src/gradientai/types/inference/model_list_response.py

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,13 @@
33
from typing import List
44
from typing_extensions import Literal
55

6+
from .model import Model
67
from ..._models import BaseModel
78

8-
__all__ = ["ModelListResponse", "Data"]
9-
10-
11-
class Data(BaseModel):
12-
id: str
13-
"""The model identifier, which can be referenced in the API endpoints."""
14-
15-
created: int
16-
"""The Unix timestamp (in seconds) when the model was created."""
17-
18-
object: Literal["model"]
19-
"""The object type, which is always "model"."""
20-
21-
owned_by: str
22-
"""The organization that owns the model."""
9+
__all__ = ["ModelListResponse"]
2310

2411

2512
class ModelListResponse(BaseModel):
26-
data: List[Data]
13+
data: List[Model]
2714

2815
object: Literal["list"]

tests/api_resources/inference/test_models.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
from gradientai import GradientAI, AsyncGradientAI
1111
from tests.utils import assert_matches_type
12-
from gradientai.types.inference import ModelListResponse, ModelRetrieveResponse
12+
from gradientai.types.inference import Model, ModelListResponse
1313

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

@@ -23,7 +23,7 @@ def test_method_retrieve(self, client: GradientAI) -> None:
2323
model = client.inference.models.retrieve(
2424
"llama3-8b-instruct",
2525
)
26-
assert_matches_type(ModelRetrieveResponse, model, path=["response"])
26+
assert_matches_type(Model, model, path=["response"])
2727

2828
@pytest.mark.skip()
2929
@parametrize
@@ -35,7 +35,7 @@ def test_raw_response_retrieve(self, client: GradientAI) -> None:
3535
assert response.is_closed is True
3636
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
3737
model = response.parse()
38-
assert_matches_type(ModelRetrieveResponse, model, path=["response"])
38+
assert_matches_type(Model, model, path=["response"])
3939

4040
@pytest.mark.skip()
4141
@parametrize
@@ -47,7 +47,7 @@ def test_streaming_response_retrieve(self, client: GradientAI) -> None:
4747
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
4848

4949
model = response.parse()
50-
assert_matches_type(ModelRetrieveResponse, model, path=["response"])
50+
assert_matches_type(Model, model, path=["response"])
5151

5252
assert cast(Any, response.is_closed) is True
5353

@@ -97,7 +97,7 @@ async def test_method_retrieve(self, async_client: AsyncGradientAI) -> None:
9797
model = await async_client.inference.models.retrieve(
9898
"llama3-8b-instruct",
9999
)
100-
assert_matches_type(ModelRetrieveResponse, model, path=["response"])
100+
assert_matches_type(Model, model, path=["response"])
101101

102102
@pytest.mark.skip()
103103
@parametrize
@@ -109,7 +109,7 @@ async def test_raw_response_retrieve(self, async_client: AsyncGradientAI) -> Non
109109
assert response.is_closed is True
110110
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
111111
model = await response.parse()
112-
assert_matches_type(ModelRetrieveResponse, model, path=["response"])
112+
assert_matches_type(Model, model, path=["response"])
113113

114114
@pytest.mark.skip()
115115
@parametrize
@@ -121,7 +121,7 @@ async def test_streaming_response_retrieve(self, async_client: AsyncGradientAI)
121121
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
122122

123123
model = await response.parse()
124-
assert_matches_type(ModelRetrieveResponse, model, path=["response"])
124+
assert_matches_type(Model, model, path=["response"])
125125

126126
assert cast(Any, response.is_closed) is True
127127

0 commit comments

Comments
 (0)