Skip to content

Commit c6d26f4

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): OpenAPI spec update via Stainless API (#50)
1 parent 3a39028 commit c6d26f4

10 files changed

Lines changed: 607 additions & 47 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
configured_endpoints: 17
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-86d074c66f5140455eedb277c3ad3de81ec91f5cbd6ade28ef00ea2546dcc95e.yml
1+
configured_endpoints: 19
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-c11fd761b5d15675ee672120e5600fd6dddd801d87c1fa6335c507184bdf60b5.yml

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@ from runloop_api_client import Runloop
2929

3030
client = Runloop(
3131
# This is the default and can be omitted
32-
bearer_token=os.environ.get("RUNLOOP_BEARER_TOKEN"),
32+
bearer_token=os.environ.get("RUNLOOP_API_KEY"),
3333
)
3434

35-
blueprint_preview_view = client.blueprints.create()
36-
print(blueprint_preview_view.dockerfile)
35+
blueprint_view = client.blueprints.create()
36+
print(blueprint_view.id)
3737
```
3838

3939
While you can provide a `bearer_token` keyword argument,
4040
we recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)
41-
to add `RUNLOOP_BEARER_TOKEN="My Bearer Token"` to your `.env` file
41+
to add `RUNLOOP_API_KEY="My Bearer Token"` to your `.env` file
4242
so that your Bearer Token is not stored in source control.
4343

4444
## Async usage
@@ -52,13 +52,13 @@ from runloop_api_client import AsyncRunloop
5252

5353
client = AsyncRunloop(
5454
# This is the default and can be omitted
55-
bearer_token=os.environ.get("RUNLOOP_BEARER_TOKEN"),
55+
bearer_token=os.environ.get("RUNLOOP_API_KEY"),
5656
)
5757

5858

5959
async def main() -> None:
60-
blueprint_preview_view = await client.blueprints.create()
61-
print(blueprint_preview_view.dockerfile)
60+
blueprint_view = await client.blueprints.create()
61+
print(blueprint_view.id)
6262

6363

6464
asyncio.run(main())
@@ -200,7 +200,7 @@ response = client.blueprints.with_raw_response.create()
200200
print(response.headers.get('X-My-Header'))
201201

202202
blueprint = response.parse() # get the object that `blueprints.create()` would have returned
203-
print(blueprint.dockerfile)
203+
print(blueprint.id)
204204
```
205205

206206
These methods return an [`APIResponse`](https://github.com/runloopai/api-client-python/tree/main/src/runloop_api_client/_response.py) object.

api.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@ from runloop_api_client.types import (
2929

3030
Methods:
3131

32-
- <code title="post /v1/blueprints">client.blueprints.<a href="./src/runloop_api_client/resources/blueprints.py">create</a>(\*\*<a href="src/runloop_api_client/types/blueprint_create_params.py">params</a>) -> <a href="./src/runloop_api_client/types/blueprint_preview_view.py">BlueprintPreviewView</a></code>
32+
- <code title="post /v1/blueprints">client.blueprints.<a href="./src/runloop_api_client/resources/blueprints.py">create</a>(\*\*<a href="src/runloop_api_client/types/blueprint_create_params.py">params</a>) -> <a href="./src/runloop_api_client/types/blueprint_view.py">BlueprintView</a></code>
3333
- <code title="get /v1/blueprints/{id}">client.blueprints.<a href="./src/runloop_api_client/resources/blueprints.py">retrieve</a>(id) -> <a href="./src/runloop_api_client/types/blueprint_view.py">BlueprintView</a></code>
34-
- <code title="get /v1/blueprints">client.blueprints.<a href="./src/runloop_api_client/resources/blueprints.py">list</a>() -> <a href="./src/runloop_api_client/types/blueprint_build_logs_list_view.py">BlueprintBuildLogsListView</a></code>
34+
- <code title="get /v1/blueprints">client.blueprints.<a href="./src/runloop_api_client/resources/blueprints.py">list</a>(\*\*<a href="src/runloop_api_client/types/blueprint_list_params.py">params</a>) -> <a href="./src/runloop_api_client/types/blueprint_list_view.py">BlueprintListView</a></code>
35+
- <code title="get /v1/blueprints/{id}/logs">client.blueprints.<a href="./src/runloop_api_client/resources/blueprints.py">logs</a>(id) -> <a href="./src/runloop_api_client/types/blueprint_build_logs_list_view.py">BlueprintBuildLogsListView</a></code>
36+
- <code title="post /v1/blueprints/preview">client.blueprints.<a href="./src/runloop_api_client/resources/blueprints.py">preview</a>(\*\*<a href="src/runloop_api_client/types/blueprint_preview_params.py">params</a>) -> <a href="./src/runloop_api_client/types/blueprint_preview_view.py">BlueprintPreviewView</a></code>
3537

3638
# Code
3739

src/runloop_api_client/_client.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,13 @@ def __init__(
8181
) -> None:
8282
"""Construct a new synchronous runloop client instance.
8383
84-
This automatically infers the `bearer_token` argument from the `RUNLOOP_BEARER_TOKEN` environment variable if it is not provided.
84+
This automatically infers the `bearer_token` argument from the `RUNLOOP_API_KEY` environment variable if it is not provided.
8585
"""
8686
if bearer_token is None:
87-
bearer_token = os.environ.get("RUNLOOP_BEARER_TOKEN")
87+
bearer_token = os.environ.get("RUNLOOP_API_KEY")
8888
if bearer_token is None:
8989
raise RunloopError(
90-
"The bearer_token client option must be set either by passing bearer_token to the client or by setting the RUNLOOP_BEARER_TOKEN environment variable"
90+
"The bearer_token client option must be set either by passing bearer_token to the client or by setting the RUNLOOP_API_KEY environment variable"
9191
)
9292
self.bearer_token = bearer_token
9393

@@ -255,13 +255,13 @@ def __init__(
255255
) -> None:
256256
"""Construct a new async runloop client instance.
257257
258-
This automatically infers the `bearer_token` argument from the `RUNLOOP_BEARER_TOKEN` environment variable if it is not provided.
258+
This automatically infers the `bearer_token` argument from the `RUNLOOP_API_KEY` environment variable if it is not provided.
259259
"""
260260
if bearer_token is None:
261-
bearer_token = os.environ.get("RUNLOOP_BEARER_TOKEN")
261+
bearer_token = os.environ.get("RUNLOOP_API_KEY")
262262
if bearer_token is None:
263263
raise RunloopError(
264-
"The bearer_token client option must be set either by passing bearer_token to the client or by setting the RUNLOOP_BEARER_TOKEN environment variable"
264+
"The bearer_token client option must be set either by passing bearer_token to the client or by setting the RUNLOOP_API_KEY environment variable"
265265
)
266266
self.bearer_token = bearer_token
267267

0 commit comments

Comments
 (0)