Skip to content

Commit dcbe442

Browse files
feat(api): update via SDK Studio
1 parent 78637e9 commit dcbe442

File tree

255 files changed

+234
-230
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

255 files changed

+234
-230
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: 70
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/digitalocean%2Fgradientai-e40feaac59c85aace6aa42d2749b20e0955dbbae58b06c3a650bc03adafcd7b5.yml
33
openapi_spec_hash: 825c1a4816938e9f594b7a8c06692667
4-
config_hash: 211ece2994c6ac52f84f78ee56c1097a
4+
config_hash: 0c94579072c21854f9e042dfaac74e1d

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ $ pip install -r requirements-dev.lock
3636

3737
Most of the SDK is generated code. Modifications to code will be persisted between generations, but may
3838
result in merge conflicts between manual patches and changes from the generator. The generator will never
39-
modify the contents of the `src/gradientai/lib/` and `examples/` directories.
39+
modify the contents of the `src/do_gradientai/lib/` and `examples/` directories.
4040

4141
## Adding and running examples
4242

README.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ The full API of this library can be found in [api.md](api.md).
2525

2626
```python
2727
import os
28-
from gradientai import GradientAI
28+
from do_gradientai import GradientAI
2929

3030
client = GradientAI(
3131
api_key=os.environ.get("GRADIENTAI_API_KEY"), # This is the default and can be omitted
@@ -49,7 +49,7 @@ Simply import `AsyncGradientAI` instead of `GradientAI` and use `await` with eac
4949
```python
5050
import os
5151
import asyncio
52-
from gradientai import AsyncGradientAI
52+
from do_gradientai import AsyncGradientAI
5353

5454
client = AsyncGradientAI(
5555
api_key=os.environ.get("GRADIENTAI_API_KEY"), # This is the default and can be omitted
@@ -84,8 +84,8 @@ Then you can enable it by instantiating the client with `http_client=DefaultAioH
8484
```python
8585
import os
8686
import asyncio
87-
from gradientai import DefaultAioHttpClient
88-
from gradientai import AsyncGradientAI
87+
from do_gradientai import DefaultAioHttpClient
88+
from do_gradientai import AsyncGradientAI
8989

9090

9191
async def main() -> None:
@@ -116,7 +116,7 @@ Typed requests and responses provide autocomplete and documentation within your
116116
Nested parameters are dictionaries, typed using `TypedDict`, for example:
117117

118118
```python
119-
from gradientai import GradientAI
119+
from do_gradientai import GradientAI
120120

121121
client = GradientAI()
122122

@@ -128,29 +128,29 @@ print(evaluation_test_case.star_metric)
128128

129129
## Handling errors
130130

131-
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `gradientai.APIConnectionError` is raised.
131+
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `do_gradientai.APIConnectionError` is raised.
132132

133133
When the API returns a non-success status code (that is, 4xx or 5xx
134-
response), a subclass of `gradientai.APIStatusError` is raised, containing `status_code` and `response` properties.
134+
response), a subclass of `do_gradientai.APIStatusError` is raised, containing `status_code` and `response` properties.
135135

136-
All errors inherit from `gradientai.APIError`.
136+
All errors inherit from `do_gradientai.APIError`.
137137

138138
```python
139-
import gradientai
140-
from gradientai import GradientAI
139+
import do_gradientai
140+
from do_gradientai import GradientAI
141141

142142
client = GradientAI()
143143

144144
try:
145145
client.agents.versions.list(
146146
uuid="REPLACE_ME",
147147
)
148-
except gradientai.APIConnectionError as e:
148+
except do_gradientai.APIConnectionError as e:
149149
print("The server could not be reached")
150150
print(e.__cause__) # an underlying Exception, likely raised within httpx.
151-
except gradientai.RateLimitError as e:
151+
except do_gradientai.RateLimitError as e:
152152
print("A 429 status code was received; we should back off a bit.")
153-
except gradientai.APIStatusError as e:
153+
except do_gradientai.APIStatusError as e:
154154
print("Another non-200-range status code was received")
155155
print(e.status_code)
156156
print(e.response)
@@ -178,7 +178,7 @@ Connection errors (for example, due to a network connectivity problem), 408 Requ
178178
You can use the `max_retries` option to configure or disable retry settings:
179179

180180
```python
181-
from gradientai import GradientAI
181+
from do_gradientai import GradientAI
182182

183183
# Configure the default for all requests:
184184
client = GradientAI(
@@ -198,7 +198,7 @@ By default requests time out after 1 minute. You can configure this with a `time
198198
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/timeouts/#fine-tuning-the-configuration) object:
199199

200200
```python
201-
from gradientai import GradientAI
201+
from do_gradientai import GradientAI
202202

203203
# Configure the default for all requests:
204204
client = GradientAI(
@@ -252,7 +252,7 @@ if response.my_field is None:
252252
The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,
253253

254254
```py
255-
from gradientai import GradientAI
255+
from do_gradientai import GradientAI
256256

257257
client = GradientAI()
258258
response = client.agents.versions.with_raw_response.list(
@@ -264,9 +264,9 @@ version = response.parse() # get the object that `agents.versions.list()` would
264264
print(version.agent_versions)
265265
```
266266

267-
These methods return an [`APIResponse`](https://github.com/digitalocean/gradientai-python/tree/main/src/gradientai/_response.py) object.
267+
These methods return an [`APIResponse`](https://github.com/digitalocean/gradientai-python/tree/main/src/do_gradientai/_response.py) object.
268268

269-
The async client returns an [`AsyncAPIResponse`](https://github.com/digitalocean/gradientai-python/tree/main/src/gradientai/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
269+
The async client returns an [`AsyncAPIResponse`](https://github.com/digitalocean/gradientai-python/tree/main/src/do_gradientai/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
270270

271271
#### `.with_streaming_response`
272272

@@ -330,7 +330,7 @@ You can directly override the [httpx client](https://www.python-httpx.org/api/#c
330330

331331
```python
332332
import httpx
333-
from gradientai import GradientAI, DefaultHttpxClient
333+
from do_gradientai import GradientAI, DefaultHttpxClient
334334

335335
client = GradientAI(
336336
# Or use the `GRADIENT_AI_BASE_URL` env var
@@ -353,7 +353,7 @@ client.with_options(http_client=DefaultHttpxClient(...))
353353
By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.
354354

355355
```py
356-
from gradientai import GradientAI
356+
from do_gradientai import GradientAI
357357

358358
with GradientAI() as client:
359359
# make requests here
@@ -381,8 +381,8 @@ If you've upgraded to the latest version but aren't seeing any new features you
381381
You can determine the version that is being used at runtime with:
382382

383383
```py
384-
import gradientai
385-
print(gradientai.__version__)
384+
import do_gradientai
385+
print(do_gradientai.__version__)
386386
```
387387

388388
## Requirements

0 commit comments

Comments
 (0)