nimble_python 0.18.0__tar.gz → 0.19.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.19.0/.release-please-manifest.json +3 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/CHANGELOG.md +10 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/PKG-INFO +1 -1
- {nimble_python-0.18.0 → nimble_python-0.19.0}/api.md +52 -2
- {nimble_python-0.18.0 → nimble_python-0.19.0}/pyproject.toml +1 -1
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/_client.py +62 -1
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/_models.py +80 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/_version.py +1 -1
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/resources/__init__.py +14 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/resources/agent.py +8 -103
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/resources/serp.py +20 -0
- nimble_python-0.19.0/src/nimble_python/resources/task_agent/__init__.py +47 -0
- nimble_python-0.19.0/src/nimble_python/resources/task_agent/runs.py +551 -0
- nimble_python-0.19.0/src/nimble_python/resources/task_agent/task_agent.py +758 -0
- nimble_python-0.19.0/src/nimble_python/resources/task_agent/templates.py +272 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/__init__.py +9 -2
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/agent_generate_params.py +3 -3
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/agent_generate_response.py +11 -7
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/agent_get_generation_response.py +11 -7
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/agent_get_response.py +2 -2
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/agent_run_batch_response.py +1 -1
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/batch_get_response.py +1 -1
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/client_extract_async_params.py +3 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/client_extract_batch_params.py +6 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/client_extract_params.py +3 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/client_search_params.py +4 -1
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/crawl_run_params.py +3 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/extract_async_response.py +1 -1
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/extract_batch_response.py +1 -1
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/media_run_async_params.py +1 -1
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/media_run_async_response.py +1 -1
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/media_run_params.py +1 -1
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/serp_run_async_params.py +6 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/serp_run_async_response.py +1 -1
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/serp_run_batch_params.py +12 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/serp_run_batch_response.py +1 -1
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/serp_run_params.py +6 -0
- nimble_python-0.19.0/src/nimble_python/types/task_agent/__init__.py +11 -0
- nimble_python-0.19.0/src/nimble_python/types/task_agent/run_get_response.py +47 -0
- nimble_python-0.19.0/src/nimble_python/types/task_agent/run_get_result_response.py +188 -0
- nimble_python-0.19.0/src/nimble_python/types/task_agent/run_list_params.py +13 -0
- nimble_python-0.19.0/src/nimble_python/types/task_agent/run_list_response.py +50 -0
- nimble_python-0.19.0/src/nimble_python/types/task_agent/template_get_response.py +65 -0
- nimble_python-0.19.0/src/nimble_python/types/task_agent/template_list_params.py +18 -0
- nimble_python-0.19.0/src/nimble_python/types/task_agent/template_list_response.py +74 -0
- nimble_python-0.19.0/src/nimble_python/types/task_agent_create_params.py +52 -0
- nimble_python-0.19.0/src/nimble_python/types/task_agent_create_response.py +73 -0
- nimble_python-0.19.0/src/nimble_python/types/task_agent_get_response.py +73 -0
- nimble_python-0.19.0/src/nimble_python/types/task_agent_list_params.py +18 -0
- nimble_python-0.19.0/src/nimble_python/types/task_agent_list_response.py +82 -0
- nimble_python-0.19.0/src/nimble_python/types/task_agent_run_params.py +16 -0
- nimble_python-0.19.0/src/nimble_python/types/task_agent_run_response.py +47 -0
- nimble_python-0.19.0/src/nimble_python/types/task_agent_update_params.py +20 -0
- nimble_python-0.19.0/src/nimble_python/types/task_agent_update_response.py +73 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/task_get_response.py +1 -1
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/task_list_response.py +1 -1
- nimble_python-0.19.0/tests/api_resources/task_agent/__init__.py +1 -0
- nimble_python-0.19.0/tests/api_resources/task_agent/test_runs.py +544 -0
- nimble_python-0.19.0/tests/api_resources/task_agent/test_templates.py +186 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/tests/api_resources/test_agent.py +4 -109
- {nimble_python-0.18.0 → nimble_python-0.19.0}/tests/api_resources/test_client.py +10 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/tests/api_resources/test_crawl.py +2 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/tests/api_resources/test_serp.py +8 -0
- nimble_python-0.19.0/tests/api_resources/test_task_agent.py +640 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/tests/test_models.py +57 -3
- nimble_python-0.18.0/.release-please-manifest.json +0 -3
- nimble_python-0.18.0/src/nimble_python/types/agent_publish_params.py +0 -11
- nimble_python-0.18.0/src/nimble_python/types/agent_publish_response.py +0 -11
- {nimble_python-0.18.0 → nimble_python-0.19.0}/.gitignore +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/CONTRIBUTING.md +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/LICENSE +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/README.md +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/SECURITY.md +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/bin/check-release-environment +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/bin/publish-pypi +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/examples/.keep +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/release-please-config.json +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/requirements-dev.lock +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/__init__.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/_base_client.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/_compat.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/_constants.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/_exceptions.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/_files.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/_qs.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/_resource.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/_response.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/_streaming.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/_types.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/_utils/__init__.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/_utils/_compat.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/_utils/_datetime_parse.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/_utils/_json.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/_utils/_logs.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/_utils/_path.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/_utils/_proxy.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/_utils/_reflection.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/_utils/_resources_proxy.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/_utils/_streams.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/_utils/_sync.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/_utils/_transform.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/_utils/_typing.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/_utils/_utils.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/lib/.keep +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/py.typed +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/resources/batches.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/resources/crawl.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/resources/domain_knowledge.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/resources/media.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/resources/tasks.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/agent_list_params.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/agent_list_response.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/agent_run_async_params.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/agent_run_async_response.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/agent_run_batch_params.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/agent_run_params.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/agent_run_response.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/batch_progress_response.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/client_map_params.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/crawl_list_params.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/crawl_list_response.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/crawl_run_response.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/crawl_status_response.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/crawl_terminate_response.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/domain_knowledge_get_driver_params.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/domain_knowledge_get_driver_response.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/extract_response.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/map_response.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/media_run_response.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/search_response.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/serp_run_response.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/shared/__init__.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/shared/auto_scroll_action.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/shared/click_action.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/shared/eval_action.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/shared/fetch_action.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/shared/fill_action.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/shared/get_cookies_action.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/shared/goto_action.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/shared/press_action.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/shared/screenshot_action.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/shared/scroll_action.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/shared/wait_action.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/shared/wait_for_element_action.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/shared/wait_for_navigation_action.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/shared_params/__init__.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/shared_params/auto_scroll_action.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/shared_params/click_action.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/shared_params/eval_action.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/shared_params/fetch_action.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/shared_params/fill_action.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/shared_params/get_cookies_action.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/shared_params/goto_action.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/shared_params/press_action.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/shared_params/screenshot_action.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/shared_params/scroll_action.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/shared_params/wait_action.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/shared_params/wait_for_element_action.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/shared_params/wait_for_navigation_action.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/task_list_params.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimble_python/types/task_results_response.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/src/nimbleway/lib/.keep +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/tests/__init__.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/tests/api_resources/__init__.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/tests/api_resources/test_batches.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/tests/api_resources/test_domain_knowledge.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/tests/api_resources/test_media.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/tests/api_resources/test_tasks.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/tests/conftest.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/tests/sample_file.txt +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/tests/test_client.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/tests/test_extract_files.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/tests/test_files.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/tests/test_qs.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/tests/test_required_args.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/tests/test_response.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/tests/test_streaming.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/tests/test_transform.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/tests/test_utils/test_datetime_parse.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/tests/test_utils/test_json.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/tests/test_utils/test_path.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/tests/test_utils/test_proxy.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/tests/test_utils/test_typing.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/tests/utils.py +0 -0
- {nimble_python-0.18.0 → nimble_python-0.19.0}/uv.lock +0 -0
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.19.0 (2026-06-11)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.18.0...v0.19.0](https://github.com/Nimbleway/nimble-python/compare/v0.18.0...v0.19.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** manually update openapi ([790af21](https://github.com/Nimbleway/nimble-python/commit/790af21dc4e08b66c5d64e2aa01c0814d1cc2fc6))
|
|
10
|
+
* **api:** Manually update OpenAPI spec ([cc790ea](https://github.com/Nimbleway/nimble-python/commit/cc790ea7a08ea9c84bb79397a6720d630a07eced))
|
|
11
|
+
* **internal/types:** support eagerly validating pydantic iterators ([0e7f8a9](https://github.com/Nimbleway/nimble-python/commit/0e7f8a99fc9d2c80c5eed1891b0e6b37187afc78))
|
|
12
|
+
|
|
3
13
|
## 0.18.0 (2026-05-10)
|
|
4
14
|
|
|
5
15
|
Full Changelog: [v0.17.0...v0.18.0](https://github.com/Nimbleway/nimble-python/compare/v0.17.0...v0.18.0)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: nimble_python
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.19.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
|
|
@@ -50,7 +50,6 @@ from nimble_python.types import (
|
|
|
50
50
|
AgentGenerateResponse,
|
|
51
51
|
AgentGetResponse,
|
|
52
52
|
AgentGetGenerationResponse,
|
|
53
|
-
AgentPublishResponse,
|
|
54
53
|
AgentRunResponse,
|
|
55
54
|
AgentRunAsyncResponse,
|
|
56
55
|
AgentRunBatchResponse,
|
|
@@ -63,7 +62,6 @@ Methods:
|
|
|
63
62
|
- <code title="post /v1/agents/generations">client.agent.<a href="./src/nimble_python/resources/agent.py">generate</a>(\*\*<a href="src/nimble_python/types/agent_generate_params.py">params</a>) -> <a href="./src/nimble_python/types/agent_generate_response.py">AgentGenerateResponse</a></code>
|
|
64
63
|
- <code title="get /v1/agents/{template_name}">client.agent.<a href="./src/nimble_python/resources/agent.py">get</a>(template_name) -> <a href="./src/nimble_python/types/agent_get_response.py">AgentGetResponse</a></code>
|
|
65
64
|
- <code title="get /v1/agents/generations/{generation_id}">client.agent.<a href="./src/nimble_python/resources/agent.py">get_generation</a>(generation_id) -> <a href="./src/nimble_python/types/agent_get_generation_response.py">AgentGetGenerationResponse</a></code>
|
|
66
|
-
- <code title="post /v1/agents/{agent_name}/publish">client.agent.<a href="./src/nimble_python/resources/agent.py">publish</a>(agent_name, \*\*<a href="src/nimble_python/types/agent_publish_params.py">params</a>) -> <a href="./src/nimble_python/types/agent_publish_response.py">AgentPublishResponse</a></code>
|
|
67
65
|
- <code title="post /v1/agents/run">client.agent.<a href="./src/nimble_python/resources/agent.py">run</a>(\*\*<a href="src/nimble_python/types/agent_run_params.py">params</a>) -> <a href="./src/nimble_python/types/agent_run_response.py">AgentRunResponse</a></code>
|
|
68
66
|
- <code title="post /v1/agents/async">client.agent.<a href="./src/nimble_python/resources/agent.py">run_async</a>(\*\*<a href="src/nimble_python/types/agent_run_async_params.py">params</a>) -> <a href="./src/nimble_python/types/agent_run_async_response.py">AgentRunAsyncResponse</a></code>
|
|
69
67
|
- <code title="post /v1/agents/batch">client.agent.<a href="./src/nimble_python/resources/agent.py">run_batch</a>(\*\*<a href="src/nimble_python/types/agent_run_batch_params.py">params</a>) -> <a href="./src/nimble_python/types/agent_run_batch_response.py">AgentRunBatchResponse</a></code>
|
|
@@ -154,3 +152,55 @@ Methods:
|
|
|
154
152
|
- <code title="post /v1/serp">client.serp.<a href="./src/nimble_python/resources/serp.py">run</a>(\*\*<a href="src/nimble_python/types/serp_run_params.py">params</a>) -> <a href="./src/nimble_python/types/serp_run_response.py">SerpRunResponse</a></code>
|
|
155
153
|
- <code title="post /v1/serp/async">client.serp.<a href="./src/nimble_python/resources/serp.py">run_async</a>(\*\*<a href="src/nimble_python/types/serp_run_async_params.py">params</a>) -> <a href="./src/nimble_python/types/serp_run_async_response.py">SerpRunAsyncResponse</a></code>
|
|
156
154
|
- <code title="post /v1/serp/batch">client.serp.<a href="./src/nimble_python/resources/serp.py">run_batch</a>(\*\*<a href="src/nimble_python/types/serp_run_batch_params.py">params</a>) -> <a href="./src/nimble_python/types/serp_run_batch_response.py">SerpRunBatchResponse</a></code>
|
|
155
|
+
|
|
156
|
+
# TaskAgent
|
|
157
|
+
|
|
158
|
+
Types:
|
|
159
|
+
|
|
160
|
+
```python
|
|
161
|
+
from nimble_python.types import (
|
|
162
|
+
TaskAgentCreateResponse,
|
|
163
|
+
TaskAgentUpdateResponse,
|
|
164
|
+
TaskAgentListResponse,
|
|
165
|
+
TaskAgentGetResponse,
|
|
166
|
+
TaskAgentRunResponse,
|
|
167
|
+
)
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Methods:
|
|
171
|
+
|
|
172
|
+
- <code title="post /v1/task-agents">client.task_agent.<a href="./src/nimble_python/resources/task_agent/task_agent.py">create</a>(\*\*<a href="src/nimble_python/types/task_agent_create_params.py">params</a>) -> <a href="./src/nimble_python/types/task_agent_create_response.py">TaskAgentCreateResponse</a></code>
|
|
173
|
+
- <code title="patch /v1/task-agents/{agent_id}">client.task_agent.<a href="./src/nimble_python/resources/task_agent/task_agent.py">update</a>(agent_id, \*\*<a href="src/nimble_python/types/task_agent_update_params.py">params</a>) -> <a href="./src/nimble_python/types/task_agent_update_response.py">TaskAgentUpdateResponse</a></code>
|
|
174
|
+
- <code title="get /v1/task-agents">client.task_agent.<a href="./src/nimble_python/resources/task_agent/task_agent.py">list</a>(\*\*<a href="src/nimble_python/types/task_agent_list_params.py">params</a>) -> <a href="./src/nimble_python/types/task_agent_list_response.py">TaskAgentListResponse</a></code>
|
|
175
|
+
- <code title="delete /v1/task-agents/{agent_id}">client.task_agent.<a href="./src/nimble_python/resources/task_agent/task_agent.py">deactivate</a>(agent_id) -> None</code>
|
|
176
|
+
- <code title="get /v1/task-agents/{agent_id}">client.task_agent.<a href="./src/nimble_python/resources/task_agent/task_agent.py">get</a>(agent_id) -> <a href="./src/nimble_python/types/task_agent_get_response.py">TaskAgentGetResponse</a></code>
|
|
177
|
+
- <code title="post /v1/task-agents/{agent_id}/runs">client.task_agent.<a href="./src/nimble_python/resources/task_agent/task_agent.py">run</a>(agent_id, \*\*<a href="src/nimble_python/types/task_agent_run_params.py">params</a>) -> <a href="./src/nimble_python/types/task_agent_run_response.py">TaskAgentRunResponse</a></code>
|
|
178
|
+
|
|
179
|
+
## Templates
|
|
180
|
+
|
|
181
|
+
Types:
|
|
182
|
+
|
|
183
|
+
```python
|
|
184
|
+
from nimble_python.types.task_agent import TemplateListResponse, TemplateGetResponse
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Methods:
|
|
188
|
+
|
|
189
|
+
- <code title="get /v1/task-agents/templates">client.task_agent.templates.<a href="./src/nimble_python/resources/task_agent/templates.py">list</a>(\*\*<a href="src/nimble_python/types/task_agent/template_list_params.py">params</a>) -> <a href="./src/nimble_python/types/task_agent/template_list_response.py">TemplateListResponse</a></code>
|
|
190
|
+
- <code title="get /v1/task-agents/templates/{template_name}">client.task_agent.templates.<a href="./src/nimble_python/resources/task_agent/templates.py">get</a>(template_name) -> <a href="./src/nimble_python/types/task_agent/template_get_response.py">TemplateGetResponse</a></code>
|
|
191
|
+
|
|
192
|
+
## Runs
|
|
193
|
+
|
|
194
|
+
Types:
|
|
195
|
+
|
|
196
|
+
```python
|
|
197
|
+
from nimble_python.types.task_agent import RunListResponse, RunGetResponse, RunGetResultResponse
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
Methods:
|
|
201
|
+
|
|
202
|
+
- <code title="get /v1/task-agents/{agent_id}/runs">client.task_agent.runs.<a href="./src/nimble_python/resources/task_agent/runs.py">list</a>(agent_id, \*\*<a href="src/nimble_python/types/task_agent/run_list_params.py">params</a>) -> <a href="./src/nimble_python/types/task_agent/run_list_response.py">RunListResponse</a></code>
|
|
203
|
+
- <code title="post /v1/task-agents/{agent_id}/runs/{run_id}/cancel">client.task_agent.runs.<a href="./src/nimble_python/resources/task_agent/runs.py">cancel</a>(run_id, \*, agent_id) -> None</code>
|
|
204
|
+
- <code title="get /v1/task-agents/{agent_id}/runs/{run_id}">client.task_agent.runs.<a href="./src/nimble_python/resources/task_agent/runs.py">get</a>(run_id, \*, agent_id) -> <a href="./src/nimble_python/types/task_agent/run_get_response.py">RunGetResponse</a></code>
|
|
205
|
+
- <code title="get /v1/task-agents/{agent_id}/runs/{run_id}/result">client.task_agent.runs.<a href="./src/nimble_python/resources/task_agent/runs.py">get_result</a>(run_id, \*, agent_id) -> <a href="./src/nimble_python/types/task_agent/run_get_result_response.py">RunGetResultResponse</a></code>
|
|
206
|
+
- <code title="get /v1/task-agents/{agent_id}/runs/{run_id}/events">client.task_agent.runs.<a href="./src/nimble_python/resources/task_agent/runs.py">stream_events</a>(run_id, \*, agent_id) -> object</code>
|
|
@@ -61,7 +61,7 @@ from .types.extract_async_response import ExtractAsyncResponse
|
|
|
61
61
|
from .types.extract_batch_response import ExtractBatchResponse
|
|
62
62
|
|
|
63
63
|
if TYPE_CHECKING:
|
|
64
|
-
from .resources import serp, agent, crawl, media, tasks, batches, domain_knowledge
|
|
64
|
+
from .resources import serp, agent, crawl, media, tasks, batches, task_agent, domain_knowledge
|
|
65
65
|
from .resources.serp import SerpResource, AsyncSerpResource
|
|
66
66
|
from .resources.agent import AgentResource, AsyncAgentResource
|
|
67
67
|
from .resources.crawl import CrawlResource, AsyncCrawlResource
|
|
@@ -69,6 +69,7 @@ if TYPE_CHECKING:
|
|
|
69
69
|
from .resources.tasks import TasksResource, AsyncTasksResource
|
|
70
70
|
from .resources.batches import BatchesResource, AsyncBatchesResource
|
|
71
71
|
from .resources.domain_knowledge import DomainKnowledgeResource, AsyncDomainKnowledgeResource
|
|
72
|
+
from .resources.task_agent.task_agent import TaskAgentResource, AsyncTaskAgentResource
|
|
72
73
|
|
|
73
74
|
__all__ = ["Timeout", "Transport", "ProxiesTypes", "RequestOptions", "Nimble", "AsyncNimble", "Client", "AsyncClient"]
|
|
74
75
|
|
|
@@ -183,6 +184,12 @@ class Nimble(SyncAPIClient):
|
|
|
183
184
|
|
|
184
185
|
return SerpResource(self)
|
|
185
186
|
|
|
187
|
+
@cached_property
|
|
188
|
+
def task_agent(self) -> TaskAgentResource:
|
|
189
|
+
from .resources.task_agent import TaskAgentResource
|
|
190
|
+
|
|
191
|
+
return TaskAgentResource(self)
|
|
192
|
+
|
|
186
193
|
@cached_property
|
|
187
194
|
def with_raw_response(self) -> NimbleWithRawResponse:
|
|
188
195
|
return NimbleWithRawResponse(self)
|
|
@@ -280,6 +287,7 @@ class Nimble(SyncAPIClient):
|
|
|
280
287
|
self,
|
|
281
288
|
*,
|
|
282
289
|
url: str,
|
|
290
|
+
body: object | Omit = omit,
|
|
283
291
|
browser: client_extract_params.Browser | Omit = omit,
|
|
284
292
|
browser_actions: Iterable[client_extract_params.BrowserAction] | Omit = omit,
|
|
285
293
|
city: str | Omit = omit,
|
|
@@ -1169,6 +1177,8 @@ class Nimble(SyncAPIClient):
|
|
|
1169
1177
|
Args:
|
|
1170
1178
|
url: Target URL to scrape
|
|
1171
1179
|
|
|
1180
|
+
body: Request body for POST, PUT, PATCH methods
|
|
1181
|
+
|
|
1172
1182
|
browser: Browser type to emulate
|
|
1173
1183
|
|
|
1174
1184
|
browser_actions: Array of browser automation actions to execute sequentially
|
|
@@ -1236,6 +1246,7 @@ class Nimble(SyncAPIClient):
|
|
|
1236
1246
|
body=maybe_transform(
|
|
1237
1247
|
{
|
|
1238
1248
|
"url": url,
|
|
1249
|
+
"body": body,
|
|
1239
1250
|
"browser": browser,
|
|
1240
1251
|
"browser_actions": browser_actions,
|
|
1241
1252
|
"city": city,
|
|
@@ -1276,6 +1287,7 @@ class Nimble(SyncAPIClient):
|
|
|
1276
1287
|
self,
|
|
1277
1288
|
*,
|
|
1278
1289
|
url: str,
|
|
1290
|
+
body: object | Omit = omit,
|
|
1279
1291
|
browser: client_extract_async_params.Browser | Omit = omit,
|
|
1280
1292
|
browser_actions: Iterable[client_extract_async_params.BrowserAction] | Omit = omit,
|
|
1281
1293
|
callback_url: str | Omit = omit,
|
|
@@ -2170,6 +2182,8 @@ class Nimble(SyncAPIClient):
|
|
|
2170
2182
|
Args:
|
|
2171
2183
|
url: Target URL to scrape
|
|
2172
2184
|
|
|
2185
|
+
body: Request body for POST, PUT, PATCH methods
|
|
2186
|
+
|
|
2173
2187
|
browser: Browser type to emulate
|
|
2174
2188
|
|
|
2175
2189
|
browser_actions: Array of browser automation actions to execute sequentially
|
|
@@ -2247,6 +2261,7 @@ class Nimble(SyncAPIClient):
|
|
|
2247
2261
|
body=maybe_transform(
|
|
2248
2262
|
{
|
|
2249
2263
|
"url": url,
|
|
2264
|
+
"body": body,
|
|
2250
2265
|
"browser": browser,
|
|
2251
2266
|
"browser_actions": browser_actions,
|
|
2252
2267
|
"callback_url": callback_url,
|
|
@@ -3186,6 +3201,7 @@ class Nimble(SyncAPIClient):
|
|
|
3186
3201
|
query: str,
|
|
3187
3202
|
content_type: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
3188
3203
|
country: str | Omit = omit,
|
|
3204
|
+
debug_params: Optional[Dict[str, object]] | Omit = omit,
|
|
3189
3205
|
deep_search: Optional[bool] | Omit = omit,
|
|
3190
3206
|
end_date: Optional[str] | Omit = omit,
|
|
3191
3207
|
exclude_domains: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
@@ -3218,6 +3234,8 @@ class Nimble(SyncAPIClient):
|
|
|
3218
3234
|
|
|
3219
3235
|
country: Country code for geo-targeted results (e.g., 'US', 'GB', 'IL')
|
|
3220
3236
|
|
|
3237
|
+
debug_params: Internal-only. Gated to allowlisted accounts; ignored otherwise.
|
|
3238
|
+
|
|
3221
3239
|
deep_search: Deprecated. Use search_depth instead. true maps to 'deep', false maps to 'lite'.
|
|
3222
3240
|
|
|
3223
3241
|
end_date: Filter results before this date (format: YYYY-MM-DD or YYYY)
|
|
@@ -3267,6 +3285,7 @@ class Nimble(SyncAPIClient):
|
|
|
3267
3285
|
"query": query,
|
|
3268
3286
|
"content_type": content_type,
|
|
3269
3287
|
"country": country,
|
|
3288
|
+
"debug_params": debug_params,
|
|
3270
3289
|
"deep_search": deep_search,
|
|
3271
3290
|
"end_date": end_date,
|
|
3272
3291
|
"exclude_domains": exclude_domains,
|
|
@@ -3433,6 +3452,12 @@ class AsyncNimble(AsyncAPIClient):
|
|
|
3433
3452
|
|
|
3434
3453
|
return AsyncSerpResource(self)
|
|
3435
3454
|
|
|
3455
|
+
@cached_property
|
|
3456
|
+
def task_agent(self) -> AsyncTaskAgentResource:
|
|
3457
|
+
from .resources.task_agent import AsyncTaskAgentResource
|
|
3458
|
+
|
|
3459
|
+
return AsyncTaskAgentResource(self)
|
|
3460
|
+
|
|
3436
3461
|
@cached_property
|
|
3437
3462
|
def with_raw_response(self) -> AsyncNimbleWithRawResponse:
|
|
3438
3463
|
return AsyncNimbleWithRawResponse(self)
|
|
@@ -3530,6 +3555,7 @@ class AsyncNimble(AsyncAPIClient):
|
|
|
3530
3555
|
self,
|
|
3531
3556
|
*,
|
|
3532
3557
|
url: str,
|
|
3558
|
+
body: object | Omit = omit,
|
|
3533
3559
|
browser: client_extract_params.Browser | Omit = omit,
|
|
3534
3560
|
browser_actions: Iterable[client_extract_params.BrowserAction] | Omit = omit,
|
|
3535
3561
|
city: str | Omit = omit,
|
|
@@ -4419,6 +4445,8 @@ class AsyncNimble(AsyncAPIClient):
|
|
|
4419
4445
|
Args:
|
|
4420
4446
|
url: Target URL to scrape
|
|
4421
4447
|
|
|
4448
|
+
body: Request body for POST, PUT, PATCH methods
|
|
4449
|
+
|
|
4422
4450
|
browser: Browser type to emulate
|
|
4423
4451
|
|
|
4424
4452
|
browser_actions: Array of browser automation actions to execute sequentially
|
|
@@ -4486,6 +4514,7 @@ class AsyncNimble(AsyncAPIClient):
|
|
|
4486
4514
|
body=await async_maybe_transform(
|
|
4487
4515
|
{
|
|
4488
4516
|
"url": url,
|
|
4517
|
+
"body": body,
|
|
4489
4518
|
"browser": browser,
|
|
4490
4519
|
"browser_actions": browser_actions,
|
|
4491
4520
|
"city": city,
|
|
@@ -4526,6 +4555,7 @@ class AsyncNimble(AsyncAPIClient):
|
|
|
4526
4555
|
self,
|
|
4527
4556
|
*,
|
|
4528
4557
|
url: str,
|
|
4558
|
+
body: object | Omit = omit,
|
|
4529
4559
|
browser: client_extract_async_params.Browser | Omit = omit,
|
|
4530
4560
|
browser_actions: Iterable[client_extract_async_params.BrowserAction] | Omit = omit,
|
|
4531
4561
|
callback_url: str | Omit = omit,
|
|
@@ -5420,6 +5450,8 @@ class AsyncNimble(AsyncAPIClient):
|
|
|
5420
5450
|
Args:
|
|
5421
5451
|
url: Target URL to scrape
|
|
5422
5452
|
|
|
5453
|
+
body: Request body for POST, PUT, PATCH methods
|
|
5454
|
+
|
|
5423
5455
|
browser: Browser type to emulate
|
|
5424
5456
|
|
|
5425
5457
|
browser_actions: Array of browser automation actions to execute sequentially
|
|
@@ -5497,6 +5529,7 @@ class AsyncNimble(AsyncAPIClient):
|
|
|
5497
5529
|
body=await async_maybe_transform(
|
|
5498
5530
|
{
|
|
5499
5531
|
"url": url,
|
|
5532
|
+
"body": body,
|
|
5500
5533
|
"browser": browser,
|
|
5501
5534
|
"browser_actions": browser_actions,
|
|
5502
5535
|
"callback_url": callback_url,
|
|
@@ -6436,6 +6469,7 @@ class AsyncNimble(AsyncAPIClient):
|
|
|
6436
6469
|
query: str,
|
|
6437
6470
|
content_type: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
6438
6471
|
country: str | Omit = omit,
|
|
6472
|
+
debug_params: Optional[Dict[str, object]] | Omit = omit,
|
|
6439
6473
|
deep_search: Optional[bool] | Omit = omit,
|
|
6440
6474
|
end_date: Optional[str] | Omit = omit,
|
|
6441
6475
|
exclude_domains: Optional[SequenceNotStr[str]] | Omit = omit,
|
|
@@ -6468,6 +6502,8 @@ class AsyncNimble(AsyncAPIClient):
|
|
|
6468
6502
|
|
|
6469
6503
|
country: Country code for geo-targeted results (e.g., 'US', 'GB', 'IL')
|
|
6470
6504
|
|
|
6505
|
+
debug_params: Internal-only. Gated to allowlisted accounts; ignored otherwise.
|
|
6506
|
+
|
|
6471
6507
|
deep_search: Deprecated. Use search_depth instead. true maps to 'deep', false maps to 'lite'.
|
|
6472
6508
|
|
|
6473
6509
|
end_date: Filter results before this date (format: YYYY-MM-DD or YYYY)
|
|
@@ -6517,6 +6553,7 @@ class AsyncNimble(AsyncAPIClient):
|
|
|
6517
6553
|
"query": query,
|
|
6518
6554
|
"content_type": content_type,
|
|
6519
6555
|
"country": country,
|
|
6556
|
+
"debug_params": debug_params,
|
|
6520
6557
|
"deep_search": deep_search,
|
|
6521
6558
|
"end_date": end_date,
|
|
6522
6559
|
"exclude_domains": exclude_domains,
|
|
@@ -6637,6 +6674,12 @@ class NimbleWithRawResponse:
|
|
|
6637
6674
|
|
|
6638
6675
|
return SerpResourceWithRawResponse(self._client.serp)
|
|
6639
6676
|
|
|
6677
|
+
@cached_property
|
|
6678
|
+
def task_agent(self) -> task_agent.TaskAgentResourceWithRawResponse:
|
|
6679
|
+
from .resources.task_agent import TaskAgentResourceWithRawResponse
|
|
6680
|
+
|
|
6681
|
+
return TaskAgentResourceWithRawResponse(self._client.task_agent)
|
|
6682
|
+
|
|
6640
6683
|
|
|
6641
6684
|
class AsyncNimbleWithRawResponse:
|
|
6642
6685
|
_client: AsyncNimble
|
|
@@ -6702,6 +6745,12 @@ class AsyncNimbleWithRawResponse:
|
|
|
6702
6745
|
|
|
6703
6746
|
return AsyncSerpResourceWithRawResponse(self._client.serp)
|
|
6704
6747
|
|
|
6748
|
+
@cached_property
|
|
6749
|
+
def task_agent(self) -> task_agent.AsyncTaskAgentResourceWithRawResponse:
|
|
6750
|
+
from .resources.task_agent import AsyncTaskAgentResourceWithRawResponse
|
|
6751
|
+
|
|
6752
|
+
return AsyncTaskAgentResourceWithRawResponse(self._client.task_agent)
|
|
6753
|
+
|
|
6705
6754
|
|
|
6706
6755
|
class NimbleWithStreamedResponse:
|
|
6707
6756
|
_client: Nimble
|
|
@@ -6767,6 +6816,12 @@ class NimbleWithStreamedResponse:
|
|
|
6767
6816
|
|
|
6768
6817
|
return SerpResourceWithStreamingResponse(self._client.serp)
|
|
6769
6818
|
|
|
6819
|
+
@cached_property
|
|
6820
|
+
def task_agent(self) -> task_agent.TaskAgentResourceWithStreamingResponse:
|
|
6821
|
+
from .resources.task_agent import TaskAgentResourceWithStreamingResponse
|
|
6822
|
+
|
|
6823
|
+
return TaskAgentResourceWithStreamingResponse(self._client.task_agent)
|
|
6824
|
+
|
|
6770
6825
|
|
|
6771
6826
|
class AsyncNimbleWithStreamedResponse:
|
|
6772
6827
|
_client: AsyncNimble
|
|
@@ -6832,6 +6887,12 @@ class AsyncNimbleWithStreamedResponse:
|
|
|
6832
6887
|
|
|
6833
6888
|
return AsyncSerpResourceWithStreamingResponse(self._client.serp)
|
|
6834
6889
|
|
|
6890
|
+
@cached_property
|
|
6891
|
+
def task_agent(self) -> task_agent.AsyncTaskAgentResourceWithStreamingResponse:
|
|
6892
|
+
from .resources.task_agent import AsyncTaskAgentResourceWithStreamingResponse
|
|
6893
|
+
|
|
6894
|
+
return AsyncTaskAgentResourceWithStreamingResponse(self._client.task_agent)
|
|
6895
|
+
|
|
6835
6896
|
|
|
6836
6897
|
Client = Nimble
|
|
6837
6898
|
|
|
@@ -25,7 +25,9 @@ from typing_extensions import (
|
|
|
25
25
|
ClassVar,
|
|
26
26
|
Protocol,
|
|
27
27
|
Required,
|
|
28
|
+
Annotated,
|
|
28
29
|
ParamSpec,
|
|
30
|
+
TypeAlias,
|
|
29
31
|
TypedDict,
|
|
30
32
|
TypeGuard,
|
|
31
33
|
final,
|
|
@@ -79,7 +81,15 @@ from ._compat import (
|
|
|
79
81
|
from ._constants import RAW_RESPONSE_HEADER
|
|
80
82
|
|
|
81
83
|
if TYPE_CHECKING:
|
|
84
|
+
from pydantic import GetCoreSchemaHandler, ValidatorFunctionWrapHandler
|
|
85
|
+
from pydantic_core import CoreSchema, core_schema
|
|
82
86
|
from pydantic_core.core_schema import ModelField, ModelSchema, LiteralSchema, ModelFieldsSchema
|
|
87
|
+
else:
|
|
88
|
+
try:
|
|
89
|
+
from pydantic_core import CoreSchema, core_schema
|
|
90
|
+
except ImportError:
|
|
91
|
+
CoreSchema = None
|
|
92
|
+
core_schema = None
|
|
83
93
|
|
|
84
94
|
__all__ = ["BaseModel", "GenericModel"]
|
|
85
95
|
|
|
@@ -396,6 +406,76 @@ class BaseModel(pydantic.BaseModel):
|
|
|
396
406
|
)
|
|
397
407
|
|
|
398
408
|
|
|
409
|
+
class _EagerIterable(list[_T], Generic[_T]):
|
|
410
|
+
"""
|
|
411
|
+
Accepts any Iterable[T] input (including generators), consumes it
|
|
412
|
+
eagerly, and validates all items upfront.
|
|
413
|
+
|
|
414
|
+
Validation preserves the original container type where possible
|
|
415
|
+
(e.g. a set[T] stays a set[T]). Serialization (model_dump / JSON)
|
|
416
|
+
always emits a list — round-tripping through model_dump() will not
|
|
417
|
+
restore the original container type.
|
|
418
|
+
"""
|
|
419
|
+
|
|
420
|
+
@classmethod
|
|
421
|
+
def __get_pydantic_core_schema__(
|
|
422
|
+
cls,
|
|
423
|
+
source_type: Any,
|
|
424
|
+
handler: GetCoreSchemaHandler,
|
|
425
|
+
) -> CoreSchema:
|
|
426
|
+
(item_type,) = get_args(source_type) or (Any,)
|
|
427
|
+
item_schema: CoreSchema = handler.generate_schema(item_type)
|
|
428
|
+
list_of_items_schema: CoreSchema = core_schema.list_schema(item_schema)
|
|
429
|
+
|
|
430
|
+
return core_schema.no_info_wrap_validator_function(
|
|
431
|
+
cls._validate,
|
|
432
|
+
list_of_items_schema,
|
|
433
|
+
serialization=core_schema.plain_serializer_function_ser_schema(
|
|
434
|
+
cls._serialize,
|
|
435
|
+
info_arg=False,
|
|
436
|
+
),
|
|
437
|
+
)
|
|
438
|
+
|
|
439
|
+
@staticmethod
|
|
440
|
+
def _validate(v: Iterable[_T], handler: "ValidatorFunctionWrapHandler") -> Any:
|
|
441
|
+
original_type: type[Any] = type(v)
|
|
442
|
+
|
|
443
|
+
# Normalize to list so list_schema can validate each item
|
|
444
|
+
if isinstance(v, list):
|
|
445
|
+
items: list[_T] = v
|
|
446
|
+
else:
|
|
447
|
+
try:
|
|
448
|
+
items = list(v)
|
|
449
|
+
except TypeError as e:
|
|
450
|
+
raise TypeError("Value is not iterable") from e
|
|
451
|
+
|
|
452
|
+
# Validate items against the inner schema
|
|
453
|
+
validated: list[_T] = handler(items)
|
|
454
|
+
|
|
455
|
+
# Reconstruct original container type
|
|
456
|
+
if original_type is list:
|
|
457
|
+
return validated
|
|
458
|
+
# str(list) produces the list's repr, not a string built from items,
|
|
459
|
+
# so skip reconstruction for str and its subclasses.
|
|
460
|
+
if issubclass(original_type, str):
|
|
461
|
+
return validated
|
|
462
|
+
try:
|
|
463
|
+
return original_type(validated)
|
|
464
|
+
except (TypeError, ValueError):
|
|
465
|
+
# If the type cannot be reconstructed, just return the validated list
|
|
466
|
+
return validated
|
|
467
|
+
|
|
468
|
+
@staticmethod
|
|
469
|
+
def _serialize(v: Iterable[_T]) -> list[_T]:
|
|
470
|
+
"""Always serialize as a list so Pydantic's JSON encoder is happy."""
|
|
471
|
+
if isinstance(v, list):
|
|
472
|
+
return v
|
|
473
|
+
return list(v)
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
EagerIterable: TypeAlias = Annotated[Iterable[_T], _EagerIterable]
|
|
477
|
+
|
|
478
|
+
|
|
399
479
|
def _construct_field(value: object, field: FieldInfo, key: str) -> object:
|
|
400
480
|
if value is None:
|
|
401
481
|
return field_get_default(field)
|
|
@@ -48,6 +48,14 @@ from .batches import (
|
|
|
48
48
|
BatchesResourceWithStreamingResponse,
|
|
49
49
|
AsyncBatchesResourceWithStreamingResponse,
|
|
50
50
|
)
|
|
51
|
+
from .task_agent import (
|
|
52
|
+
TaskAgentResource,
|
|
53
|
+
AsyncTaskAgentResource,
|
|
54
|
+
TaskAgentResourceWithRawResponse,
|
|
55
|
+
AsyncTaskAgentResourceWithRawResponse,
|
|
56
|
+
TaskAgentResourceWithStreamingResponse,
|
|
57
|
+
AsyncTaskAgentResourceWithStreamingResponse,
|
|
58
|
+
)
|
|
51
59
|
from .domain_knowledge import (
|
|
52
60
|
DomainKnowledgeResource,
|
|
53
61
|
AsyncDomainKnowledgeResource,
|
|
@@ -100,4 +108,10 @@ __all__ = [
|
|
|
100
108
|
"AsyncSerpResourceWithRawResponse",
|
|
101
109
|
"SerpResourceWithStreamingResponse",
|
|
102
110
|
"AsyncSerpResourceWithStreamingResponse",
|
|
111
|
+
"TaskAgentResource",
|
|
112
|
+
"AsyncTaskAgentResource",
|
|
113
|
+
"TaskAgentResourceWithRawResponse",
|
|
114
|
+
"AsyncTaskAgentResourceWithRawResponse",
|
|
115
|
+
"TaskAgentResourceWithStreamingResponse",
|
|
116
|
+
"AsyncTaskAgentResourceWithStreamingResponse",
|
|
103
117
|
]
|