runloop-api-client 0.1.0a6__tar.gz → 0.1.0a7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- runloop_api_client-0.1.0a7/.release-please-manifest.json +3 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/CHANGELOG.md +20 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/PKG-INFO +15 -15
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/README.md +14 -14
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/api.md +39 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/pyproject.toml +1 -1
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/_client.py +14 -6
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/_models.py +9 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/_version.py +1 -1
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/resources/__init__.py +14 -0
- runloop_api_client-0.1.0a7/src/runloop_api_client/resources/blueprints.py +600 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/resources/devboxes/devboxes.py +20 -10
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/types/__init__.py +12 -0
- runloop_api_client-0.1.0a7/src/runloop_api_client/types/blueprint_build_log.py +18 -0
- runloop_api_client-0.1.0a7/src/runloop_api_client/types/blueprint_build_logs_list_view.py +16 -0
- runloop_api_client-0.1.0a7/src/runloop_api_client/types/blueprint_build_parameters.py +34 -0
- runloop_api_client-0.1.0a7/src/runloop_api_client/types/blueprint_create_params.py +36 -0
- runloop_api_client-0.1.0a7/src/runloop_api_client/types/blueprint_list_params.py +18 -0
- runloop_api_client-0.1.0a7/src/runloop_api_client/types/blueprint_list_view.py +17 -0
- runloop_api_client-0.1.0a7/src/runloop_api_client/types/blueprint_preview_params.py +36 -0
- runloop_api_client-0.1.0a7/src/runloop_api_client/types/blueprint_preview_view.py +12 -0
- runloop_api_client-0.1.0a7/src/runloop_api_client/types/blueprint_view.py +26 -0
- runloop_api_client-0.1.0a7/src/runloop_api_client/types/code_mount_parameters.py +24 -0
- runloop_api_client-0.1.0a7/src/runloop_api_client/types/code_mount_parameters_param.py +24 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/types/devbox_create_params.py +13 -6
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/types/devbox_view.py +3 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/types/function_invoke_async_response.py +6 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/types/function_invoke_sync_response.py +6 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/types/functions/invocation_retrieve_response.py +6 -0
- runloop_api_client-0.1.0a7/src/runloop_api_client/types/resource_size.py +7 -0
- runloop_api_client-0.1.0a7/tests/api_resources/test_blueprints.py +479 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/tests/api_resources/test_devboxes.py +4 -2
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/tests/test_client.py +8 -8
- runloop_api_client-0.1.0a6/.release-please-manifest.json +0 -3
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/.gitignore +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/CONTRIBUTING.md +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/LICENSE +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/SECURITY.md +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/bin/check-release-environment +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/bin/publish-pypi +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/examples/.keep +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/mypy.ini +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/noxfile.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/release-please-config.json +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/requirements-dev.lock +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/requirements.lock +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop/lib/.keep +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/__init__.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/_base_client.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/_compat.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/_constants.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/_exceptions.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/_files.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/_qs.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/_resource.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/_response.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/_streaming.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/_types.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/_utils/__init__.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/_utils/_logs.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/_utils/_proxy.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/_utils/_reflection.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/_utils/_streams.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/_utils/_sync.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/_utils/_transform.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/_utils/_typing.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/_utils/_utils.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/lib/.keep +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/py.typed +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/resources/devboxes/__init__.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/resources/devboxes/logs.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/resources/functions/__init__.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/resources/functions/functions.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/resources/functions/invocations/__init__.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/resources/functions/invocations/invocations.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/resources/projects/__init__.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/resources/projects/logs.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/resources/projects/projects.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/types/devbox_execute_sync_params.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/types/devbox_execution_detail_view.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/types/devbox_list_params.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/types/devbox_list_view.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/types/devboxes/__init__.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/types/devboxes/devbox_logs_list_view.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/types/function_invoke_async_params.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/types/function_invoke_sync_params.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/types/function_list_view.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/types/functions/__init__.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/types/functions/function_invocation_list_view.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/types/functions/invocation_list_params.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/types/functions/invocations/__init__.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/types/project_list_view.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/types/projects/__init__.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/types/shared/__init__.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/src/runloop_api_client/types/shared/project_logs_view.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/tests/__init__.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/tests/api_resources/__init__.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/tests/api_resources/devboxes/__init__.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/tests/api_resources/devboxes/test_logs.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/tests/api_resources/functions/__init__.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/tests/api_resources/functions/invocations/__init__.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/tests/api_resources/functions/test_invocations.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/tests/api_resources/projects/__init__.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/tests/api_resources/projects/test_logs.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/tests/api_resources/test_functions.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/tests/api_resources/test_projects.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/tests/conftest.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/tests/sample_file.txt +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/tests/test_deepcopy.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/tests/test_extract_files.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/tests/test_files.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/tests/test_models.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/tests/test_qs.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/tests/test_required_args.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/tests/test_response.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/tests/test_streaming.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/tests/test_transform.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/tests/test_utils/test_proxy.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/tests/test_utils/test_typing.py +0 -0
- {runloop_api_client-0.1.0a6 → runloop_api_client-0.1.0a7}/tests/utils.py +0 -0
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.0-alpha.7 (2024-07-30)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.1.0-alpha.6...v0.1.0-alpha.7](https://github.com/runloopai/api-client-python/compare/v0.1.0-alpha.6...v0.1.0-alpha.7)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** OpenAPI spec update via Stainless API ([#41](https://github.com/runloopai/api-client-python/issues/41)) ([d4da50f](https://github.com/runloopai/api-client-python/commit/d4da50fc963abf097b5d214df1cc3ee641281ab3))
|
|
10
|
+
* **api:** OpenAPI spec update via Stainless API ([#43](https://github.com/runloopai/api-client-python/issues/43)) ([2eed5ae](https://github.com/runloopai/api-client-python/commit/2eed5aed9091a2040efe730cb63baa8b284f1c4d))
|
|
11
|
+
* **api:** OpenAPI spec update via Stainless API ([#44](https://github.com/runloopai/api-client-python/issues/44)) ([d936662](https://github.com/runloopai/api-client-python/commit/d936662a5aea53a50f8ccf7e7d29c3634a8567d7))
|
|
12
|
+
* **api:** OpenAPI spec update via Stainless API ([#46](https://github.com/runloopai/api-client-python/issues/46)) ([cd62f94](https://github.com/runloopai/api-client-python/commit/cd62f949150028cdd481966722d26f1ea3333cd2))
|
|
13
|
+
* **api:** OpenAPI spec update via Stainless API ([#47](https://github.com/runloopai/api-client-python/issues/47)) ([218b9b0](https://github.com/runloopai/api-client-python/commit/218b9b0a1af247c96d7ca5299cf5c855bc4e3dfd))
|
|
14
|
+
* **api:** OpenAPI spec update via Stainless API ([#48](https://github.com/runloopai/api-client-python/issues/48)) ([b866f26](https://github.com/runloopai/api-client-python/commit/b866f2684b69ba1f5b3ed4f360c8de03aefa63e4))
|
|
15
|
+
* **api:** OpenAPI spec update via Stainless API ([#49](https://github.com/runloopai/api-client-python/issues/49)) ([3a39028](https://github.com/runloopai/api-client-python/commit/3a390287c870129265fc9f2cee6c6042430ea61f))
|
|
16
|
+
* **api:** OpenAPI spec update via Stainless API ([#50](https://github.com/runloopai/api-client-python/issues/50)) ([c6d26f4](https://github.com/runloopai/api-client-python/commit/c6d26f407dffb8b65342476e129e11a2caa481db))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Chores
|
|
20
|
+
|
|
21
|
+
* **internal:** add type construction helper ([#45](https://github.com/runloopai/api-client-python/issues/45)) ([8b05828](https://github.com/runloopai/api-client-python/commit/8b058280802b5ce7987065d17806632de4a80d32))
|
|
22
|
+
|
|
3
23
|
## 0.1.0-alpha.6 (2024-07-25)
|
|
4
24
|
|
|
5
25
|
Full Changelog: [v0.1.0-alpha.5...v0.1.0-alpha.6](https://github.com/runloopai/api-client-python/compare/v0.1.0-alpha.5...v0.1.0-alpha.6)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: runloop_api_client
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.0a7
|
|
4
4
|
Summary: The official Python library for the runloop API
|
|
5
5
|
Project-URL: Homepage, https://github.com/runloopai/api-client-python
|
|
6
6
|
Project-URL: Repository, https://github.com/runloopai/api-client-python
|
|
@@ -63,16 +63,16 @@ from runloop_api_client import Runloop
|
|
|
63
63
|
|
|
64
64
|
client = Runloop(
|
|
65
65
|
# This is the default and can be omitted
|
|
66
|
-
bearer_token=os.environ.get("
|
|
66
|
+
bearer_token=os.environ.get("RUNLOOP_API_KEY"),
|
|
67
67
|
)
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
print(
|
|
69
|
+
blueprint_view = client.blueprints.create()
|
|
70
|
+
print(blueprint_view.id)
|
|
71
71
|
```
|
|
72
72
|
|
|
73
73
|
While you can provide a `bearer_token` keyword argument,
|
|
74
74
|
we recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)
|
|
75
|
-
to add `
|
|
75
|
+
to add `RUNLOOP_API_KEY="My Bearer Token"` to your `.env` file
|
|
76
76
|
so that your Bearer Token is not stored in source control.
|
|
77
77
|
|
|
78
78
|
## Async usage
|
|
@@ -86,13 +86,13 @@ from runloop_api_client import AsyncRunloop
|
|
|
86
86
|
|
|
87
87
|
client = AsyncRunloop(
|
|
88
88
|
# This is the default and can be omitted
|
|
89
|
-
bearer_token=os.environ.get("
|
|
89
|
+
bearer_token=os.environ.get("RUNLOOP_API_KEY"),
|
|
90
90
|
)
|
|
91
91
|
|
|
92
92
|
|
|
93
93
|
async def main() -> None:
|
|
94
|
-
|
|
95
|
-
print(
|
|
94
|
+
blueprint_view = await client.blueprints.create()
|
|
95
|
+
print(blueprint_view.id)
|
|
96
96
|
|
|
97
97
|
|
|
98
98
|
asyncio.run(main())
|
|
@@ -125,7 +125,7 @@ from runloop_api_client import Runloop
|
|
|
125
125
|
client = Runloop()
|
|
126
126
|
|
|
127
127
|
try:
|
|
128
|
-
client.
|
|
128
|
+
client.blueprints.create()
|
|
129
129
|
except runloop_api_client.APIConnectionError as e:
|
|
130
130
|
print("The server could not be reached")
|
|
131
131
|
print(e.__cause__) # an underlying Exception, likely raised within httpx.
|
|
@@ -168,7 +168,7 @@ client = Runloop(
|
|
|
168
168
|
)
|
|
169
169
|
|
|
170
170
|
# Or, configure per-request:
|
|
171
|
-
client.with_options(max_retries=5).
|
|
171
|
+
client.with_options(max_retries=5).blueprints.create()
|
|
172
172
|
```
|
|
173
173
|
|
|
174
174
|
### Timeouts
|
|
@@ -191,7 +191,7 @@ client = Runloop(
|
|
|
191
191
|
)
|
|
192
192
|
|
|
193
193
|
# Override per-request:
|
|
194
|
-
client.with_options(timeout=5.0).
|
|
194
|
+
client.with_options(timeout=5.0).blueprints.create()
|
|
195
195
|
```
|
|
196
196
|
|
|
197
197
|
On timeout, an `APITimeoutError` is thrown.
|
|
@@ -230,11 +230,11 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
|
|
|
230
230
|
from runloop_api_client import Runloop
|
|
231
231
|
|
|
232
232
|
client = Runloop()
|
|
233
|
-
response = client.
|
|
233
|
+
response = client.blueprints.with_raw_response.create()
|
|
234
234
|
print(response.headers.get('X-My-Header'))
|
|
235
235
|
|
|
236
|
-
|
|
237
|
-
print(
|
|
236
|
+
blueprint = response.parse() # get the object that `blueprints.create()` would have returned
|
|
237
|
+
print(blueprint.id)
|
|
238
238
|
```
|
|
239
239
|
|
|
240
240
|
These methods return an [`APIResponse`](https://github.com/runloopai/api-client-python/tree/main/src/runloop_api_client/_response.py) object.
|
|
@@ -248,7 +248,7 @@ The above interface eagerly reads the full response body when you make the reque
|
|
|
248
248
|
To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.
|
|
249
249
|
|
|
250
250
|
```python
|
|
251
|
-
with client.
|
|
251
|
+
with client.blueprints.with_streaming_response.create() as response:
|
|
252
252
|
print(response.headers.get("X-My-Header"))
|
|
253
253
|
|
|
254
254
|
for line in response.iter_lines():
|
|
@@ -29,16 +29,16 @@ from runloop_api_client import Runloop
|
|
|
29
29
|
|
|
30
30
|
client = Runloop(
|
|
31
31
|
# This is the default and can be omitted
|
|
32
|
-
bearer_token=os.environ.get("
|
|
32
|
+
bearer_token=os.environ.get("RUNLOOP_API_KEY"),
|
|
33
33
|
)
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
print(
|
|
35
|
+
blueprint_view = client.blueprints.create()
|
|
36
|
+
print(blueprint_view.id)
|
|
37
37
|
```
|
|
38
38
|
|
|
39
39
|
While you can provide a `bearer_token` keyword argument,
|
|
40
40
|
we recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)
|
|
41
|
-
to add `
|
|
41
|
+
to add `RUNLOOP_API_KEY="My Bearer Token"` to your `.env` file
|
|
42
42
|
so that your Bearer Token is not stored in source control.
|
|
43
43
|
|
|
44
44
|
## Async usage
|
|
@@ -52,13 +52,13 @@ from runloop_api_client import AsyncRunloop
|
|
|
52
52
|
|
|
53
53
|
client = AsyncRunloop(
|
|
54
54
|
# This is the default and can be omitted
|
|
55
|
-
bearer_token=os.environ.get("
|
|
55
|
+
bearer_token=os.environ.get("RUNLOOP_API_KEY"),
|
|
56
56
|
)
|
|
57
57
|
|
|
58
58
|
|
|
59
59
|
async def main() -> None:
|
|
60
|
-
|
|
61
|
-
print(
|
|
60
|
+
blueprint_view = await client.blueprints.create()
|
|
61
|
+
print(blueprint_view.id)
|
|
62
62
|
|
|
63
63
|
|
|
64
64
|
asyncio.run(main())
|
|
@@ -91,7 +91,7 @@ from runloop_api_client import Runloop
|
|
|
91
91
|
client = Runloop()
|
|
92
92
|
|
|
93
93
|
try:
|
|
94
|
-
client.
|
|
94
|
+
client.blueprints.create()
|
|
95
95
|
except runloop_api_client.APIConnectionError as e:
|
|
96
96
|
print("The server could not be reached")
|
|
97
97
|
print(e.__cause__) # an underlying Exception, likely raised within httpx.
|
|
@@ -134,7 +134,7 @@ client = Runloop(
|
|
|
134
134
|
)
|
|
135
135
|
|
|
136
136
|
# Or, configure per-request:
|
|
137
|
-
client.with_options(max_retries=5).
|
|
137
|
+
client.with_options(max_retries=5).blueprints.create()
|
|
138
138
|
```
|
|
139
139
|
|
|
140
140
|
### Timeouts
|
|
@@ -157,7 +157,7 @@ client = Runloop(
|
|
|
157
157
|
)
|
|
158
158
|
|
|
159
159
|
# Override per-request:
|
|
160
|
-
client.with_options(timeout=5.0).
|
|
160
|
+
client.with_options(timeout=5.0).blueprints.create()
|
|
161
161
|
```
|
|
162
162
|
|
|
163
163
|
On timeout, an `APITimeoutError` is thrown.
|
|
@@ -196,11 +196,11 @@ The "raw" Response object can be accessed by prefixing `.with_raw_response.` to
|
|
|
196
196
|
from runloop_api_client import Runloop
|
|
197
197
|
|
|
198
198
|
client = Runloop()
|
|
199
|
-
response = client.
|
|
199
|
+
response = client.blueprints.with_raw_response.create()
|
|
200
200
|
print(response.headers.get('X-My-Header'))
|
|
201
201
|
|
|
202
|
-
|
|
203
|
-
print(
|
|
202
|
+
blueprint = response.parse() # get the object that `blueprints.create()` would have returned
|
|
203
|
+
print(blueprint.id)
|
|
204
204
|
```
|
|
205
205
|
|
|
206
206
|
These methods return an [`APIResponse`](https://github.com/runloopai/api-client-python/tree/main/src/runloop_api_client/_response.py) object.
|
|
@@ -214,7 +214,7 @@ The above interface eagerly reads the full response body when you make the reque
|
|
|
214
214
|
To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.
|
|
215
215
|
|
|
216
216
|
```python
|
|
217
|
-
with client.
|
|
217
|
+
with client.blueprints.with_streaming_response.create() as response:
|
|
218
218
|
print(response.headers.get("X-My-Header"))
|
|
219
219
|
|
|
220
220
|
for line in response.iter_lines():
|
|
@@ -4,6 +4,45 @@
|
|
|
4
4
|
from runloop_api_client.types import ProjectLogsView
|
|
5
5
|
```
|
|
6
6
|
|
|
7
|
+
# Account
|
|
8
|
+
|
|
9
|
+
Types:
|
|
10
|
+
|
|
11
|
+
```python
|
|
12
|
+
from runloop_api_client.types import ResourceSize
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
# Blueprints
|
|
16
|
+
|
|
17
|
+
Types:
|
|
18
|
+
|
|
19
|
+
```python
|
|
20
|
+
from runloop_api_client.types import (
|
|
21
|
+
BlueprintBuildLog,
|
|
22
|
+
BlueprintBuildLogsListView,
|
|
23
|
+
BlueprintBuildParameters,
|
|
24
|
+
BlueprintListView,
|
|
25
|
+
BlueprintPreviewView,
|
|
26
|
+
BlueprintView,
|
|
27
|
+
)
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Methods:
|
|
31
|
+
|
|
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>
|
|
33
|
+
- <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_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>
|
|
37
|
+
|
|
38
|
+
# Code
|
|
39
|
+
|
|
40
|
+
Types:
|
|
41
|
+
|
|
42
|
+
```python
|
|
43
|
+
from runloop_api_client.types import CodeMountParameters
|
|
44
|
+
```
|
|
45
|
+
|
|
7
46
|
# Devboxes
|
|
8
47
|
|
|
9
48
|
Types:
|
|
@@ -46,6 +46,7 @@ __all__ = [
|
|
|
46
46
|
|
|
47
47
|
|
|
48
48
|
class Runloop(SyncAPIClient):
|
|
49
|
+
blueprints: resources.BlueprintsResource
|
|
49
50
|
devboxes: resources.DevboxesResource
|
|
50
51
|
functions: resources.FunctionsResource
|
|
51
52
|
projects: resources.ProjectsResource
|
|
@@ -80,13 +81,13 @@ class Runloop(SyncAPIClient):
|
|
|
80
81
|
) -> None:
|
|
81
82
|
"""Construct a new synchronous runloop client instance.
|
|
82
83
|
|
|
83
|
-
This automatically infers the `bearer_token` argument from the `
|
|
84
|
+
This automatically infers the `bearer_token` argument from the `RUNLOOP_API_KEY` environment variable if it is not provided.
|
|
84
85
|
"""
|
|
85
86
|
if bearer_token is None:
|
|
86
|
-
bearer_token = os.environ.get("
|
|
87
|
+
bearer_token = os.environ.get("RUNLOOP_API_KEY")
|
|
87
88
|
if bearer_token is None:
|
|
88
89
|
raise RunloopError(
|
|
89
|
-
"The bearer_token client option must be set either by passing bearer_token to the client or by setting the
|
|
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"
|
|
90
91
|
)
|
|
91
92
|
self.bearer_token = bearer_token
|
|
92
93
|
|
|
@@ -106,6 +107,7 @@ class Runloop(SyncAPIClient):
|
|
|
106
107
|
_strict_response_validation=_strict_response_validation,
|
|
107
108
|
)
|
|
108
109
|
|
|
110
|
+
self.blueprints = resources.BlueprintsResource(self)
|
|
109
111
|
self.devboxes = resources.DevboxesResource(self)
|
|
110
112
|
self.functions = resources.FunctionsResource(self)
|
|
111
113
|
self.projects = resources.ProjectsResource(self)
|
|
@@ -218,6 +220,7 @@ class Runloop(SyncAPIClient):
|
|
|
218
220
|
|
|
219
221
|
|
|
220
222
|
class AsyncRunloop(AsyncAPIClient):
|
|
223
|
+
blueprints: resources.AsyncBlueprintsResource
|
|
221
224
|
devboxes: resources.AsyncDevboxesResource
|
|
222
225
|
functions: resources.AsyncFunctionsResource
|
|
223
226
|
projects: resources.AsyncProjectsResource
|
|
@@ -252,13 +255,13 @@ class AsyncRunloop(AsyncAPIClient):
|
|
|
252
255
|
) -> None:
|
|
253
256
|
"""Construct a new async runloop client instance.
|
|
254
257
|
|
|
255
|
-
This automatically infers the `bearer_token` argument from the `
|
|
258
|
+
This automatically infers the `bearer_token` argument from the `RUNLOOP_API_KEY` environment variable if it is not provided.
|
|
256
259
|
"""
|
|
257
260
|
if bearer_token is None:
|
|
258
|
-
bearer_token = os.environ.get("
|
|
261
|
+
bearer_token = os.environ.get("RUNLOOP_API_KEY")
|
|
259
262
|
if bearer_token is None:
|
|
260
263
|
raise RunloopError(
|
|
261
|
-
"The bearer_token client option must be set either by passing bearer_token to the client or by setting the
|
|
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"
|
|
262
265
|
)
|
|
263
266
|
self.bearer_token = bearer_token
|
|
264
267
|
|
|
@@ -278,6 +281,7 @@ class AsyncRunloop(AsyncAPIClient):
|
|
|
278
281
|
_strict_response_validation=_strict_response_validation,
|
|
279
282
|
)
|
|
280
283
|
|
|
284
|
+
self.blueprints = resources.AsyncBlueprintsResource(self)
|
|
281
285
|
self.devboxes = resources.AsyncDevboxesResource(self)
|
|
282
286
|
self.functions = resources.AsyncFunctionsResource(self)
|
|
283
287
|
self.projects = resources.AsyncProjectsResource(self)
|
|
@@ -391,6 +395,7 @@ class AsyncRunloop(AsyncAPIClient):
|
|
|
391
395
|
|
|
392
396
|
class RunloopWithRawResponse:
|
|
393
397
|
def __init__(self, client: Runloop) -> None:
|
|
398
|
+
self.blueprints = resources.BlueprintsResourceWithRawResponse(client.blueprints)
|
|
394
399
|
self.devboxes = resources.DevboxesResourceWithRawResponse(client.devboxes)
|
|
395
400
|
self.functions = resources.FunctionsResourceWithRawResponse(client.functions)
|
|
396
401
|
self.projects = resources.ProjectsResourceWithRawResponse(client.projects)
|
|
@@ -398,6 +403,7 @@ class RunloopWithRawResponse:
|
|
|
398
403
|
|
|
399
404
|
class AsyncRunloopWithRawResponse:
|
|
400
405
|
def __init__(self, client: AsyncRunloop) -> None:
|
|
406
|
+
self.blueprints = resources.AsyncBlueprintsResourceWithRawResponse(client.blueprints)
|
|
401
407
|
self.devboxes = resources.AsyncDevboxesResourceWithRawResponse(client.devboxes)
|
|
402
408
|
self.functions = resources.AsyncFunctionsResourceWithRawResponse(client.functions)
|
|
403
409
|
self.projects = resources.AsyncProjectsResourceWithRawResponse(client.projects)
|
|
@@ -405,6 +411,7 @@ class AsyncRunloopWithRawResponse:
|
|
|
405
411
|
|
|
406
412
|
class RunloopWithStreamedResponse:
|
|
407
413
|
def __init__(self, client: Runloop) -> None:
|
|
414
|
+
self.blueprints = resources.BlueprintsResourceWithStreamingResponse(client.blueprints)
|
|
408
415
|
self.devboxes = resources.DevboxesResourceWithStreamingResponse(client.devboxes)
|
|
409
416
|
self.functions = resources.FunctionsResourceWithStreamingResponse(client.functions)
|
|
410
417
|
self.projects = resources.ProjectsResourceWithStreamingResponse(client.projects)
|
|
@@ -412,6 +419,7 @@ class RunloopWithStreamedResponse:
|
|
|
412
419
|
|
|
413
420
|
class AsyncRunloopWithStreamedResponse:
|
|
414
421
|
def __init__(self, client: AsyncRunloop) -> None:
|
|
422
|
+
self.blueprints = resources.AsyncBlueprintsResourceWithStreamingResponse(client.blueprints)
|
|
415
423
|
self.devboxes = resources.AsyncDevboxesResourceWithStreamingResponse(client.devboxes)
|
|
416
424
|
self.functions = resources.AsyncFunctionsResourceWithStreamingResponse(client.functions)
|
|
417
425
|
self.projects = resources.AsyncProjectsResourceWithStreamingResponse(client.projects)
|
|
@@ -406,6 +406,15 @@ def build(
|
|
|
406
406
|
return cast(_BaseModelT, construct_type(type_=base_model_cls, value=kwargs))
|
|
407
407
|
|
|
408
408
|
|
|
409
|
+
def construct_type_unchecked(*, value: object, type_: type[_T]) -> _T:
|
|
410
|
+
"""Loose coercion to the expected type with construction of nested values.
|
|
411
|
+
|
|
412
|
+
Note: the returned value from this function is not guaranteed to match the
|
|
413
|
+
given type.
|
|
414
|
+
"""
|
|
415
|
+
return cast(_T, construct_type(value=value, type_=type_))
|
|
416
|
+
|
|
417
|
+
|
|
409
418
|
def construct_type(*, value: object, type_: object) -> object:
|
|
410
419
|
"""Loose coercion to the expected type with construction of nested values.
|
|
411
420
|
|
|
@@ -24,8 +24,22 @@ from .functions import (
|
|
|
24
24
|
FunctionsResourceWithStreamingResponse,
|
|
25
25
|
AsyncFunctionsResourceWithStreamingResponse,
|
|
26
26
|
)
|
|
27
|
+
from .blueprints import (
|
|
28
|
+
BlueprintsResource,
|
|
29
|
+
AsyncBlueprintsResource,
|
|
30
|
+
BlueprintsResourceWithRawResponse,
|
|
31
|
+
AsyncBlueprintsResourceWithRawResponse,
|
|
32
|
+
BlueprintsResourceWithStreamingResponse,
|
|
33
|
+
AsyncBlueprintsResourceWithStreamingResponse,
|
|
34
|
+
)
|
|
27
35
|
|
|
28
36
|
__all__ = [
|
|
37
|
+
"BlueprintsResource",
|
|
38
|
+
"AsyncBlueprintsResource",
|
|
39
|
+
"BlueprintsResourceWithRawResponse",
|
|
40
|
+
"AsyncBlueprintsResourceWithRawResponse",
|
|
41
|
+
"BlueprintsResourceWithStreamingResponse",
|
|
42
|
+
"AsyncBlueprintsResourceWithStreamingResponse",
|
|
29
43
|
"DevboxesResource",
|
|
30
44
|
"AsyncDevboxesResource",
|
|
31
45
|
"DevboxesResourceWithRawResponse",
|