groundx 3.7.2__tar.gz → 3.7.3__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.
- {groundx-3.7.2 → groundx-3.7.3}/PKG-INFO +1 -1
- {groundx-3.7.2 → groundx-3.7.3}/pyproject.toml +1 -1
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/core/client_wrapper.py +2 -2
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/extract/agents/agent.py +127 -3
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/extract/settings/settings.py +1 -0
- {groundx-3.7.2 → groundx-3.7.3}/LICENSE +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/README.md +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/__init__.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/_default_clients.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/api_key/__init__.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/api_key/client.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/api_key/raw_client.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/buckets/__init__.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/buckets/client.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/buckets/raw_client.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/client.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/core/__init__.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/core/api_error.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/core/datetime_utils.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/core/file.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/core/force_multipart.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/core/http_client.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/core/http_response.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/core/http_sse/__init__.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/core/http_sse/_api.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/core/http_sse/_decoders.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/core/http_sse/_exceptions.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/core/http_sse/_models.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/core/jsonable_encoder.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/core/logging.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/core/parse_error.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/core/pydantic_utilities.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/core/query_encoder.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/core/remove_none_from_dict.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/core/request_options.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/core/serialization.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/csv_splitter.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/customer/__init__.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/customer/client.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/customer/raw_client.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/documents/__init__.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/documents/client.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/documents/raw_client.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/environment.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/errors/__init__.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/errors/bad_request_error.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/errors/unauthorized_error.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/extract/__init__.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/extract/agents/__init__.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/extract/classes/__init__.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/extract/classes/agent.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/extract/classes/api.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/extract/classes/document.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/extract/classes/element.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/extract/classes/field.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/extract/classes/groundx.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/extract/classes/group.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/extract/classes/prompt.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/extract/classes/testing.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/extract/post_process/__init__.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/extract/post_process/post_process.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/extract/prompt/__init__.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/extract/prompt/manager.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/extract/prompt/object_store.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/extract/prompt/source.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/extract/prompt/utility.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/extract/services/.DS_Store +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/extract/services/__init__.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/extract/services/csv.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/extract/services/logger.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/extract/services/logging_cfg.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/extract/services/ratelimit.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/extract/services/sheets_client.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/extract/services/status.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/extract/services/upload.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/extract/services/upload_minio.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/extract/services/upload_s3.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/extract/services/utility.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/extract/settings/__init__.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/extract/tasks/__init__.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/extract/tasks/utility.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/extract/utility/__init__.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/extract/utility/utility.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/extract/workflows.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/groups/__init__.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/groups/client.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/groups/raw_client.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/health/__init__.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/health/client.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/health/raw_client.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/ingest.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/py.typed +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/search/__init__.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/search/client.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/search/raw_client.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/search/types/__init__.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/search/types/search_content_request_id.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/__init__.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/api_key_detail.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/api_key_request.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/api_key_response.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/bounding_box_detail.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/bucket_detail.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/bucket_list_response.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/bucket_response.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/bucket_update_detail.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/bucket_update_response.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/custom_workflow_leaf_field.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/custom_workflow_leaf_field_level.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/custom_workflow_leaf_field_repetition_scope.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/custom_workflow_output_map.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/custom_workflow_output_route.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/custom_workflow_output_route_level.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/custom_workflow_output_route_output_map.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/custom_workflow_step.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/custom_workflow_step_config.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/custom_workflow_step_element_config.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/custom_workflow_step_kind.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/custom_workflow_step_level.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/customer_detail.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/customer_detail_status.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/customer_response.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/document.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/document_detail.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/document_list_response.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/document_local_ingest_request.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/document_lookup_response.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/document_response.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/document_type.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/document_update.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/document_xray.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/document_xray_chunk.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/document_xray_page.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/group_detail.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/group_list_response.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/group_response.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/health_response.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/health_response_health.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/health_service.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/health_service_status.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/ingest_local_document.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/ingest_local_document_metadata.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/ingest_remote_document.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/ingest_response.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/ingest_status.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/ingest_status_light.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/ingest_status_progress.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/ingest_status_progress_cancelled.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/ingest_status_progress_complete.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/ingest_status_progress_errors.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/ingest_status_progress_processing.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/ingest_status_progress_queued.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/message_response.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/meter_detail.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/process_level.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/processes_status_response.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/processing_status.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/search_response.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/search_response_search.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/search_result_item.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/search_result_item_pages_item.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/sort.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/sort_order.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/subscription_detail.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/subscription_detail_meters.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/website_source.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/workflow_apply_request.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/workflow_detail.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/workflow_detail_chunk_strategy.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/workflow_detail_relationships.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/workflow_detail_section_strategy.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/workflow_engine.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/workflow_engine_reasoning_effort.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/workflow_engine_service.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/workflow_prompt.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/workflow_prompt_group.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/workflow_prompt_role.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/workflow_request.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/workflow_request_chunk_strategy.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/workflow_request_section_strategy.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/workflow_response.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/workflow_step.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/workflow_step_config.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/workflow_step_config_field.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/workflow_steps.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/workflow_template.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/workflows_response.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/version.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/workflows/__init__.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/workflows/client.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/workflows/raw_client.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/workflows/types/__init__.py +0 -0
- {groundx-3.7.2 → groundx-3.7.3}/src/groundx/workflows/types/workflows_get_request_id.py +0 -0
|
@@ -27,12 +27,12 @@ class BaseClientWrapper:
|
|
|
27
27
|
import platform
|
|
28
28
|
|
|
29
29
|
headers: typing.Dict[str, str] = {
|
|
30
|
-
"User-Agent": "groundx/3.7.
|
|
30
|
+
"User-Agent": "groundx/3.7.3",
|
|
31
31
|
"X-Fern-Language": "Python",
|
|
32
32
|
"X-Fern-Runtime": f"python/{platform.python_version()}",
|
|
33
33
|
"X-Fern-Platform": f"{platform.system().lower()}/{platform.release()}",
|
|
34
34
|
"X-Fern-SDK-Name": "groundx",
|
|
35
|
-
"X-Fern-SDK-Version": "3.7.
|
|
35
|
+
"X-Fern-SDK-Version": "3.7.3",
|
|
36
36
|
**(self.get_custom_headers() or {}),
|
|
37
37
|
}
|
|
38
38
|
headers["X-API-Key"] = self.api_key
|
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
import json, traceback, typing
|
|
4
|
+
from dataclasses import dataclass, field
|
|
5
|
+
from urllib.parse import urlparse
|
|
4
6
|
|
|
5
7
|
from smolagents import ( # pyright: ignore[reportMissingTypeStubs]
|
|
6
8
|
CodeAgent,
|
|
7
9
|
Tool,
|
|
8
10
|
ToolCallingAgent,
|
|
9
11
|
)
|
|
12
|
+
from smolagents.memory import ( # pyright: ignore[reportMissingTypeStubs]
|
|
13
|
+
FinalAnswerStep,
|
|
14
|
+
SystemPromptStep,
|
|
15
|
+
TaskStep,
|
|
16
|
+
)
|
|
10
17
|
from smolagents.models import ( # pyright: ignore[reportMissingTypeStubs]
|
|
18
|
+
ChatMessage,
|
|
19
|
+
MessageRole,
|
|
11
20
|
OpenAIServerModel,
|
|
12
21
|
)
|
|
13
22
|
|
|
@@ -27,6 +36,37 @@ Return only your response using the `final_answer` tool format:
|
|
|
27
36
|
```
|
|
28
37
|
"""
|
|
29
38
|
|
|
39
|
+
SUPPORTED_IMAGE_TRANSPORTS = {"pil", "data_url", "remote_url"}
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
@dataclass
|
|
43
|
+
class RemoteImageTaskStep(TaskStep):
|
|
44
|
+
image_urls: typing.List[str] = field(default_factory=list)
|
|
45
|
+
|
|
46
|
+
def to_messages(self, summary_mode: bool = False) -> typing.List[ChatMessage]:
|
|
47
|
+
content: typing.List[typing.Dict[str, typing.Any]] = [
|
|
48
|
+
{"type": "text", "text": f"New task:\n{self.task}"}
|
|
49
|
+
]
|
|
50
|
+
content.extend(
|
|
51
|
+
{"type": "image_url", "image_url": {"url": image_url}}
|
|
52
|
+
for image_url in self.image_urls
|
|
53
|
+
)
|
|
54
|
+
return [ChatMessage(role=MessageRole.USER, content=content)]
|
|
55
|
+
|
|
56
|
+
def dict(self) -> typing.Dict[str, typing.Any]:
|
|
57
|
+
return {
|
|
58
|
+
"task": self.task,
|
|
59
|
+
"task_images": None,
|
|
60
|
+
"image_urls": [_sanitize_image_url(image_url) for image_url in self.image_urls],
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def _sanitize_image_url(image_url: str) -> str:
|
|
65
|
+
parsed = urlparse(image_url)
|
|
66
|
+
if not parsed.scheme or not parsed.netloc:
|
|
67
|
+
return "<invalid-image-url>"
|
|
68
|
+
return f"{parsed.scheme}://{parsed.netloc}{parsed.path}"
|
|
69
|
+
|
|
30
70
|
|
|
31
71
|
def extract_response(res: typing.Dict[str, typing.Any]) -> typing.Any:
|
|
32
72
|
if "answer" in res and "type" in res["answer"]:
|
|
@@ -209,6 +249,7 @@ class AgentTool(ToolCallingAgent):
|
|
|
209
249
|
)
|
|
210
250
|
|
|
211
251
|
self.log = log
|
|
252
|
+
self.image_transport = settings.image_transport
|
|
212
253
|
|
|
213
254
|
def process(
|
|
214
255
|
self,
|
|
@@ -217,11 +258,25 @@ class AgentTool(ToolCallingAgent):
|
|
|
217
258
|
expected_types: typing.Union[type, typing.Tuple[type, ...]] = dict,
|
|
218
259
|
attempt: int = 0,
|
|
219
260
|
type: str = "",
|
|
261
|
+
image_urls: typing.Optional[typing.Sequence[str]] = None,
|
|
262
|
+
image_transport: typing.Optional[str] = None,
|
|
220
263
|
) -> typing.Any:
|
|
221
|
-
|
|
222
|
-
|
|
264
|
+
selected_image_transport = image_transport or self.image_transport
|
|
265
|
+
transport = self._validate_image_inputs(
|
|
223
266
|
images=images,
|
|
267
|
+
image_urls=image_urls,
|
|
268
|
+
image_transport=selected_image_transport,
|
|
224
269
|
)
|
|
270
|
+
if transport == "remote_url":
|
|
271
|
+
res = self._run_with_remote_image_urls(
|
|
272
|
+
conflict + prompt_suffix,
|
|
273
|
+
list(image_urls or []),
|
|
274
|
+
)
|
|
275
|
+
else:
|
|
276
|
+
res = super().run( # pyright: ignore[reportUnknownMemberType]
|
|
277
|
+
conflict + prompt_suffix,
|
|
278
|
+
images=images,
|
|
279
|
+
)
|
|
225
280
|
|
|
226
281
|
try:
|
|
227
282
|
return process_response(res=res, expected_types=expected_types)
|
|
@@ -236,4 +291,73 @@ class AgentTool(ToolCallingAgent):
|
|
|
236
291
|
f"agent process result is not of expected type(s) {expected_types!r}: [{e}], attempting again [{attempt+1}]\n\n{res}"
|
|
237
292
|
)
|
|
238
293
|
|
|
239
|
-
return self.process(
|
|
294
|
+
return self.process(
|
|
295
|
+
conflict,
|
|
296
|
+
images,
|
|
297
|
+
expected_types,
|
|
298
|
+
attempt + 1,
|
|
299
|
+
type,
|
|
300
|
+
image_urls=image_urls,
|
|
301
|
+
image_transport=transport,
|
|
302
|
+
)
|
|
303
|
+
|
|
304
|
+
def _run_with_remote_image_urls(
|
|
305
|
+
self,
|
|
306
|
+
task: str,
|
|
307
|
+
image_urls: typing.List[str],
|
|
308
|
+
) -> typing.Any:
|
|
309
|
+
self.task = task
|
|
310
|
+
self.interrupt_switch = False
|
|
311
|
+
self.memory.system_prompt = SystemPromptStep(system_prompt=self.system_prompt)
|
|
312
|
+
self.memory.reset()
|
|
313
|
+
self.monitor.reset()
|
|
314
|
+
self.memory.steps.append(
|
|
315
|
+
RemoteImageTaskStep(task=self.task, task_images=None, image_urls=image_urls)
|
|
316
|
+
)
|
|
317
|
+
|
|
318
|
+
try:
|
|
319
|
+
try:
|
|
320
|
+
steps = list(self._run_stream(task=self.task, max_steps=self.max_steps, images=None))
|
|
321
|
+
except Exception as exc:
|
|
322
|
+
raise RuntimeError(f"remote_url image transport failed: {exc}") from exc
|
|
323
|
+
assert isinstance(steps[-1], FinalAnswerStep)
|
|
324
|
+
return steps[-1].output
|
|
325
|
+
finally:
|
|
326
|
+
self._sanitize_remote_image_urls_in_memory()
|
|
327
|
+
|
|
328
|
+
def _validate_image_inputs(
|
|
329
|
+
self,
|
|
330
|
+
*,
|
|
331
|
+
images: typing.Sequence[Image],
|
|
332
|
+
image_urls: typing.Optional[typing.Sequence[str]],
|
|
333
|
+
image_transport: str,
|
|
334
|
+
) -> str:
|
|
335
|
+
if image_transport not in SUPPORTED_IMAGE_TRANSPORTS:
|
|
336
|
+
raise ValueError(
|
|
337
|
+
"unsupported image_transport "
|
|
338
|
+
f"[{image_transport}]; expected one of {sorted(SUPPORTED_IMAGE_TRANSPORTS)}"
|
|
339
|
+
)
|
|
340
|
+
if image_urls and image_transport != "remote_url":
|
|
341
|
+
raise ValueError("image_urls require image_transport='remote_url'")
|
|
342
|
+
if image_transport == "remote_url":
|
|
343
|
+
if images:
|
|
344
|
+
raise ValueError("remote_url transport does not accept PIL images")
|
|
345
|
+
if not image_urls:
|
|
346
|
+
raise ValueError("remote_url transport requires image_urls")
|
|
347
|
+
return image_transport
|
|
348
|
+
|
|
349
|
+
def _sanitize_remote_image_urls_in_memory(self) -> None:
|
|
350
|
+
for step in self.memory.steps:
|
|
351
|
+
model_input_messages = getattr(step, "model_input_messages", None)
|
|
352
|
+
if not model_input_messages:
|
|
353
|
+
continue
|
|
354
|
+
for message in model_input_messages:
|
|
355
|
+
content = getattr(message, "content", None)
|
|
356
|
+
if not isinstance(content, list):
|
|
357
|
+
continue
|
|
358
|
+
for item in content:
|
|
359
|
+
if not isinstance(item, dict) or item.get("type") != "image_url":
|
|
360
|
+
continue
|
|
361
|
+
image_url = item.get("image_url")
|
|
362
|
+
if isinstance(image_url, dict) and isinstance(image_url.get("url"), str):
|
|
363
|
+
image_url["url"] = _sanitize_image_url(image_url["url"])
|
|
@@ -43,6 +43,7 @@ class AgentSettings(BaseModel):
|
|
|
43
43
|
max_steps: int = 7
|
|
44
44
|
model_id: str = "gpt-5-mini"
|
|
45
45
|
reasoning_effort: typing.Optional[str] = "medium"
|
|
46
|
+
image_transport: str = "pil"
|
|
46
47
|
model_kwargs: typing.Optional[typing.Dict[str, typing.Any]] = None
|
|
47
48
|
|
|
48
49
|
def get_api_key(self) -> str:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/custom_workflow_leaf_field_repetition_scope.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{groundx-3.7.2 → groundx-3.7.3}/src/groundx/types/custom_workflow_output_route_output_map.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|