Skip to content

Commit 5f700dc

Browse files
feat(api): update via SDK Studio
1 parent e649dcb commit 5f700dc

39 files changed

+398
-1250
lines changed

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 58
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fdigitalocean-genai-sdk-6e449984986e066baea73af5c2726811e74a284f0d68d49926ec5c7821c7ed31.yml
3-
openapi_spec_hash: 78f43f68f46df0d81891ae2ff66bf3a0
4-
config_hash: 84ba29fbded3618d3cc3994639c82547
1+
configured_endpoints: 56
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fdigitalocean-genai-sdk-e40feaac59c85aace6aa42d2749b20e0955dbbae58b06c3a650bc03adafcd7b5.yml
3+
openapi_spec_hash: 825c1a4816938e9f594b7a8c06692667
4+
config_hash: cfd2d18e8dfe7223b15ce9b204cef29e

api.md

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -170,22 +170,6 @@ Methods:
170170
- <code title="delete /v2/gen-ai/openai/keys/{api_key_uuid}">client.providers.openai.keys.<a href="./src/gradientai/resources/providers/openai/keys.py">delete</a>(api_key_uuid) -> <a href="./src/gradientai/types/providers/openai/key_delete_response.py">KeyDeleteResponse</a></code>
171171
- <code title="get /v2/gen-ai/openai/keys/{uuid}/agents">client.providers.openai.keys.<a href="./src/gradientai/resources/providers/openai/keys.py">retrieve_agents</a>(uuid, \*\*<a href="src/gradientai/types/providers/openai/key_retrieve_agents_params.py">params</a>) -> <a href="./src/gradientai/types/providers/openai/key_retrieve_agents_response.py">KeyRetrieveAgentsResponse</a></code>
172172

173-
# Auth
174-
175-
## Agents
176-
177-
### Token
178-
179-
Types:
180-
181-
```python
182-
from gradientai.types.auth.agents import TokenCreateResponse
183-
```
184-
185-
Methods:
186-
187-
- <code title="post /v2/gen-ai/auth/agents/{agent_uuid}/token">client.auth.agents.token.<a href="./src/gradientai/resources/auth/agents/token.py">create</a>(path_agent_uuid, \*\*<a href="src/gradientai/types/auth/agents/token_create_params.py">params</a>) -> <a href="./src/gradientai/types/auth/agents/token_create_response.py">TokenCreateResponse</a></code>
188-
189173
# Regions
190174

191175
Types:
@@ -306,21 +290,9 @@ Methods:
306290
Types:
307291

308292
```python
309-
from gradientai.types import ChatCompletionRequestMessageContentPartText, ChatCompletionTokenLogprob
310-
```
311-
312-
# Embeddings
313-
314-
Types:
315-
316-
```python
317-
from gradientai.types import EmbeddingCreateResponse
293+
from gradientai.types import ChatCompletionTokenLogprob
318294
```
319295

320-
Methods:
321-
322-
- <code title="post /embeddings">client.embeddings.<a href="./src/gradientai/resources/embeddings.py">create</a>(\*\*<a href="src/gradientai/types/embedding_create_params.py">params</a>) -> <a href="./src/gradientai/types/embedding_create_response.py">EmbeddingCreateResponse</a></code>
323-
324296
# Models
325297

326298
Types:

src/gradientai/_client.py

Lines changed: 9 additions & 87 deletions
Original file line numberDiff line numberDiff line change
@@ -31,21 +31,9 @@
3131
)
3232

3333
if TYPE_CHECKING:
34-
from .resources import (
35-
auth,
36-
agents,
37-
models,
38-
regions,
39-
api_keys,
40-
providers,
41-
embeddings,
42-
indexing_jobs,
43-
knowledge_bases,
44-
)
34+
from .resources import agents, models, regions, api_keys, providers, indexing_jobs, knowledge_bases
4535
from .resources.models import ModelsResource, AsyncModelsResource
4636
from .resources.regions import RegionsResource, AsyncRegionsResource
47-
from .resources.auth.auth import AuthResource, AsyncAuthResource
48-
from .resources.embeddings import EmbeddingsResource, AsyncEmbeddingsResource
4937
from .resources.agents.agents import AgentsResource, AsyncAgentsResource
5038
from .resources.indexing_jobs import IndexingJobsResource, AsyncIndexingJobsResource
5139
from .resources.api_keys.api_keys import APIKeysResource, AsyncAPIKeysResource
@@ -105,6 +93,7 @@ def __init__(
10593

10694
if base_url is None:
10795
base_url = os.environ.get("GRADIENT_AI_BASE_URL")
96+
self._base_url_overridden = base_url is not None
10897
if base_url is None:
10998
base_url = f"https://api.digitalocean.com/"
11099

@@ -131,12 +120,6 @@ def providers(self) -> ProvidersResource:
131120

132121
return ProvidersResource(self)
133122

134-
@cached_property
135-
def auth(self) -> AuthResource:
136-
from .resources.auth import AuthResource
137-
138-
return AuthResource(self)
139-
140123
@cached_property
141124
def regions(self) -> RegionsResource:
142125
from .resources.regions import RegionsResource
@@ -161,12 +144,6 @@ def api_keys(self) -> APIKeysResource:
161144

162145
return APIKeysResource(self)
163146

164-
@cached_property
165-
def embeddings(self) -> EmbeddingsResource:
166-
from .resources.embeddings import EmbeddingsResource
167-
168-
return EmbeddingsResource(self)
169-
170147
@cached_property
171148
def models(self) -> ModelsResource:
172149
from .resources.models import ModelsResource
@@ -237,7 +214,7 @@ def copy(
237214
params = set_default_query
238215

239216
http_client = http_client or self._client
240-
return self.__class__(
217+
client = self.__class__(
241218
api_key=api_key or self.api_key,
242219
base_url=base_url or self.base_url,
243220
timeout=self.timeout if isinstance(timeout, NotGiven) else timeout,
@@ -247,6 +224,8 @@ def copy(
247224
default_query=params,
248225
**_extra_kwargs,
249226
)
227+
client._base_url_overridden = self._base_url_overridden or base_url is not None
228+
return client
250229

251230
# Alias for `copy` for nicer inline usage, e.g.
252231
# client.with_options(timeout=10).foo.create(...)
@@ -327,6 +306,7 @@ def __init__(
327306

328307
if base_url is None:
329308
base_url = os.environ.get("GRADIENT_AI_BASE_URL")
309+
self._base_url_overridden = base_url is not None
330310
if base_url is None:
331311
base_url = f"https://api.digitalocean.com/"
332312

@@ -353,12 +333,6 @@ def providers(self) -> AsyncProvidersResource:
353333

354334
return AsyncProvidersResource(self)
355335

356-
@cached_property
357-
def auth(self) -> AsyncAuthResource:
358-
from .resources.auth import AsyncAuthResource
359-
360-
return AsyncAuthResource(self)
361-
362336
@cached_property
363337
def regions(self) -> AsyncRegionsResource:
364338
from .resources.regions import AsyncRegionsResource
@@ -383,12 +357,6 @@ def api_keys(self) -> AsyncAPIKeysResource:
383357

384358
return AsyncAPIKeysResource(self)
385359

386-
@cached_property
387-
def embeddings(self) -> AsyncEmbeddingsResource:
388-
from .resources.embeddings import AsyncEmbeddingsResource
389-
390-
return AsyncEmbeddingsResource(self)
391-
392360
@cached_property
393361
def models(self) -> AsyncModelsResource:
394362
from .resources.models import AsyncModelsResource
@@ -459,7 +427,7 @@ def copy(
459427
params = set_default_query
460428

461429
http_client = http_client or self._client
462-
return self.__class__(
430+
client = self.__class__(
463431
api_key=api_key or self.api_key,
464432
base_url=base_url or self.base_url,
465433
timeout=self.timeout if isinstance(timeout, NotGiven) else timeout,
@@ -469,6 +437,8 @@ def copy(
469437
default_query=params,
470438
**_extra_kwargs,
471439
)
440+
client._base_url_overridden = self._base_url_overridden or base_url is not None
441+
return client
472442

473443
# Alias for `copy` for nicer inline usage, e.g.
474444
# client.with_options(timeout=10).foo.create(...)
@@ -526,12 +496,6 @@ def providers(self) -> providers.ProvidersResourceWithRawResponse:
526496

527497
return ProvidersResourceWithRawResponse(self._client.providers)
528498

529-
@cached_property
530-
def auth(self) -> auth.AuthResourceWithRawResponse:
531-
from .resources.auth import AuthResourceWithRawResponse
532-
533-
return AuthResourceWithRawResponse(self._client.auth)
534-
535499
@cached_property
536500
def regions(self) -> regions.RegionsResourceWithRawResponse:
537501
from .resources.regions import RegionsResourceWithRawResponse
@@ -556,12 +520,6 @@ def api_keys(self) -> api_keys.APIKeysResourceWithRawResponse:
556520

557521
return APIKeysResourceWithRawResponse(self._client.api_keys)
558522

559-
@cached_property
560-
def embeddings(self) -> embeddings.EmbeddingsResourceWithRawResponse:
561-
from .resources.embeddings import EmbeddingsResourceWithRawResponse
562-
563-
return EmbeddingsResourceWithRawResponse(self._client.embeddings)
564-
565523
@cached_property
566524
def models(self) -> models.ModelsResourceWithRawResponse:
567525
from .resources.models import ModelsResourceWithRawResponse
@@ -587,12 +545,6 @@ def providers(self) -> providers.AsyncProvidersResourceWithRawResponse:
587545

588546
return AsyncProvidersResourceWithRawResponse(self._client.providers)
589547

590-
@cached_property
591-
def auth(self) -> auth.AsyncAuthResourceWithRawResponse:
592-
from .resources.auth import AsyncAuthResourceWithRawResponse
593-
594-
return AsyncAuthResourceWithRawResponse(self._client.auth)
595-
596548
@cached_property
597549
def regions(self) -> regions.AsyncRegionsResourceWithRawResponse:
598550
from .resources.regions import AsyncRegionsResourceWithRawResponse
@@ -617,12 +569,6 @@ def api_keys(self) -> api_keys.AsyncAPIKeysResourceWithRawResponse:
617569

618570
return AsyncAPIKeysResourceWithRawResponse(self._client.api_keys)
619571

620-
@cached_property
621-
def embeddings(self) -> embeddings.AsyncEmbeddingsResourceWithRawResponse:
622-
from .resources.embeddings import AsyncEmbeddingsResourceWithRawResponse
623-
624-
return AsyncEmbeddingsResourceWithRawResponse(self._client.embeddings)
625-
626572
@cached_property
627573
def models(self) -> models.AsyncModelsResourceWithRawResponse:
628574
from .resources.models import AsyncModelsResourceWithRawResponse
@@ -648,12 +594,6 @@ def providers(self) -> providers.ProvidersResourceWithStreamingResponse:
648594

649595
return ProvidersResourceWithStreamingResponse(self._client.providers)
650596

651-
@cached_property
652-
def auth(self) -> auth.AuthResourceWithStreamingResponse:
653-
from .resources.auth import AuthResourceWithStreamingResponse
654-
655-
return AuthResourceWithStreamingResponse(self._client.auth)
656-
657597
@cached_property
658598
def regions(self) -> regions.RegionsResourceWithStreamingResponse:
659599
from .resources.regions import RegionsResourceWithStreamingResponse
@@ -678,12 +618,6 @@ def api_keys(self) -> api_keys.APIKeysResourceWithStreamingResponse:
678618

679619
return APIKeysResourceWithStreamingResponse(self._client.api_keys)
680620

681-
@cached_property
682-
def embeddings(self) -> embeddings.EmbeddingsResourceWithStreamingResponse:
683-
from .resources.embeddings import EmbeddingsResourceWithStreamingResponse
684-
685-
return EmbeddingsResourceWithStreamingResponse(self._client.embeddings)
686-
687621
@cached_property
688622
def models(self) -> models.ModelsResourceWithStreamingResponse:
689623
from .resources.models import ModelsResourceWithStreamingResponse
@@ -709,12 +643,6 @@ def providers(self) -> providers.AsyncProvidersResourceWithStreamingResponse:
709643

710644
return AsyncProvidersResourceWithStreamingResponse(self._client.providers)
711645

712-
@cached_property
713-
def auth(self) -> auth.AsyncAuthResourceWithStreamingResponse:
714-
from .resources.auth import AsyncAuthResourceWithStreamingResponse
715-
716-
return AsyncAuthResourceWithStreamingResponse(self._client.auth)
717-
718646
@cached_property
719647
def regions(self) -> regions.AsyncRegionsResourceWithStreamingResponse:
720648
from .resources.regions import AsyncRegionsResourceWithStreamingResponse
@@ -739,12 +667,6 @@ def api_keys(self) -> api_keys.AsyncAPIKeysResourceWithStreamingResponse:
739667

740668
return AsyncAPIKeysResourceWithStreamingResponse(self._client.api_keys)
741669

742-
@cached_property
743-
def embeddings(self) -> embeddings.AsyncEmbeddingsResourceWithStreamingResponse:
744-
from .resources.embeddings import AsyncEmbeddingsResourceWithStreamingResponse
745-
746-
return AsyncEmbeddingsResourceWithStreamingResponse(self._client.embeddings)
747-
748670
@cached_property
749671
def models(self) -> models.AsyncModelsResourceWithStreamingResponse:
750672
from .resources.models import AsyncModelsResourceWithStreamingResponse

src/gradientai/resources/__init__.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from .auth import (
4-
AuthResource,
5-
AsyncAuthResource,
6-
AuthResourceWithRawResponse,
7-
AsyncAuthResourceWithRawResponse,
8-
AuthResourceWithStreamingResponse,
9-
AsyncAuthResourceWithStreamingResponse,
10-
)
113
from .agents import (
124
AgentsResource,
135
AsyncAgentsResource,
@@ -48,14 +40,6 @@
4840
ProvidersResourceWithStreamingResponse,
4941
AsyncProvidersResourceWithStreamingResponse,
5042
)
51-
from .embeddings import (
52-
EmbeddingsResource,
53-
AsyncEmbeddingsResource,
54-
EmbeddingsResourceWithRawResponse,
55-
AsyncEmbeddingsResourceWithRawResponse,
56-
EmbeddingsResourceWithStreamingResponse,
57-
AsyncEmbeddingsResourceWithStreamingResponse,
58-
)
5943
from .indexing_jobs import (
6044
IndexingJobsResource,
6145
AsyncIndexingJobsResource,
@@ -86,12 +70,6 @@
8670
"AsyncProvidersResourceWithRawResponse",
8771
"ProvidersResourceWithStreamingResponse",
8872
"AsyncProvidersResourceWithStreamingResponse",
89-
"AuthResource",
90-
"AsyncAuthResource",
91-
"AuthResourceWithRawResponse",
92-
"AsyncAuthResourceWithRawResponse",
93-
"AuthResourceWithStreamingResponse",
94-
"AsyncAuthResourceWithStreamingResponse",
9573
"RegionsResource",
9674
"AsyncRegionsResource",
9775
"RegionsResourceWithRawResponse",
@@ -116,12 +94,6 @@
11694
"AsyncAPIKeysResourceWithRawResponse",
11795
"APIKeysResourceWithStreamingResponse",
11896
"AsyncAPIKeysResourceWithStreamingResponse",
119-
"EmbeddingsResource",
120-
"AsyncEmbeddingsResource",
121-
"EmbeddingsResourceWithRawResponse",
122-
"AsyncEmbeddingsResourceWithRawResponse",
123-
"EmbeddingsResourceWithStreamingResponse",
124-
"AsyncEmbeddingsResourceWithStreamingResponse",
12597
"ModelsResource",
12698
"AsyncModelsResource",
12799
"ModelsResourceWithRawResponse",

0 commit comments

Comments
 (0)