Skip to content

Commit 4d4a408

Browse files
feat(api): manual updates
1 parent cd0ec74 commit 4d4a408

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: 3
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/warp-bnavetta%2Fwarp-api-c4c5f89f67a73e4d17377d2b96fc201a63cd5458cbebaa23e78f92b59b90cc5b.yml
33
openapi_spec_hash: 931c6189a4fc4ee320963646b1b7edbe
4-
config_hash: 554356d6e2bebaa59aaebbc75eebf525
4+
config_hash: 9c63a294a8e5fdc1f71187a9461b5b40

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import os
3232
from warp_sdk import WarpAPI
3333

3434
client = WarpAPI(
35-
api_key=os.environ.get("WARP_API_API_KEY"), # This is the default and can be omitted
35+
api_key=os.environ.get("WARP_API_KEY"), # This is the default and can be omitted
3636
)
3737

3838
response = client.agent.run(
@@ -43,7 +43,7 @@ print(response.task_id)
4343

4444
While you can provide an `api_key` keyword argument,
4545
we recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)
46-
to add `WARP_API_API_KEY="My API Key"` to your `.env` file
46+
to add `WARP_API_KEY="My API Key"` to your `.env` file
4747
so that your API Key is not stored in source control.
4848

4949
## Async usage
@@ -56,7 +56,7 @@ import asyncio
5656
from warp_sdk import AsyncWarpAPI
5757

5858
client = AsyncWarpAPI(
59-
api_key=os.environ.get("WARP_API_API_KEY"), # This is the default and can be omitted
59+
api_key=os.environ.get("WARP_API_KEY"), # This is the default and can be omitted
6060
)
6161

6262

@@ -94,7 +94,7 @@ from warp_sdk import AsyncWarpAPI
9494

9595
async def main() -> None:
9696
async with AsyncWarpAPI(
97-
api_key=os.environ.get("WARP_API_API_KEY"), # This is the default and can be omitted
97+
api_key=os.environ.get("WARP_API_KEY"), # This is the default and can be omitted
9898
http_client=DefaultAioHttpClient(),
9999
) as client:
100100
response = await client.agent.run(

src/warp_sdk/_client.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ def __init__(
6666
) -> None:
6767
"""Construct a new synchronous WarpAPI client instance.
6868
69-
This automatically infers the `api_key` argument from the `WARP_API_API_KEY` environment variable if it is not provided.
69+
This automatically infers the `api_key` argument from the `WARP_API_KEY` environment variable if it is not provided.
7070
"""
7171
if api_key is None:
72-
api_key = os.environ.get("WARP_API_API_KEY")
72+
api_key = os.environ.get("WARP_API_KEY")
7373
if api_key is None:
7474
raise WarpAPIError(
75-
"The api_key client option must be set either by passing api_key to the client or by setting the WARP_API_API_KEY environment variable"
75+
"The api_key client option must be set either by passing api_key to the client or by setting the WARP_API_KEY environment variable"
7676
)
7777
self.api_key = api_key
7878

@@ -234,13 +234,13 @@ def __init__(
234234
) -> None:
235235
"""Construct a new async AsyncWarpAPI client instance.
236236
237-
This automatically infers the `api_key` argument from the `WARP_API_API_KEY` environment variable if it is not provided.
237+
This automatically infers the `api_key` argument from the `WARP_API_KEY` environment variable if it is not provided.
238238
"""
239239
if api_key is None:
240-
api_key = os.environ.get("WARP_API_API_KEY")
240+
api_key = os.environ.get("WARP_API_KEY")
241241
if api_key is None:
242242
raise WarpAPIError(
243-
"The api_key client option must be set either by passing api_key to the client or by setting the WARP_API_API_KEY environment variable"
243+
"The api_key client option must be set either by passing api_key to the client or by setting the WARP_API_KEY environment variable"
244244
)
245245
self.api_key = api_key
246246

tests/test_client.py

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

352352
with pytest.raises(WarpAPIError):
353-
with update_env(**{"WARP_API_API_KEY": Omit()}):
353+
with update_env(**{"WARP_API_KEY": Omit()}):
354354
client2 = WarpAPI(base_url=base_url, api_key=None, _strict_response_validation=True)
355355
_ = client2
356356

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

11751175
with pytest.raises(WarpAPIError):
1176-
with update_env(**{"WARP_API_API_KEY": Omit()}):
1176+
with update_env(**{"WARP_API_KEY": Omit()}):
11771177
client2 = AsyncWarpAPI(base_url=base_url, api_key=None, _strict_response_validation=True)
11781178
_ = client2
11791179

0 commit comments

Comments
 (0)