Skip to content

Commit 4813de5

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
feat(api): update via SDK Studio (#15)
1 parent bc9b948 commit 4813de5

File tree

85 files changed

+124
-134
lines changed

Some content is hidden

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

85 files changed

+124
-134
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ $ pip install -r requirements-dev.lock
3232
## Modifying/Adding code
3333

3434
Most of the SDK is generated code, and any modified code will be overridden on the next generation. The
35-
`src/runloop_minus_api_minus_client/lib/` and `examples/` directories are exceptions and will never be overridden.
35+
`src/runloop_api_client/lib/` and `examples/` directories are exceptions and will never be overridden.
3636

3737
## Adding and running examples
3838

README.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Runloop Python API library
22

3-
[![PyPI version](https://img.shields.io/pypi/v/runloop-api-client.svg)](https://pypi.org/project/runloop-api-client/)
3+
[![PyPI version](https://img.shields.io/pypi/v/runloop_api_client.svg)](https://pypi.org/project/runloop_api_client/)
44

55
The Runloop Python library provides convenient access to the Runloop REST API from any Python 3.7+
66
application. The library includes type definitions for all request params and response fields,
@@ -16,7 +16,7 @@ The REST API documentation can be found [on runloop.ai](https://runloop.ai). The
1616

1717
```sh
1818
# install from PyPI
19-
pip install --pre runloop-api-client
19+
pip install --pre runloop_api_client
2020
```
2121

2222
## Usage
@@ -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 runloop_minus_api_minus_client import Runloop
28+
from runloop_api_client import Runloop
2929

3030
client = Runloop(
3131
# This is the default and can be omitted
@@ -48,7 +48,7 @@ Simply import `AsyncRunloop` instead of `Runloop` and use `await` with each API
4848
```python
4949
import os
5050
import asyncio
51-
from runloop_minus_api_minus_client import AsyncRunloop
51+
from runloop_api_client import AsyncRunloop
5252

5353
client = AsyncRunloop(
5454
# This is the default and can be omitted
@@ -77,27 +77,27 @@ Typed requests and responses provide autocomplete and documentation within your
7777

7878
## Handling errors
7979

80-
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `runloop_minus_api_minus_client.APIConnectionError` is raised.
80+
When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `runloop_api_client.APIConnectionError` is raised.
8181

8282
When the API returns a non-success status code (that is, 4xx or 5xx
83-
response), a subclass of `runloop_minus_api_minus_client.APIStatusError` is raised, containing `status_code` and `response` properties.
83+
response), a subclass of `runloop_api_client.APIStatusError` is raised, containing `status_code` and `response` properties.
8484

85-
All errors inherit from `runloop_minus_api_minus_client.APIError`.
85+
All errors inherit from `runloop_api_client.APIError`.
8686

8787
```python
88-
import runloop_minus_api_minus_client
89-
from runloop_minus_api_minus_client import Runloop
88+
import runloop_api_client
89+
from runloop_api_client import Runloop
9090

9191
client = Runloop()
9292

9393
try:
9494
client.devboxes.create()
95-
except runloop_minus_api_minus_client.APIConnectionError as e:
95+
except runloop_api_client.APIConnectionError as e:
9696
print("The server could not be reached")
9797
print(e.__cause__) # an underlying Exception, likely raised within httpx.
98-
except runloop_minus_api_minus_client.RateLimitError as e:
98+
except runloop_api_client.RateLimitError as e:
9999
print("A 429 status code was received; we should back off a bit.")
100-
except runloop_minus_api_minus_client.APIStatusError as e:
100+
except runloop_api_client.APIStatusError as e:
101101
print("Another non-200-range status code was received")
102102
print(e.status_code)
103103
print(e.response)
@@ -125,7 +125,7 @@ Connection errors (for example, due to a network connectivity problem), 408 Requ
125125
You can use the `max_retries` option to configure or disable retry settings:
126126

127127
```python
128-
from runloop_minus_api_minus_client import Runloop
128+
from runloop_api_client import Runloop
129129

130130
# Configure the default for all requests:
131131
client = Runloop(
@@ -143,7 +143,7 @@ By default requests time out after 1 minute. You can configure this with a `time
143143
which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object:
144144

145145
```python
146-
from runloop_minus_api_minus_client import Runloop
146+
from runloop_api_client import Runloop
147147

148148
# Configure the default for all requests:
149149
client = Runloop(
@@ -193,7 +193,7 @@ if response.my_field is None:
193193
The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,
194194

195195
```py
196-
from runloop_minus_api_minus_client import Runloop
196+
from runloop_api_client import Runloop
197197

198198
client = Runloop()
199199
response = client.devboxes.with_raw_response.create()
@@ -203,9 +203,9 @@ devbox = response.parse() # get the object that `devboxes.create()` would have
203203
print(devbox.id)
204204
```
205205

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

208-
The async client returns an [`AsyncAPIResponse`](https://github.com/runloopai/api-client-python/tree/main/src/runloop_minus_api_minus_client/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
208+
The async client returns an [`AsyncAPIResponse`](https://github.com/runloopai/api-client-python/tree/main/src/runloop_api_client/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.
209209

210210
#### `.with_streaming_response`
211211

@@ -267,7 +267,7 @@ You can directly override the [httpx client](https://www.python-httpx.org/api/#c
267267
- Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality
268268

269269
```python
270-
from runloop_minus_api_minus_client import Runloop, DefaultHttpxClient
270+
from runloop_api_client import Runloop, DefaultHttpxClient
271271

272272
client = Runloop(
273273
# Or use the `RUNLOOP_BASE_URL` env var

api.md

Lines changed: 22 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,91 @@
11
# Shared Types
22

33
```python
4-
from runloop_minus_api_minus_client.types import FunctionInvocationDetailView, ProjectLogsView
4+
from runloop_api_client.types import FunctionInvocationDetailView, ProjectLogsView
55
```
66

77
# Devboxes
88

99
Types:
1010

1111
```python
12-
from runloop_minus_api_minus_client.types import (
13-
DevboxExecutionDetailView,
14-
DevboxListView,
15-
DevboxView,
16-
)
12+
from runloop_api_client.types import DevboxExecutionDetailView, DevboxListView, DevboxView
1713
```
1814

1915
Methods:
2016

21-
- <code title="post /v1/devboxes">client.devboxes.<a href="./src/runloop_minus_api_minus_client/resources/devboxes/devboxes.py">create</a>(\*\*<a href="src/runloop_minus_api_minus_client/types/devbox_create_params.py">params</a>) -> <a href="./src/runloop_minus_api_minus_client/types/devbox_view.py">DevboxView</a></code>
22-
- <code title="get /v1/devboxes/{id}">client.devboxes.<a href="./src/runloop_minus_api_minus_client/resources/devboxes/devboxes.py">retrieve</a>(id) -> <a href="./src/runloop_minus_api_minus_client/types/devbox_view.py">DevboxView</a></code>
23-
- <code title="get /v1/devboxes">client.devboxes.<a href="./src/runloop_minus_api_minus_client/resources/devboxes/devboxes.py">list</a>(\*\*<a href="src/runloop_minus_api_minus_client/types/devbox_list_params.py">params</a>) -> <a href="./src/runloop_minus_api_minus_client/types/devbox_list_view.py">DevboxListView</a></code>
24-
- <code title="post /v1/devboxes/{id}/execute_sync">client.devboxes.<a href="./src/runloop_minus_api_minus_client/resources/devboxes/devboxes.py">execute_sync</a>(id) -> <a href="./src/runloop_minus_api_minus_client/types/devbox_execution_detail_view.py">DevboxExecutionDetailView</a></code>
25-
- <code title="post /v1/devboxes/{id}/shutdown">client.devboxes.<a href="./src/runloop_minus_api_minus_client/resources/devboxes/devboxes.py">shutdown</a>(id) -> <a href="./src/runloop_minus_api_minus_client/types/devbox_view.py">DevboxView</a></code>
17+
- <code title="post /v1/devboxes">client.devboxes.<a href="./src/runloop_api_client/resources/devboxes/devboxes.py">create</a>(\*\*<a href="src/runloop_api_client/types/devbox_create_params.py">params</a>) -> <a href="./src/runloop_api_client/types/devbox_view.py">DevboxView</a></code>
18+
- <code title="get /v1/devboxes/{id}">client.devboxes.<a href="./src/runloop_api_client/resources/devboxes/devboxes.py">retrieve</a>(id) -> <a href="./src/runloop_api_client/types/devbox_view.py">DevboxView</a></code>
19+
- <code title="get /v1/devboxes">client.devboxes.<a href="./src/runloop_api_client/resources/devboxes/devboxes.py">list</a>(\*\*<a href="src/runloop_api_client/types/devbox_list_params.py">params</a>) -> <a href="./src/runloop_api_client/types/devbox_list_view.py">DevboxListView</a></code>
20+
- <code title="post /v1/devboxes/{id}/execute_sync">client.devboxes.<a href="./src/runloop_api_client/resources/devboxes/devboxes.py">execute_sync</a>(id) -> <a href="./src/runloop_api_client/types/devbox_execution_detail_view.py">DevboxExecutionDetailView</a></code>
21+
- <code title="post /v1/devboxes/{id}/shutdown">client.devboxes.<a href="./src/runloop_api_client/resources/devboxes/devboxes.py">shutdown</a>(id) -> <a href="./src/runloop_api_client/types/devbox_view.py">DevboxView</a></code>
2622

2723
## Logs
2824

2925
Types:
3026

3127
```python
32-
from runloop_minus_api_minus_client.types.devboxes import DevboxLogsListView
28+
from runloop_api_client.types.devboxes import DevboxLogsListView
3329
```
3430

3531
Methods:
3632

37-
- <code title="get /v1/devboxes/{id}/logs">client.devboxes.logs.<a href="./src/runloop_minus_api_minus_client/resources/devboxes/logs.py">list</a>(id) -> <a href="./src/runloop_minus_api_minus_client/types/devboxes/devbox_logs_list_view.py">DevboxLogsListView</a></code>
33+
- <code title="get /v1/devboxes/{id}/logs">client.devboxes.logs.<a href="./src/runloop_api_client/resources/devboxes/logs.py">list</a>(id) -> <a href="./src/runloop_api_client/types/devboxes/devbox_logs_list_view.py">DevboxLogsListView</a></code>
3834

3935
# Functions
4036

4137
Types:
4238

4339
```python
44-
from runloop_minus_api_minus_client.types import FunctionListView
40+
from runloop_api_client.types import FunctionListView
4541
```
4642

4743
Methods:
4844

49-
- <code title="get /v1/functions">client.functions.<a href="./src/runloop_minus_api_minus_client/resources/functions/functions.py">list</a>() -> <a href="./src/runloop_minus_api_minus_client/types/function_list_view.py">FunctionListView</a></code>
50-
- <code title="post /v1/functions/{project_name}/{function_name}/invoke_async">client.functions.<a href="./src/runloop_minus_api_minus_client/resources/functions/functions.py">invoke_async</a>(function_name, \*, project_name, \*\*<a href="src/runloop_minus_api_minus_client/types/function_invoke_async_params.py">params</a>) -> <a href="./src/runloop_minus_api_minus_client/types/shared/function_invocation_detail_view.py">FunctionInvocationDetailView</a></code>
51-
- <code title="post /v1/functions/{project_name}/{function_name}/invoke_sync">client.functions.<a href="./src/runloop_minus_api_minus_client/resources/functions/functions.py">invoke_sync</a>(function_name, \*, project_name, \*\*<a href="src/runloop_minus_api_minus_client/types/function_invoke_sync_params.py">params</a>) -> <a href="./src/runloop_minus_api_minus_client/types/shared/function_invocation_detail_view.py">FunctionInvocationDetailView</a></code>
45+
- <code title="get /v1/functions">client.functions.<a href="./src/runloop_api_client/resources/functions/functions.py">list</a>() -> <a href="./src/runloop_api_client/types/function_list_view.py">FunctionListView</a></code>
46+
- <code title="post /v1/functions/{project_name}/{function_name}/invoke_async">client.functions.<a href="./src/runloop_api_client/resources/functions/functions.py">invoke_async</a>(function_name, \*, project_name, \*\*<a href="src/runloop_api_client/types/function_invoke_async_params.py">params</a>) -> <a href="./src/runloop_api_client/types/shared/function_invocation_detail_view.py">FunctionInvocationDetailView</a></code>
47+
- <code title="post /v1/functions/{project_name}/{function_name}/invoke_sync">client.functions.<a href="./src/runloop_api_client/resources/functions/functions.py">invoke_sync</a>(function_name, \*, project_name, \*\*<a href="src/runloop_api_client/types/function_invoke_sync_params.py">params</a>) -> <a href="./src/runloop_api_client/types/shared/function_invocation_detail_view.py">FunctionInvocationDetailView</a></code>
5248

5349
## Invocations
5450

5551
Types:
5652

5753
```python
58-
from runloop_minus_api_minus_client.types.functions import (
59-
FunctionInvocationListView,
60-
KillOperationResponse,
61-
)
54+
from runloop_api_client.types.functions import FunctionInvocationListView, KillOperationResponse
6255
```
6356

6457
Methods:
6558

66-
- <code title="get /v1/functions/invocations/{invocationId}">client.functions.invocations.<a href="./src/runloop_minus_api_minus_client/resources/functions/invocations/invocations.py">retrieve</a>(invocation_id) -> <a href="./src/runloop_minus_api_minus_client/types/shared/function_invocation_detail_view.py">FunctionInvocationDetailView</a></code>
67-
- <code title="get /v1/functions/invocations">client.functions.invocations.<a href="./src/runloop_minus_api_minus_client/resources/functions/invocations/invocations.py">list</a>() -> <a href="./src/runloop_minus_api_minus_client/types/functions/function_invocation_list_view.py">FunctionInvocationListView</a></code>
68-
- <code title="post /v1/functions/invocations/{invocationId}/kill">client.functions.invocations.<a href="./src/runloop_minus_api_minus_client/resources/functions/invocations/invocations.py">kill</a>(invocation_id) -> <a href="./src/runloop_minus_api_minus_client/types/functions/kill_operation_response.py">object</a></code>
59+
- <code title="get /v1/functions/invocations/{invocationId}">client.functions.invocations.<a href="./src/runloop_api_client/resources/functions/invocations/invocations.py">retrieve</a>(invocation_id) -> <a href="./src/runloop_api_client/types/shared/function_invocation_detail_view.py">FunctionInvocationDetailView</a></code>
60+
- <code title="get /v1/functions/invocations">client.functions.invocations.<a href="./src/runloop_api_client/resources/functions/invocations/invocations.py">list</a>() -> <a href="./src/runloop_api_client/types/functions/function_invocation_list_view.py">FunctionInvocationListView</a></code>
61+
- <code title="post /v1/functions/invocations/{invocationId}/kill">client.functions.invocations.<a href="./src/runloop_api_client/resources/functions/invocations/invocations.py">kill</a>(invocation_id) -> <a href="./src/runloop_api_client/types/functions/kill_operation_response.py">object</a></code>
6962

7063
### Spans
7164

7265
Types:
7366

7467
```python
75-
from runloop_minus_api_minus_client.types.functions.invocations import InvocationSpanListView
68+
from runloop_api_client.types.functions.invocations import InvocationSpanListView
7669
```
7770

7871
Methods:
7972

80-
- <code title="get /v1/functions/invocations/{invocationId}/spans">client.functions.invocations.spans.<a href="./src/runloop_minus_api_minus_client/resources/functions/invocations/spans.py">list</a>(invocation_id) -> <a href="./src/runloop_minus_api_minus_client/types/functions/invocations/invocation_span_list_view.py">InvocationSpanListView</a></code>
73+
- <code title="get /v1/functions/invocations/{invocationId}/spans">client.functions.invocations.spans.<a href="./src/runloop_api_client/resources/functions/invocations/spans.py">list</a>(invocation_id) -> <a href="./src/runloop_api_client/types/functions/invocations/invocation_span_list_view.py">InvocationSpanListView</a></code>
8174

8275
# Projects
8376

8477
Types:
8578

8679
```python
87-
from runloop_minus_api_minus_client.types import ProjectListView
80+
from runloop_api_client.types import ProjectListView
8881
```
8982

9083
Methods:
9184

92-
- <code title="get /v1/projects">client.projects.<a href="./src/runloop_minus_api_minus_client/resources/projects/projects.py">list</a>() -> <a href="./src/runloop_minus_api_minus_client/types/project_list_view.py">ProjectListView</a></code>
85+
- <code title="get /v1/projects">client.projects.<a href="./src/runloop_api_client/resources/projects/projects.py">list</a>() -> <a href="./src/runloop_api_client/types/project_list_view.py">ProjectListView</a></code>
9386

9487
## Logs
9588

9689
Methods:
9790

98-
- <code title="get /v1/projects/{id}/logs">client.projects.logs.<a href="./src/runloop_minus_api_minus_client/resources/projects/logs.py">list</a>(id) -> <a href="./src/runloop_minus_api_minus_client/types/shared/project_logs_view.py">ProjectLogsView</a></code>
91+
- <code title="get /v1/projects/{id}/logs">client.projects.logs.<a href="./src/runloop_api_client/resources/projects/logs.py">list</a>(id) -> <a href="./src/runloop_api_client/types/shared/project_logs_view.py">ProjectLogsView</a></code>

mypy.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ show_error_codes = True
55
# Exclude _files.py because mypy isn't smart enough to apply
66
# the correct type narrowing and as this is an internal module
77
# it's fine to just use Pyright.
8-
exclude = ^(src/runloop_minus_api_minus_client/_files\.py|_dev/.*\.py)$
8+
exclude = ^(src/runloop_api_client/_files\.py|_dev/.*\.py)$
99

1010
strict_equality = True
1111
implicit_reexport = True

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[project]
2-
name = "runloop-api-client"
2+
name = "runloop_api_client"
33
version = "0.1.0-alpha.3"
44
description = "The official Python library for the runloop API"
55
dynamic = ["readme"]
@@ -84,7 +84,7 @@ typecheck = { chain = [
8484
"typecheck:mypy"
8585
]}
8686
"typecheck:pyright" = "pyright"
87-
"typecheck:verify-types" = "pyright --verifytypes runloop_minus_api_minus_client --ignoreexternal"
87+
"typecheck:verify-types" = "pyright --verifytypes runloop_api_client --ignoreexternal"
8888
"typecheck:mypy" = "mypy ."
8989

9090
[build-system]
@@ -97,7 +97,7 @@ include = [
9797
]
9898

9999
[tool.hatch.build.targets.wheel]
100-
packages = ["src/runloop_minus_api_minus_client"]
100+
packages = ["src/runloop_api_client"]
101101

102102
[tool.hatch.metadata.hooks.fancy-pypi-readme]
103103
content-type = "text/markdown"
@@ -187,7 +187,7 @@ length-sort = true
187187
length-sort-straight = true
188188
combine-as-imports = true
189189
extra-standard-library = ["typing_extensions"]
190-
known-first-party = ["runloop_minus_api_minus_client", "tests"]
190+
known-first-party = ["runloop_api_client", "tests"]
191191

192192
[tool.ruff.per-file-ignores]
193193
"bin/**.py" = ["T201", "T203"]

release-please-config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,6 @@
6161
],
6262
"release-type": "python",
6363
"extra-files": [
64-
"src/runloop_minus_api_minus_client/_version.py"
64+
"src/runloop_api_client/_version.py"
6565
]
6666
}

scripts/lint

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ echo "==> Running lints"
88
rye run lint
99

1010
echo "==> Making sure it imports"
11-
rye run python -c 'import runloop_minus_api_minus_client'
11+
rye run python -c 'import runloop_api_client'
1212

src/runloop_minus_api_minus_client/__init__.py renamed to src/runloop_api_client/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@
7272
# Update the __module__ attribute for exported symbols so that
7373
# error messages point to this module instead of the module
7474
# it was originally defined in, e.g.
75-
# runloop_minus_api_minus_client._exceptions.NotFoundError -> runloop_minus_api_minus_client.NotFoundError
75+
# runloop_api_client._exceptions.NotFoundError -> runloop_api_client.NotFoundError
7676
__locals = locals()
7777
for __name in __all__:
7878
if not __name.startswith("__"):
7979
try:
80-
__locals[__name].__module__ = "runloop_minus_api_minus_client"
80+
__locals[__name].__module__ = "runloop_api_client"
8181
except (TypeError, AttributeError):
8282
# Some of our exported symbols are builtins which we can't set attributes for.
8383
pass

src/runloop_minus_api_minus_client/_base_client.py renamed to src/runloop_api_client/_base_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ def __init__(
362362

363363
if max_retries is None: # pyright: ignore[reportUnnecessaryComparison]
364364
raise TypeError(
365-
"max_retries cannot be None. If you want to disable retries, pass `0`; if you want unlimited retries, pass `math.inf` or a very high number; if you want the default behavior, pass `runloop-api-client.DEFAULT_MAX_RETRIES`"
365+
"max_retries cannot be None. If you want to disable retries, pass `0`; if you want unlimited retries, pass `math.inf` or a very high number; if you want the default behavior, pass `runloop_api_client.DEFAULT_MAX_RETRIES`"
366366
)
367367

368368
def _enforce_trailing_slash(self, url: URL) -> URL:
File renamed without changes.

0 commit comments

Comments
 (0)