Skip to content

Commit 359c8d8

Browse files
feat(api): update via SDK Studio
1 parent 494afde commit 359c8d8

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
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%2Fgradientai-e40feaac59c85aace6aa42d2749b20e0955dbbae58b06c3a650bc03adafcd7b5.yml
33
openapi_spec_hash: 825c1a4816938e9f594b7a8c06692667
4-
config_hash: a2c4c23eb1e8655fbfb2b6930ce0fd46
4+
config_hash: 48e21c88c078b1d478257b2da0c840b2

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ from gradientai import GradientAI
2929

3030
client = GradientAI(
3131
api_key=os.environ.get(
32-
"DIGITALOCEAN_GENAI_SDK_API_KEY"
32+
"DIGITALOCEAN_GRADIENTAI_API_KEY"
3333
), # This is the default and can be omitted
3434
)
3535

@@ -41,7 +41,7 @@ print(versions.agent_versions)
4141

4242
While you can provide an `api_key` keyword argument,
4343
we recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)
44-
to add `DIGITALOCEAN_GENAI_SDK_API_KEY="My API Key"` to your `.env` file
44+
to add `DIGITALOCEAN_GRADIENTAI_API_KEY="My API Key"` to your `.env` file
4545
so that your API Key is not stored in source control.
4646

4747
## Async usage
@@ -55,7 +55,7 @@ from gradientai import AsyncGradientAI
5555

5656
client = AsyncGradientAI(
5757
api_key=os.environ.get(
58-
"DIGITALOCEAN_GENAI_SDK_API_KEY"
58+
"DIGITALOCEAN_GRADIENTAI_API_KEY"
5959
), # This is the default and can be omitted
6060
)
6161

@@ -95,7 +95,7 @@ from gradientai import AsyncGradientAI
9595
async def main() -> None:
9696
async with AsyncGradientAI(
9797
api_key=os.environ.get(
98-
"DIGITALOCEAN_GENAI_SDK_API_KEY"
98+
"DIGITALOCEAN_GRADIENTAI_API_KEY"
9999
), # This is the default and can be omitted
100100
http_client=DefaultAioHttpClient(),
101101
) as client:

src/gradientai/_client.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,13 @@ def __init__(
8282
) -> None:
8383
"""Construct a new synchronous GradientAI client instance.
8484
85-
This automatically infers the `api_key` argument from the `DIGITALOCEAN_GENAI_SDK_API_KEY` environment variable if it is not provided.
85+
This automatically infers the `api_key` argument from the `DIGITALOCEAN_GRADIENTAI_API_KEY` environment variable if it is not provided.
8686
"""
8787
if api_key is None:
88-
api_key = os.environ.get("DIGITALOCEAN_GENAI_SDK_API_KEY")
88+
api_key = os.environ.get("DIGITALOCEAN_GRADIENTAI_API_KEY")
8989
if api_key is None:
9090
raise GradientAIError(
91-
"The api_key client option must be set either by passing api_key to the client or by setting the DIGITALOCEAN_GENAI_SDK_API_KEY environment variable"
91+
"The api_key client option must be set either by passing api_key to the client or by setting the DIGITALOCEAN_GRADIENTAI_API_KEY environment variable"
9292
)
9393
self.api_key = api_key
9494

@@ -301,13 +301,13 @@ def __init__(
301301
) -> None:
302302
"""Construct a new async AsyncGradientAI client instance.
303303
304-
This automatically infers the `api_key` argument from the `DIGITALOCEAN_GENAI_SDK_API_KEY` environment variable if it is not provided.
304+
This automatically infers the `api_key` argument from the `DIGITALOCEAN_GRADIENTAI_API_KEY` environment variable if it is not provided.
305305
"""
306306
if api_key is None:
307-
api_key = os.environ.get("DIGITALOCEAN_GENAI_SDK_API_KEY")
307+
api_key = os.environ.get("DIGITALOCEAN_GRADIENTAI_API_KEY")
308308
if api_key is None:
309309
raise GradientAIError(
310-
"The api_key client option must be set either by passing api_key to the client or by setting the DIGITALOCEAN_GENAI_SDK_API_KEY environment variable"
310+
"The api_key client option must be set either by passing api_key to the client or by setting the DIGITALOCEAN_GRADIENTAI_API_KEY environment variable"
311311
)
312312
self.api_key = api_key
313313

tests/test_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ def test_validate_headers(self) -> None:
341341
assert request.headers.get("Authorization") == f"Bearer {api_key}"
342342

343343
with pytest.raises(GradientAIError):
344-
with update_env(**{"DIGITALOCEAN_GENAI_SDK_API_KEY": Omit()}):
344+
with update_env(**{"DIGITALOCEAN_GRADIENTAI_API_KEY": Omit()}):
345345
client2 = GradientAI(base_url=base_url, api_key=None, _strict_response_validation=True)
346346
_ = client2
347347

@@ -1153,7 +1153,7 @@ def test_validate_headers(self) -> None:
11531153
assert request.headers.get("Authorization") == f"Bearer {api_key}"
11541154

11551155
with pytest.raises(GradientAIError):
1156-
with update_env(**{"DIGITALOCEAN_GENAI_SDK_API_KEY": Omit()}):
1156+
with update_env(**{"DIGITALOCEAN_GRADIENTAI_API_KEY": Omit()}):
11571157
client2 = AsyncGradientAI(base_url=base_url, api_key=None, _strict_response_validation=True)
11581158
_ = client2
11591159

0 commit comments

Comments
 (0)