nimble_python 0.11.0__tar.gz → 0.13.0__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.
- {nimble_python-0.11.0 → nimble_python-0.13.0}/.gitignore +1 -0
- nimble_python-0.13.0/.release-please-manifest.json +3 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/CHANGELOG.md +37 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/PKG-INFO +2 -2
- {nimble_python-0.11.0 → nimble_python-0.13.0}/api.md +22 -1
- {nimble_python-0.11.0 → nimble_python-0.13.0}/pyproject.toml +2 -2
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/_client.py +150 -2
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/_compat.py +9 -2
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/_utils/__init__.py +1 -0
- nimble_python-0.13.0/src/nimble_python/_utils/_path.py +127 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/_version.py +1 -1
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/resources/__init__.py +14 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/resources/agent.py +3 -3
- nimble_python-0.13.0/src/nimble_python/resources/batches.py +305 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/resources/crawl.py +5 -5
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/resources/tasks.py +5 -5
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/__init__.py +4 -0
- nimble_python-0.13.0/src/nimble_python/types/batch_get_response.py +82 -0
- nimble_python-0.13.0/src/nimble_python/types/batch_progress_response.py +29 -0
- nimble_python-0.13.0/src/nimble_python/types/client_extract_batch_params.py +1084 -0
- nimble_python-0.13.0/src/nimble_python/types/extract_batch_response.py +68 -0
- nimble_python-0.13.0/tests/api_resources/test_batches.py +248 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/tests/api_resources/test_client.py +329 -0
- nimble_python-0.13.0/tests/test_utils/test_path.py +89 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/uv.lock +1 -1
- nimble_python-0.11.0/.release-please-manifest.json +0 -3
- {nimble_python-0.11.0 → nimble_python-0.13.0}/CONTRIBUTING.md +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/LICENSE +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/README.md +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/SECURITY.md +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/bin/check-release-environment +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/bin/publish-pypi +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/examples/.keep +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/release-please-config.json +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/requirements-dev.lock +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/__init__.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/_base_client.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/_constants.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/_exceptions.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/_files.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/_models.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/_qs.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/_resource.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/_response.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/_streaming.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/_types.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/_utils/_compat.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/_utils/_datetime_parse.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/_utils/_json.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/_utils/_logs.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/_utils/_proxy.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/_utils/_reflection.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/_utils/_resources_proxy.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/_utils/_streams.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/_utils/_sync.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/_utils/_transform.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/_utils/_typing.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/_utils/_utils.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/lib/.keep +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/py.typed +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/agent_get_response.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/agent_list_params.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/agent_list_response.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/agent_run_async_params.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/agent_run_async_response.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/agent_run_params.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/agent_run_response.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/client_extract_async_params.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/client_extract_params.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/client_map_params.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/client_search_params.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/crawl_list_params.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/crawl_list_response.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/crawl_run_params.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/crawl_run_response.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/crawl_status_response.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/crawl_terminate_response.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/extract_async_response.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/extract_response.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/map_response.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/search_response.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/shared/__init__.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/shared/auto_scroll_action.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/shared/click_action.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/shared/eval_action.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/shared/fetch_action.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/shared/fill_action.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/shared/get_cookies_action.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/shared/goto_action.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/shared/press_action.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/shared/screenshot_action.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/shared/scroll_action.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/shared/wait_action.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/shared/wait_for_element_action.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/shared/wait_for_navigation_action.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/shared_params/__init__.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/shared_params/auto_scroll_action.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/shared_params/click_action.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/shared_params/eval_action.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/shared_params/fetch_action.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/shared_params/fill_action.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/shared_params/get_cookies_action.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/shared_params/goto_action.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/shared_params/press_action.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/shared_params/screenshot_action.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/shared_params/scroll_action.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/shared_params/wait_action.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/shared_params/wait_for_element_action.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/shared_params/wait_for_navigation_action.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/task_get_response.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/task_list_params.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/task_list_response.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimble_python/types/task_results_response.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/src/nimbleway/lib/.keep +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/tests/__init__.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/tests/api_resources/__init__.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/tests/api_resources/test_agent.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/tests/api_resources/test_crawl.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/tests/api_resources/test_tasks.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/tests/conftest.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/tests/sample_file.txt +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/tests/test_client.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/tests/test_deepcopy.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/tests/test_extract_files.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/tests/test_files.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/tests/test_models.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/tests/test_qs.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/tests/test_required_args.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/tests/test_response.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/tests/test_streaming.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/tests/test_transform.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/tests/test_utils/test_datetime_parse.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/tests/test_utils/test_json.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/tests/test_utils/test_proxy.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/tests/test_utils/test_typing.py +0 -0
- {nimble_python-0.11.0 → nimble_python-0.13.0}/tests/utils.py +0 -0
|
@@ -1,5 +1,42 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.13.0 (2026-03-24)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.12.0...v0.13.0](https://github.com/Nimbleway/nimble-python/compare/v0.12.0...v0.13.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** manual updates ([17e730d](https://github.com/Nimbleway/nimble-python/commit/17e730d1f09b8cead6fa11cb68af9d8105dc57df))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* sanitize endpoint path params ([0c14c30](https://github.com/Nimbleway/nimble-python/commit/0c14c308e068da0c00affd197abb5ddd3b7f8ca2))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Chores
|
|
18
|
+
|
|
19
|
+
* **internal:** update gitignore ([f19a4e6](https://github.com/Nimbleway/nimble-python/commit/f19a4e6cea6039638d95e8b5f8d136a34149c63d))
|
|
20
|
+
|
|
21
|
+
## 0.12.0 (2026-03-18)
|
|
22
|
+
|
|
23
|
+
Full Changelog: [v0.11.0...v0.12.0](https://github.com/Nimbleway/nimble-python/compare/v0.11.0...v0.12.0)
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
* **api:** manual updates ([2ea15a2](https://github.com/Nimbleway/nimble-python/commit/2ea15a25dbbaecd0d19f81900c09b3cafc66aa56))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Bug Fixes
|
|
31
|
+
|
|
32
|
+
* **deps:** bump minimum typing-extensions version ([05fce2b](https://github.com/Nimbleway/nimble-python/commit/05fce2b345c4758ec79c97b11f3ed92d53036b61))
|
|
33
|
+
* **pydantic:** do not pass `by_alias` unless set ([1700093](https://github.com/Nimbleway/nimble-python/commit/170009336ff559e375736dbee881002fc4d5c0fe))
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### Chores
|
|
37
|
+
|
|
38
|
+
* **internal:** tweak CI branches ([8f134ca](https://github.com/Nimbleway/nimble-python/commit/8f134ca188d5af80631adf9865f5799ca8fe0f93))
|
|
39
|
+
|
|
3
40
|
## 0.11.0 (2026-03-10)
|
|
4
41
|
|
|
5
42
|
Full Changelog: [v0.10.0...v0.11.0](https://github.com/Nimbleway/nimble-python/compare/v0.10.0...v0.11.0)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: nimble_python
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.13.0
|
|
4
4
|
Summary: The official Python library for the nimble API
|
|
5
5
|
Project-URL: Homepage, https://github.com/Nimbleway/nimble-python
|
|
6
6
|
Project-URL: Repository, https://github.com/Nimbleway/nimble-python
|
|
@@ -27,7 +27,7 @@ Requires-Dist: distro<2,>=1.7.0
|
|
|
27
27
|
Requires-Dist: httpx<1,>=0.23.0
|
|
28
28
|
Requires-Dist: pydantic<3,>=1.9.0
|
|
29
29
|
Requires-Dist: sniffio
|
|
30
|
-
Requires-Dist: typing-extensions<5,>=4.
|
|
30
|
+
Requires-Dist: typing-extensions<5,>=4.14
|
|
31
31
|
Provides-Extra: aiohttp
|
|
32
32
|
Requires-Dist: aiohttp; extra == 'aiohttp'
|
|
33
33
|
Requires-Dist: httpx-aiohttp>=0.1.9; extra == 'aiohttp'
|
|
@@ -23,13 +23,20 @@ from nimble_python.types import (
|
|
|
23
23
|
Types:
|
|
24
24
|
|
|
25
25
|
```python
|
|
26
|
-
from nimble_python.types import
|
|
26
|
+
from nimble_python.types import (
|
|
27
|
+
ExtractResponse,
|
|
28
|
+
ExtractAsyncResponse,
|
|
29
|
+
ExtractBatchResponse,
|
|
30
|
+
MapResponse,
|
|
31
|
+
SearchResponse,
|
|
32
|
+
)
|
|
27
33
|
```
|
|
28
34
|
|
|
29
35
|
Methods:
|
|
30
36
|
|
|
31
37
|
- <code title="post /v1/extract">client.<a href="./src/nimble_python/_client.py">extract</a>(\*\*<a href="src/nimble_python/types/client_extract_params.py">params</a>) -> <a href="./src/nimble_python/types/extract_response.py">ExtractResponse</a></code>
|
|
32
38
|
- <code title="post /v1/extract/async">client.<a href="./src/nimble_python/_client.py">extract_async</a>(\*\*<a href="src/nimble_python/types/client_extract_async_params.py">params</a>) -> <a href="./src/nimble_python/types/extract_async_response.py">ExtractAsyncResponse</a></code>
|
|
39
|
+
- <code title="post /v1/extract/batch">client.<a href="./src/nimble_python/_client.py">extract_batch</a>(\*\*<a href="src/nimble_python/types/client_extract_batch_params.py">params</a>) -> <a href="./src/nimble_python/types/extract_batch_response.py">ExtractBatchResponse</a></code>
|
|
33
40
|
- <code title="post /v1/map">client.<a href="./src/nimble_python/_client.py">map</a>(\*\*<a href="src/nimble_python/types/client_map_params.py">params</a>) -> <a href="./src/nimble_python/types/map_response.py">MapResponse</a></code>
|
|
34
41
|
- <code title="post /v1/search">client.<a href="./src/nimble_python/_client.py">search</a>(\*\*<a href="src/nimble_python/types/client_search_params.py">params</a>) -> <a href="./src/nimble_python/types/search_response.py">SearchResponse</a></code>
|
|
35
42
|
|
|
@@ -86,3 +93,17 @@ Methods:
|
|
|
86
93
|
- <code title="get /v1/tasks">client.tasks.<a href="./src/nimble_python/resources/tasks.py">list</a>(\*\*<a href="src/nimble_python/types/task_list_params.py">params</a>) -> <a href="./src/nimble_python/types/task_list_response.py">TaskListResponse</a></code>
|
|
87
94
|
- <code title="get /v1/tasks/{task_id}">client.tasks.<a href="./src/nimble_python/resources/tasks.py">get</a>(task_id) -> <a href="./src/nimble_python/types/task_get_response.py">TaskGetResponse</a></code>
|
|
88
95
|
- <code title="get /v1/tasks/{task_id}/results">client.tasks.<a href="./src/nimble_python/resources/tasks.py">results</a>(task_id) -> <a href="./src/nimble_python/types/task_results_response.py">TaskResultsResponse</a></code>
|
|
96
|
+
|
|
97
|
+
# Batches
|
|
98
|
+
|
|
99
|
+
Types:
|
|
100
|
+
|
|
101
|
+
```python
|
|
102
|
+
from nimble_python.types import BatchGetResponse, BatchProgressResponse
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Methods:
|
|
106
|
+
|
|
107
|
+
- <code title="get /v1/batches">client.batches.<a href="./src/nimble_python/resources/batches.py">list</a>() -> None</code>
|
|
108
|
+
- <code title="get /v1/batches/{batch_id}">client.batches.<a href="./src/nimble_python/resources/batches.py">get</a>(batch_id) -> <a href="./src/nimble_python/types/batch_get_response.py">BatchGetResponse</a></code>
|
|
109
|
+
- <code title="get /v1/batches/{batch_id}/progress">client.batches.<a href="./src/nimble_python/resources/batches.py">progress</a>(batch_id) -> <a href="./src/nimble_python/types/batch_progress_response.py">BatchProgressResponse</a></code>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "nimble_python"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.13.0"
|
|
4
4
|
description = "The official Python library for the nimble API"
|
|
5
5
|
dynamic = ["readme"]
|
|
6
6
|
license = "Apache-2.0"
|
|
@@ -11,7 +11,7 @@ authors = [
|
|
|
11
11
|
dependencies = [
|
|
12
12
|
"httpx>=0.23.0, <1",
|
|
13
13
|
"pydantic>=1.9.0, <3",
|
|
14
|
-
"typing-extensions>=4.
|
|
14
|
+
"typing-extensions>=4.14, <5",
|
|
15
15
|
"anyio>=3.5.0, <5",
|
|
16
16
|
"distro>=1.7.0, <2",
|
|
17
17
|
"sniffio",
|
|
@@ -10,7 +10,13 @@ import httpx
|
|
|
10
10
|
|
|
11
11
|
from . import _exceptions
|
|
12
12
|
from ._qs import Querystring
|
|
13
|
-
from .types import
|
|
13
|
+
from .types import (
|
|
14
|
+
client_map_params,
|
|
15
|
+
client_search_params,
|
|
16
|
+
client_extract_params,
|
|
17
|
+
client_extract_async_params,
|
|
18
|
+
client_extract_batch_params,
|
|
19
|
+
)
|
|
14
20
|
from ._types import (
|
|
15
21
|
Body,
|
|
16
22
|
Omit,
|
|
@@ -51,12 +57,14 @@ from .types.map_response import MapResponse
|
|
|
51
57
|
from .types.search_response import SearchResponse
|
|
52
58
|
from .types.extract_response import ExtractResponse
|
|
53
59
|
from .types.extract_async_response import ExtractAsyncResponse
|
|
60
|
+
from .types.extract_batch_response import ExtractBatchResponse
|
|
54
61
|
|
|
55
62
|
if TYPE_CHECKING:
|
|
56
|
-
from .resources import agent, crawl, tasks
|
|
63
|
+
from .resources import agent, crawl, tasks, batches
|
|
57
64
|
from .resources.agent import AgentResource, AsyncAgentResource
|
|
58
65
|
from .resources.crawl import CrawlResource, AsyncCrawlResource
|
|
59
66
|
from .resources.tasks import TasksResource, AsyncTasksResource
|
|
67
|
+
from .resources.batches import BatchesResource, AsyncBatchesResource
|
|
60
68
|
|
|
61
69
|
__all__ = ["Timeout", "Transport", "ProxiesTypes", "RequestOptions", "Nimble", "AsyncNimble", "Client", "AsyncClient"]
|
|
62
70
|
|
|
@@ -130,6 +138,12 @@ class Nimble(SyncAPIClient):
|
|
|
130
138
|
|
|
131
139
|
return TasksResource(self)
|
|
132
140
|
|
|
141
|
+
@cached_property
|
|
142
|
+
def batches(self) -> BatchesResource:
|
|
143
|
+
from .resources.batches import BatchesResource
|
|
144
|
+
|
|
145
|
+
return BatchesResource(self)
|
|
146
|
+
|
|
133
147
|
@cached_property
|
|
134
148
|
def with_raw_response(self) -> NimbleWithRawResponse:
|
|
135
149
|
return NimbleWithRawResponse(self)
|
|
@@ -2220,6 +2234,52 @@ class Nimble(SyncAPIClient):
|
|
|
2220
2234
|
cast_to=ExtractAsyncResponse,
|
|
2221
2235
|
)
|
|
2222
2236
|
|
|
2237
|
+
def extract_batch(
|
|
2238
|
+
self,
|
|
2239
|
+
*,
|
|
2240
|
+
params: Iterable[client_extract_batch_params.Param],
|
|
2241
|
+
shared_params: client_extract_batch_params.SharedParams | Omit = omit,
|
|
2242
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
2243
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
2244
|
+
extra_headers: Headers | None = None,
|
|
2245
|
+
extra_query: Query | None = None,
|
|
2246
|
+
extra_body: Body | None = None,
|
|
2247
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
2248
|
+
) -> ExtractBatchResponse:
|
|
2249
|
+
"""Extract Batch Endpoint
|
|
2250
|
+
|
|
2251
|
+
Args:
|
|
2252
|
+
params: Array of extraction requests.
|
|
2253
|
+
|
|
2254
|
+
Each object represents one extraction with its own
|
|
2255
|
+
parameters.
|
|
2256
|
+
|
|
2257
|
+
shared_params: Shared parameters applied to the entire batch, such as storage and callback
|
|
2258
|
+
configuration.
|
|
2259
|
+
|
|
2260
|
+
extra_headers: Send extra headers
|
|
2261
|
+
|
|
2262
|
+
extra_query: Add additional query parameters to the request
|
|
2263
|
+
|
|
2264
|
+
extra_body: Add additional JSON properties to the request
|
|
2265
|
+
|
|
2266
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
2267
|
+
"""
|
|
2268
|
+
return self.post(
|
|
2269
|
+
"/v1/extract/batch",
|
|
2270
|
+
body=maybe_transform(
|
|
2271
|
+
{
|
|
2272
|
+
"params": params,
|
|
2273
|
+
"shared_params": shared_params,
|
|
2274
|
+
},
|
|
2275
|
+
client_extract_batch_params.ClientExtractBatchParams,
|
|
2276
|
+
),
|
|
2277
|
+
options=make_request_options(
|
|
2278
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
2279
|
+
),
|
|
2280
|
+
cast_to=ExtractBatchResponse,
|
|
2281
|
+
)
|
|
2282
|
+
|
|
2223
2283
|
def map(
|
|
2224
2284
|
self,
|
|
2225
2285
|
*,
|
|
@@ -3278,6 +3338,12 @@ class AsyncNimble(AsyncAPIClient):
|
|
|
3278
3338
|
|
|
3279
3339
|
return AsyncTasksResource(self)
|
|
3280
3340
|
|
|
3341
|
+
@cached_property
|
|
3342
|
+
def batches(self) -> AsyncBatchesResource:
|
|
3343
|
+
from .resources.batches import AsyncBatchesResource
|
|
3344
|
+
|
|
3345
|
+
return AsyncBatchesResource(self)
|
|
3346
|
+
|
|
3281
3347
|
@cached_property
|
|
3282
3348
|
def with_raw_response(self) -> AsyncNimbleWithRawResponse:
|
|
3283
3349
|
return AsyncNimbleWithRawResponse(self)
|
|
@@ -5368,6 +5434,52 @@ class AsyncNimble(AsyncAPIClient):
|
|
|
5368
5434
|
cast_to=ExtractAsyncResponse,
|
|
5369
5435
|
)
|
|
5370
5436
|
|
|
5437
|
+
async def extract_batch(
|
|
5438
|
+
self,
|
|
5439
|
+
*,
|
|
5440
|
+
params: Iterable[client_extract_batch_params.Param],
|
|
5441
|
+
shared_params: client_extract_batch_params.SharedParams | Omit = omit,
|
|
5442
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
5443
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
5444
|
+
extra_headers: Headers | None = None,
|
|
5445
|
+
extra_query: Query | None = None,
|
|
5446
|
+
extra_body: Body | None = None,
|
|
5447
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
5448
|
+
) -> ExtractBatchResponse:
|
|
5449
|
+
"""Extract Batch Endpoint
|
|
5450
|
+
|
|
5451
|
+
Args:
|
|
5452
|
+
params: Array of extraction requests.
|
|
5453
|
+
|
|
5454
|
+
Each object represents one extraction with its own
|
|
5455
|
+
parameters.
|
|
5456
|
+
|
|
5457
|
+
shared_params: Shared parameters applied to the entire batch, such as storage and callback
|
|
5458
|
+
configuration.
|
|
5459
|
+
|
|
5460
|
+
extra_headers: Send extra headers
|
|
5461
|
+
|
|
5462
|
+
extra_query: Add additional query parameters to the request
|
|
5463
|
+
|
|
5464
|
+
extra_body: Add additional JSON properties to the request
|
|
5465
|
+
|
|
5466
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
5467
|
+
"""
|
|
5468
|
+
return await self.post(
|
|
5469
|
+
"/v1/extract/batch",
|
|
5470
|
+
body=await async_maybe_transform(
|
|
5471
|
+
{
|
|
5472
|
+
"params": params,
|
|
5473
|
+
"shared_params": shared_params,
|
|
5474
|
+
},
|
|
5475
|
+
client_extract_batch_params.ClientExtractBatchParams,
|
|
5476
|
+
),
|
|
5477
|
+
options=make_request_options(
|
|
5478
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
5479
|
+
),
|
|
5480
|
+
cast_to=ExtractBatchResponse,
|
|
5481
|
+
)
|
|
5482
|
+
|
|
5371
5483
|
async def map(
|
|
5372
5484
|
self,
|
|
5373
5485
|
*,
|
|
@@ -6369,6 +6481,9 @@ class NimbleWithRawResponse:
|
|
|
6369
6481
|
self.extract_async = to_raw_response_wrapper(
|
|
6370
6482
|
client.extract_async,
|
|
6371
6483
|
)
|
|
6484
|
+
self.extract_batch = to_raw_response_wrapper(
|
|
6485
|
+
client.extract_batch,
|
|
6486
|
+
)
|
|
6372
6487
|
self.map = to_raw_response_wrapper(
|
|
6373
6488
|
client.map,
|
|
6374
6489
|
)
|
|
@@ -6394,6 +6509,12 @@ class NimbleWithRawResponse:
|
|
|
6394
6509
|
|
|
6395
6510
|
return TasksResourceWithRawResponse(self._client.tasks)
|
|
6396
6511
|
|
|
6512
|
+
@cached_property
|
|
6513
|
+
def batches(self) -> batches.BatchesResourceWithRawResponse:
|
|
6514
|
+
from .resources.batches import BatchesResourceWithRawResponse
|
|
6515
|
+
|
|
6516
|
+
return BatchesResourceWithRawResponse(self._client.batches)
|
|
6517
|
+
|
|
6397
6518
|
|
|
6398
6519
|
class AsyncNimbleWithRawResponse:
|
|
6399
6520
|
_client: AsyncNimble
|
|
@@ -6407,6 +6528,9 @@ class AsyncNimbleWithRawResponse:
|
|
|
6407
6528
|
self.extract_async = async_to_raw_response_wrapper(
|
|
6408
6529
|
client.extract_async,
|
|
6409
6530
|
)
|
|
6531
|
+
self.extract_batch = async_to_raw_response_wrapper(
|
|
6532
|
+
client.extract_batch,
|
|
6533
|
+
)
|
|
6410
6534
|
self.map = async_to_raw_response_wrapper(
|
|
6411
6535
|
client.map,
|
|
6412
6536
|
)
|
|
@@ -6432,6 +6556,12 @@ class AsyncNimbleWithRawResponse:
|
|
|
6432
6556
|
|
|
6433
6557
|
return AsyncTasksResourceWithRawResponse(self._client.tasks)
|
|
6434
6558
|
|
|
6559
|
+
@cached_property
|
|
6560
|
+
def batches(self) -> batches.AsyncBatchesResourceWithRawResponse:
|
|
6561
|
+
from .resources.batches import AsyncBatchesResourceWithRawResponse
|
|
6562
|
+
|
|
6563
|
+
return AsyncBatchesResourceWithRawResponse(self._client.batches)
|
|
6564
|
+
|
|
6435
6565
|
|
|
6436
6566
|
class NimbleWithStreamedResponse:
|
|
6437
6567
|
_client: Nimble
|
|
@@ -6445,6 +6575,9 @@ class NimbleWithStreamedResponse:
|
|
|
6445
6575
|
self.extract_async = to_streamed_response_wrapper(
|
|
6446
6576
|
client.extract_async,
|
|
6447
6577
|
)
|
|
6578
|
+
self.extract_batch = to_streamed_response_wrapper(
|
|
6579
|
+
client.extract_batch,
|
|
6580
|
+
)
|
|
6448
6581
|
self.map = to_streamed_response_wrapper(
|
|
6449
6582
|
client.map,
|
|
6450
6583
|
)
|
|
@@ -6470,6 +6603,12 @@ class NimbleWithStreamedResponse:
|
|
|
6470
6603
|
|
|
6471
6604
|
return TasksResourceWithStreamingResponse(self._client.tasks)
|
|
6472
6605
|
|
|
6606
|
+
@cached_property
|
|
6607
|
+
def batches(self) -> batches.BatchesResourceWithStreamingResponse:
|
|
6608
|
+
from .resources.batches import BatchesResourceWithStreamingResponse
|
|
6609
|
+
|
|
6610
|
+
return BatchesResourceWithStreamingResponse(self._client.batches)
|
|
6611
|
+
|
|
6473
6612
|
|
|
6474
6613
|
class AsyncNimbleWithStreamedResponse:
|
|
6475
6614
|
_client: AsyncNimble
|
|
@@ -6483,6 +6622,9 @@ class AsyncNimbleWithStreamedResponse:
|
|
|
6483
6622
|
self.extract_async = async_to_streamed_response_wrapper(
|
|
6484
6623
|
client.extract_async,
|
|
6485
6624
|
)
|
|
6625
|
+
self.extract_batch = async_to_streamed_response_wrapper(
|
|
6626
|
+
client.extract_batch,
|
|
6627
|
+
)
|
|
6486
6628
|
self.map = async_to_streamed_response_wrapper(
|
|
6487
6629
|
client.map,
|
|
6488
6630
|
)
|
|
@@ -6508,6 +6650,12 @@ class AsyncNimbleWithStreamedResponse:
|
|
|
6508
6650
|
|
|
6509
6651
|
return AsyncTasksResourceWithStreamingResponse(self._client.tasks)
|
|
6510
6652
|
|
|
6653
|
+
@cached_property
|
|
6654
|
+
def batches(self) -> batches.AsyncBatchesResourceWithStreamingResponse:
|
|
6655
|
+
from .resources.batches import AsyncBatchesResourceWithStreamingResponse
|
|
6656
|
+
|
|
6657
|
+
return AsyncBatchesResourceWithStreamingResponse(self._client.batches)
|
|
6658
|
+
|
|
6511
6659
|
|
|
6512
6660
|
Client = Nimble
|
|
6513
6661
|
|
|
@@ -2,7 +2,7 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
from typing import TYPE_CHECKING, Any, Union, Generic, TypeVar, Callable, cast, overload
|
|
4
4
|
from datetime import date, datetime
|
|
5
|
-
from typing_extensions import Self, Literal
|
|
5
|
+
from typing_extensions import Self, Literal, TypedDict
|
|
6
6
|
|
|
7
7
|
import pydantic
|
|
8
8
|
from pydantic.fields import FieldInfo
|
|
@@ -131,6 +131,10 @@ def model_json(model: pydantic.BaseModel, *, indent: int | None = None) -> str:
|
|
|
131
131
|
return model.model_dump_json(indent=indent)
|
|
132
132
|
|
|
133
133
|
|
|
134
|
+
class _ModelDumpKwargs(TypedDict, total=False):
|
|
135
|
+
by_alias: bool
|
|
136
|
+
|
|
137
|
+
|
|
134
138
|
def model_dump(
|
|
135
139
|
model: pydantic.BaseModel,
|
|
136
140
|
*,
|
|
@@ -142,6 +146,9 @@ def model_dump(
|
|
|
142
146
|
by_alias: bool | None = None,
|
|
143
147
|
) -> dict[str, Any]:
|
|
144
148
|
if (not PYDANTIC_V1) or hasattr(model, "model_dump"):
|
|
149
|
+
kwargs: _ModelDumpKwargs = {}
|
|
150
|
+
if by_alias is not None:
|
|
151
|
+
kwargs["by_alias"] = by_alias
|
|
145
152
|
return model.model_dump(
|
|
146
153
|
mode=mode,
|
|
147
154
|
exclude=exclude,
|
|
@@ -149,7 +156,7 @@ def model_dump(
|
|
|
149
156
|
exclude_defaults=exclude_defaults,
|
|
150
157
|
# warnings are not supported in Pydantic v1
|
|
151
158
|
warnings=True if PYDANTIC_V1 else warnings,
|
|
152
|
-
|
|
159
|
+
**kwargs,
|
|
153
160
|
)
|
|
154
161
|
return cast(
|
|
155
162
|
"dict[str, Any]",
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import re
|
|
4
|
+
from typing import (
|
|
5
|
+
Any,
|
|
6
|
+
Mapping,
|
|
7
|
+
Callable,
|
|
8
|
+
)
|
|
9
|
+
from urllib.parse import quote
|
|
10
|
+
|
|
11
|
+
# Matches '.' or '..' where each dot is either literal or percent-encoded (%2e / %2E).
|
|
12
|
+
_DOT_SEGMENT_RE = re.compile(r"^(?:\.|%2[eE]){1,2}$")
|
|
13
|
+
|
|
14
|
+
_PLACEHOLDER_RE = re.compile(r"\{(\w+)\}")
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def _quote_path_segment_part(value: str) -> str:
|
|
18
|
+
"""Percent-encode `value` for use in a URI path segment.
|
|
19
|
+
|
|
20
|
+
Considers characters not in `pchar` set from RFC 3986 §3.3 to be unsafe.
|
|
21
|
+
https://datatracker.ietf.org/doc/html/rfc3986#section-3.3
|
|
22
|
+
"""
|
|
23
|
+
# quote() already treats unreserved characters (letters, digits, and -._~)
|
|
24
|
+
# as safe, so we only need to add sub-delims, ':', and '@'.
|
|
25
|
+
# Notably, unlike the default `safe` for quote(), / is unsafe and must be quoted.
|
|
26
|
+
return quote(value, safe="!$&'()*+,;=:@")
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def _quote_query_part(value: str) -> str:
|
|
30
|
+
"""Percent-encode `value` for use in a URI query string.
|
|
31
|
+
|
|
32
|
+
Considers &, = and characters not in `query` set from RFC 3986 §3.4 to be unsafe.
|
|
33
|
+
https://datatracker.ietf.org/doc/html/rfc3986#section-3.4
|
|
34
|
+
"""
|
|
35
|
+
return quote(value, safe="!$'()*+,;:@/?")
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def _quote_fragment_part(value: str) -> str:
|
|
39
|
+
"""Percent-encode `value` for use in a URI fragment.
|
|
40
|
+
|
|
41
|
+
Considers characters not in `fragment` set from RFC 3986 §3.5 to be unsafe.
|
|
42
|
+
https://datatracker.ietf.org/doc/html/rfc3986#section-3.5
|
|
43
|
+
"""
|
|
44
|
+
return quote(value, safe="!$&'()*+,;=:@/?")
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def _interpolate(
|
|
48
|
+
template: str,
|
|
49
|
+
values: Mapping[str, Any],
|
|
50
|
+
quoter: Callable[[str], str],
|
|
51
|
+
) -> str:
|
|
52
|
+
"""Replace {name} placeholders in `template`, quoting each value with `quoter`.
|
|
53
|
+
|
|
54
|
+
Placeholder names are looked up in `values`.
|
|
55
|
+
|
|
56
|
+
Raises:
|
|
57
|
+
KeyError: If a placeholder is not found in `values`.
|
|
58
|
+
"""
|
|
59
|
+
# re.split with a capturing group returns alternating
|
|
60
|
+
# [text, name, text, name, ..., text] elements.
|
|
61
|
+
parts = _PLACEHOLDER_RE.split(template)
|
|
62
|
+
|
|
63
|
+
for i in range(1, len(parts), 2):
|
|
64
|
+
name = parts[i]
|
|
65
|
+
if name not in values:
|
|
66
|
+
raise KeyError(f"a value for placeholder {{{name}}} was not provided")
|
|
67
|
+
val = values[name]
|
|
68
|
+
if val is None:
|
|
69
|
+
parts[i] = "null"
|
|
70
|
+
elif isinstance(val, bool):
|
|
71
|
+
parts[i] = "true" if val else "false"
|
|
72
|
+
else:
|
|
73
|
+
parts[i] = quoter(str(values[name]))
|
|
74
|
+
|
|
75
|
+
return "".join(parts)
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def path_template(template: str, /, **kwargs: Any) -> str:
|
|
79
|
+
"""Interpolate {name} placeholders in `template` from keyword arguments.
|
|
80
|
+
|
|
81
|
+
Args:
|
|
82
|
+
template: The template string containing {name} placeholders.
|
|
83
|
+
**kwargs: Keyword arguments to interpolate into the template.
|
|
84
|
+
|
|
85
|
+
Returns:
|
|
86
|
+
The template with placeholders interpolated and percent-encoded.
|
|
87
|
+
|
|
88
|
+
Safe characters for percent-encoding are dependent on the URI component.
|
|
89
|
+
Placeholders in path and fragment portions are percent-encoded where the `segment`
|
|
90
|
+
and `fragment` sets from RFC 3986 respectively are considered safe.
|
|
91
|
+
Placeholders in the query portion are percent-encoded where the `query` set from
|
|
92
|
+
RFC 3986 §3.3 is considered safe except for = and & characters.
|
|
93
|
+
|
|
94
|
+
Raises:
|
|
95
|
+
KeyError: If a placeholder is not found in `kwargs`.
|
|
96
|
+
ValueError: If resulting path contains /./ or /../ segments (including percent-encoded dot-segments).
|
|
97
|
+
"""
|
|
98
|
+
# Split the template into path, query, and fragment portions.
|
|
99
|
+
fragment_template: str | None = None
|
|
100
|
+
query_template: str | None = None
|
|
101
|
+
|
|
102
|
+
rest = template
|
|
103
|
+
if "#" in rest:
|
|
104
|
+
rest, fragment_template = rest.split("#", 1)
|
|
105
|
+
if "?" in rest:
|
|
106
|
+
rest, query_template = rest.split("?", 1)
|
|
107
|
+
path_template = rest
|
|
108
|
+
|
|
109
|
+
# Interpolate each portion with the appropriate quoting rules.
|
|
110
|
+
path_result = _interpolate(path_template, kwargs, _quote_path_segment_part)
|
|
111
|
+
|
|
112
|
+
# Reject dot-segments (. and ..) in the final assembled path. The check
|
|
113
|
+
# runs after interpolation so that adjacent placeholders or a mix of static
|
|
114
|
+
# text and placeholders that together form a dot-segment are caught.
|
|
115
|
+
# Also reject percent-encoded dot-segments to protect against incorrectly
|
|
116
|
+
# implemented normalization in servers/proxies.
|
|
117
|
+
for segment in path_result.split("/"):
|
|
118
|
+
if _DOT_SEGMENT_RE.match(segment):
|
|
119
|
+
raise ValueError(f"Constructed path {path_result!r} contains dot-segment {segment!r} which is not allowed")
|
|
120
|
+
|
|
121
|
+
result = path_result
|
|
122
|
+
if query_template is not None:
|
|
123
|
+
result += "?" + _interpolate(query_template, kwargs, _quote_query_part)
|
|
124
|
+
if fragment_template is not None:
|
|
125
|
+
result += "#" + _interpolate(fragment_template, kwargs, _quote_fragment_part)
|
|
126
|
+
|
|
127
|
+
return result
|
|
@@ -24,6 +24,14 @@ from .tasks import (
|
|
|
24
24
|
TasksResourceWithStreamingResponse,
|
|
25
25
|
AsyncTasksResourceWithStreamingResponse,
|
|
26
26
|
)
|
|
27
|
+
from .batches import (
|
|
28
|
+
BatchesResource,
|
|
29
|
+
AsyncBatchesResource,
|
|
30
|
+
BatchesResourceWithRawResponse,
|
|
31
|
+
AsyncBatchesResourceWithRawResponse,
|
|
32
|
+
BatchesResourceWithStreamingResponse,
|
|
33
|
+
AsyncBatchesResourceWithStreamingResponse,
|
|
34
|
+
)
|
|
27
35
|
|
|
28
36
|
__all__ = [
|
|
29
37
|
"AgentResource",
|
|
@@ -44,4 +52,10 @@ __all__ = [
|
|
|
44
52
|
"AsyncTasksResourceWithRawResponse",
|
|
45
53
|
"TasksResourceWithStreamingResponse",
|
|
46
54
|
"AsyncTasksResourceWithStreamingResponse",
|
|
55
|
+
"BatchesResource",
|
|
56
|
+
"AsyncBatchesResource",
|
|
57
|
+
"BatchesResourceWithRawResponse",
|
|
58
|
+
"AsyncBatchesResourceWithRawResponse",
|
|
59
|
+
"BatchesResourceWithStreamingResponse",
|
|
60
|
+
"AsyncBatchesResourceWithStreamingResponse",
|
|
47
61
|
]
|
|
@@ -9,7 +9,7 @@ import httpx
|
|
|
9
9
|
|
|
10
10
|
from ..types import agent_run_params, agent_list_params, agent_run_async_params
|
|
11
11
|
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
|
12
|
-
from .._utils import maybe_transform, async_maybe_transform
|
|
12
|
+
from .._utils import path_template, maybe_transform, async_maybe_transform
|
|
13
13
|
from .._compat import cached_property
|
|
14
14
|
from .._resource import SyncAPIResource, AsyncAPIResource
|
|
15
15
|
from .._response import (
|
|
@@ -131,7 +131,7 @@ class AgentResource(SyncAPIResource):
|
|
|
131
131
|
if not template_name:
|
|
132
132
|
raise ValueError(f"Expected a non-empty value for `template_name` but received {template_name!r}")
|
|
133
133
|
return self._get(
|
|
134
|
-
|
|
134
|
+
path_template("/v1/agents/{template_name}", template_name=template_name),
|
|
135
135
|
options=make_request_options(
|
|
136
136
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
137
137
|
),
|
|
@@ -345,7 +345,7 @@ class AsyncAgentResource(AsyncAPIResource):
|
|
|
345
345
|
if not template_name:
|
|
346
346
|
raise ValueError(f"Expected a non-empty value for `template_name` but received {template_name!r}")
|
|
347
347
|
return await self._get(
|
|
348
|
-
|
|
348
|
+
path_template("/v1/agents/{template_name}", template_name=template_name),
|
|
349
349
|
options=make_request_options(
|
|
350
350
|
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
351
351
|
),
|