Skip to content

Commit 1fa7ebb

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

26 files changed

+829
-180
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 56
1+
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: 6abb2ff94db8b1b61321606275ba3e80
4+
config_hash: 01ce4f461115cf14fd2b26a7d08a3a6a

api.md

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -250,12 +250,28 @@ Methods:
250250
- <code title="get /v2/gen-ai/knowledge_bases/{knowledge_base_uuid}/data_sources">client.knowledge_bases.data_sources.<a href="./src/gradientai/resources/knowledge_bases/data_sources.py">list</a>(knowledge_base_uuid, \*\*<a href="src/gradientai/types/knowledge_bases/data_source_list_params.py">params</a>) -> <a href="./src/gradientai/types/knowledge_bases/data_source_list_response.py">DataSourceListResponse</a></code>
251251
- <code title="delete /v2/gen-ai/knowledge_bases/{knowledge_base_uuid}/data_sources/{data_source_uuid}">client.knowledge_bases.data_sources.<a href="./src/gradientai/resources/knowledge_bases/data_sources.py">delete</a>(data_source_uuid, \*, knowledge_base_uuid) -> <a href="./src/gradientai/types/knowledge_bases/data_source_delete_response.py">DataSourceDeleteResponse</a></code>
252252

253-
# APIKeys
253+
# Chat
254+
255+
## Completions
254256

255257
Types:
256258

257259
```python
258-
from gradientai.types import (
260+
from gradientai.types.chat import CompletionCreateResponse
261+
```
262+
263+
Methods:
264+
265+
- <code title="post /chat/completions">client.chat.completions.<a href="./src/gradientai/resources/chat/completions.py">create</a>(\*\*<a href="src/gradientai/types/chat/completion_create_params.py">params</a>) -> <a href="./src/gradientai/types/chat/completion_create_response.py">CompletionCreateResponse</a></code>
266+
267+
# Inference
268+
269+
## APIKeys
270+
271+
Types:
272+
273+
```python
274+
from gradientai.types.inference import (
259275
APIModelAPIKeyInfo,
260276
APIKeyCreateResponse,
261277
APIKeyUpdateResponse,
@@ -267,25 +283,24 @@ from gradientai.types import (
267283

268284
Methods:
269285

270-
- <code title="post /v2/gen-ai/models/api_keys">client.api_keys.<a href="./src/gradientai/resources/api_keys.py">create</a>(\*\*<a href="src/gradientai/types/api_key_create_params.py">params</a>) -> <a href="./src/gradientai/types/api_key_create_response.py">APIKeyCreateResponse</a></code>
271-
- <code title="put /v2/gen-ai/models/api_keys/{api_key_uuid}">client.api_keys.<a href="./src/gradientai/resources/api_keys.py">update</a>(path_api_key_uuid, \*\*<a href="src/gradientai/types/api_key_update_params.py">params</a>) -> <a href="./src/gradientai/types/api_key_update_response.py">APIKeyUpdateResponse</a></code>
272-
- <code title="get /v2/gen-ai/models/api_keys">client.api_keys.<a href="./src/gradientai/resources/api_keys.py">list</a>(\*\*<a href="src/gradientai/types/api_key_list_params.py">params</a>) -> <a href="./src/gradientai/types/api_key_list_response.py">APIKeyListResponse</a></code>
273-
- <code title="delete /v2/gen-ai/models/api_keys/{api_key_uuid}">client.api_keys.<a href="./src/gradientai/resources/api_keys.py">delete</a>(api_key_uuid) -> <a href="./src/gradientai/types/api_key_delete_response.py">APIKeyDeleteResponse</a></code>
274-
- <code title="put /v2/gen-ai/models/api_keys/{api_key_uuid}/regenerate">client.api_keys.<a href="./src/gradientai/resources/api_keys.py">update_regenerate</a>(api_key_uuid) -> <a href="./src/gradientai/types/api_key_update_regenerate_response.py">APIKeyUpdateRegenerateResponse</a></code>
286+
- <code title="post /v2/gen-ai/models/api_keys">client.inference.api_keys.<a href="./src/gradientai/resources/inference/api_keys.py">create</a>(\*\*<a href="src/gradientai/types/inference/api_key_create_params.py">params</a>) -> <a href="./src/gradientai/types/inference/api_key_create_response.py">APIKeyCreateResponse</a></code>
287+
- <code title="put /v2/gen-ai/models/api_keys/{api_key_uuid}">client.inference.api_keys.<a href="./src/gradientai/resources/inference/api_keys.py">update</a>(path_api_key_uuid, \*\*<a href="src/gradientai/types/inference/api_key_update_params.py">params</a>) -> <a href="./src/gradientai/types/inference/api_key_update_response.py">APIKeyUpdateResponse</a></code>
288+
- <code title="get /v2/gen-ai/models/api_keys">client.inference.api_keys.<a href="./src/gradientai/resources/inference/api_keys.py">list</a>(\*\*<a href="src/gradientai/types/inference/api_key_list_params.py">params</a>) -> <a href="./src/gradientai/types/inference/api_key_list_response.py">APIKeyListResponse</a></code>
289+
- <code title="delete /v2/gen-ai/models/api_keys/{api_key_uuid}">client.inference.api_keys.<a href="./src/gradientai/resources/inference/api_keys.py">delete</a>(api_key_uuid) -> <a href="./src/gradientai/types/inference/api_key_delete_response.py">APIKeyDeleteResponse</a></code>
290+
- <code title="put /v2/gen-ai/models/api_keys/{api_key_uuid}/regenerate">client.inference.api_keys.<a href="./src/gradientai/resources/inference/api_keys.py">update_regenerate</a>(api_key_uuid) -> <a href="./src/gradientai/types/inference/api_key_update_regenerate_response.py">APIKeyUpdateRegenerateResponse</a></code>
275291

276-
# Chat
277-
278-
## Completions
292+
## Models
279293

280294
Types:
281295

282296
```python
283-
from gradientai.types.chat import CompletionCreateResponse
297+
from gradientai.types.inference import ModelRetrieveResponse, ModelListResponse
284298
```
285299

286300
Methods:
287301

288-
- <code title="post /chat/completions">client.chat.completions.<a href="./src/gradientai/resources/chat/completions.py">create</a>(\*\*<a href="src/gradientai/types/chat/completion_create_params.py">params</a>) -> <a href="./src/gradientai/types/chat/completion_create_response.py">CompletionCreateResponse</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_retrieve_response.py">ModelRetrieveResponse</a></code>
303+
- <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>
289304

290305
# Models
291306

src/gradientai/_client.py

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@
3131
)
3232

3333
if TYPE_CHECKING:
34-
from .resources import chat, agents, models, regions, api_keys, providers, indexing_jobs, knowledge_bases
34+
from .resources import chat, agents, models, regions, inference, providers, indexing_jobs, knowledge_bases
3535
from .resources.models import ModelsResource, AsyncModelsResource
3636
from .resources.regions import RegionsResource, AsyncRegionsResource
37-
from .resources.api_keys import APIKeysResource, AsyncAPIKeysResource
3837
from .resources.chat.chat import ChatResource, AsyncChatResource
3938
from .resources.agents.agents import AgentsResource, AsyncAgentsResource
4039
from .resources.indexing_jobs import IndexingJobsResource, AsyncIndexingJobsResource
40+
from .resources.inference.inference import InferenceResource, AsyncInferenceResource
4141
from .resources.providers.providers import ProvidersResource, AsyncProvidersResource
4242
from .resources.knowledge_bases.knowledge_bases import KnowledgeBasesResource, AsyncKnowledgeBasesResource
4343

@@ -139,18 +139,18 @@ def knowledge_bases(self) -> KnowledgeBasesResource:
139139

140140
return KnowledgeBasesResource(self)
141141

142-
@cached_property
143-
def api_keys(self) -> APIKeysResource:
144-
from .resources.api_keys import APIKeysResource
145-
146-
return APIKeysResource(self)
147-
148142
@cached_property
149143
def chat(self) -> ChatResource:
150144
from .resources.chat import ChatResource
151145

152146
return ChatResource(self)
153147

148+
@cached_property
149+
def inference(self) -> InferenceResource:
150+
from .resources.inference import InferenceResource
151+
152+
return InferenceResource(self)
153+
154154
@cached_property
155155
def models(self) -> ModelsResource:
156156
from .resources.models import ModelsResource
@@ -358,18 +358,18 @@ def knowledge_bases(self) -> AsyncKnowledgeBasesResource:
358358

359359
return AsyncKnowledgeBasesResource(self)
360360

361-
@cached_property
362-
def api_keys(self) -> AsyncAPIKeysResource:
363-
from .resources.api_keys import AsyncAPIKeysResource
364-
365-
return AsyncAPIKeysResource(self)
366-
367361
@cached_property
368362
def chat(self) -> AsyncChatResource:
369363
from .resources.chat import AsyncChatResource
370364

371365
return AsyncChatResource(self)
372366

367+
@cached_property
368+
def inference(self) -> AsyncInferenceResource:
369+
from .resources.inference import AsyncInferenceResource
370+
371+
return AsyncInferenceResource(self)
372+
373373
@cached_property
374374
def models(self) -> AsyncModelsResource:
375375
from .resources.models import AsyncModelsResource
@@ -527,18 +527,18 @@ def knowledge_bases(self) -> knowledge_bases.KnowledgeBasesResourceWithRawRespon
527527

528528
return KnowledgeBasesResourceWithRawResponse(self._client.knowledge_bases)
529529

530-
@cached_property
531-
def api_keys(self) -> api_keys.APIKeysResourceWithRawResponse:
532-
from .resources.api_keys import APIKeysResourceWithRawResponse
533-
534-
return APIKeysResourceWithRawResponse(self._client.api_keys)
535-
536530
@cached_property
537531
def chat(self) -> chat.ChatResourceWithRawResponse:
538532
from .resources.chat import ChatResourceWithRawResponse
539533

540534
return ChatResourceWithRawResponse(self._client.chat)
541535

536+
@cached_property
537+
def inference(self) -> inference.InferenceResourceWithRawResponse:
538+
from .resources.inference import InferenceResourceWithRawResponse
539+
540+
return InferenceResourceWithRawResponse(self._client.inference)
541+
542542
@cached_property
543543
def models(self) -> models.ModelsResourceWithRawResponse:
544544
from .resources.models import ModelsResourceWithRawResponse
@@ -582,18 +582,18 @@ def knowledge_bases(self) -> knowledge_bases.AsyncKnowledgeBasesResourceWithRawR
582582

583583
return AsyncKnowledgeBasesResourceWithRawResponse(self._client.knowledge_bases)
584584

585-
@cached_property
586-
def api_keys(self) -> api_keys.AsyncAPIKeysResourceWithRawResponse:
587-
from .resources.api_keys import AsyncAPIKeysResourceWithRawResponse
588-
589-
return AsyncAPIKeysResourceWithRawResponse(self._client.api_keys)
590-
591585
@cached_property
592586
def chat(self) -> chat.AsyncChatResourceWithRawResponse:
593587
from .resources.chat import AsyncChatResourceWithRawResponse
594588

595589
return AsyncChatResourceWithRawResponse(self._client.chat)
596590

591+
@cached_property
592+
def inference(self) -> inference.AsyncInferenceResourceWithRawResponse:
593+
from .resources.inference import AsyncInferenceResourceWithRawResponse
594+
595+
return AsyncInferenceResourceWithRawResponse(self._client.inference)
596+
597597
@cached_property
598598
def models(self) -> models.AsyncModelsResourceWithRawResponse:
599599
from .resources.models import AsyncModelsResourceWithRawResponse
@@ -637,18 +637,18 @@ def knowledge_bases(self) -> knowledge_bases.KnowledgeBasesResourceWithStreaming
637637

638638
return KnowledgeBasesResourceWithStreamingResponse(self._client.knowledge_bases)
639639

640-
@cached_property
641-
def api_keys(self) -> api_keys.APIKeysResourceWithStreamingResponse:
642-
from .resources.api_keys import APIKeysResourceWithStreamingResponse
643-
644-
return APIKeysResourceWithStreamingResponse(self._client.api_keys)
645-
646640
@cached_property
647641
def chat(self) -> chat.ChatResourceWithStreamingResponse:
648642
from .resources.chat import ChatResourceWithStreamingResponse
649643

650644
return ChatResourceWithStreamingResponse(self._client.chat)
651645

646+
@cached_property
647+
def inference(self) -> inference.InferenceResourceWithStreamingResponse:
648+
from .resources.inference import InferenceResourceWithStreamingResponse
649+
650+
return InferenceResourceWithStreamingResponse(self._client.inference)
651+
652652
@cached_property
653653
def models(self) -> models.ModelsResourceWithStreamingResponse:
654654
from .resources.models import ModelsResourceWithStreamingResponse
@@ -692,18 +692,18 @@ def knowledge_bases(self) -> knowledge_bases.AsyncKnowledgeBasesResourceWithStre
692692

693693
return AsyncKnowledgeBasesResourceWithStreamingResponse(self._client.knowledge_bases)
694694

695-
@cached_property
696-
def api_keys(self) -> api_keys.AsyncAPIKeysResourceWithStreamingResponse:
697-
from .resources.api_keys import AsyncAPIKeysResourceWithStreamingResponse
698-
699-
return AsyncAPIKeysResourceWithStreamingResponse(self._client.api_keys)
700-
701695
@cached_property
702696
def chat(self) -> chat.AsyncChatResourceWithStreamingResponse:
703697
from .resources.chat import AsyncChatResourceWithStreamingResponse
704698

705699
return AsyncChatResourceWithStreamingResponse(self._client.chat)
706700

701+
@cached_property
702+
def inference(self) -> inference.AsyncInferenceResourceWithStreamingResponse:
703+
from .resources.inference import AsyncInferenceResourceWithStreamingResponse
704+
705+
return AsyncInferenceResourceWithStreamingResponse(self._client.inference)
706+
707707
@cached_property
708708
def models(self) -> models.AsyncModelsResourceWithStreamingResponse:
709709
from .resources.models import AsyncModelsResourceWithStreamingResponse

src/gradientai/resources/__init__.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@
3232
RegionsResourceWithStreamingResponse,
3333
AsyncRegionsResourceWithStreamingResponse,
3434
)
35-
from .api_keys import (
36-
APIKeysResource,
37-
AsyncAPIKeysResource,
38-
APIKeysResourceWithRawResponse,
39-
AsyncAPIKeysResourceWithRawResponse,
40-
APIKeysResourceWithStreamingResponse,
41-
AsyncAPIKeysResourceWithStreamingResponse,
35+
from .inference import (
36+
InferenceResource,
37+
AsyncInferenceResource,
38+
InferenceResourceWithRawResponse,
39+
AsyncInferenceResourceWithRawResponse,
40+
InferenceResourceWithStreamingResponse,
41+
AsyncInferenceResourceWithStreamingResponse,
4242
)
4343
from .providers import (
4444
ProvidersResource,
@@ -96,18 +96,18 @@
9696
"AsyncKnowledgeBasesResourceWithRawResponse",
9797
"KnowledgeBasesResourceWithStreamingResponse",
9898
"AsyncKnowledgeBasesResourceWithStreamingResponse",
99-
"APIKeysResource",
100-
"AsyncAPIKeysResource",
101-
"APIKeysResourceWithRawResponse",
102-
"AsyncAPIKeysResourceWithRawResponse",
103-
"APIKeysResourceWithStreamingResponse",
104-
"AsyncAPIKeysResourceWithStreamingResponse",
10599
"ChatResource",
106100
"AsyncChatResource",
107101
"ChatResourceWithRawResponse",
108102
"AsyncChatResourceWithRawResponse",
109103
"ChatResourceWithStreamingResponse",
110104
"AsyncChatResourceWithStreamingResponse",
105+
"InferenceResource",
106+
"AsyncInferenceResource",
107+
"InferenceResourceWithRawResponse",
108+
"AsyncInferenceResourceWithRawResponse",
109+
"InferenceResourceWithStreamingResponse",
110+
"AsyncInferenceResourceWithStreamingResponse",
111111
"ModelsResource",
112112
"AsyncModelsResource",
113113
"ModelsResourceWithRawResponse",
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from .models import (
4+
ModelsResource,
5+
AsyncModelsResource,
6+
ModelsResourceWithRawResponse,
7+
AsyncModelsResourceWithRawResponse,
8+
ModelsResourceWithStreamingResponse,
9+
AsyncModelsResourceWithStreamingResponse,
10+
)
11+
from .api_keys import (
12+
APIKeysResource,
13+
AsyncAPIKeysResource,
14+
APIKeysResourceWithRawResponse,
15+
AsyncAPIKeysResourceWithRawResponse,
16+
APIKeysResourceWithStreamingResponse,
17+
AsyncAPIKeysResourceWithStreamingResponse,
18+
)
19+
from .inference import (
20+
InferenceResource,
21+
AsyncInferenceResource,
22+
InferenceResourceWithRawResponse,
23+
AsyncInferenceResourceWithRawResponse,
24+
InferenceResourceWithStreamingResponse,
25+
AsyncInferenceResourceWithStreamingResponse,
26+
)
27+
28+
__all__ = [
29+
"APIKeysResource",
30+
"AsyncAPIKeysResource",
31+
"APIKeysResourceWithRawResponse",
32+
"AsyncAPIKeysResourceWithRawResponse",
33+
"APIKeysResourceWithStreamingResponse",
34+
"AsyncAPIKeysResourceWithStreamingResponse",
35+
"ModelsResource",
36+
"AsyncModelsResource",
37+
"ModelsResourceWithRawResponse",
38+
"AsyncModelsResourceWithRawResponse",
39+
"ModelsResourceWithStreamingResponse",
40+
"AsyncModelsResourceWithStreamingResponse",
41+
"InferenceResource",
42+
"AsyncInferenceResource",
43+
"InferenceResourceWithRawResponse",
44+
"AsyncInferenceResourceWithRawResponse",
45+
"InferenceResourceWithStreamingResponse",
46+
"AsyncInferenceResourceWithStreamingResponse",
47+
]

src/gradientai/resources/api_keys.py renamed to src/gradientai/resources/inference/api_keys.py

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

55
import httpx
66

7-
from ..types import api_key_list_params, api_key_create_params, api_key_update_params
8-
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
9-
from .._utils import maybe_transform, async_maybe_transform
10-
from .._compat import cached_property
11-
from .._resource import SyncAPIResource, AsyncAPIResource
12-
from .._response import (
7+
from ..._types import NOT_GIVEN, Body, Query, Headers, NotGiven
8+
from ..._utils import maybe_transform, async_maybe_transform
9+
from ..._compat import cached_property
10+
from ..._resource import SyncAPIResource, AsyncAPIResource
11+
from ..._response import (
1312
to_raw_response_wrapper,
1413
to_streamed_response_wrapper,
1514
async_to_raw_response_wrapper,
1615
async_to_streamed_response_wrapper,
1716
)
18-
from .._base_client import make_request_options
19-
from ..types.api_key_list_response import APIKeyListResponse
20-
from ..types.api_key_create_response import APIKeyCreateResponse
21-
from ..types.api_key_delete_response import APIKeyDeleteResponse
22-
from ..types.api_key_update_response import APIKeyUpdateResponse
23-
from ..types.api_key_update_regenerate_response import APIKeyUpdateRegenerateResponse
17+
from ..._base_client import make_request_options
18+
from ...types.inference import api_key_list_params, api_key_create_params, api_key_update_params
19+
from ...types.inference.api_key_list_response import APIKeyListResponse
20+
from ...types.inference.api_key_create_response import APIKeyCreateResponse
21+
from ...types.inference.api_key_delete_response import APIKeyDeleteResponse
22+
from ...types.inference.api_key_update_response import APIKeyUpdateResponse
23+
from ...types.inference.api_key_update_regenerate_response import APIKeyUpdateRegenerateResponse
2424

2525
__all__ = ["APIKeysResource", "AsyncAPIKeysResource"]
2626

0 commit comments

Comments
 (0)