asteroid-odyssey 1.3.8__py3-none-any.whl → 1.3.10__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.
@@ -112,8 +112,10 @@ from asteroid_odyssey.agents_v2_gen.models.agents_graph_models_transitions_trans
112
112
  from asteroid_odyssey.agents_v2_gen.models.common_bad_request_error_body import CommonBadRequestErrorBody
113
113
  from asteroid_odyssey.agents_v2_gen.models.common_error import CommonError
114
114
  from asteroid_odyssey.agents_v2_gen.models.common_forbidden_error_body import CommonForbiddenErrorBody
115
+ from asteroid_odyssey.agents_v2_gen.models.common_internal_server_error_body import CommonInternalServerErrorBody
115
116
  from asteroid_odyssey.agents_v2_gen.models.common_not_found_error_body import CommonNotFoundErrorBody
116
117
  from asteroid_odyssey.agents_v2_gen.models.common_os_error import CommonOSError
117
118
  from asteroid_odyssey.agents_v2_gen.models.common_sort_direction import CommonSortDirection
119
+ from asteroid_odyssey.agents_v2_gen.models.common_unauthorized_error_body import CommonUnauthorizedErrorBody
118
120
  from asteroid_odyssey.agents_v2_gen.models.executions_list200_response import ExecutionsList200Response
119
121
  from asteroid_odyssey.agents_v2_gen.models.version import Version
@@ -110,8 +110,10 @@ class ExecutionApi:
110
110
  _response_types_map: Dict[str, Optional[str]] = {
111
111
  '200': "List[AgentsExecutionActivity]",
112
112
  '400': "CommonBadRequestErrorBody",
113
+ '401': "CommonUnauthorizedErrorBody",
113
114
  '403': "CommonForbiddenErrorBody",
114
115
  '404': "CommonNotFoundErrorBody",
116
+ '500': "CommonInternalServerErrorBody",
115
117
  }
116
118
  response_data = self.api_client.call_api(
117
119
  *_param,
@@ -188,8 +190,10 @@ class ExecutionApi:
188
190
  _response_types_map: Dict[str, Optional[str]] = {
189
191
  '200': "List[AgentsExecutionActivity]",
190
192
  '400': "CommonBadRequestErrorBody",
193
+ '401': "CommonUnauthorizedErrorBody",
191
194
  '403': "CommonForbiddenErrorBody",
192
195
  '404': "CommonNotFoundErrorBody",
196
+ '500': "CommonInternalServerErrorBody",
193
197
  }
194
198
  response_data = self.api_client.call_api(
195
199
  *_param,
@@ -266,8 +270,10 @@ class ExecutionApi:
266
270
  _response_types_map: Dict[str, Optional[str]] = {
267
271
  '200': "List[AgentsExecutionActivity]",
268
272
  '400': "CommonBadRequestErrorBody",
273
+ '401': "CommonUnauthorizedErrorBody",
269
274
  '403': "CommonForbiddenErrorBody",
270
275
  '404': "CommonNotFoundErrorBody",
276
+ '500': "CommonInternalServerErrorBody",
271
277
  }
272
278
  response_data = self.api_client.call_api(
273
279
  *_param,
@@ -406,8 +412,10 @@ class ExecutionApi:
406
412
  _response_types_map: Dict[str, Optional[str]] = {
407
413
  '200': "AgentsExecutionListItem",
408
414
  '400': "CommonBadRequestErrorBody",
415
+ '401': "CommonUnauthorizedErrorBody",
409
416
  '403': "CommonForbiddenErrorBody",
410
417
  '404': "CommonNotFoundErrorBody",
418
+ '500': "CommonInternalServerErrorBody",
411
419
  }
412
420
  response_data = self.api_client.call_api(
413
421
  *_param,
@@ -476,8 +484,10 @@ class ExecutionApi:
476
484
  _response_types_map: Dict[str, Optional[str]] = {
477
485
  '200': "AgentsExecutionListItem",
478
486
  '400': "CommonBadRequestErrorBody",
487
+ '401': "CommonUnauthorizedErrorBody",
479
488
  '403': "CommonForbiddenErrorBody",
480
489
  '404': "CommonNotFoundErrorBody",
490
+ '500': "CommonInternalServerErrorBody",
481
491
  }
482
492
  response_data = self.api_client.call_api(
483
493
  *_param,
@@ -546,8 +556,10 @@ class ExecutionApi:
546
556
  _response_types_map: Dict[str, Optional[str]] = {
547
557
  '200': "AgentsExecutionListItem",
548
558
  '400': "CommonBadRequestErrorBody",
559
+ '401': "CommonUnauthorizedErrorBody",
549
560
  '403': "CommonForbiddenErrorBody",
550
561
  '404': "CommonNotFoundErrorBody",
562
+ '500': "CommonInternalServerErrorBody",
551
563
  }
552
564
  response_data = self.api_client.call_api(
553
565
  *_param,
@@ -680,8 +692,10 @@ class ExecutionApi:
680
692
  _response_types_map: Dict[str, Optional[str]] = {
681
693
  '201': "str",
682
694
  '400': "CommonBadRequestErrorBody",
695
+ '401': "CommonUnauthorizedErrorBody",
683
696
  '403': "CommonForbiddenErrorBody",
684
697
  '404': "CommonNotFoundErrorBody",
698
+ '500': "CommonInternalServerErrorBody",
685
699
  }
686
700
  response_data = self.api_client.call_api(
687
701
  *_param,
@@ -754,8 +768,10 @@ class ExecutionApi:
754
768
  _response_types_map: Dict[str, Optional[str]] = {
755
769
  '201': "str",
756
770
  '400': "CommonBadRequestErrorBody",
771
+ '401': "CommonUnauthorizedErrorBody",
757
772
  '403': "CommonForbiddenErrorBody",
758
773
  '404': "CommonNotFoundErrorBody",
774
+ '500': "CommonInternalServerErrorBody",
759
775
  }
760
776
  response_data = self.api_client.call_api(
761
777
  *_param,
@@ -828,8 +844,10 @@ class ExecutionApi:
828
844
  _response_types_map: Dict[str, Optional[str]] = {
829
845
  '201': "str",
830
846
  '400': "CommonBadRequestErrorBody",
847
+ '401': "CommonUnauthorizedErrorBody",
831
848
  '403': "CommonForbiddenErrorBody",
832
849
  '404': "CommonNotFoundErrorBody",
850
+ '500': "CommonInternalServerErrorBody",
833
851
  }
834
852
  response_data = self.api_client.call_api(
835
853
  *_param,
@@ -1031,8 +1049,10 @@ class ExecutionApi:
1031
1049
  _response_types_map: Dict[str, Optional[str]] = {
1032
1050
  '200': "ExecutionsList200Response",
1033
1051
  '400': "CommonBadRequestErrorBody",
1052
+ '401': "CommonUnauthorizedErrorBody",
1034
1053
  '403': "CommonForbiddenErrorBody",
1035
1054
  '404': "CommonNotFoundErrorBody",
1055
+ '500': "CommonInternalServerErrorBody",
1036
1056
  }
1037
1057
  response_data = self.api_client.call_api(
1038
1058
  *_param,
@@ -1157,8 +1177,10 @@ class ExecutionApi:
1157
1177
  _response_types_map: Dict[str, Optional[str]] = {
1158
1178
  '200': "ExecutionsList200Response",
1159
1179
  '400': "CommonBadRequestErrorBody",
1180
+ '401': "CommonUnauthorizedErrorBody",
1160
1181
  '403': "CommonForbiddenErrorBody",
1161
1182
  '404': "CommonNotFoundErrorBody",
1183
+ '500': "CommonInternalServerErrorBody",
1162
1184
  }
1163
1185
  response_data = self.api_client.call_api(
1164
1186
  *_param,
@@ -1283,8 +1305,10 @@ class ExecutionApi:
1283
1305
  _response_types_map: Dict[str, Optional[str]] = {
1284
1306
  '200': "ExecutionsList200Response",
1285
1307
  '400': "CommonBadRequestErrorBody",
1308
+ '401': "CommonUnauthorizedErrorBody",
1286
1309
  '403': "CommonForbiddenErrorBody",
1287
1310
  '404': "CommonNotFoundErrorBody",
1311
+ '500': "CommonInternalServerErrorBody",
1288
1312
  }
1289
1313
  response_data = self.api_client.call_api(
1290
1314
  *_param,
@@ -93,8 +93,10 @@ from asteroid_odyssey.agents_v2_gen.models.agents_graph_models_transitions_trans
93
93
  from asteroid_odyssey.agents_v2_gen.models.common_bad_request_error_body import CommonBadRequestErrorBody
94
94
  from asteroid_odyssey.agents_v2_gen.models.common_error import CommonError
95
95
  from asteroid_odyssey.agents_v2_gen.models.common_forbidden_error_body import CommonForbiddenErrorBody
96
+ from asteroid_odyssey.agents_v2_gen.models.common_internal_server_error_body import CommonInternalServerErrorBody
96
97
  from asteroid_odyssey.agents_v2_gen.models.common_not_found_error_body import CommonNotFoundErrorBody
97
98
  from asteroid_odyssey.agents_v2_gen.models.common_os_error import CommonOSError
98
99
  from asteroid_odyssey.agents_v2_gen.models.common_sort_direction import CommonSortDirection
100
+ from asteroid_odyssey.agents_v2_gen.models.common_unauthorized_error_body import CommonUnauthorizedErrorBody
99
101
  from asteroid_odyssey.agents_v2_gen.models.executions_list200_response import ExecutionsList200Response
100
102
  from asteroid_odyssey.agents_v2_gen.models.version import Version
@@ -36,7 +36,8 @@ class AgentsExecutionListItem(BaseModel):
36
36
  agent_profile_name: Optional[StrictStr] = Field(default=None, description="The name of the agent profile used for this execution (if any)", alias="agentProfileName")
37
37
  agent_version: StrictInt = Field(description="The version of the agent that was executed", alias="agentVersion")
38
38
  agent_version_dirty: StrictBool = Field(description="Whether the agent version was modified from the original", alias="agentVersionDirty")
39
- browser_recording_url: Optional[StrictStr] = Field(default=None, description="Browser recording URL (if a browser session was used)", alias="browserRecordingUrl")
39
+ browser_live_view_url: Optional[StrictStr] = Field(default=None, description="Browser live view URL for debugging (if a browser session is active and execution is running)", alias="browserLiveViewUrl")
40
+ browser_recording_url: Optional[StrictStr] = Field(default=None, description="Browser recording URL (if a browser session was used and execution is terminal)", alias="browserRecordingUrl")
40
41
  comments: List[AgentsExecutionComment] = Field(description="Comments on this execution")
41
42
  created_at: datetime = Field(description="When the execution was created", alias="createdAt")
42
43
  duration: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Execution duration in seconds (only present for terminal executions)")
@@ -48,7 +49,7 @@ class AgentsExecutionListItem(BaseModel):
48
49
  status: AgentsExecutionStatus = Field(description="The current status of the execution")
49
50
  terminal_at: Optional[datetime] = Field(default=None, description="When the execution reached a terminal state (if applicable)", alias="terminalAt")
50
51
  workflow_id: StrictStr = Field(description="The ID of the workflow that was executed", alias="workflowId")
51
- __properties: ClassVar[List[str]] = ["agentId", "agentName", "agentProfileName", "agentVersion", "agentVersionDirty", "browserRecordingUrl", "comments", "createdAt", "duration", "executionResult", "humanLabels", "id", "metadata", "organizationId", "status", "terminalAt", "workflowId"]
52
+ __properties: ClassVar[List[str]] = ["agentId", "agentName", "agentProfileName", "agentVersion", "agentVersionDirty", "browserLiveViewUrl", "browserRecordingUrl", "comments", "createdAt", "duration", "executionResult", "humanLabels", "id", "metadata", "organizationId", "status", "terminalAt", "workflowId"]
52
53
 
53
54
  model_config = ConfigDict(
54
55
  populate_by_name=True,
@@ -123,6 +124,7 @@ class AgentsExecutionListItem(BaseModel):
123
124
  "agentProfileName": obj.get("agentProfileName"),
124
125
  "agentVersion": obj.get("agentVersion"),
125
126
  "agentVersionDirty": obj.get("agentVersionDirty"),
127
+ "browserLiveViewUrl": obj.get("browserLiveViewUrl"),
126
128
  "browserRecordingUrl": obj.get("browserRecordingUrl"),
127
129
  "comments": [AgentsExecutionComment.from_dict(_item) for _item in obj["comments"]] if obj.get("comments") is not None else None,
128
130
  "createdAt": obj.get("createdAt"),
@@ -0,0 +1,96 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Agent Service
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: v1
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 pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr, field_validator
21
+ from typing import Any, ClassVar, Dict, List, Union
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class CommonInternalServerErrorBody(BaseModel):
26
+ """
27
+ CommonInternalServerErrorBody
28
+ """ # noqa: E501
29
+ code: Union[StrictFloat, StrictInt]
30
+ message: StrictStr
31
+ __properties: ClassVar[List[str]] = ["code", "message"]
32
+
33
+ @field_validator('code')
34
+ def code_validate_enum(cls, value):
35
+ """Validates the enum"""
36
+ if value not in set([500]):
37
+ raise ValueError("must be one of enum values (500)")
38
+ return value
39
+
40
+ model_config = ConfigDict(
41
+ populate_by_name=True,
42
+ validate_assignment=True,
43
+ protected_namespaces=(),
44
+ )
45
+
46
+
47
+ def to_str(self) -> str:
48
+ """Returns the string representation of the model using alias"""
49
+ return pprint.pformat(self.model_dump(by_alias=True))
50
+
51
+ def to_json(self) -> str:
52
+ """Returns the JSON representation of the model using alias"""
53
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
54
+ return json.dumps(self.to_dict())
55
+
56
+ @classmethod
57
+ def from_json(cls, json_str: str) -> Optional[Self]:
58
+ """Create an instance of CommonInternalServerErrorBody from a JSON string"""
59
+ return cls.from_dict(json.loads(json_str))
60
+
61
+ def to_dict(self) -> Dict[str, Any]:
62
+ """Return the dictionary representation of the model using alias.
63
+
64
+ This has the following differences from calling pydantic's
65
+ `self.model_dump(by_alias=True)`:
66
+
67
+ * `None` is only added to the output dict for nullable fields that
68
+ were set at model initialization. Other fields with value `None`
69
+ are ignored.
70
+ """
71
+ excluded_fields: Set[str] = set([
72
+ ])
73
+
74
+ _dict = self.model_dump(
75
+ by_alias=True,
76
+ exclude=excluded_fields,
77
+ exclude_none=True,
78
+ )
79
+ return _dict
80
+
81
+ @classmethod
82
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
83
+ """Create an instance of CommonInternalServerErrorBody from a dict"""
84
+ if obj is None:
85
+ return None
86
+
87
+ if not isinstance(obj, dict):
88
+ return cls.model_validate(obj)
89
+
90
+ _obj = cls.model_validate({
91
+ "code": obj.get("code"),
92
+ "message": obj.get("message")
93
+ })
94
+ return _obj
95
+
96
+
@@ -0,0 +1,96 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ Agent Service
5
+
6
+ No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
7
+
8
+ The version of the OpenAPI document: v1
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 pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr, field_validator
21
+ from typing import Any, ClassVar, Dict, List, Union
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class CommonUnauthorizedErrorBody(BaseModel):
26
+ """
27
+ CommonUnauthorizedErrorBody
28
+ """ # noqa: E501
29
+ code: Union[StrictFloat, StrictInt]
30
+ message: StrictStr
31
+ __properties: ClassVar[List[str]] = ["code", "message"]
32
+
33
+ @field_validator('code')
34
+ def code_validate_enum(cls, value):
35
+ """Validates the enum"""
36
+ if value not in set([401]):
37
+ raise ValueError("must be one of enum values (401)")
38
+ return value
39
+
40
+ model_config = ConfigDict(
41
+ populate_by_name=True,
42
+ validate_assignment=True,
43
+ protected_namespaces=(),
44
+ )
45
+
46
+
47
+ def to_str(self) -> str:
48
+ """Returns the string representation of the model using alias"""
49
+ return pprint.pformat(self.model_dump(by_alias=True))
50
+
51
+ def to_json(self) -> str:
52
+ """Returns the JSON representation of the model using alias"""
53
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
54
+ return json.dumps(self.to_dict())
55
+
56
+ @classmethod
57
+ def from_json(cls, json_str: str) -> Optional[Self]:
58
+ """Create an instance of CommonUnauthorizedErrorBody from a JSON string"""
59
+ return cls.from_dict(json.loads(json_str))
60
+
61
+ def to_dict(self) -> Dict[str, Any]:
62
+ """Return the dictionary representation of the model using alias.
63
+
64
+ This has the following differences from calling pydantic's
65
+ `self.model_dump(by_alias=True)`:
66
+
67
+ * `None` is only added to the output dict for nullable fields that
68
+ were set at model initialization. Other fields with value `None`
69
+ are ignored.
70
+ """
71
+ excluded_fields: Set[str] = set([
72
+ ])
73
+
74
+ _dict = self.model_dump(
75
+ by_alias=True,
76
+ exclude=excluded_fields,
77
+ exclude_none=True,
78
+ )
79
+ return _dict
80
+
81
+ @classmethod
82
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
83
+ """Create an instance of CommonUnauthorizedErrorBody from a dict"""
84
+ if obj is None:
85
+ return None
86
+
87
+ if not isinstance(obj, dict):
88
+ return cls.model_validate(obj)
89
+
90
+ _obj = cls.model_validate({
91
+ "code": obj.get("code"),
92
+ "message": obj.get("message")
93
+ })
94
+ return _obj
95
+
96
+
@@ -25,7 +25,6 @@ from .agents_v1_gen import (
25
25
  ExecutionStatusResponse,
26
26
  ExecutionResult,
27
27
  Status,
28
- StructuredAgentExecutionRequest,
29
28
  CreateAgentProfileRequest,
30
29
  UpdateAgentProfileRequest,
31
30
  DeleteAgentProfile200Response,
@@ -44,9 +43,14 @@ from .agents_v2_gen import (
44
43
  AgentsExecutionActivity as ExecutionActivity,
45
44
  AgentsExecutionUserMessagesAddTextBody as ExecutionUserMessagesAddTextBody,
46
45
  AgentsFilesFile as File,
47
- AgentsAgentExecuteAgentRequest as V2ExecuteAgentRequest,
46
+ AgentsAgentExecuteAgentRequest as ExecuteAgentRequest,
48
47
  AgentsFilesTempFile as TempFile,
49
48
  AgentsFilesTempFilesResponse as TempFilesResponse,
49
+ AgentsExecutionSortField as ExecutionSortField,
50
+ AgentsExecutionStatus as ExecutionStatus,
51
+ AgentsExecutionListItem as ExecutionListItem,
52
+ ExecutionsList200Response,
53
+ CommonSortDirection as SortDirection,
50
54
  )
51
55
 
52
56
 
@@ -156,10 +160,12 @@ class AsteroidClient:
156
160
  self.agents_v2_execution_api = AgentsV2ExecutionApi(self.agents_v2_api_client)
157
161
  self.agents_v2_files_api = AgentsV2FilesApi(self.agents_v2_api_client)
158
162
 
163
+ # --- V2 ---
164
+
159
165
  def execute_agent(
160
166
  self,
161
167
  agent_id: str,
162
- execution_data: Optional[Dict[str, Any]] = None,
168
+ dynamic_data: Optional[Dict[str, Any]] = None,
163
169
  agent_profile_id: Optional[str] = None,
164
170
  metadata: Optional[Dict[str, Any]] = None,
165
171
  temp_files: Optional[List[TempFile]] = None,
@@ -170,10 +176,10 @@ class AsteroidClient:
170
176
 
171
177
  Args:
172
178
  agent_id: The ID of the agent to execute
173
- execution_data: Dynamic data to be merged into the placeholders defined in prompts
179
+ dynamic_data: Dynamic data to be merged into the placeholders defined in prompts
174
180
  agent_profile_id: Optional ID of the agent profile to use
175
181
  metadata: Optional metadata key-value pairs for organizing and filtering executions
176
- temp_files: Optional list of temporary files to attach (must be pre-uploaded using stage file endpoint)
182
+ temp_files: Optional list of temporary files to attach (must be pre-uploaded using stage_temp_files)
177
183
  version: Optional version of the agent to execute. If not provided, the latest version will be used.
178
184
 
179
185
  Returns:
@@ -186,8 +192,8 @@ class AsteroidClient:
186
192
  execution_id = client.execute_agent('my-agent-id', {'input': 'some dynamic value'})
187
193
  execution_id = client.execute_agent('my-agent-id', {'input': 'value'}, version=3)
188
194
  """
189
- req = V2ExecuteAgentRequest(
190
- dynamic_data=execution_data,
195
+ req = ExecuteAgentRequest(
196
+ dynamic_data=dynamic_data,
191
197
  agent_profile_id=agent_profile_id,
192
198
  metadata=metadata,
193
199
  temp_files=temp_files,
@@ -794,8 +800,6 @@ class AsteroidClient:
794
800
  pass
795
801
  return False
796
802
 
797
- # --- V2 ---
798
-
799
803
  def get_agents(self, org_id: str, page: int = 1, page_size: int = 100) -> List[Agent]:
800
804
  """
801
805
  Get a paginated list of agents for an organization.
@@ -812,9 +816,102 @@ class AsteroidClient:
812
816
  for agent in agents:
813
817
  print(f"Agent: {agent.name}")
814
818
  """
815
- response = self.agents_v2_execution_api.agent_list(organization_id=org_id, page=page, page_size=page_size)
819
+ response = self.agents_v2_agents_api.agent_list(organization_id=org_id, page=page, page_size=page_size)
816
820
  return response.items
817
821
 
822
+ def get_executions(
823
+ self,
824
+ organization_id: str,
825
+ page: int = 1,
826
+ page_size: int = 20,
827
+ execution_id: Optional[str] = None,
828
+ agent_id: Optional[str] = None,
829
+ status: Optional[List[str]] = None,
830
+ agent_version: Optional[int] = None,
831
+ created_after: Optional[str] = None,
832
+ created_before: Optional[str] = None,
833
+ human_labels: Optional[List[str]] = None,
834
+ outcome_label: Optional[str] = None,
835
+ metadata_key: Optional[str] = None,
836
+ metadata_value: Optional[str] = None,
837
+ sort_field: Optional[str] = None,
838
+ sort_direction: Optional[str] = None,
839
+ ) -> ExecutionsList200Response:
840
+ """
841
+ Get a paginated list of executions with optional filtering.
842
+
843
+ Args:
844
+ organization_id: The organization identifier (required)
845
+ page: The page number (default: 1)
846
+ page_size: The page size (default: 20)
847
+ execution_id: Search by execution ID (partial, case-insensitive match)
848
+ agent_id: Filter by agent ID
849
+ status: Filter by execution status (can specify multiple)
850
+ agent_version: Filter by agent version
851
+ created_after: Filter executions created after this timestamp (ISO 8601)
852
+ created_before: Filter executions created before this timestamp (ISO 8601)
853
+ human_labels: Filter by human labels (can specify multiple label IDs)
854
+ outcome_label: Filter by execution result outcome (partial, case-insensitive match)
855
+ metadata_key: Filter by metadata key - must be used together with metadata_value
856
+ metadata_value: Filter by metadata value - must be used together with metadata_key
857
+ sort_field: Field to sort by (e.g., 'created_at')
858
+ sort_direction: Sort direction ('asc' or 'desc')
859
+
860
+ Returns:
861
+ Paginated execution list with metadata
862
+
863
+ Raises:
864
+ AsteroidAPIError: If the executions request fails
865
+
866
+ Example:
867
+ # Get all executions for an organization
868
+ result = client.get_executions(organization_id='org_123', page=1, page_size=20)
869
+
870
+ # Filter by agent and status
871
+ result = client.get_executions(
872
+ organization_id='org_123',
873
+ agent_id='agent_456',
874
+ status=['completed', 'failed'],
875
+ sort_field='created_at',
876
+ sort_direction='desc'
877
+ )
878
+ """
879
+ from datetime import datetime as dt
880
+
881
+ # Convert status strings to enum if provided
882
+ status_enums = None
883
+ if status:
884
+ status_enums = [ExecutionStatus(s) for s in status]
885
+
886
+ # Convert sort_field and sort_direction to enums if provided
887
+ sort_field_enum = ExecutionSortField(sort_field) if sort_field else None
888
+ sort_direction_enum = SortDirection(sort_direction) if sort_direction else None
889
+
890
+ # Parse datetime strings
891
+ created_after_dt = dt.fromisoformat(created_after.replace('Z', '+00:00')) if created_after else None
892
+ created_before_dt = dt.fromisoformat(created_before.replace('Z', '+00:00')) if created_before else None
893
+
894
+ try:
895
+ return self.agents_v2_execution_api.executions_list(
896
+ page_size=page_size,
897
+ page=page,
898
+ organization_id=organization_id,
899
+ execution_id=execution_id,
900
+ agent_id=agent_id,
901
+ status=status_enums,
902
+ agent_version=agent_version,
903
+ created_after=created_after_dt,
904
+ created_before=created_before_dt,
905
+ human_labels=human_labels,
906
+ outcome_label=outcome_label,
907
+ metadata_key=metadata_key,
908
+ metadata_value=metadata_value,
909
+ sort_field=sort_field_enum,
910
+ sort_direction=sort_direction_enum,
911
+ )
912
+ except ApiException as e:
913
+ raise AsteroidAPIError(f"Failed to get executions: {e}") from e
914
+
818
915
  def get_last_n_execution_activities(self, execution_id: str, n: int) -> List[ExecutionActivity]:
819
916
  """
820
917
  Get the last N execution activities for a given execution ID, sorted by their timestamp in descending order.
@@ -1055,10 +1152,12 @@ def create_client(api_key: str, base_url: Optional[str] = None) -> AsteroidClien
1055
1152
  """
1056
1153
  return AsteroidClient(api_key, base_url)
1057
1154
 
1155
+ # --- V2 ---
1156
+
1058
1157
  def execute_agent(
1059
1158
  client: AsteroidClient,
1060
1159
  agent_id: str,
1061
- execution_data: Optional[Dict[str, Any]] = None,
1160
+ dynamic_data: Optional[Dict[str, Any]] = None,
1062
1161
  agent_profile_id: Optional[str] = None,
1063
1162
  metadata: Optional[Dict[str, Any]] = None,
1064
1163
  temp_files: Optional[List[TempFile]] = None,
@@ -1070,10 +1169,10 @@ def execute_agent(
1070
1169
  Args:
1071
1170
  client: The AsteroidClient instance
1072
1171
  agent_id: The ID of the agent to execute
1073
- execution_data: Dynamic data to be merged into the placeholders defined in prompts
1172
+ dynamic_data: Dynamic data to be merged into the placeholders defined in prompts
1074
1173
  agent_profile_id: Optional ID of the agent profile to use
1075
1174
  metadata: Optional metadata key-value pairs for organizing and filtering executions
1076
- temp_files: Optional list of temporary files to attach (must be pre-uploaded using stage file endpoint)
1175
+ temp_files: Optional list of temporary files to attach (must be pre-uploaded using stage_temp_files)
1077
1176
  version: Optional version of the agent to execute. If not provided, the latest version will be used.
1078
1177
 
1079
1178
  Returns:
@@ -1085,7 +1184,7 @@ def execute_agent(
1085
1184
  """
1086
1185
  return client.execute_agent(
1087
1186
  agent_id,
1088
- execution_data,
1187
+ dynamic_data,
1089
1188
  agent_profile_id,
1090
1189
  metadata,
1091
1190
  temp_files,
@@ -1380,8 +1479,71 @@ def get_agents(client: AsteroidClient, org_id: str, page: int = 1, page_size: in
1380
1479
  for agent in agents:
1381
1480
  print(f"Agent: {agent.name}")
1382
1481
  """
1383
- response = client.get_agents(org_id, page, page_size)
1384
- return response.items
1482
+ return client.get_agents(org_id, page, page_size)
1483
+
1484
+ def get_executions(
1485
+ client: AsteroidClient,
1486
+ organization_id: str,
1487
+ page: int = 1,
1488
+ page_size: int = 20,
1489
+ execution_id: Optional[str] = None,
1490
+ agent_id: Optional[str] = None,
1491
+ status: Optional[List[str]] = None,
1492
+ agent_version: Optional[int] = None,
1493
+ created_after: Optional[str] = None,
1494
+ created_before: Optional[str] = None,
1495
+ human_labels: Optional[List[str]] = None,
1496
+ outcome_label: Optional[str] = None,
1497
+ metadata_key: Optional[str] = None,
1498
+ metadata_value: Optional[str] = None,
1499
+ sort_field: Optional[str] = None,
1500
+ sort_direction: Optional[str] = None,
1501
+ ) -> ExecutionsList200Response:
1502
+ """
1503
+ Get a paginated list of executions with optional filtering.
1504
+
1505
+ Args:
1506
+ client: The AsteroidClient instance
1507
+ organization_id: The organization identifier (required)
1508
+ page: The page number (default: 1)
1509
+ page_size: The page size (default: 20)
1510
+ execution_id: Search by execution ID (partial, case-insensitive match)
1511
+ agent_id: Filter by agent ID
1512
+ status: Filter by execution status (can specify multiple)
1513
+ agent_version: Filter by agent version
1514
+ created_after: Filter executions created after this timestamp (ISO 8601)
1515
+ created_before: Filter executions created before this timestamp (ISO 8601)
1516
+ human_labels: Filter by human labels (can specify multiple label IDs)
1517
+ outcome_label: Filter by execution result outcome (partial, case-insensitive match)
1518
+ metadata_key: Filter by metadata key - must be used together with metadata_value
1519
+ metadata_value: Filter by metadata value - must be used together with metadata_key
1520
+ sort_field: Field to sort by (e.g., 'created_at')
1521
+ sort_direction: Sort direction ('asc' or 'desc')
1522
+
1523
+ Returns:
1524
+ Paginated execution list with metadata
1525
+
1526
+ Example:
1527
+ result = get_executions(client, organization_id='org_123', page=1, page_size=20)
1528
+ """
1529
+ return client.get_executions(
1530
+ organization_id=organization_id,
1531
+ page=page,
1532
+ page_size=page_size,
1533
+ execution_id=execution_id,
1534
+ agent_id=agent_id,
1535
+ status=status,
1536
+ agent_version=agent_version,
1537
+ created_after=created_after,
1538
+ created_before=created_before,
1539
+ human_labels=human_labels,
1540
+ outcome_label=outcome_label,
1541
+ metadata_key=metadata_key,
1542
+ metadata_value=metadata_value,
1543
+ sort_field=sort_field,
1544
+ sort_direction=sort_direction,
1545
+ )
1546
+
1385
1547
  def get_last_n_execution_activities(client: AsteroidClient, execution_id: str, n: int) -> List[ExecutionActivity]:
1386
1548
  """
1387
1549
  Get the last N execution activities for a given execution ID, sorted by their timestamp in descending order.
@@ -1520,31 +1682,46 @@ def wait_for_agent_interaction(
1520
1682
 
1521
1683
  # Re-export common types for convenience
1522
1684
  __all__ = [
1685
+ # Client
1523
1686
  'AsteroidClient',
1524
1687
  'create_client',
1688
+ # Agent Execution (V2)
1525
1689
  'execute_agent',
1690
+ 'get_executions',
1691
+ # Execution Status & Results (V1)
1526
1692
  'get_execution_status',
1527
1693
  'get_execution_result',
1528
1694
  'wait_for_execution_result',
1529
1695
  'upload_execution_files',
1530
1696
  'stage_temp_files',
1531
1697
  'get_browser_session_recording',
1698
+ # Agent Profiles (V1)
1532
1699
  'get_agent_profiles',
1533
1700
  'get_agent_profile',
1534
1701
  'create_agent_profile',
1535
1702
  'update_agent_profile',
1536
1703
  'delete_agent_profile',
1704
+ 'get_credentials_public_key',
1705
+ # Agents (V2)
1537
1706
  'get_agents',
1707
+ # Execution Activities (V2)
1538
1708
  'get_last_n_execution_activities',
1539
1709
  'add_message_to_execution',
1540
1710
  'get_execution_files',
1541
1711
  'download_execution_file',
1542
1712
  'wait_for_agent_interaction',
1543
- 'get_credentials_public_key',
1713
+ # Exceptions
1544
1714
  'AsteroidAPIError',
1545
1715
  'ExecutionError',
1546
1716
  'TimeoutError',
1547
1717
  'AgentInteractionResult',
1718
+ # Types
1548
1719
  'TempFile',
1549
1720
  'TempFilesResponse',
1721
+ 'ExecuteAgentRequest',
1722
+ 'ExecutionListItem',
1723
+ 'ExecutionsList200Response',
1724
+ 'ExecutionStatus',
1725
+ 'ExecutionSortField',
1726
+ 'SortDirection',
1550
1727
  ]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: asteroid-odyssey
3
- Version: 1.3.8
3
+ Version: 1.3.10
4
4
  Summary: A Python SDK for browser automation using Asteroid platform.
5
5
  Author-email: David Mlcoch <founders@asteroid.com>
6
6
  License-Expression: MIT
@@ -1,5 +1,5 @@
1
1
  asteroid_odyssey/__init__.py,sha256=po0AK2n1AiFyeAywL4Ju3qHGzTcRuH2LuXstuXthbT0,1273
2
- asteroid_odyssey/client.py,sha256=hn4n26Sf6k0qxxBKYFMiKahhKZW1JrvyqfRPLgk9yQI,59685
2
+ asteroid_odyssey/client.py,sha256=vL1JF5PiKfhK3MdagdviUhUJraSWRYZNL5hclN70M08,66726
3
3
  asteroid_odyssey/agents_v1_gen/__init__.py,sha256=8ULksHLOQJbxz9LkUs0sHFs47cWst2SeKs3NLGlLCjk,2841
4
4
  asteroid_odyssey/agents_v1_gen/api_client.py,sha256=sxH4_y4LtJLTmK9Sd67qYIkHwnbjLGFI7aaL-Y4xZUs,27513
5
5
  asteroid_odyssey/agents_v1_gen/api_response.py,sha256=eMxw1mpmJcoGZ3gs9z6jM4oYoZ10Gjk333s9sKxGv7s,652
@@ -30,7 +30,7 @@ asteroid_odyssey/agents_v1_gen/models/proxy_type.py,sha256=zZ2MI0w7PZ8_a3KCLlNqQ
30
30
  asteroid_odyssey/agents_v1_gen/models/status.py,sha256=tnt_4jdoMzcjo6J0vttf2QKLNK0FC9XcjZKbGC3sbz0,889
31
31
  asteroid_odyssey/agents_v1_gen/models/structured_agent_execution_request.py,sha256=VZyW85pVz9T27aiG4ZlGywnnxTOaJCAjHSDz8D2YxY8,2913
32
32
  asteroid_odyssey/agents_v1_gen/models/update_agent_profile_request.py,sha256=zFy3EoYm9-nCncNPHwZDX7I5O2ZlKRJH6foPk0sAhA8,5895
33
- asteroid_odyssey/agents_v2_gen/__init__.py,sha256=iR4Io6QLbZUU_NUNvYe2Xeo1M9ueJc2dGZLwQS7JH9k,11969
33
+ asteroid_odyssey/agents_v2_gen/__init__.py,sha256=Zp_fAYikJ55pSXr1vdXgH5akHbWUEc9kvV8fkrSBblQ,12192
34
34
  asteroid_odyssey/agents_v2_gen/api_client.py,sha256=zf8LBIbhuInmYPs4iTmxc8mU4gwONeX3JPq3D8ZTftM,27573
35
35
  asteroid_odyssey/agents_v2_gen/api_response.py,sha256=eMxw1mpmJcoGZ3gs9z6jM4oYoZ10Gjk333s9sKxGv7s,652
36
36
  asteroid_odyssey/agents_v2_gen/configuration.py,sha256=z_um4Jc01mYd-U0-8J74KOy2AJYq6KDtcRxBtDFVsEQ,18593
@@ -39,9 +39,9 @@ asteroid_odyssey/agents_v2_gen/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMp
39
39
  asteroid_odyssey/agents_v2_gen/rest.py,sha256=pSjg1rCUe0Z7K1xrRtsHwQo7Xa-yF35k2o2ORAdbiKY,9431
40
40
  asteroid_odyssey/agents_v2_gen/api/__init__.py,sha256=zP96zXtocDaIDci8REJzcl6ARlnBapyslSrPf7-JiT0,256
41
41
  asteroid_odyssey/agents_v2_gen/api/agents_api.py,sha256=UAIQsb3CLwN-q_cwlEH3sfOwfEvaT67E5OSDpVXFK9M,26558
42
- asteroid_odyssey/agents_v2_gen/api/execution_api.py,sha256=F9hQRxRItKRvru3drCnXzIcLfU2bwmrdW6TZPENr8B4,62441
42
+ asteroid_odyssey/agents_v2_gen/api/execution_api.py,sha256=PZ11wUU9ilYzf943aDdL2r-JKmBq1KNYC5qC0itRv8g,63665
43
43
  asteroid_odyssey/agents_v2_gen/api/files_api.py,sha256=jcIgHi2b6g49eh07bVd99LdWXGpZuN0czmrWoxayqSQ,35517
44
- asteroid_odyssey/agents_v2_gen/models/__init__.py,sha256=xjB5hYPR0x4Tul9qvGYE1GHbcV8_rukGasojBKeB1IY,11073
44
+ asteroid_odyssey/agents_v2_gen/models/__init__.py,sha256=PxgTCmKQyJNiZ3KDO2YKBqkjZSU5uIT0E9RkcUXObFQ,11296
45
45
  asteroid_odyssey/agents_v2_gen/models/agent_list200_response.py,sha256=09DlBwTk0VSWPgfLewU9HkNncyrz1ij2I7PxtaYQC8o,3249
46
46
  asteroid_odyssey/agents_v2_gen/models/agents_agent_base.py,sha256=XfW4gpuvynUZ1JJn1ovnLBcM25fB_Ctgnm7VO1NoiNg,2955
47
47
  asteroid_odyssey/agents_v2_gen/models/agents_agent_execute_agent_request.py,sha256=BDOK7pn3RTNIlmSTFspgtxpTy8AQa0MC0pJp9-b_VgI,4245
@@ -79,7 +79,7 @@ asteroid_odyssey/agents_v2_gen/models/agents_execution_file_list_completed_detai
79
79
  asteroid_odyssey/agents_v2_gen/models/agents_execution_file_read_completed_details.py,sha256=4LVTrL7iS2yfE4JAMXNeCxAPaVfgJSKVqih_T6Vgb5I,3352
80
80
  asteroid_odyssey/agents_v2_gen/models/agents_execution_file_stage_completed_details.py,sha256=aowoJrFg-jwZQ3ImE1WRdMR-8gS2qo4bxrBavbQSCbk,3032
81
81
  asteroid_odyssey/agents_v2_gen/models/agents_execution_human_label.py,sha256=kjFJmgimqWECegmLpeiomykYdupyvw67s3OXS5vNutg,3218
82
- asteroid_odyssey/agents_v2_gen/models/agents_execution_list_item.py,sha256=04WyY7ZgFGV8iJxBaiYLvJKGaQJX7zxY5XK5eN72hCc,7415
82
+ asteroid_odyssey/agents_v2_gen/models/agents_execution_list_item.py,sha256=DzdAV5e7c_hFYTbrIvaTtU4LL5HKRJb0FFEtYHX3Uys,7734
83
83
  asteroid_odyssey/agents_v2_gen/models/agents_execution_llm_call_purpose.py,sha256=ZyMEExVLDmrRDU25GWEePHAnDhKFEgJmUaU4h7ij2lU,1065
84
84
  asteroid_odyssey/agents_v2_gen/models/agents_execution_llm_call_started_details.py,sha256=18pbGktwRxtLhvGm58uAvihD9Ve3hKrWrsrPzMfhAGY,3104
85
85
  asteroid_odyssey/agents_v2_gen/models/agents_execution_nav_to_completed_details.py,sha256=x3FB2vujx1Kedlplfe6jaZ6KhchFuX0KCliZbGgUDzE,3036
@@ -121,12 +121,14 @@ asteroid_odyssey/agents_v2_gen/models/agents_graph_models_transitions_transition
121
121
  asteroid_odyssey/agents_v2_gen/models/common_bad_request_error_body.py,sha256=cZQcZH6c2RmQleZe57-mfUsCKW74lGGtVMWbJFGc1ho,2889
122
122
  asteroid_odyssey/agents_v2_gen/models/common_error.py,sha256=to8zl1yPqcf8hRXEZeOrhuA_jWhmpaMmly5Y_Xl129k,2551
123
123
  asteroid_odyssey/agents_v2_gen/models/common_forbidden_error_body.py,sha256=9yADAujD_9eTW4BtZ7oYifmFCDTpAw-j1jEEJhwdAVs,2885
124
+ asteroid_odyssey/agents_v2_gen/models/common_internal_server_error_body.py,sha256=DDtB3LOeVTtvdWhTEthmobNL-0BsuhAd7Zh0ZAb4Mgs,2905
124
125
  asteroid_odyssey/agents_v2_gen/models/common_not_found_error_body.py,sha256=BAVAweVD5ltGL2lWfdDNwaq82CI4iVkPVE_E9JfEpi8,2881
125
126
  asteroid_odyssey/agents_v2_gen/models/common_os_error.py,sha256=5hF0Q4D2sYdRe-F-mDT1FmD5yH4PcbKRlm8VkqDtBC4,2483
126
127
  asteroid_odyssey/agents_v2_gen/models/common_sort_direction.py,sha256=UBW99PM3QRGRRE7dB5OSBhmhogmsXQQsrw66j0fg_xc,763
128
+ asteroid_odyssey/agents_v2_gen/models/common_unauthorized_error_body.py,sha256=Ng62vZVuPWEkTvdnYimbItSKhUGT9G52ZOapMQ2O7Xg,2897
127
129
  asteroid_odyssey/agents_v2_gen/models/executions_list200_response.py,sha256=hmZBiOEUKpzEptDcElwgNwhCwSnXFJsrBbb9w2amGiM,3302
128
130
  asteroid_odyssey/agents_v2_gen/models/version.py,sha256=Vjiri_a5CcDJ1lSziRqif5HuFpaxneVDLIB1r8SFIkE,707
129
- asteroid_odyssey-1.3.8.dist-info/METADATA,sha256=CgC3RezOclwF6timGiFyaLtJHInS2dDHFf-sWwBDFtY,7108
130
- asteroid_odyssey-1.3.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
131
- asteroid_odyssey-1.3.8.dist-info/top_level.txt,sha256=h4T6NKscnThJ4Nhzors2NKlJeZzepnM7XvDgsnfi5HA,17
132
- asteroid_odyssey-1.3.8.dist-info/RECORD,,
131
+ asteroid_odyssey-1.3.10.dist-info/METADATA,sha256=HVHgSVf2vDCzIBo08j4YHScTAIpYZTws37dNX4--rJs,7109
132
+ asteroid_odyssey-1.3.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
133
+ asteroid_odyssey-1.3.10.dist-info/top_level.txt,sha256=h4T6NKscnThJ4Nhzors2NKlJeZzepnM7XvDgsnfi5HA,17
134
+ asteroid_odyssey-1.3.10.dist-info/RECORD,,