asteroid-odyssey 1.3.13__py3-none-any.whl → 1.6.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 +254 -82
- asteroid_odyssey/api/__init__.py +8 -0
- asteroid_odyssey/{agents_v1_gen/api/agent_profile_api.py → api/agent_profiles_api.py} +414 -281
- asteroid_odyssey/{agents_v2_gen/api → api}/agents_api.py +30 -30
- asteroid_odyssey/{agents_v2_gen/api → api}/execution_api.py +32 -49
- asteroid_odyssey/{agents_v2_gen/api → api}/files_api.py +5 -5
- asteroid_odyssey/{agents_v2_gen/api_client.py → api_client.py} +10 -6
- asteroid_odyssey/{agents_v2_gen/configuration.py → configuration.py} +11 -4
- asteroid_odyssey/models/__init__.py +118 -0
- asteroid_odyssey/{agents_v2_gen/models → models}/agent_list200_response.py +1 -1
- asteroid_odyssey/models/agent_profile_clear_browser_cache200_response.py +87 -0
- asteroid_odyssey/models/agent_profiles_list200_response.py +101 -0
- asteroid_odyssey/{agents_v2_gen/models → models}/agents_agent_base.py +3 -3
- asteroid_odyssey/{agents_v2_gen/models → models}/agents_agent_execute_agent_request.py +7 -5
- asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_activity.py +4 -4
- asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_activity_action_completed_info.py +65 -37
- asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_activity_action_completed_payload.py +8 -8
- asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_activity_action_failed_payload.py +9 -9
- asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_activity_action_started_info.py +50 -22
- asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_activity_action_started_payload.py +10 -10
- asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_activity_file_added_payload.py +6 -6
- asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_activity_payload_union.py +14 -14
- asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_activity_playwright_script_generated_payload.py +9 -9
- asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_activity_status_changed_payload.py +19 -19
- asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_activity_transitioned_node_payload.py +6 -6
- asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_activity_workflow_updated_payload.py +1 -1
- asteroid_odyssey/models/agents_execution_agent_query_context_completed_details.py +98 -0
- asteroid_odyssey/models/agents_execution_agent_query_context_started_details.py +96 -0
- asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_cancelled_payload.py +1 -1
- asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_comment.py +10 -10
- asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_completed_payload.py +4 -4
- asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_execution_result.py +6 -6
- asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_ext_api_call_completed_details.py +6 -6
- asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_failed_payload.py +5 -5
- asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_file_read_completed_details.py +3 -3
- asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_human_label.py +7 -7
- asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_list_item.py +33 -37
- asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_llm_call_started_details.py +1 -1
- asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_obs_snapshot_with_selectors_completed_details.py +4 -4
- asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_scratchpad_write_completed_details.py +7 -7
- asteroid_odyssey/models/agents_execution_script_eval_completed_details.py +101 -0
- asteroid_odyssey/models/agents_execution_script_eval_started_details.py +100 -0
- asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_script_hybrid_playwright_completed_details.py +6 -6
- asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_script_pad_run_function_completed_details.py +6 -6
- asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_script_playwright_completed_details.py +6 -6
- asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_scriptpad_read_started_details.py +4 -4
- asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_scriptpad_run_function_started_details.py +4 -4
- asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_scriptpad_search_replace_completed_details.py +5 -5
- asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_scriptpad_search_replace_started_details.py +4 -4
- asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_scriptpad_write_completed_details.py +4 -4
- asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_terminal_payload.py +4 -4
- asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_util_get_datetime_completed_details.py +4 -4
- asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_workflow_update.py +13 -13
- asteroid_odyssey/{agents_v2_gen/models → models}/agents_files_file.py +11 -11
- asteroid_odyssey/{agents_v2_gen/models → models}/agents_files_temp_files_response.py +1 -1
- asteroid_odyssey/{agents_v2_gen/models → models}/agents_graph_models_nodes_properties_playwright_script_llm_var.py +5 -5
- asteroid_odyssey/{agents_v1_gen/models/agent_profile.py → models/agents_profile_agent_profile.py} +37 -32
- asteroid_odyssey/{agents_v1_gen/models/cookie.py → models/agents_profile_cookie.py} +21 -26
- asteroid_odyssey/{agents_v1_gen/models/country_code.py → models/agents_profile_country_code.py} +5 -5
- asteroid_odyssey/{agents_v1_gen/models/create_agent_profile_request.py → models/agents_profile_create_agent_profile_request.py} +33 -28
- asteroid_odyssey/{agents_v1_gen/models/credential.py → models/agents_profile_credential.py} +13 -13
- asteroid_odyssey/models/agents_profile_operating_system.py +37 -0
- asteroid_odyssey/models/agents_profile_proxy_type.py +38 -0
- asteroid_odyssey/models/agents_profile_same_site.py +38 -0
- asteroid_odyssey/models/agents_profile_sort_field.py +38 -0
- asteroid_odyssey/models/agents_profile_update_agent_profile_request.py +129 -0
- asteroid_odyssey/{agents_v2_gen/models → models}/executions_list200_response.py +1 -1
- asteroid_odyssey/{agents_v2_gen/rest.py → rest.py} +2 -1
- asteroid_odyssey-1.6.0.dist-info/METADATA +65 -0
- asteroid_odyssey-1.6.0.dist-info/RECORD +119 -0
- asteroid_odyssey/agents_v1_gen/__init__.py +0 -53
- asteroid_odyssey/agents_v1_gen/api/__init__.py +0 -7
- asteroid_odyssey/agents_v1_gen/api/api_api.py +0 -516
- asteroid_odyssey/agents_v1_gen/api/execution_api.py +0 -1449
- asteroid_odyssey/agents_v1_gen/api_client.py +0 -797
- asteroid_odyssey/agents_v1_gen/configuration.py +0 -599
- asteroid_odyssey/agents_v1_gen/exceptions.py +0 -216
- asteroid_odyssey/agents_v1_gen/models/__init__.py +0 -34
- asteroid_odyssey/agents_v1_gen/models/browser_session_recording_response.py +0 -87
- asteroid_odyssey/agents_v1_gen/models/delete_agent_profile200_response.py +0 -87
- asteroid_odyssey/agents_v1_gen/models/error_response.py +0 -87
- asteroid_odyssey/agents_v1_gen/models/execution_response.py +0 -87
- asteroid_odyssey/agents_v1_gen/models/execution_result.py +0 -101
- asteroid_odyssey/agents_v1_gen/models/execution_result_response.py +0 -100
- asteroid_odyssey/agents_v1_gen/models/execution_status_response.py +0 -95
- asteroid_odyssey/agents_v1_gen/models/health_check200_response.py +0 -87
- asteroid_odyssey/agents_v1_gen/models/health_check500_response.py +0 -87
- asteroid_odyssey/agents_v1_gen/models/proxy_type.py +0 -38
- asteroid_odyssey/agents_v1_gen/models/status.py +0 -43
- asteroid_odyssey/agents_v1_gen/models/structured_agent_execution_request.py +0 -89
- asteroid_odyssey/agents_v1_gen/models/update_agent_profile_request.py +0 -126
- asteroid_odyssey/agents_v1_gen/rest.py +0 -257
- asteroid_odyssey/agents_v2_gen/__init__.py +0 -121
- asteroid_odyssey/agents_v2_gen/api/__init__.py +0 -7
- asteroid_odyssey/agents_v2_gen/api_response.py +0 -21
- asteroid_odyssey/agents_v2_gen/models/__init__.py +0 -102
- asteroid_odyssey/agents_v2_gen/py.typed +0 -0
- asteroid_odyssey/client.py +0 -1629
- asteroid_odyssey-1.3.13.dist-info/METADATA +0 -214
- asteroid_odyssey-1.3.13.dist-info/RECORD +0 -134
- /asteroid_odyssey/{agents_v1_gen/api_response.py → api_response.py} +0 -0
- /asteroid_odyssey/{agents_v2_gen/exceptions.py → exceptions.py} +0 -0
- /asteroid_odyssey/{agents_v2_gen/models → models}/agents_agent_execute_agent_response.py +0 -0
- /asteroid_odyssey/{agents_v2_gen/models → models}/agents_agent_sort_field.py +0 -0
- /asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_action_name.py +0 -0
- /asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_activity_generic_payload.py +0 -0
- /asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_activity_reasoning_payload.py +0 -0
- /asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_activity_step_completed_payload.py +0 -0
- /asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_activity_step_started_payload.py +0 -0
- /asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_activity_user_message_received_payload.py +0 -0
- /asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_awaiting_confirmation_payload.py +0 -0
- /asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_cancel_reason.py +0 -0
- /asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_element_file_upload_completed_details.py +0 -0
- /asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_ext_get_mail_completed_details.py +0 -0
- /asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_file_list_completed_details.py +0 -0
- /asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_file_stage_completed_details.py +0 -0
- /asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_llm_call_purpose.py +0 -0
- /asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_nav_to_completed_details.py +0 -0
- /asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_nav_to_started_details.py +0 -0
- /asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_node_details.py +0 -0
- /asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_paused_payload.py +0 -0
- /asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_rules_details.py +0 -0
- /asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_scratchpad_read_completed_details.py +0 -0
- /asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_scratchpad_read_started_details.py +0 -0
- /asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_scratchpad_write_started_details.py +0 -0
- /asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_script_hybrid_playwright_started_details.py +0 -0
- /asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_script_playwright_started_details.py +0 -0
- /asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_scriptpad_read_completed_details.py +0 -0
- /asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_sort_field.py +0 -0
- /asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_status.py +0 -0
- /asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_transition_details.py +0 -0
- /asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_update_type.py +0 -0
- /asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_user_messages_add_text_body.py +0 -0
- /asteroid_odyssey/{agents_v2_gen/models → models}/agents_execution_util_get_datetime_started_details.py +0 -0
- /asteroid_odyssey/{agents_v2_gen/models → models}/agents_files_temp_file.py +0 -0
- /asteroid_odyssey/{agents_v2_gen/models → models}/agents_graph_models_nodes_properties_playwright_script_llm_var_type.py +0 -0
- /asteroid_odyssey/{agents_v2_gen/models → models}/agents_graph_models_transitions_transition_type.py +0 -0
- /asteroid_odyssey/{agents_v2_gen/models → models}/common_bad_request_error_body.py +0 -0
- /asteroid_odyssey/{agents_v2_gen/models → models}/common_error.py +0 -0
- /asteroid_odyssey/{agents_v2_gen/models → models}/common_forbidden_error_body.py +0 -0
- /asteroid_odyssey/{agents_v2_gen/models → models}/common_internal_server_error_body.py +0 -0
- /asteroid_odyssey/{agents_v2_gen/models → models}/common_not_found_error_body.py +0 -0
- /asteroid_odyssey/{agents_v2_gen/models → models}/common_os_error.py +0 -0
- /asteroid_odyssey/{agents_v2_gen/models → models}/common_sort_direction.py +0 -0
- /asteroid_odyssey/{agents_v2_gen/models → models}/common_unauthorized_error_body.py +0 -0
- /asteroid_odyssey/{agents_v2_gen/models → models}/version.py +0 -0
- /asteroid_odyssey/{agents_v1_gen/py.typed → py.typed} +0 -0
- {asteroid_odyssey-1.3.13.dist-info → asteroid_odyssey-1.6.0.dist-info}/WHEEL +0 -0
- {asteroid_odyssey-1.3.13.dist-info → asteroid_odyssey-1.6.0.dist-info}/top_level.txt +0 -0
|
@@ -1,216 +0,0 @@
|
|
|
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
|
-
from typing import Any, Optional
|
|
15
|
-
from typing_extensions import Self
|
|
16
|
-
|
|
17
|
-
class OpenApiException(Exception):
|
|
18
|
-
"""The base exception class for all OpenAPIExceptions"""
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
class ApiTypeError(OpenApiException, TypeError):
|
|
22
|
-
def __init__(self, msg, path_to_item=None, valid_classes=None,
|
|
23
|
-
key_type=None) -> None:
|
|
24
|
-
""" Raises an exception for TypeErrors
|
|
25
|
-
|
|
26
|
-
Args:
|
|
27
|
-
msg (str): the exception message
|
|
28
|
-
|
|
29
|
-
Keyword Args:
|
|
30
|
-
path_to_item (list): a list of keys an indices to get to the
|
|
31
|
-
current_item
|
|
32
|
-
None if unset
|
|
33
|
-
valid_classes (tuple): the primitive classes that current item
|
|
34
|
-
should be an instance of
|
|
35
|
-
None if unset
|
|
36
|
-
key_type (bool): False if our value is a value in a dict
|
|
37
|
-
True if it is a key in a dict
|
|
38
|
-
False if our item is an item in a list
|
|
39
|
-
None if unset
|
|
40
|
-
"""
|
|
41
|
-
self.path_to_item = path_to_item
|
|
42
|
-
self.valid_classes = valid_classes
|
|
43
|
-
self.key_type = key_type
|
|
44
|
-
full_msg = msg
|
|
45
|
-
if path_to_item:
|
|
46
|
-
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
|
47
|
-
super(ApiTypeError, self).__init__(full_msg)
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
class ApiValueError(OpenApiException, ValueError):
|
|
51
|
-
def __init__(self, msg, path_to_item=None) -> None:
|
|
52
|
-
"""
|
|
53
|
-
Args:
|
|
54
|
-
msg (str): the exception message
|
|
55
|
-
|
|
56
|
-
Keyword Args:
|
|
57
|
-
path_to_item (list) the path to the exception in the
|
|
58
|
-
received_data dict. None if unset
|
|
59
|
-
"""
|
|
60
|
-
|
|
61
|
-
self.path_to_item = path_to_item
|
|
62
|
-
full_msg = msg
|
|
63
|
-
if path_to_item:
|
|
64
|
-
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
|
65
|
-
super(ApiValueError, self).__init__(full_msg)
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
class ApiAttributeError(OpenApiException, AttributeError):
|
|
69
|
-
def __init__(self, msg, path_to_item=None) -> None:
|
|
70
|
-
"""
|
|
71
|
-
Raised when an attribute reference or assignment fails.
|
|
72
|
-
|
|
73
|
-
Args:
|
|
74
|
-
msg (str): the exception message
|
|
75
|
-
|
|
76
|
-
Keyword Args:
|
|
77
|
-
path_to_item (None/list) the path to the exception in the
|
|
78
|
-
received_data dict
|
|
79
|
-
"""
|
|
80
|
-
self.path_to_item = path_to_item
|
|
81
|
-
full_msg = msg
|
|
82
|
-
if path_to_item:
|
|
83
|
-
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
|
84
|
-
super(ApiAttributeError, self).__init__(full_msg)
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
class ApiKeyError(OpenApiException, KeyError):
|
|
88
|
-
def __init__(self, msg, path_to_item=None) -> None:
|
|
89
|
-
"""
|
|
90
|
-
Args:
|
|
91
|
-
msg (str): the exception message
|
|
92
|
-
|
|
93
|
-
Keyword Args:
|
|
94
|
-
path_to_item (None/list) the path to the exception in the
|
|
95
|
-
received_data dict
|
|
96
|
-
"""
|
|
97
|
-
self.path_to_item = path_to_item
|
|
98
|
-
full_msg = msg
|
|
99
|
-
if path_to_item:
|
|
100
|
-
full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
|
|
101
|
-
super(ApiKeyError, self).__init__(full_msg)
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
class ApiException(OpenApiException):
|
|
105
|
-
|
|
106
|
-
def __init__(
|
|
107
|
-
self,
|
|
108
|
-
status=None,
|
|
109
|
-
reason=None,
|
|
110
|
-
http_resp=None,
|
|
111
|
-
*,
|
|
112
|
-
body: Optional[str] = None,
|
|
113
|
-
data: Optional[Any] = None,
|
|
114
|
-
) -> None:
|
|
115
|
-
self.status = status
|
|
116
|
-
self.reason = reason
|
|
117
|
-
self.body = body
|
|
118
|
-
self.data = data
|
|
119
|
-
self.headers = None
|
|
120
|
-
|
|
121
|
-
if http_resp:
|
|
122
|
-
if self.status is None:
|
|
123
|
-
self.status = http_resp.status
|
|
124
|
-
if self.reason is None:
|
|
125
|
-
self.reason = http_resp.reason
|
|
126
|
-
if self.body is None:
|
|
127
|
-
try:
|
|
128
|
-
self.body = http_resp.data.decode('utf-8')
|
|
129
|
-
except Exception:
|
|
130
|
-
pass
|
|
131
|
-
self.headers = http_resp.getheaders()
|
|
132
|
-
|
|
133
|
-
@classmethod
|
|
134
|
-
def from_response(
|
|
135
|
-
cls,
|
|
136
|
-
*,
|
|
137
|
-
http_resp,
|
|
138
|
-
body: Optional[str],
|
|
139
|
-
data: Optional[Any],
|
|
140
|
-
) -> Self:
|
|
141
|
-
if http_resp.status == 400:
|
|
142
|
-
raise BadRequestException(http_resp=http_resp, body=body, data=data)
|
|
143
|
-
|
|
144
|
-
if http_resp.status == 401:
|
|
145
|
-
raise UnauthorizedException(http_resp=http_resp, body=body, data=data)
|
|
146
|
-
|
|
147
|
-
if http_resp.status == 403:
|
|
148
|
-
raise ForbiddenException(http_resp=http_resp, body=body, data=data)
|
|
149
|
-
|
|
150
|
-
if http_resp.status == 404:
|
|
151
|
-
raise NotFoundException(http_resp=http_resp, body=body, data=data)
|
|
152
|
-
|
|
153
|
-
# Added new conditions for 409 and 422
|
|
154
|
-
if http_resp.status == 409:
|
|
155
|
-
raise ConflictException(http_resp=http_resp, body=body, data=data)
|
|
156
|
-
|
|
157
|
-
if http_resp.status == 422:
|
|
158
|
-
raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data)
|
|
159
|
-
|
|
160
|
-
if 500 <= http_resp.status <= 599:
|
|
161
|
-
raise ServiceException(http_resp=http_resp, body=body, data=data)
|
|
162
|
-
raise ApiException(http_resp=http_resp, body=body, data=data)
|
|
163
|
-
|
|
164
|
-
def __str__(self):
|
|
165
|
-
"""Custom error messages for exception"""
|
|
166
|
-
error_message = "({0})\n"\
|
|
167
|
-
"Reason: {1}\n".format(self.status, self.reason)
|
|
168
|
-
if self.headers:
|
|
169
|
-
error_message += "HTTP response headers: {0}\n".format(
|
|
170
|
-
self.headers)
|
|
171
|
-
|
|
172
|
-
if self.data or self.body:
|
|
173
|
-
error_message += "HTTP response body: {0}\n".format(self.data or self.body)
|
|
174
|
-
|
|
175
|
-
return error_message
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
class BadRequestException(ApiException):
|
|
179
|
-
pass
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
class NotFoundException(ApiException):
|
|
183
|
-
pass
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
class UnauthorizedException(ApiException):
|
|
187
|
-
pass
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
class ForbiddenException(ApiException):
|
|
191
|
-
pass
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
class ServiceException(ApiException):
|
|
195
|
-
pass
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
class ConflictException(ApiException):
|
|
199
|
-
"""Exception for HTTP 409 Conflict."""
|
|
200
|
-
pass
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
class UnprocessableEntityException(ApiException):
|
|
204
|
-
"""Exception for HTTP 422 Unprocessable Entity."""
|
|
205
|
-
pass
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
def render_path(path_to_item):
|
|
209
|
-
"""Returns a string representation of a path"""
|
|
210
|
-
result = ""
|
|
211
|
-
for pth in path_to_item:
|
|
212
|
-
if isinstance(pth, int):
|
|
213
|
-
result += "[{0}]".format(pth)
|
|
214
|
-
else:
|
|
215
|
-
result += "['{0}']".format(pth)
|
|
216
|
-
return result
|
|
@@ -1,34 +0,0 @@
|
|
|
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.cookie import Cookie
|
|
20
|
-
from asteroid_odyssey.agents_v1_gen.models.country_code import CountryCode
|
|
21
|
-
from asteroid_odyssey.agents_v1_gen.models.create_agent_profile_request import CreateAgentProfileRequest
|
|
22
|
-
from asteroid_odyssey.agents_v1_gen.models.credential import Credential
|
|
23
|
-
from asteroid_odyssey.agents_v1_gen.models.delete_agent_profile200_response import DeleteAgentProfile200Response
|
|
24
|
-
from asteroid_odyssey.agents_v1_gen.models.error_response import ErrorResponse
|
|
25
|
-
from asteroid_odyssey.agents_v1_gen.models.execution_response import ExecutionResponse
|
|
26
|
-
from asteroid_odyssey.agents_v1_gen.models.execution_result import ExecutionResult
|
|
27
|
-
from asteroid_odyssey.agents_v1_gen.models.execution_result_response import ExecutionResultResponse
|
|
28
|
-
from asteroid_odyssey.agents_v1_gen.models.execution_status_response import ExecutionStatusResponse
|
|
29
|
-
from asteroid_odyssey.agents_v1_gen.models.health_check200_response import HealthCheck200Response
|
|
30
|
-
from asteroid_odyssey.agents_v1_gen.models.health_check500_response import HealthCheck500Response
|
|
31
|
-
from asteroid_odyssey.agents_v1_gen.models.proxy_type import ProxyType
|
|
32
|
-
from asteroid_odyssey.agents_v1_gen.models.status import Status
|
|
33
|
-
from asteroid_odyssey.agents_v1_gen.models.structured_agent_execution_request import StructuredAgentExecutionRequest
|
|
34
|
-
from asteroid_odyssey.agents_v1_gen.models.update_agent_profile_request import UpdateAgentProfileRequest
|
|
@@ -1,87 +0,0 @@
|
|
|
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 pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
21
|
-
from typing import Any, ClassVar, Dict, List
|
|
22
|
-
from typing import Optional, Set
|
|
23
|
-
from typing_extensions import Self
|
|
24
|
-
|
|
25
|
-
class BrowserSessionRecordingResponse(BaseModel):
|
|
26
|
-
"""
|
|
27
|
-
BrowserSessionRecordingResponse
|
|
28
|
-
""" # noqa: E501
|
|
29
|
-
recording_url: StrictStr = Field(description="The URL of the browser session recording")
|
|
30
|
-
__properties: ClassVar[List[str]] = ["recording_url"]
|
|
31
|
-
|
|
32
|
-
model_config = ConfigDict(
|
|
33
|
-
populate_by_name=True,
|
|
34
|
-
validate_assignment=True,
|
|
35
|
-
protected_namespaces=(),
|
|
36
|
-
)
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
def to_str(self) -> str:
|
|
40
|
-
"""Returns the string representation of the model using alias"""
|
|
41
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
|
42
|
-
|
|
43
|
-
def to_json(self) -> str:
|
|
44
|
-
"""Returns the JSON representation of the model using alias"""
|
|
45
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
46
|
-
return json.dumps(self.to_dict())
|
|
47
|
-
|
|
48
|
-
@classmethod
|
|
49
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
50
|
-
"""Create an instance of BrowserSessionRecordingResponse from a JSON string"""
|
|
51
|
-
return cls.from_dict(json.loads(json_str))
|
|
52
|
-
|
|
53
|
-
def to_dict(self) -> Dict[str, Any]:
|
|
54
|
-
"""Return the dictionary representation of the model using alias.
|
|
55
|
-
|
|
56
|
-
This has the following differences from calling pydantic's
|
|
57
|
-
`self.model_dump(by_alias=True)`:
|
|
58
|
-
|
|
59
|
-
* `None` is only added to the output dict for nullable fields that
|
|
60
|
-
were set at model initialization. Other fields with value `None`
|
|
61
|
-
are ignored.
|
|
62
|
-
"""
|
|
63
|
-
excluded_fields: Set[str] = set([
|
|
64
|
-
])
|
|
65
|
-
|
|
66
|
-
_dict = self.model_dump(
|
|
67
|
-
by_alias=True,
|
|
68
|
-
exclude=excluded_fields,
|
|
69
|
-
exclude_none=True,
|
|
70
|
-
)
|
|
71
|
-
return _dict
|
|
72
|
-
|
|
73
|
-
@classmethod
|
|
74
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
75
|
-
"""Create an instance of BrowserSessionRecordingResponse from a dict"""
|
|
76
|
-
if obj is None:
|
|
77
|
-
return None
|
|
78
|
-
|
|
79
|
-
if not isinstance(obj, dict):
|
|
80
|
-
return cls.model_validate(obj)
|
|
81
|
-
|
|
82
|
-
_obj = cls.model_validate({
|
|
83
|
-
"recording_url": obj.get("recording_url")
|
|
84
|
-
})
|
|
85
|
-
return _obj
|
|
86
|
-
|
|
87
|
-
|
|
@@ -1,87 +0,0 @@
|
|
|
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 pydantic import BaseModel, ConfigDict, StrictStr
|
|
21
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
-
from typing import Optional, Set
|
|
23
|
-
from typing_extensions import Self
|
|
24
|
-
|
|
25
|
-
class DeleteAgentProfile200Response(BaseModel):
|
|
26
|
-
"""
|
|
27
|
-
DeleteAgentProfile200Response
|
|
28
|
-
""" # noqa: E501
|
|
29
|
-
message: Optional[StrictStr] = None
|
|
30
|
-
__properties: ClassVar[List[str]] = ["message"]
|
|
31
|
-
|
|
32
|
-
model_config = ConfigDict(
|
|
33
|
-
populate_by_name=True,
|
|
34
|
-
validate_assignment=True,
|
|
35
|
-
protected_namespaces=(),
|
|
36
|
-
)
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
def to_str(self) -> str:
|
|
40
|
-
"""Returns the string representation of the model using alias"""
|
|
41
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
|
42
|
-
|
|
43
|
-
def to_json(self) -> str:
|
|
44
|
-
"""Returns the JSON representation of the model using alias"""
|
|
45
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
46
|
-
return json.dumps(self.to_dict())
|
|
47
|
-
|
|
48
|
-
@classmethod
|
|
49
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
50
|
-
"""Create an instance of DeleteAgentProfile200Response from a JSON string"""
|
|
51
|
-
return cls.from_dict(json.loads(json_str))
|
|
52
|
-
|
|
53
|
-
def to_dict(self) -> Dict[str, Any]:
|
|
54
|
-
"""Return the dictionary representation of the model using alias.
|
|
55
|
-
|
|
56
|
-
This has the following differences from calling pydantic's
|
|
57
|
-
`self.model_dump(by_alias=True)`:
|
|
58
|
-
|
|
59
|
-
* `None` is only added to the output dict for nullable fields that
|
|
60
|
-
were set at model initialization. Other fields with value `None`
|
|
61
|
-
are ignored.
|
|
62
|
-
"""
|
|
63
|
-
excluded_fields: Set[str] = set([
|
|
64
|
-
])
|
|
65
|
-
|
|
66
|
-
_dict = self.model_dump(
|
|
67
|
-
by_alias=True,
|
|
68
|
-
exclude=excluded_fields,
|
|
69
|
-
exclude_none=True,
|
|
70
|
-
)
|
|
71
|
-
return _dict
|
|
72
|
-
|
|
73
|
-
@classmethod
|
|
74
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
75
|
-
"""Create an instance of DeleteAgentProfile200Response from a dict"""
|
|
76
|
-
if obj is None:
|
|
77
|
-
return None
|
|
78
|
-
|
|
79
|
-
if not isinstance(obj, dict):
|
|
80
|
-
return cls.model_validate(obj)
|
|
81
|
-
|
|
82
|
-
_obj = cls.model_validate({
|
|
83
|
-
"message": obj.get("message")
|
|
84
|
-
})
|
|
85
|
-
return _obj
|
|
86
|
-
|
|
87
|
-
|
|
@@ -1,87 +0,0 @@
|
|
|
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 pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
21
|
-
from typing import Any, ClassVar, Dict, List
|
|
22
|
-
from typing import Optional, Set
|
|
23
|
-
from typing_extensions import Self
|
|
24
|
-
|
|
25
|
-
class ErrorResponse(BaseModel):
|
|
26
|
-
"""
|
|
27
|
-
ErrorResponse
|
|
28
|
-
""" # noqa: E501
|
|
29
|
-
error: StrictStr = Field(description="Error message")
|
|
30
|
-
__properties: ClassVar[List[str]] = ["error"]
|
|
31
|
-
|
|
32
|
-
model_config = ConfigDict(
|
|
33
|
-
populate_by_name=True,
|
|
34
|
-
validate_assignment=True,
|
|
35
|
-
protected_namespaces=(),
|
|
36
|
-
)
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
def to_str(self) -> str:
|
|
40
|
-
"""Returns the string representation of the model using alias"""
|
|
41
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
|
42
|
-
|
|
43
|
-
def to_json(self) -> str:
|
|
44
|
-
"""Returns the JSON representation of the model using alias"""
|
|
45
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
46
|
-
return json.dumps(self.to_dict())
|
|
47
|
-
|
|
48
|
-
@classmethod
|
|
49
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
50
|
-
"""Create an instance of ErrorResponse from a JSON string"""
|
|
51
|
-
return cls.from_dict(json.loads(json_str))
|
|
52
|
-
|
|
53
|
-
def to_dict(self) -> Dict[str, Any]:
|
|
54
|
-
"""Return the dictionary representation of the model using alias.
|
|
55
|
-
|
|
56
|
-
This has the following differences from calling pydantic's
|
|
57
|
-
`self.model_dump(by_alias=True)`:
|
|
58
|
-
|
|
59
|
-
* `None` is only added to the output dict for nullable fields that
|
|
60
|
-
were set at model initialization. Other fields with value `None`
|
|
61
|
-
are ignored.
|
|
62
|
-
"""
|
|
63
|
-
excluded_fields: Set[str] = set([
|
|
64
|
-
])
|
|
65
|
-
|
|
66
|
-
_dict = self.model_dump(
|
|
67
|
-
by_alias=True,
|
|
68
|
-
exclude=excluded_fields,
|
|
69
|
-
exclude_none=True,
|
|
70
|
-
)
|
|
71
|
-
return _dict
|
|
72
|
-
|
|
73
|
-
@classmethod
|
|
74
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
75
|
-
"""Create an instance of ErrorResponse from a dict"""
|
|
76
|
-
if obj is None:
|
|
77
|
-
return None
|
|
78
|
-
|
|
79
|
-
if not isinstance(obj, dict):
|
|
80
|
-
return cls.model_validate(obj)
|
|
81
|
-
|
|
82
|
-
_obj = cls.model_validate({
|
|
83
|
-
"error": obj.get("error")
|
|
84
|
-
})
|
|
85
|
-
return _obj
|
|
86
|
-
|
|
87
|
-
|
|
@@ -1,87 +0,0 @@
|
|
|
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 pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
21
|
-
from typing import Any, ClassVar, Dict, List
|
|
22
|
-
from typing import Optional, Set
|
|
23
|
-
from typing_extensions import Self
|
|
24
|
-
|
|
25
|
-
class ExecutionResponse(BaseModel):
|
|
26
|
-
"""
|
|
27
|
-
ExecutionResponse
|
|
28
|
-
""" # noqa: E501
|
|
29
|
-
execution_id: StrictStr = Field(description="The ID of the execution")
|
|
30
|
-
__properties: ClassVar[List[str]] = ["execution_id"]
|
|
31
|
-
|
|
32
|
-
model_config = ConfigDict(
|
|
33
|
-
populate_by_name=True,
|
|
34
|
-
validate_assignment=True,
|
|
35
|
-
protected_namespaces=(),
|
|
36
|
-
)
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
def to_str(self) -> str:
|
|
40
|
-
"""Returns the string representation of the model using alias"""
|
|
41
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
|
42
|
-
|
|
43
|
-
def to_json(self) -> str:
|
|
44
|
-
"""Returns the JSON representation of the model using alias"""
|
|
45
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
46
|
-
return json.dumps(self.to_dict())
|
|
47
|
-
|
|
48
|
-
@classmethod
|
|
49
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
50
|
-
"""Create an instance of ExecutionResponse from a JSON string"""
|
|
51
|
-
return cls.from_dict(json.loads(json_str))
|
|
52
|
-
|
|
53
|
-
def to_dict(self) -> Dict[str, Any]:
|
|
54
|
-
"""Return the dictionary representation of the model using alias.
|
|
55
|
-
|
|
56
|
-
This has the following differences from calling pydantic's
|
|
57
|
-
`self.model_dump(by_alias=True)`:
|
|
58
|
-
|
|
59
|
-
* `None` is only added to the output dict for nullable fields that
|
|
60
|
-
were set at model initialization. Other fields with value `None`
|
|
61
|
-
are ignored.
|
|
62
|
-
"""
|
|
63
|
-
excluded_fields: Set[str] = set([
|
|
64
|
-
])
|
|
65
|
-
|
|
66
|
-
_dict = self.model_dump(
|
|
67
|
-
by_alias=True,
|
|
68
|
-
exclude=excluded_fields,
|
|
69
|
-
exclude_none=True,
|
|
70
|
-
)
|
|
71
|
-
return _dict
|
|
72
|
-
|
|
73
|
-
@classmethod
|
|
74
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
75
|
-
"""Create an instance of ExecutionResponse from a dict"""
|
|
76
|
-
if obj is None:
|
|
77
|
-
return None
|
|
78
|
-
|
|
79
|
-
if not isinstance(obj, dict):
|
|
80
|
-
return cls.model_validate(obj)
|
|
81
|
-
|
|
82
|
-
_obj = cls.model_validate({
|
|
83
|
-
"execution_id": obj.get("execution_id")
|
|
84
|
-
})
|
|
85
|
-
return _obj
|
|
86
|
-
|
|
87
|
-
|
|
@@ -1,101 +0,0 @@
|
|
|
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 pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
21
|
-
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
-
from typing import Optional, Set
|
|
23
|
-
from typing_extensions import Self
|
|
24
|
-
|
|
25
|
-
class ExecutionResult(BaseModel):
|
|
26
|
-
"""
|
|
27
|
-
The result of an execution. Contains the outcome, reasoning, and result.
|
|
28
|
-
""" # noqa: E501
|
|
29
|
-
outcome: Optional[StrictStr] = Field(default=None, description="The outcome of the execution (success or failure)")
|
|
30
|
-
reasoning: Optional[StrictStr] = Field(default=None, description="The reasoning behind the execution outcome")
|
|
31
|
-
result: Optional[Dict[str, Any]] = Field(default=None, description="The structured result data from the execution. This will follow the format defined in the result_schema of the agent.")
|
|
32
|
-
__properties: ClassVar[List[str]] = ["outcome", "reasoning", "result"]
|
|
33
|
-
|
|
34
|
-
@field_validator('outcome')
|
|
35
|
-
def outcome_validate_enum(cls, value):
|
|
36
|
-
"""Validates the enum"""
|
|
37
|
-
if value is None:
|
|
38
|
-
return value
|
|
39
|
-
|
|
40
|
-
if value not in set(['success', 'failure']):
|
|
41
|
-
raise ValueError("must be one of enum values ('success', 'failure')")
|
|
42
|
-
return value
|
|
43
|
-
|
|
44
|
-
model_config = ConfigDict(
|
|
45
|
-
populate_by_name=True,
|
|
46
|
-
validate_assignment=True,
|
|
47
|
-
protected_namespaces=(),
|
|
48
|
-
)
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
def to_str(self) -> str:
|
|
52
|
-
"""Returns the string representation of the model using alias"""
|
|
53
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
|
54
|
-
|
|
55
|
-
def to_json(self) -> str:
|
|
56
|
-
"""Returns the JSON representation of the model using alias"""
|
|
57
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
58
|
-
return json.dumps(self.to_dict())
|
|
59
|
-
|
|
60
|
-
@classmethod
|
|
61
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
62
|
-
"""Create an instance of ExecutionResult from a JSON string"""
|
|
63
|
-
return cls.from_dict(json.loads(json_str))
|
|
64
|
-
|
|
65
|
-
def to_dict(self) -> Dict[str, Any]:
|
|
66
|
-
"""Return the dictionary representation of the model using alias.
|
|
67
|
-
|
|
68
|
-
This has the following differences from calling pydantic's
|
|
69
|
-
`self.model_dump(by_alias=True)`:
|
|
70
|
-
|
|
71
|
-
* `None` is only added to the output dict for nullable fields that
|
|
72
|
-
were set at model initialization. Other fields with value `None`
|
|
73
|
-
are ignored.
|
|
74
|
-
"""
|
|
75
|
-
excluded_fields: Set[str] = set([
|
|
76
|
-
])
|
|
77
|
-
|
|
78
|
-
_dict = self.model_dump(
|
|
79
|
-
by_alias=True,
|
|
80
|
-
exclude=excluded_fields,
|
|
81
|
-
exclude_none=True,
|
|
82
|
-
)
|
|
83
|
-
return _dict
|
|
84
|
-
|
|
85
|
-
@classmethod
|
|
86
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
87
|
-
"""Create an instance of ExecutionResult from a dict"""
|
|
88
|
-
if obj is None:
|
|
89
|
-
return None
|
|
90
|
-
|
|
91
|
-
if not isinstance(obj, dict):
|
|
92
|
-
return cls.model_validate(obj)
|
|
93
|
-
|
|
94
|
-
_obj = cls.model_validate({
|
|
95
|
-
"outcome": obj.get("outcome"),
|
|
96
|
-
"reasoning": obj.get("reasoning"),
|
|
97
|
-
"result": obj.get("result")
|
|
98
|
-
})
|
|
99
|
-
return _obj
|
|
100
|
-
|
|
101
|
-
|