asteroid-odyssey 1.0.3__py3-none-any.whl → 1.2.0__py3-none-any.whl
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.
- asteroid_odyssey/__init__.py +10 -2
- asteroid_odyssey/agents_v1_gen/__init__.py +87 -0
- asteroid_odyssey/agents_v1_gen/api/__init__.py +7 -0
- asteroid_odyssey/agents_v1_gen/api/agent_profile_api.py +1696 -0
- asteroid_odyssey/{openapi_client → agents_v1_gen}/api/api_api.py +4 -4
- asteroid_odyssey/{openapi_client/api/sdk_api.py → agents_v1_gen/api/execution_api.py} +314 -14
- asteroid_odyssey/{openapi_client → agents_v1_gen}/api_client.py +6 -6
- asteroid_odyssey/{openapi_client → agents_v1_gen}/configuration.py +2 -2
- asteroid_odyssey/agents_v1_gen/models/__init__.py +34 -0
- asteroid_odyssey/agents_v1_gen/models/agent_profile.py +118 -0
- asteroid_odyssey/agents_v1_gen/models/country_code.py +44 -0
- asteroid_odyssey/agents_v1_gen/models/create_agent_profile_request.py +112 -0
- asteroid_odyssey/agents_v1_gen/models/credential.py +95 -0
- asteroid_odyssey/agents_v1_gen/models/delete_agent_profile200_response.py +87 -0
- asteroid_odyssey/{openapi_client → agents_v1_gen}/models/execution_result_response.py +2 -2
- asteroid_odyssey/{openapi_client → agents_v1_gen}/models/execution_status_response.py +1 -1
- asteroid_odyssey/agents_v1_gen/models/proxy_type.py +37 -0
- asteroid_odyssey/agents_v1_gen/models/update_agent_profile_request.py +112 -0
- asteroid_odyssey/{openapi_client → agents_v1_gen}/rest.py +1 -1
- asteroid_odyssey/agents_v2_gen/__init__.py +99 -0
- asteroid_odyssey/agents_v2_gen/api/__init__.py +5 -0
- asteroid_odyssey/agents_v2_gen/api/execution_api.py +625 -0
- asteroid_odyssey/agents_v2_gen/api_client.py +801 -0
- asteroid_odyssey/agents_v2_gen/api_response.py +21 -0
- asteroid_odyssey/agents_v2_gen/configuration.py +612 -0
- asteroid_odyssey/agents_v2_gen/exceptions.py +216 -0
- asteroid_odyssey/agents_v2_gen/models/__init__.py +42 -0
- asteroid_odyssey/agents_v2_gen/models/activity_payload_union_action_completed.py +100 -0
- asteroid_odyssey/agents_v2_gen/models/activity_payload_union_action_failed.py +100 -0
- asteroid_odyssey/agents_v2_gen/models/activity_payload_union_action_started.py +100 -0
- asteroid_odyssey/agents_v2_gen/models/activity_payload_union_generic.py +100 -0
- asteroid_odyssey/agents_v2_gen/models/activity_payload_union_status_changed.py +100 -0
- asteroid_odyssey/agents_v2_gen/models/activity_payload_union_step_completed.py +100 -0
- asteroid_odyssey/agents_v2_gen/models/activity_payload_union_step_started.py +100 -0
- asteroid_odyssey/agents_v2_gen/models/activity_payload_union_terminal.py +100 -0
- asteroid_odyssey/agents_v2_gen/models/activity_payload_union_transitioned_node.py +100 -0
- asteroid_odyssey/agents_v2_gen/models/activity_payload_union_user_message_received.py +100 -0
- asteroid_odyssey/agents_v2_gen/models/error.py +89 -0
- asteroid_odyssey/agents_v2_gen/models/execution_activity.py +98 -0
- asteroid_odyssey/agents_v2_gen/models/execution_activity_action_completed_payload.py +87 -0
- asteroid_odyssey/agents_v2_gen/models/execution_activity_action_failed_payload.py +87 -0
- asteroid_odyssey/agents_v2_gen/models/execution_activity_action_started_payload.py +87 -0
- asteroid_odyssey/agents_v2_gen/models/execution_activity_generic_payload.py +87 -0
- asteroid_odyssey/agents_v2_gen/models/execution_activity_payload_union.py +252 -0
- asteroid_odyssey/agents_v2_gen/models/execution_activity_status_changed_payload.py +88 -0
- asteroid_odyssey/agents_v2_gen/models/execution_activity_step_completed_payload.py +87 -0
- asteroid_odyssey/agents_v2_gen/models/execution_activity_step_started_payload.py +87 -0
- asteroid_odyssey/agents_v2_gen/models/execution_activity_transitioned_node_payload.py +89 -0
- asteroid_odyssey/agents_v2_gen/models/execution_activity_user_message_received_payload.py +89 -0
- asteroid_odyssey/agents_v2_gen/models/execution_status.py +43 -0
- asteroid_odyssey/agents_v2_gen/models/execution_terminal_payload.py +96 -0
- asteroid_odyssey/agents_v2_gen/models/execution_user_messages_add_text_body.py +87 -0
- asteroid_odyssey/agents_v2_gen/models/versions.py +37 -0
- asteroid_odyssey/agents_v2_gen/py.typed +0 -0
- asteroid_odyssey/agents_v2_gen/rest.py +258 -0
- asteroid_odyssey/client.py +640 -131
- {asteroid_odyssey-1.0.3.dist-info → asteroid_odyssey-1.2.0.dist-info}/METADATA +2 -1
- asteroid_odyssey-1.2.0.dist-info/RECORD +72 -0
- asteroid_odyssey/openapi_client/__init__.py +0 -73
- asteroid_odyssey/openapi_client/api/__init__.py +0 -7
- asteroid_odyssey/openapi_client/api/execution_api.py +0 -335
- asteroid_odyssey/openapi_client/models/__init__.py +0 -27
- asteroid_odyssey-1.0.3.dist-info/RECORD +0 -29
- /asteroid_odyssey/{openapi_client → agents_v1_gen}/api_response.py +0 -0
- /asteroid_odyssey/{openapi_client → agents_v1_gen}/exceptions.py +0 -0
- /asteroid_odyssey/{openapi_client → agents_v1_gen}/models/browser_session_recording_response.py +0 -0
- /asteroid_odyssey/{openapi_client → agents_v1_gen}/models/error_response.py +0 -0
- /asteroid_odyssey/{openapi_client → agents_v1_gen}/models/execution_response.py +0 -0
- /asteroid_odyssey/{openapi_client → agents_v1_gen}/models/execution_result.py +0 -0
- /asteroid_odyssey/{openapi_client → agents_v1_gen}/models/health_check200_response.py +0 -0
- /asteroid_odyssey/{openapi_client → agents_v1_gen}/models/health_check500_response.py +0 -0
- /asteroid_odyssey/{openapi_client → agents_v1_gen}/models/status.py +0 -0
- /asteroid_odyssey/{openapi_client → agents_v1_gen}/models/structured_agent_execution_request.py +0 -0
- /asteroid_odyssey/{openapi_client → agents_v1_gen}/models/upload_execution_files200_response.py +0 -0
- /asteroid_odyssey/{openapi_client → agents_v1_gen}/py.typed +0 -0
- {asteroid_odyssey-1.0.3.dist-info → asteroid_odyssey-1.2.0.dist-info}/WHEEL +0 -0
- {asteroid_odyssey-1.0.3.dist-info → asteroid_odyssey-1.2.0.dist-info}/top_level.txt +0 -0
|
@@ -16,11 +16,11 @@ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
|
|
16
16
|
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
17
17
|
from typing_extensions import Annotated
|
|
18
18
|
|
|
19
|
-
from asteroid_odyssey.
|
|
19
|
+
from asteroid_odyssey.agents_v1_gen.models.health_check200_response import HealthCheck200Response
|
|
20
20
|
|
|
21
|
-
from asteroid_odyssey.
|
|
22
|
-
from asteroid_odyssey.
|
|
23
|
-
from asteroid_odyssey.
|
|
21
|
+
from asteroid_odyssey.agents_v1_gen.api_client import ApiClient, RequestSerialized
|
|
22
|
+
from asteroid_odyssey.agents_v1_gen.api_response import ApiResponse
|
|
23
|
+
from asteroid_odyssey.agents_v1_gen.rest import RESTResponseType
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
class APIApi:
|
|
@@ -16,21 +16,22 @@ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
|
|
16
16
|
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
17
17
|
from typing_extensions import Annotated
|
|
18
18
|
|
|
19
|
-
from pydantic import Field, StrictStr
|
|
20
|
-
from typing import Any, Dict
|
|
19
|
+
from pydantic import Field, StrictBytes, StrictStr
|
|
20
|
+
from typing import Any, Dict, List, Optional, Tuple, Union
|
|
21
21
|
from typing_extensions import Annotated
|
|
22
|
-
from asteroid_odyssey.
|
|
23
|
-
from asteroid_odyssey.
|
|
24
|
-
from asteroid_odyssey.
|
|
25
|
-
from asteroid_odyssey.
|
|
26
|
-
from asteroid_odyssey.
|
|
22
|
+
from asteroid_odyssey.agents_v1_gen.models.browser_session_recording_response import BrowserSessionRecordingResponse
|
|
23
|
+
from asteroid_odyssey.agents_v1_gen.models.execution_response import ExecutionResponse
|
|
24
|
+
from asteroid_odyssey.agents_v1_gen.models.execution_result_response import ExecutionResultResponse
|
|
25
|
+
from asteroid_odyssey.agents_v1_gen.models.execution_status_response import ExecutionStatusResponse
|
|
26
|
+
from asteroid_odyssey.agents_v1_gen.models.structured_agent_execution_request import StructuredAgentExecutionRequest
|
|
27
|
+
from asteroid_odyssey.agents_v1_gen.models.upload_execution_files200_response import UploadExecutionFiles200Response
|
|
27
28
|
|
|
28
|
-
from asteroid_odyssey.
|
|
29
|
-
from asteroid_odyssey.
|
|
30
|
-
from asteroid_odyssey.
|
|
29
|
+
from asteroid_odyssey.agents_v1_gen.api_client import ApiClient, RequestSerialized
|
|
30
|
+
from asteroid_odyssey.agents_v1_gen.api_response import ApiResponse
|
|
31
|
+
from asteroid_odyssey.agents_v1_gen.rest import RESTResponseType
|
|
31
32
|
|
|
32
33
|
|
|
33
|
-
class
|
|
34
|
+
class ExecutionApi:
|
|
34
35
|
"""NOTE: This class is auto generated by OpenAPI Generator
|
|
35
36
|
Ref: https://openapi-generator.tech
|
|
36
37
|
|
|
@@ -61,7 +62,7 @@ class SDKApi:
|
|
|
61
62
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
62
63
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
63
64
|
) -> ExecutionResponse:
|
|
64
|
-
"""Execute an agent
|
|
65
|
+
"""(Deprecated) Execute an agent
|
|
65
66
|
|
|
66
67
|
Executes an agent with the provided parameters
|
|
67
68
|
|
|
@@ -90,6 +91,7 @@ class SDKApi:
|
|
|
90
91
|
:type _host_index: int, optional
|
|
91
92
|
:return: Returns the result object.
|
|
92
93
|
""" # noqa: E501
|
|
94
|
+
warnings.warn("POST /agent/{id} is deprecated.", DeprecationWarning)
|
|
93
95
|
|
|
94
96
|
_param = self._execute_agent_serialize(
|
|
95
97
|
id=id,
|
|
@@ -135,7 +137,7 @@ class SDKApi:
|
|
|
135
137
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
136
138
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
137
139
|
) -> ApiResponse[ExecutionResponse]:
|
|
138
|
-
"""Execute an agent
|
|
140
|
+
"""(Deprecated) Execute an agent
|
|
139
141
|
|
|
140
142
|
Executes an agent with the provided parameters
|
|
141
143
|
|
|
@@ -164,6 +166,7 @@ class SDKApi:
|
|
|
164
166
|
:type _host_index: int, optional
|
|
165
167
|
:return: Returns the result object.
|
|
166
168
|
""" # noqa: E501
|
|
169
|
+
warnings.warn("POST /agent/{id} is deprecated.", DeprecationWarning)
|
|
167
170
|
|
|
168
171
|
_param = self._execute_agent_serialize(
|
|
169
172
|
id=id,
|
|
@@ -209,7 +212,7 @@ class SDKApi:
|
|
|
209
212
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
210
213
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
211
214
|
) -> RESTResponseType:
|
|
212
|
-
"""Execute an agent
|
|
215
|
+
"""(Deprecated) Execute an agent
|
|
213
216
|
|
|
214
217
|
Executes an agent with the provided parameters
|
|
215
218
|
|
|
@@ -238,6 +241,7 @@ class SDKApi:
|
|
|
238
241
|
:type _host_index: int, optional
|
|
239
242
|
:return: Returns the result object.
|
|
240
243
|
""" # noqa: E501
|
|
244
|
+
warnings.warn("POST /agent/{id} is deprecated.", DeprecationWarning)
|
|
241
245
|
|
|
242
246
|
_param = self._execute_agent_serialize(
|
|
243
247
|
id=id,
|
|
@@ -1432,3 +1436,299 @@ class SDKApi:
|
|
|
1432
1436
|
)
|
|
1433
1437
|
|
|
1434
1438
|
|
|
1439
|
+
|
|
1440
|
+
|
|
1441
|
+
@validate_call
|
|
1442
|
+
def upload_execution_files(
|
|
1443
|
+
self,
|
|
1444
|
+
id: Annotated[StrictStr, Field(description="The ID of the execution")],
|
|
1445
|
+
files: Annotated[Optional[List[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]]], Field(description="Files to upload to the execution")] = None,
|
|
1446
|
+
_request_timeout: Union[
|
|
1447
|
+
None,
|
|
1448
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1449
|
+
Tuple[
|
|
1450
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1451
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1452
|
+
]
|
|
1453
|
+
] = None,
|
|
1454
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1455
|
+
_content_type: Optional[StrictStr] = None,
|
|
1456
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1457
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1458
|
+
) -> UploadExecutionFiles200Response:
|
|
1459
|
+
"""Upload files to an execution
|
|
1460
|
+
|
|
1461
|
+
|
|
1462
|
+
:param id: The ID of the execution (required)
|
|
1463
|
+
:type id: str
|
|
1464
|
+
:param files: Files to upload to the execution
|
|
1465
|
+
:type files: List[bytearray]
|
|
1466
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1467
|
+
number provided, it will be total request
|
|
1468
|
+
timeout. It can also be a pair (tuple) of
|
|
1469
|
+
(connection, read) timeouts.
|
|
1470
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1471
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1472
|
+
request; this effectively ignores the
|
|
1473
|
+
authentication in the spec for a single request.
|
|
1474
|
+
:type _request_auth: dict, optional
|
|
1475
|
+
:param _content_type: force content-type for the request.
|
|
1476
|
+
:type _content_type: str, Optional
|
|
1477
|
+
:param _headers: set to override the headers for a single
|
|
1478
|
+
request; this effectively ignores the headers
|
|
1479
|
+
in the spec for a single request.
|
|
1480
|
+
:type _headers: dict, optional
|
|
1481
|
+
:param _host_index: set to override the host_index for a single
|
|
1482
|
+
request; this effectively ignores the host_index
|
|
1483
|
+
in the spec for a single request.
|
|
1484
|
+
:type _host_index: int, optional
|
|
1485
|
+
:return: Returns the result object.
|
|
1486
|
+
""" # noqa: E501
|
|
1487
|
+
|
|
1488
|
+
_param = self._upload_execution_files_serialize(
|
|
1489
|
+
id=id,
|
|
1490
|
+
files=files,
|
|
1491
|
+
_request_auth=_request_auth,
|
|
1492
|
+
_content_type=_content_type,
|
|
1493
|
+
_headers=_headers,
|
|
1494
|
+
_host_index=_host_index
|
|
1495
|
+
)
|
|
1496
|
+
|
|
1497
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1498
|
+
'200': "UploadExecutionFiles200Response",
|
|
1499
|
+
'400': "ErrorResponse",
|
|
1500
|
+
'401': "ErrorResponse",
|
|
1501
|
+
'404': "ErrorResponse",
|
|
1502
|
+
}
|
|
1503
|
+
response_data = self.api_client.call_api(
|
|
1504
|
+
*_param,
|
|
1505
|
+
_request_timeout=_request_timeout
|
|
1506
|
+
)
|
|
1507
|
+
response_data.read()
|
|
1508
|
+
return self.api_client.response_deserialize(
|
|
1509
|
+
response_data=response_data,
|
|
1510
|
+
response_types_map=_response_types_map,
|
|
1511
|
+
).data
|
|
1512
|
+
|
|
1513
|
+
|
|
1514
|
+
@validate_call
|
|
1515
|
+
def upload_execution_files_with_http_info(
|
|
1516
|
+
self,
|
|
1517
|
+
id: Annotated[StrictStr, Field(description="The ID of the execution")],
|
|
1518
|
+
files: Annotated[Optional[List[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]]], Field(description="Files to upload to the execution")] = None,
|
|
1519
|
+
_request_timeout: Union[
|
|
1520
|
+
None,
|
|
1521
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1522
|
+
Tuple[
|
|
1523
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1524
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1525
|
+
]
|
|
1526
|
+
] = None,
|
|
1527
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1528
|
+
_content_type: Optional[StrictStr] = None,
|
|
1529
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1530
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1531
|
+
) -> ApiResponse[UploadExecutionFiles200Response]:
|
|
1532
|
+
"""Upload files to an execution
|
|
1533
|
+
|
|
1534
|
+
|
|
1535
|
+
:param id: The ID of the execution (required)
|
|
1536
|
+
:type id: str
|
|
1537
|
+
:param files: Files to upload to the execution
|
|
1538
|
+
:type files: List[bytearray]
|
|
1539
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1540
|
+
number provided, it will be total request
|
|
1541
|
+
timeout. It can also be a pair (tuple) of
|
|
1542
|
+
(connection, read) timeouts.
|
|
1543
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1544
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1545
|
+
request; this effectively ignores the
|
|
1546
|
+
authentication in the spec for a single request.
|
|
1547
|
+
:type _request_auth: dict, optional
|
|
1548
|
+
:param _content_type: force content-type for the request.
|
|
1549
|
+
:type _content_type: str, Optional
|
|
1550
|
+
:param _headers: set to override the headers for a single
|
|
1551
|
+
request; this effectively ignores the headers
|
|
1552
|
+
in the spec for a single request.
|
|
1553
|
+
:type _headers: dict, optional
|
|
1554
|
+
:param _host_index: set to override the host_index for a single
|
|
1555
|
+
request; this effectively ignores the host_index
|
|
1556
|
+
in the spec for a single request.
|
|
1557
|
+
:type _host_index: int, optional
|
|
1558
|
+
:return: Returns the result object.
|
|
1559
|
+
""" # noqa: E501
|
|
1560
|
+
|
|
1561
|
+
_param = self._upload_execution_files_serialize(
|
|
1562
|
+
id=id,
|
|
1563
|
+
files=files,
|
|
1564
|
+
_request_auth=_request_auth,
|
|
1565
|
+
_content_type=_content_type,
|
|
1566
|
+
_headers=_headers,
|
|
1567
|
+
_host_index=_host_index
|
|
1568
|
+
)
|
|
1569
|
+
|
|
1570
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1571
|
+
'200': "UploadExecutionFiles200Response",
|
|
1572
|
+
'400': "ErrorResponse",
|
|
1573
|
+
'401': "ErrorResponse",
|
|
1574
|
+
'404': "ErrorResponse",
|
|
1575
|
+
}
|
|
1576
|
+
response_data = self.api_client.call_api(
|
|
1577
|
+
*_param,
|
|
1578
|
+
_request_timeout=_request_timeout
|
|
1579
|
+
)
|
|
1580
|
+
response_data.read()
|
|
1581
|
+
return self.api_client.response_deserialize(
|
|
1582
|
+
response_data=response_data,
|
|
1583
|
+
response_types_map=_response_types_map,
|
|
1584
|
+
)
|
|
1585
|
+
|
|
1586
|
+
|
|
1587
|
+
@validate_call
|
|
1588
|
+
def upload_execution_files_without_preload_content(
|
|
1589
|
+
self,
|
|
1590
|
+
id: Annotated[StrictStr, Field(description="The ID of the execution")],
|
|
1591
|
+
files: Annotated[Optional[List[Union[StrictBytes, StrictStr, Tuple[StrictStr, StrictBytes]]]], Field(description="Files to upload to the execution")] = None,
|
|
1592
|
+
_request_timeout: Union[
|
|
1593
|
+
None,
|
|
1594
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1595
|
+
Tuple[
|
|
1596
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1597
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1598
|
+
]
|
|
1599
|
+
] = None,
|
|
1600
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1601
|
+
_content_type: Optional[StrictStr] = None,
|
|
1602
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1603
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1604
|
+
) -> RESTResponseType:
|
|
1605
|
+
"""Upload files to an execution
|
|
1606
|
+
|
|
1607
|
+
|
|
1608
|
+
:param id: The ID of the execution (required)
|
|
1609
|
+
:type id: str
|
|
1610
|
+
:param files: Files to upload to the execution
|
|
1611
|
+
:type files: List[bytearray]
|
|
1612
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1613
|
+
number provided, it will be total request
|
|
1614
|
+
timeout. It can also be a pair (tuple) of
|
|
1615
|
+
(connection, read) timeouts.
|
|
1616
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1617
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1618
|
+
request; this effectively ignores the
|
|
1619
|
+
authentication in the spec for a single request.
|
|
1620
|
+
:type _request_auth: dict, optional
|
|
1621
|
+
:param _content_type: force content-type for the request.
|
|
1622
|
+
:type _content_type: str, Optional
|
|
1623
|
+
:param _headers: set to override the headers for a single
|
|
1624
|
+
request; this effectively ignores the headers
|
|
1625
|
+
in the spec for a single request.
|
|
1626
|
+
:type _headers: dict, optional
|
|
1627
|
+
:param _host_index: set to override the host_index for a single
|
|
1628
|
+
request; this effectively ignores the host_index
|
|
1629
|
+
in the spec for a single request.
|
|
1630
|
+
:type _host_index: int, optional
|
|
1631
|
+
:return: Returns the result object.
|
|
1632
|
+
""" # noqa: E501
|
|
1633
|
+
|
|
1634
|
+
_param = self._upload_execution_files_serialize(
|
|
1635
|
+
id=id,
|
|
1636
|
+
files=files,
|
|
1637
|
+
_request_auth=_request_auth,
|
|
1638
|
+
_content_type=_content_type,
|
|
1639
|
+
_headers=_headers,
|
|
1640
|
+
_host_index=_host_index
|
|
1641
|
+
)
|
|
1642
|
+
|
|
1643
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1644
|
+
'200': "UploadExecutionFiles200Response",
|
|
1645
|
+
'400': "ErrorResponse",
|
|
1646
|
+
'401': "ErrorResponse",
|
|
1647
|
+
'404': "ErrorResponse",
|
|
1648
|
+
}
|
|
1649
|
+
response_data = self.api_client.call_api(
|
|
1650
|
+
*_param,
|
|
1651
|
+
_request_timeout=_request_timeout
|
|
1652
|
+
)
|
|
1653
|
+
return response_data.response
|
|
1654
|
+
|
|
1655
|
+
|
|
1656
|
+
def _upload_execution_files_serialize(
|
|
1657
|
+
self,
|
|
1658
|
+
id,
|
|
1659
|
+
files,
|
|
1660
|
+
_request_auth,
|
|
1661
|
+
_content_type,
|
|
1662
|
+
_headers,
|
|
1663
|
+
_host_index,
|
|
1664
|
+
) -> RequestSerialized:
|
|
1665
|
+
|
|
1666
|
+
_host = None
|
|
1667
|
+
|
|
1668
|
+
_collection_formats: Dict[str, str] = {
|
|
1669
|
+
'files': 'csv',
|
|
1670
|
+
}
|
|
1671
|
+
|
|
1672
|
+
_path_params: Dict[str, str] = {}
|
|
1673
|
+
_query_params: List[Tuple[str, str]] = []
|
|
1674
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
1675
|
+
_form_params: List[Tuple[str, str]] = []
|
|
1676
|
+
_files: Dict[
|
|
1677
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
1678
|
+
] = {}
|
|
1679
|
+
_body_params: Optional[bytes] = None
|
|
1680
|
+
|
|
1681
|
+
# process the path parameters
|
|
1682
|
+
if id is not None:
|
|
1683
|
+
_path_params['id'] = id
|
|
1684
|
+
# process the query parameters
|
|
1685
|
+
# process the header parameters
|
|
1686
|
+
# process the form parameters
|
|
1687
|
+
if files is not None:
|
|
1688
|
+
_files['files'] = files
|
|
1689
|
+
# process the body parameter
|
|
1690
|
+
|
|
1691
|
+
|
|
1692
|
+
# set the HTTP header `Accept`
|
|
1693
|
+
if 'Accept' not in _header_params:
|
|
1694
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
1695
|
+
[
|
|
1696
|
+
'application/json'
|
|
1697
|
+
]
|
|
1698
|
+
)
|
|
1699
|
+
|
|
1700
|
+
# set the HTTP header `Content-Type`
|
|
1701
|
+
if _content_type:
|
|
1702
|
+
_header_params['Content-Type'] = _content_type
|
|
1703
|
+
else:
|
|
1704
|
+
_default_content_type = (
|
|
1705
|
+
self.api_client.select_header_content_type(
|
|
1706
|
+
[
|
|
1707
|
+
'multipart/form-data'
|
|
1708
|
+
]
|
|
1709
|
+
)
|
|
1710
|
+
)
|
|
1711
|
+
if _default_content_type is not None:
|
|
1712
|
+
_header_params['Content-Type'] = _default_content_type
|
|
1713
|
+
|
|
1714
|
+
# authentication setting
|
|
1715
|
+
_auth_settings: List[str] = [
|
|
1716
|
+
'ApiKeyAuth'
|
|
1717
|
+
]
|
|
1718
|
+
|
|
1719
|
+
return self.api_client.param_serialize(
|
|
1720
|
+
method='POST',
|
|
1721
|
+
resource_path='/execution/{id}/files',
|
|
1722
|
+
path_params=_path_params,
|
|
1723
|
+
query_params=_query_params,
|
|
1724
|
+
header_params=_header_params,
|
|
1725
|
+
body=_body_params,
|
|
1726
|
+
post_params=_form_params,
|
|
1727
|
+
files=_files,
|
|
1728
|
+
auth_settings=_auth_settings,
|
|
1729
|
+
collection_formats=_collection_formats,
|
|
1730
|
+
_host=_host,
|
|
1731
|
+
_request_auth=_request_auth
|
|
1732
|
+
)
|
|
1733
|
+
|
|
1734
|
+
|
|
@@ -26,11 +26,11 @@ from urllib.parse import quote
|
|
|
26
26
|
from typing import Tuple, Optional, List, Dict, Union
|
|
27
27
|
from pydantic import SecretStr
|
|
28
28
|
|
|
29
|
-
from asteroid_odyssey.
|
|
30
|
-
from asteroid_odyssey.
|
|
31
|
-
import asteroid_odyssey.
|
|
32
|
-
from asteroid_odyssey.
|
|
33
|
-
from asteroid_odyssey.
|
|
29
|
+
from asteroid_odyssey.agents_v1_gen.configuration import Configuration
|
|
30
|
+
from asteroid_odyssey.agents_v1_gen.api_response import ApiResponse, T as ApiResponseT
|
|
31
|
+
import asteroid_odyssey.agents_v1_gen.models
|
|
32
|
+
from asteroid_odyssey.agents_v1_gen import rest
|
|
33
|
+
from asteroid_odyssey.agents_v1_gen.exceptions import (
|
|
34
34
|
ApiValueError,
|
|
35
35
|
ApiException,
|
|
36
36
|
BadRequestException,
|
|
@@ -453,7 +453,7 @@ class ApiClient:
|
|
|
453
453
|
if klass in self.NATIVE_TYPES_MAPPING:
|
|
454
454
|
klass = self.NATIVE_TYPES_MAPPING[klass]
|
|
455
455
|
else:
|
|
456
|
-
klass = getattr(asteroid_odyssey.
|
|
456
|
+
klass = getattr(asteroid_odyssey.agents_v1_gen.models, klass)
|
|
457
457
|
|
|
458
458
|
if klass in self.PRIMITIVE_TYPES:
|
|
459
459
|
return self.__deserialize_primitive(data, klass)
|
|
@@ -177,7 +177,7 @@ class Configuration:
|
|
|
177
177
|
|
|
178
178
|
You can programmatically set the cookie:
|
|
179
179
|
|
|
180
|
-
conf = asteroid_odyssey.
|
|
180
|
+
conf = asteroid_odyssey.agents_v1_gen.Configuration(
|
|
181
181
|
api_key={'cookieAuth': 'abc123'}
|
|
182
182
|
api_key_prefix={'cookieAuth': 'JSESSIONID'}
|
|
183
183
|
)
|
|
@@ -252,7 +252,7 @@ conf = asteroid_odyssey.openapi_client.Configuration(
|
|
|
252
252
|
self.logger = {}
|
|
253
253
|
"""Logging Settings
|
|
254
254
|
"""
|
|
255
|
-
self.logger["package_logger"] = logging.getLogger("asteroid_odyssey.
|
|
255
|
+
self.logger["package_logger"] = logging.getLogger("asteroid_odyssey.agents_v1_gen")
|
|
256
256
|
self.logger["urllib3_logger"] = logging.getLogger("urllib3")
|
|
257
257
|
self.logger_format = '%(asctime)s %(levelname)s %(message)s'
|
|
258
258
|
"""Log format
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
# flake8: noqa
|
|
4
|
+
"""
|
|
5
|
+
Asteroid Agents API
|
|
6
|
+
|
|
7
|
+
Version 1 of the Asteroid Agents API
|
|
8
|
+
|
|
9
|
+
The version of the OpenAPI document: v1.0.0
|
|
10
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
11
|
+
|
|
12
|
+
Do not edit the class manually.
|
|
13
|
+
""" # noqa: E501
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
# import models into model package
|
|
17
|
+
from asteroid_odyssey.agents_v1_gen.models.agent_profile import AgentProfile
|
|
18
|
+
from asteroid_odyssey.agents_v1_gen.models.browser_session_recording_response import BrowserSessionRecordingResponse
|
|
19
|
+
from asteroid_odyssey.agents_v1_gen.models.country_code import CountryCode
|
|
20
|
+
from asteroid_odyssey.agents_v1_gen.models.create_agent_profile_request import CreateAgentProfileRequest
|
|
21
|
+
from asteroid_odyssey.agents_v1_gen.models.credential import Credential
|
|
22
|
+
from asteroid_odyssey.agents_v1_gen.models.delete_agent_profile200_response import DeleteAgentProfile200Response
|
|
23
|
+
from asteroid_odyssey.agents_v1_gen.models.error_response import ErrorResponse
|
|
24
|
+
from asteroid_odyssey.agents_v1_gen.models.execution_response import ExecutionResponse
|
|
25
|
+
from asteroid_odyssey.agents_v1_gen.models.execution_result import ExecutionResult
|
|
26
|
+
from asteroid_odyssey.agents_v1_gen.models.execution_result_response import ExecutionResultResponse
|
|
27
|
+
from asteroid_odyssey.agents_v1_gen.models.execution_status_response import ExecutionStatusResponse
|
|
28
|
+
from asteroid_odyssey.agents_v1_gen.models.health_check200_response import HealthCheck200Response
|
|
29
|
+
from asteroid_odyssey.agents_v1_gen.models.health_check500_response import HealthCheck500Response
|
|
30
|
+
from asteroid_odyssey.agents_v1_gen.models.proxy_type import ProxyType
|
|
31
|
+
from asteroid_odyssey.agents_v1_gen.models.status import Status
|
|
32
|
+
from asteroid_odyssey.agents_v1_gen.models.structured_agent_execution_request import StructuredAgentExecutionRequest
|
|
33
|
+
from asteroid_odyssey.agents_v1_gen.models.update_agent_profile_request import UpdateAgentProfileRequest
|
|
34
|
+
from asteroid_odyssey.agents_v1_gen.models.upload_execution_files200_response import UploadExecutionFiles200Response
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Asteroid Agents API
|
|
5
|
+
|
|
6
|
+
Version 1 of the Asteroid Agents API
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: v1.0.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from datetime import datetime
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
|
23
|
+
from asteroid_odyssey.agents_v1_gen.models.country_code import CountryCode
|
|
24
|
+
from asteroid_odyssey.agents_v1_gen.models.credential import Credential
|
|
25
|
+
from asteroid_odyssey.agents_v1_gen.models.proxy_type import ProxyType
|
|
26
|
+
from typing import Optional, Set
|
|
27
|
+
from typing_extensions import Self
|
|
28
|
+
|
|
29
|
+
class AgentProfile(BaseModel):
|
|
30
|
+
"""
|
|
31
|
+
AgentProfile
|
|
32
|
+
""" # noqa: E501
|
|
33
|
+
id: StrictStr = Field(description="Unique identifier for the agent profile")
|
|
34
|
+
name: StrictStr = Field(description="Name of the agent profile (unique within organization)")
|
|
35
|
+
description: StrictStr = Field(description="Description of the agent profile")
|
|
36
|
+
organization_id: StrictStr = Field(description="The ID of the organization that the agent profile belongs to")
|
|
37
|
+
proxy_cc: CountryCode
|
|
38
|
+
proxy_type: ProxyType
|
|
39
|
+
captcha_solver_active: StrictBool = Field(description="Whether the captcha solver is active for this profile")
|
|
40
|
+
sticky_ip: StrictBool = Field(description="Whether the same IP address should be used for all executions of this profile")
|
|
41
|
+
credentials: List[Credential] = Field(description="List of credentials associated with this agent profile")
|
|
42
|
+
created_at: datetime = Field(description="The date and time the agent profile was created")
|
|
43
|
+
updated_at: datetime = Field(description="The last update time of the agent profile")
|
|
44
|
+
__properties: ClassVar[List[str]] = ["id", "name", "description", "organization_id", "proxy_cc", "proxy_type", "captcha_solver_active", "sticky_ip", "credentials", "created_at", "updated_at"]
|
|
45
|
+
|
|
46
|
+
model_config = ConfigDict(
|
|
47
|
+
populate_by_name=True,
|
|
48
|
+
validate_assignment=True,
|
|
49
|
+
protected_namespaces=(),
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def to_str(self) -> str:
|
|
54
|
+
"""Returns the string representation of the model using alias"""
|
|
55
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
56
|
+
|
|
57
|
+
def to_json(self) -> str:
|
|
58
|
+
"""Returns the JSON representation of the model using alias"""
|
|
59
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
60
|
+
return json.dumps(self.to_dict())
|
|
61
|
+
|
|
62
|
+
@classmethod
|
|
63
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
64
|
+
"""Create an instance of AgentProfile from a JSON string"""
|
|
65
|
+
return cls.from_dict(json.loads(json_str))
|
|
66
|
+
|
|
67
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
68
|
+
"""Return the dictionary representation of the model using alias.
|
|
69
|
+
|
|
70
|
+
This has the following differences from calling pydantic's
|
|
71
|
+
`self.model_dump(by_alias=True)`:
|
|
72
|
+
|
|
73
|
+
* `None` is only added to the output dict for nullable fields that
|
|
74
|
+
were set at model initialization. Other fields with value `None`
|
|
75
|
+
are ignored.
|
|
76
|
+
"""
|
|
77
|
+
excluded_fields: Set[str] = set([
|
|
78
|
+
])
|
|
79
|
+
|
|
80
|
+
_dict = self.model_dump(
|
|
81
|
+
by_alias=True,
|
|
82
|
+
exclude=excluded_fields,
|
|
83
|
+
exclude_none=True,
|
|
84
|
+
)
|
|
85
|
+
# override the default output from pydantic by calling `to_dict()` of each item in credentials (list)
|
|
86
|
+
_items = []
|
|
87
|
+
if self.credentials:
|
|
88
|
+
for _item_credentials in self.credentials:
|
|
89
|
+
if _item_credentials:
|
|
90
|
+
_items.append(_item_credentials.to_dict())
|
|
91
|
+
_dict['credentials'] = _items
|
|
92
|
+
return _dict
|
|
93
|
+
|
|
94
|
+
@classmethod
|
|
95
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
96
|
+
"""Create an instance of AgentProfile from a dict"""
|
|
97
|
+
if obj is None:
|
|
98
|
+
return None
|
|
99
|
+
|
|
100
|
+
if not isinstance(obj, dict):
|
|
101
|
+
return cls.model_validate(obj)
|
|
102
|
+
|
|
103
|
+
_obj = cls.model_validate({
|
|
104
|
+
"id": obj.get("id"),
|
|
105
|
+
"name": obj.get("name"),
|
|
106
|
+
"description": obj.get("description"),
|
|
107
|
+
"organization_id": obj.get("organization_id"),
|
|
108
|
+
"proxy_cc": obj.get("proxy_cc"),
|
|
109
|
+
"proxy_type": obj.get("proxy_type"),
|
|
110
|
+
"captcha_solver_active": obj.get("captcha_solver_active"),
|
|
111
|
+
"sticky_ip": obj.get("sticky_ip"),
|
|
112
|
+
"credentials": [Credential.from_dict(_item) for _item in obj["credentials"]] if obj.get("credentials") is not None else None,
|
|
113
|
+
"created_at": obj.get("created_at"),
|
|
114
|
+
"updated_at": obj.get("updated_at")
|
|
115
|
+
})
|
|
116
|
+
return _obj
|
|
117
|
+
|
|
118
|
+
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Asteroid Agents API
|
|
5
|
+
|
|
6
|
+
Version 1 of the Asteroid Agents API
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: v1.0.0
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import json
|
|
17
|
+
from enum import Enum
|
|
18
|
+
from typing_extensions import Self
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class CountryCode(str, Enum):
|
|
22
|
+
"""
|
|
23
|
+
Two-letter country code for proxy location
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
"""
|
|
27
|
+
allowed enum values
|
|
28
|
+
"""
|
|
29
|
+
US = 'us'
|
|
30
|
+
UK = 'uk'
|
|
31
|
+
FR = 'fr'
|
|
32
|
+
IT = 'it'
|
|
33
|
+
JP = 'jp'
|
|
34
|
+
AU = 'au'
|
|
35
|
+
DE = 'de'
|
|
36
|
+
FI = 'fi'
|
|
37
|
+
CA = 'ca'
|
|
38
|
+
|
|
39
|
+
@classmethod
|
|
40
|
+
def from_json(cls, json_str: str) -> Self:
|
|
41
|
+
"""Create an instance of CountryCode from a JSON string"""
|
|
42
|
+
return cls(json.loads(json_str))
|
|
43
|
+
|
|
44
|
+
|