asteroid-odyssey 1.3.7__py3-none-any.whl → 1.3.8__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 +4 -2
- asteroid_odyssey/agents_v1_gen/__init__.py +0 -1
- asteroid_odyssey/agents_v1_gen/api/execution_api.py +26 -311
- asteroid_odyssey/agents_v1_gen/models/__init__.py +0 -1
- asteroid_odyssey/agents_v1_gen/models/agent_profile.py +1 -3
- asteroid_odyssey/agents_v1_gen/models/create_agent_profile_request.py +1 -3
- asteroid_odyssey/agents_v1_gen/models/proxy_type.py +1 -0
- asteroid_odyssey/agents_v1_gen/models/update_agent_profile_request.py +1 -3
- asteroid_odyssey/agents_v2_gen/__init__.py +53 -15
- asteroid_odyssey/agents_v2_gen/api/__init__.py +3 -1
- asteroid_odyssey/agents_v2_gen/api/agents_api.py +684 -0
- asteroid_odyssey/agents_v2_gen/api/{default_api.py → execution_api.py} +381 -479
- asteroid_odyssey/agents_v2_gen/api/files_api.py +895 -0
- asteroid_odyssey/agents_v2_gen/models/__init__.py +50 -14
- asteroid_odyssey/agents_v2_gen/models/agents_agent_execute_agent_request.py +103 -0
- asteroid_odyssey/{agents_v1_gen/models/upload_execution_files200_response.py → agents_v2_gen/models/agents_agent_execute_agent_response.py} +11 -13
- asteroid_odyssey/agents_v2_gen/models/agents_execution_action_name.py +93 -0
- asteroid_odyssey/agents_v2_gen/models/agents_execution_activity_action_completed_info.py +350 -0
- asteroid_odyssey/agents_v2_gen/models/agents_execution_activity_action_completed_payload.py +25 -3
- asteroid_odyssey/agents_v2_gen/models/agents_execution_activity_action_failed_payload.py +19 -3
- asteroid_odyssey/agents_v2_gen/models/agents_execution_activity_action_started_info.py +252 -0
- asteroid_odyssey/agents_v2_gen/models/agents_execution_activity_action_started_payload.py +23 -3
- asteroid_odyssey/agents_v2_gen/models/agents_execution_activity_file_added_payload.py +10 -1
- asteroid_odyssey/agents_v2_gen/models/agents_execution_activity_generic_payload.py +11 -2
- asteroid_odyssey/agents_v2_gen/models/agents_execution_activity_payload_union.py +132 -104
- asteroid_odyssey/agents_v2_gen/models/agents_execution_activity_playwright_script_generated_payload.py +114 -0
- asteroid_odyssey/agents_v2_gen/models/{activity_payload_union_terminal.py → agents_execution_activity_reasoning_payload.py} +9 -13
- asteroid_odyssey/agents_v2_gen/models/agents_execution_activity_status_changed_payload.py +11 -2
- asteroid_odyssey/agents_v2_gen/models/agents_execution_activity_step_completed_payload.py +11 -2
- asteroid_odyssey/agents_v2_gen/models/agents_execution_activity_step_started_payload.py +11 -2
- asteroid_odyssey/agents_v2_gen/models/agents_execution_activity_transitioned_node_payload.py +20 -4
- asteroid_odyssey/agents_v2_gen/models/agents_execution_activity_user_message_received_payload.py +11 -2
- asteroid_odyssey/agents_v2_gen/models/{activity_payload_union_action_started.py → agents_execution_activity_workflow_updated_payload.py} +17 -13
- asteroid_odyssey/agents_v2_gen/models/agents_execution_comment.py +100 -0
- asteroid_odyssey/agents_v2_gen/models/agents_execution_completed_payload.py +4 -11
- asteroid_odyssey/agents_v2_gen/models/agents_execution_element_file_upload_completed_details.py +96 -0
- asteroid_odyssey/agents_v2_gen/models/agents_execution_execution_result.py +103 -0
- asteroid_odyssey/agents_v2_gen/models/agents_execution_ext_api_call_completed_details.py +102 -0
- asteroid_odyssey/agents_v2_gen/models/agents_execution_ext_get_mail_completed_details.py +98 -0
- asteroid_odyssey/agents_v2_gen/models/agents_execution_failed_payload.py +8 -2
- asteroid_odyssey/agents_v2_gen/models/{activity_payload_union_file_added.py → agents_execution_file_list_completed_details.py} +13 -17
- asteroid_odyssey/agents_v2_gen/models/agents_execution_file_read_completed_details.py +100 -0
- asteroid_odyssey/agents_v2_gen/models/agents_execution_file_stage_completed_details.py +96 -0
- asteroid_odyssey/agents_v2_gen/models/agents_execution_human_label.py +96 -0
- asteroid_odyssey/agents_v2_gen/models/agents_execution_list_item.py +141 -0
- asteroid_odyssey/agents_v2_gen/models/agents_execution_llm_call_purpose.py +40 -0
- asteroid_odyssey/agents_v2_gen/models/agents_execution_llm_call_started_details.py +97 -0
- asteroid_odyssey/agents_v2_gen/models/agents_execution_nav_to_completed_details.py +96 -0
- asteroid_odyssey/agents_v2_gen/models/agents_execution_nav_to_started_details.py +96 -0
- asteroid_odyssey/agents_v2_gen/models/agents_execution_obs_snapshot_with_selectors_completed_details.py +98 -0
- asteroid_odyssey/agents_v2_gen/models/agents_execution_rules_details.py +87 -0
- asteroid_odyssey/agents_v2_gen/models/agents_execution_scratchpad_read_completed_details.py +98 -0
- asteroid_odyssey/agents_v2_gen/models/{activity_payload_union_generic.py → agents_execution_scratchpad_read_started_details.py} +20 -17
- asteroid_odyssey/agents_v2_gen/models/agents_execution_scratchpad_write_completed_details.py +104 -0
- asteroid_odyssey/agents_v2_gen/models/{activity_payload_union_step_started.py → agents_execution_scratchpad_write_started_details.py} +20 -17
- asteroid_odyssey/agents_v2_gen/models/agents_execution_script_hybrid_playwright_completed_details.py +102 -0
- asteroid_odyssey/agents_v2_gen/models/agents_execution_script_hybrid_playwright_started_details.py +96 -0
- asteroid_odyssey/agents_v2_gen/models/agents_execution_script_pad_run_function_completed_details.py +102 -0
- asteroid_odyssey/agents_v2_gen/models/agents_execution_script_playwright_completed_details.py +102 -0
- asteroid_odyssey/agents_v2_gen/models/agents_execution_script_playwright_started_details.py +96 -0
- asteroid_odyssey/agents_v2_gen/models/agents_execution_scriptpad_read_completed_details.py +96 -0
- asteroid_odyssey/agents_v2_gen/models/agents_execution_scriptpad_read_started_details.py +98 -0
- asteroid_odyssey/agents_v2_gen/models/{activity_payload_union_action_completed.py → agents_execution_scriptpad_run_function_started_details.py} +21 -18
- asteroid_odyssey/agents_v2_gen/models/agents_execution_scriptpad_search_replace_completed_details.py +106 -0
- asteroid_odyssey/agents_v2_gen/models/agents_execution_scriptpad_search_replace_started_details.py +100 -0
- asteroid_odyssey/agents_v2_gen/models/agents_execution_scriptpad_write_completed_details.py +102 -0
- asteroid_odyssey/agents_v2_gen/models/agents_execution_sort_field.py +37 -0
- asteroid_odyssey/agents_v2_gen/models/agents_execution_terminal_payload.py +11 -2
- asteroid_odyssey/agents_v2_gen/models/{activity_payload_union_action_failed.py → agents_execution_util_get_datetime_completed_details.py} +20 -19
- asteroid_odyssey/agents_v2_gen/models/agents_execution_util_get_datetime_started_details.py +96 -0
- asteroid_odyssey/agents_v2_gen/models/{agents_execution_graph_update.py → agents_execution_workflow_update.py} +11 -5
- asteroid_odyssey/agents_v2_gen/models/agents_files_temp_file.py +89 -0
- asteroid_odyssey/agents_v2_gen/models/{agents_execution_activity_graph_updated_payload.py → agents_files_temp_files_response.py} +14 -14
- asteroid_odyssey/agents_v2_gen/models/agents_graph_models_nodes_properties_playwright_script_llm_var.py +92 -0
- asteroid_odyssey/agents_v2_gen/models/agents_graph_models_nodes_properties_playwright_script_llm_var_type.py +38 -0
- asteroid_odyssey/agents_v2_gen/models/agents_graph_models_transitions_transition_type.py +38 -0
- asteroid_odyssey/agents_v2_gen/models/common_os_error.py +87 -0
- asteroid_odyssey/agents_v2_gen/models/executions_list200_response.py +101 -0
- asteroid_odyssey/client.py +204 -33
- {asteroid_odyssey-1.3.7.dist-info → asteroid_odyssey-1.3.8.dist-info}/METADATA +1 -1
- asteroid_odyssey-1.3.8.dist-info/RECORD +132 -0
- asteroid_odyssey/agents_v2_gen/models/activity_payload_union_graph_updated.py +0 -100
- asteroid_odyssey/agents_v2_gen/models/activity_payload_union_status_changed.py +0 -100
- asteroid_odyssey/agents_v2_gen/models/activity_payload_union_step_completed.py +0 -100
- asteroid_odyssey/agents_v2_gen/models/activity_payload_union_transitioned_node.py +0 -100
- asteroid_odyssey/agents_v2_gen/models/activity_payload_union_user_message_received.py +0 -100
- asteroid_odyssey-1.3.7.dist-info/RECORD +0 -95
- {asteroid_odyssey-1.3.7.dist-info → asteroid_odyssey-1.3.8.dist-info}/WHEEL +0 -0
- {asteroid_odyssey-1.3.7.dist-info → asteroid_odyssey-1.3.8.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,252 @@
|
|
|
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 json
|
|
17
|
+
import pprint
|
|
18
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
|
|
19
|
+
from typing import Any, List, Optional
|
|
20
|
+
from asteroid_odyssey.agents_v2_gen.models.agents_execution_llm_call_started_details import AgentsExecutionLLMCallStartedDetails
|
|
21
|
+
from asteroid_odyssey.agents_v2_gen.models.agents_execution_nav_to_started_details import AgentsExecutionNavToStartedDetails
|
|
22
|
+
from asteroid_odyssey.agents_v2_gen.models.agents_execution_scratchpad_read_started_details import AgentsExecutionScratchpadReadStartedDetails
|
|
23
|
+
from asteroid_odyssey.agents_v2_gen.models.agents_execution_scratchpad_write_started_details import AgentsExecutionScratchpadWriteStartedDetails
|
|
24
|
+
from asteroid_odyssey.agents_v2_gen.models.agents_execution_script_hybrid_playwright_started_details import AgentsExecutionScriptHybridPlaywrightStartedDetails
|
|
25
|
+
from asteroid_odyssey.agents_v2_gen.models.agents_execution_script_playwright_started_details import AgentsExecutionScriptPlaywrightStartedDetails
|
|
26
|
+
from asteroid_odyssey.agents_v2_gen.models.agents_execution_scriptpad_read_started_details import AgentsExecutionScriptpadReadStartedDetails
|
|
27
|
+
from asteroid_odyssey.agents_v2_gen.models.agents_execution_scriptpad_run_function_started_details import AgentsExecutionScriptpadRunFunctionStartedDetails
|
|
28
|
+
from asteroid_odyssey.agents_v2_gen.models.agents_execution_scriptpad_search_replace_started_details import AgentsExecutionScriptpadSearchReplaceStartedDetails
|
|
29
|
+
from asteroid_odyssey.agents_v2_gen.models.agents_execution_util_get_datetime_started_details import AgentsExecutionUtilGetDatetimeStartedDetails
|
|
30
|
+
from pydantic import StrictStr, Field
|
|
31
|
+
from typing import Union, List, Set, Optional, Dict
|
|
32
|
+
from typing_extensions import Literal, Self
|
|
33
|
+
|
|
34
|
+
AGENTSEXECUTIONACTIVITYACTIONSTARTEDINFO_ONE_OF_SCHEMAS = ["AgentsExecutionLLMCallStartedDetails", "AgentsExecutionNavToStartedDetails", "AgentsExecutionScratchpadReadStartedDetails", "AgentsExecutionScratchpadWriteStartedDetails", "AgentsExecutionScriptHybridPlaywrightStartedDetails", "AgentsExecutionScriptPlaywrightStartedDetails", "AgentsExecutionScriptpadReadStartedDetails", "AgentsExecutionScriptpadRunFunctionStartedDetails", "AgentsExecutionScriptpadSearchReplaceStartedDetails", "AgentsExecutionUtilGetDatetimeStartedDetails"]
|
|
35
|
+
|
|
36
|
+
class AgentsExecutionActivityActionStartedInfo(BaseModel):
|
|
37
|
+
"""
|
|
38
|
+
AgentsExecutionActivityActionStartedInfo
|
|
39
|
+
"""
|
|
40
|
+
# data type: AgentsExecutionNavToStartedDetails
|
|
41
|
+
oneof_schema_1_validator: Optional[AgentsExecutionNavToStartedDetails] = None
|
|
42
|
+
# data type: AgentsExecutionScratchpadReadStartedDetails
|
|
43
|
+
oneof_schema_2_validator: Optional[AgentsExecutionScratchpadReadStartedDetails] = None
|
|
44
|
+
# data type: AgentsExecutionScratchpadWriteStartedDetails
|
|
45
|
+
oneof_schema_3_validator: Optional[AgentsExecutionScratchpadWriteStartedDetails] = None
|
|
46
|
+
# data type: AgentsExecutionScriptpadRunFunctionStartedDetails
|
|
47
|
+
oneof_schema_4_validator: Optional[AgentsExecutionScriptpadRunFunctionStartedDetails] = None
|
|
48
|
+
# data type: AgentsExecutionScriptPlaywrightStartedDetails
|
|
49
|
+
oneof_schema_5_validator: Optional[AgentsExecutionScriptPlaywrightStartedDetails] = None
|
|
50
|
+
# data type: AgentsExecutionScriptHybridPlaywrightStartedDetails
|
|
51
|
+
oneof_schema_6_validator: Optional[AgentsExecutionScriptHybridPlaywrightStartedDetails] = None
|
|
52
|
+
# data type: AgentsExecutionScriptpadSearchReplaceStartedDetails
|
|
53
|
+
oneof_schema_7_validator: Optional[AgentsExecutionScriptpadSearchReplaceStartedDetails] = None
|
|
54
|
+
# data type: AgentsExecutionUtilGetDatetimeStartedDetails
|
|
55
|
+
oneof_schema_8_validator: Optional[AgentsExecutionUtilGetDatetimeStartedDetails] = None
|
|
56
|
+
# data type: AgentsExecutionScriptpadReadStartedDetails
|
|
57
|
+
oneof_schema_9_validator: Optional[AgentsExecutionScriptpadReadStartedDetails] = None
|
|
58
|
+
# data type: AgentsExecutionLLMCallStartedDetails
|
|
59
|
+
oneof_schema_10_validator: Optional[AgentsExecutionLLMCallStartedDetails] = None
|
|
60
|
+
actual_instance: Optional[Union[AgentsExecutionLLMCallStartedDetails, AgentsExecutionNavToStartedDetails, AgentsExecutionScratchpadReadStartedDetails, AgentsExecutionScratchpadWriteStartedDetails, AgentsExecutionScriptHybridPlaywrightStartedDetails, AgentsExecutionScriptPlaywrightStartedDetails, AgentsExecutionScriptpadReadStartedDetails, AgentsExecutionScriptpadRunFunctionStartedDetails, AgentsExecutionScriptpadSearchReplaceStartedDetails, AgentsExecutionUtilGetDatetimeStartedDetails]] = None
|
|
61
|
+
one_of_schemas: Set[str] = { "AgentsExecutionLLMCallStartedDetails", "AgentsExecutionNavToStartedDetails", "AgentsExecutionScratchpadReadStartedDetails", "AgentsExecutionScratchpadWriteStartedDetails", "AgentsExecutionScriptHybridPlaywrightStartedDetails", "AgentsExecutionScriptPlaywrightStartedDetails", "AgentsExecutionScriptpadReadStartedDetails", "AgentsExecutionScriptpadRunFunctionStartedDetails", "AgentsExecutionScriptpadSearchReplaceStartedDetails", "AgentsExecutionUtilGetDatetimeStartedDetails" }
|
|
62
|
+
|
|
63
|
+
model_config = ConfigDict(
|
|
64
|
+
validate_assignment=True,
|
|
65
|
+
protected_namespaces=(),
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
discriminator_value_class_map: Dict[str, str] = {
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
73
|
+
if args:
|
|
74
|
+
if len(args) > 1:
|
|
75
|
+
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
|
76
|
+
if kwargs:
|
|
77
|
+
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
|
78
|
+
super().__init__(actual_instance=args[0])
|
|
79
|
+
else:
|
|
80
|
+
super().__init__(**kwargs)
|
|
81
|
+
|
|
82
|
+
@field_validator('actual_instance')
|
|
83
|
+
def actual_instance_must_validate_oneof(cls, v):
|
|
84
|
+
instance = AgentsExecutionActivityActionStartedInfo.model_construct()
|
|
85
|
+
error_messages = []
|
|
86
|
+
match = 0
|
|
87
|
+
# validate data type: AgentsExecutionNavToStartedDetails
|
|
88
|
+
if not isinstance(v, AgentsExecutionNavToStartedDetails):
|
|
89
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `AgentsExecutionNavToStartedDetails`")
|
|
90
|
+
else:
|
|
91
|
+
match += 1
|
|
92
|
+
# validate data type: AgentsExecutionScratchpadReadStartedDetails
|
|
93
|
+
if not isinstance(v, AgentsExecutionScratchpadReadStartedDetails):
|
|
94
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `AgentsExecutionScratchpadReadStartedDetails`")
|
|
95
|
+
else:
|
|
96
|
+
match += 1
|
|
97
|
+
# validate data type: AgentsExecutionScratchpadWriteStartedDetails
|
|
98
|
+
if not isinstance(v, AgentsExecutionScratchpadWriteStartedDetails):
|
|
99
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `AgentsExecutionScratchpadWriteStartedDetails`")
|
|
100
|
+
else:
|
|
101
|
+
match += 1
|
|
102
|
+
# validate data type: AgentsExecutionScriptpadRunFunctionStartedDetails
|
|
103
|
+
if not isinstance(v, AgentsExecutionScriptpadRunFunctionStartedDetails):
|
|
104
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `AgentsExecutionScriptpadRunFunctionStartedDetails`")
|
|
105
|
+
else:
|
|
106
|
+
match += 1
|
|
107
|
+
# validate data type: AgentsExecutionScriptPlaywrightStartedDetails
|
|
108
|
+
if not isinstance(v, AgentsExecutionScriptPlaywrightStartedDetails):
|
|
109
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `AgentsExecutionScriptPlaywrightStartedDetails`")
|
|
110
|
+
else:
|
|
111
|
+
match += 1
|
|
112
|
+
# validate data type: AgentsExecutionScriptHybridPlaywrightStartedDetails
|
|
113
|
+
if not isinstance(v, AgentsExecutionScriptHybridPlaywrightStartedDetails):
|
|
114
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `AgentsExecutionScriptHybridPlaywrightStartedDetails`")
|
|
115
|
+
else:
|
|
116
|
+
match += 1
|
|
117
|
+
# validate data type: AgentsExecutionScriptpadSearchReplaceStartedDetails
|
|
118
|
+
if not isinstance(v, AgentsExecutionScriptpadSearchReplaceStartedDetails):
|
|
119
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `AgentsExecutionScriptpadSearchReplaceStartedDetails`")
|
|
120
|
+
else:
|
|
121
|
+
match += 1
|
|
122
|
+
# validate data type: AgentsExecutionUtilGetDatetimeStartedDetails
|
|
123
|
+
if not isinstance(v, AgentsExecutionUtilGetDatetimeStartedDetails):
|
|
124
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `AgentsExecutionUtilGetDatetimeStartedDetails`")
|
|
125
|
+
else:
|
|
126
|
+
match += 1
|
|
127
|
+
# validate data type: AgentsExecutionScriptpadReadStartedDetails
|
|
128
|
+
if not isinstance(v, AgentsExecutionScriptpadReadStartedDetails):
|
|
129
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `AgentsExecutionScriptpadReadStartedDetails`")
|
|
130
|
+
else:
|
|
131
|
+
match += 1
|
|
132
|
+
# validate data type: AgentsExecutionLLMCallStartedDetails
|
|
133
|
+
if not isinstance(v, AgentsExecutionLLMCallStartedDetails):
|
|
134
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `AgentsExecutionLLMCallStartedDetails`")
|
|
135
|
+
else:
|
|
136
|
+
match += 1
|
|
137
|
+
if match > 1:
|
|
138
|
+
# more than 1 match
|
|
139
|
+
raise ValueError("Multiple matches found when setting `actual_instance` in AgentsExecutionActivityActionStartedInfo with oneOf schemas: AgentsExecutionLLMCallStartedDetails, AgentsExecutionNavToStartedDetails, AgentsExecutionScratchpadReadStartedDetails, AgentsExecutionScratchpadWriteStartedDetails, AgentsExecutionScriptHybridPlaywrightStartedDetails, AgentsExecutionScriptPlaywrightStartedDetails, AgentsExecutionScriptpadReadStartedDetails, AgentsExecutionScriptpadRunFunctionStartedDetails, AgentsExecutionScriptpadSearchReplaceStartedDetails, AgentsExecutionUtilGetDatetimeStartedDetails. Details: " + ", ".join(error_messages))
|
|
140
|
+
elif match == 0:
|
|
141
|
+
# no match
|
|
142
|
+
raise ValueError("No match found when setting `actual_instance` in AgentsExecutionActivityActionStartedInfo with oneOf schemas: AgentsExecutionLLMCallStartedDetails, AgentsExecutionNavToStartedDetails, AgentsExecutionScratchpadReadStartedDetails, AgentsExecutionScratchpadWriteStartedDetails, AgentsExecutionScriptHybridPlaywrightStartedDetails, AgentsExecutionScriptPlaywrightStartedDetails, AgentsExecutionScriptpadReadStartedDetails, AgentsExecutionScriptpadRunFunctionStartedDetails, AgentsExecutionScriptpadSearchReplaceStartedDetails, AgentsExecutionUtilGetDatetimeStartedDetails. Details: " + ", ".join(error_messages))
|
|
143
|
+
else:
|
|
144
|
+
return v
|
|
145
|
+
|
|
146
|
+
@classmethod
|
|
147
|
+
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
|
|
148
|
+
return cls.from_json(json.dumps(obj))
|
|
149
|
+
|
|
150
|
+
@classmethod
|
|
151
|
+
def from_json(cls, json_str: str) -> Self:
|
|
152
|
+
"""Returns the object represented by the json string"""
|
|
153
|
+
instance = cls.model_construct()
|
|
154
|
+
error_messages = []
|
|
155
|
+
match = 0
|
|
156
|
+
|
|
157
|
+
# deserialize data into AgentsExecutionNavToStartedDetails
|
|
158
|
+
try:
|
|
159
|
+
instance.actual_instance = AgentsExecutionNavToStartedDetails.from_json(json_str)
|
|
160
|
+
match += 1
|
|
161
|
+
except (ValidationError, ValueError) as e:
|
|
162
|
+
error_messages.append(str(e))
|
|
163
|
+
# deserialize data into AgentsExecutionScratchpadReadStartedDetails
|
|
164
|
+
try:
|
|
165
|
+
instance.actual_instance = AgentsExecutionScratchpadReadStartedDetails.from_json(json_str)
|
|
166
|
+
match += 1
|
|
167
|
+
except (ValidationError, ValueError) as e:
|
|
168
|
+
error_messages.append(str(e))
|
|
169
|
+
# deserialize data into AgentsExecutionScratchpadWriteStartedDetails
|
|
170
|
+
try:
|
|
171
|
+
instance.actual_instance = AgentsExecutionScratchpadWriteStartedDetails.from_json(json_str)
|
|
172
|
+
match += 1
|
|
173
|
+
except (ValidationError, ValueError) as e:
|
|
174
|
+
error_messages.append(str(e))
|
|
175
|
+
# deserialize data into AgentsExecutionScriptpadRunFunctionStartedDetails
|
|
176
|
+
try:
|
|
177
|
+
instance.actual_instance = AgentsExecutionScriptpadRunFunctionStartedDetails.from_json(json_str)
|
|
178
|
+
match += 1
|
|
179
|
+
except (ValidationError, ValueError) as e:
|
|
180
|
+
error_messages.append(str(e))
|
|
181
|
+
# deserialize data into AgentsExecutionScriptPlaywrightStartedDetails
|
|
182
|
+
try:
|
|
183
|
+
instance.actual_instance = AgentsExecutionScriptPlaywrightStartedDetails.from_json(json_str)
|
|
184
|
+
match += 1
|
|
185
|
+
except (ValidationError, ValueError) as e:
|
|
186
|
+
error_messages.append(str(e))
|
|
187
|
+
# deserialize data into AgentsExecutionScriptHybridPlaywrightStartedDetails
|
|
188
|
+
try:
|
|
189
|
+
instance.actual_instance = AgentsExecutionScriptHybridPlaywrightStartedDetails.from_json(json_str)
|
|
190
|
+
match += 1
|
|
191
|
+
except (ValidationError, ValueError) as e:
|
|
192
|
+
error_messages.append(str(e))
|
|
193
|
+
# deserialize data into AgentsExecutionScriptpadSearchReplaceStartedDetails
|
|
194
|
+
try:
|
|
195
|
+
instance.actual_instance = AgentsExecutionScriptpadSearchReplaceStartedDetails.from_json(json_str)
|
|
196
|
+
match += 1
|
|
197
|
+
except (ValidationError, ValueError) as e:
|
|
198
|
+
error_messages.append(str(e))
|
|
199
|
+
# deserialize data into AgentsExecutionUtilGetDatetimeStartedDetails
|
|
200
|
+
try:
|
|
201
|
+
instance.actual_instance = AgentsExecutionUtilGetDatetimeStartedDetails.from_json(json_str)
|
|
202
|
+
match += 1
|
|
203
|
+
except (ValidationError, ValueError) as e:
|
|
204
|
+
error_messages.append(str(e))
|
|
205
|
+
# deserialize data into AgentsExecutionScriptpadReadStartedDetails
|
|
206
|
+
try:
|
|
207
|
+
instance.actual_instance = AgentsExecutionScriptpadReadStartedDetails.from_json(json_str)
|
|
208
|
+
match += 1
|
|
209
|
+
except (ValidationError, ValueError) as e:
|
|
210
|
+
error_messages.append(str(e))
|
|
211
|
+
# deserialize data into AgentsExecutionLLMCallStartedDetails
|
|
212
|
+
try:
|
|
213
|
+
instance.actual_instance = AgentsExecutionLLMCallStartedDetails.from_json(json_str)
|
|
214
|
+
match += 1
|
|
215
|
+
except (ValidationError, ValueError) as e:
|
|
216
|
+
error_messages.append(str(e))
|
|
217
|
+
|
|
218
|
+
if match > 1:
|
|
219
|
+
# more than 1 match
|
|
220
|
+
raise ValueError("Multiple matches found when deserializing the JSON string into AgentsExecutionActivityActionStartedInfo with oneOf schemas: AgentsExecutionLLMCallStartedDetails, AgentsExecutionNavToStartedDetails, AgentsExecutionScratchpadReadStartedDetails, AgentsExecutionScratchpadWriteStartedDetails, AgentsExecutionScriptHybridPlaywrightStartedDetails, AgentsExecutionScriptPlaywrightStartedDetails, AgentsExecutionScriptpadReadStartedDetails, AgentsExecutionScriptpadRunFunctionStartedDetails, AgentsExecutionScriptpadSearchReplaceStartedDetails, AgentsExecutionUtilGetDatetimeStartedDetails. Details: " + ", ".join(error_messages))
|
|
221
|
+
elif match == 0:
|
|
222
|
+
# no match
|
|
223
|
+
raise ValueError("No match found when deserializing the JSON string into AgentsExecutionActivityActionStartedInfo with oneOf schemas: AgentsExecutionLLMCallStartedDetails, AgentsExecutionNavToStartedDetails, AgentsExecutionScratchpadReadStartedDetails, AgentsExecutionScratchpadWriteStartedDetails, AgentsExecutionScriptHybridPlaywrightStartedDetails, AgentsExecutionScriptPlaywrightStartedDetails, AgentsExecutionScriptpadReadStartedDetails, AgentsExecutionScriptpadRunFunctionStartedDetails, AgentsExecutionScriptpadSearchReplaceStartedDetails, AgentsExecutionUtilGetDatetimeStartedDetails. Details: " + ", ".join(error_messages))
|
|
224
|
+
else:
|
|
225
|
+
return instance
|
|
226
|
+
|
|
227
|
+
def to_json(self) -> str:
|
|
228
|
+
"""Returns the JSON representation of the actual instance"""
|
|
229
|
+
if self.actual_instance is None:
|
|
230
|
+
return "null"
|
|
231
|
+
|
|
232
|
+
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
|
|
233
|
+
return self.actual_instance.to_json()
|
|
234
|
+
else:
|
|
235
|
+
return json.dumps(self.actual_instance)
|
|
236
|
+
|
|
237
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], AgentsExecutionLLMCallStartedDetails, AgentsExecutionNavToStartedDetails, AgentsExecutionScratchpadReadStartedDetails, AgentsExecutionScratchpadWriteStartedDetails, AgentsExecutionScriptHybridPlaywrightStartedDetails, AgentsExecutionScriptPlaywrightStartedDetails, AgentsExecutionScriptpadReadStartedDetails, AgentsExecutionScriptpadRunFunctionStartedDetails, AgentsExecutionScriptpadSearchReplaceStartedDetails, AgentsExecutionUtilGetDatetimeStartedDetails]]:
|
|
238
|
+
"""Returns the dict representation of the actual instance"""
|
|
239
|
+
if self.actual_instance is None:
|
|
240
|
+
return None
|
|
241
|
+
|
|
242
|
+
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
|
|
243
|
+
return self.actual_instance.to_dict()
|
|
244
|
+
else:
|
|
245
|
+
# primitive type
|
|
246
|
+
return self.actual_instance
|
|
247
|
+
|
|
248
|
+
def to_str(self) -> str:
|
|
249
|
+
"""Returns the string representation of the actual instance"""
|
|
250
|
+
return pprint.pformat(self.model_dump())
|
|
251
|
+
|
|
252
|
+
|
|
@@ -17,8 +17,10 @@ import pprint
|
|
|
17
17
|
import re # noqa: F401
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, StrictStr
|
|
21
|
-
from typing import Any, ClassVar, Dict, List
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from asteroid_odyssey.agents_v2_gen.models.agents_execution_action_name import AgentsExecutionActionName
|
|
23
|
+
from asteroid_odyssey.agents_v2_gen.models.agents_execution_activity_action_started_info import AgentsExecutionActivityActionStartedInfo
|
|
22
24
|
from typing import Optional, Set
|
|
23
25
|
from typing_extensions import Self
|
|
24
26
|
|
|
@@ -26,8 +28,19 @@ class AgentsExecutionActivityActionStartedPayload(BaseModel):
|
|
|
26
28
|
"""
|
|
27
29
|
AgentsExecutionActivityActionStartedPayload
|
|
28
30
|
""" # noqa: E501
|
|
31
|
+
action_id: StrictStr = Field(alias="actionId")
|
|
32
|
+
action_name: AgentsExecutionActionName = Field(alias="actionName")
|
|
33
|
+
activity_type: StrictStr = Field(alias="activityType")
|
|
34
|
+
info: Optional[AgentsExecutionActivityActionStartedInfo] = None
|
|
29
35
|
message: StrictStr
|
|
30
|
-
__properties: ClassVar[List[str]] = ["message"]
|
|
36
|
+
__properties: ClassVar[List[str]] = ["actionId", "actionName", "activityType", "info", "message"]
|
|
37
|
+
|
|
38
|
+
@field_validator('activity_type')
|
|
39
|
+
def activity_type_validate_enum(cls, value):
|
|
40
|
+
"""Validates the enum"""
|
|
41
|
+
if value not in set(['action_started']):
|
|
42
|
+
raise ValueError("must be one of enum values ('action_started')")
|
|
43
|
+
return value
|
|
31
44
|
|
|
32
45
|
model_config = ConfigDict(
|
|
33
46
|
populate_by_name=True,
|
|
@@ -68,6 +81,9 @@ class AgentsExecutionActivityActionStartedPayload(BaseModel):
|
|
|
68
81
|
exclude=excluded_fields,
|
|
69
82
|
exclude_none=True,
|
|
70
83
|
)
|
|
84
|
+
# override the default output from pydantic by calling `to_dict()` of info
|
|
85
|
+
if self.info:
|
|
86
|
+
_dict['info'] = self.info.to_dict()
|
|
71
87
|
return _dict
|
|
72
88
|
|
|
73
89
|
@classmethod
|
|
@@ -80,6 +96,10 @@ class AgentsExecutionActivityActionStartedPayload(BaseModel):
|
|
|
80
96
|
return cls.model_validate(obj)
|
|
81
97
|
|
|
82
98
|
_obj = cls.model_validate({
|
|
99
|
+
"actionId": obj.get("actionId"),
|
|
100
|
+
"actionName": obj.get("actionName"),
|
|
101
|
+
"activityType": obj.get("activityType"),
|
|
102
|
+
"info": AgentsExecutionActivityActionStartedInfo.from_dict(obj["info"]) if obj.get("info") is not None else None,
|
|
83
103
|
"message": obj.get("message")
|
|
84
104
|
})
|
|
85
105
|
return _obj
|
|
@@ -26,13 +26,21 @@ class AgentsExecutionActivityFileAddedPayload(BaseModel):
|
|
|
26
26
|
"""
|
|
27
27
|
AgentsExecutionActivityFileAddedPayload
|
|
28
28
|
""" # noqa: E501
|
|
29
|
+
activity_type: StrictStr = Field(alias="activityType")
|
|
29
30
|
file_id: StrictStr = Field(alias="fileId")
|
|
30
31
|
file_name: StrictStr = Field(alias="fileName")
|
|
31
32
|
file_size: StrictInt = Field(alias="fileSize")
|
|
32
33
|
mime_type: StrictStr = Field(alias="mimeType")
|
|
33
34
|
presigned_url: StrictStr = Field(alias="presignedUrl")
|
|
34
35
|
source: StrictStr
|
|
35
|
-
__properties: ClassVar[List[str]] = ["fileId", "fileName", "fileSize", "mimeType", "presignedUrl", "source"]
|
|
36
|
+
__properties: ClassVar[List[str]] = ["activityType", "fileId", "fileName", "fileSize", "mimeType", "presignedUrl", "source"]
|
|
37
|
+
|
|
38
|
+
@field_validator('activity_type')
|
|
39
|
+
def activity_type_validate_enum(cls, value):
|
|
40
|
+
"""Validates the enum"""
|
|
41
|
+
if value not in set(['file_added']):
|
|
42
|
+
raise ValueError("must be one of enum values ('file_added')")
|
|
43
|
+
return value
|
|
36
44
|
|
|
37
45
|
@field_validator('source')
|
|
38
46
|
def source_validate_enum(cls, value):
|
|
@@ -92,6 +100,7 @@ class AgentsExecutionActivityFileAddedPayload(BaseModel):
|
|
|
92
100
|
return cls.model_validate(obj)
|
|
93
101
|
|
|
94
102
|
_obj = cls.model_validate({
|
|
103
|
+
"activityType": obj.get("activityType"),
|
|
95
104
|
"fileId": obj.get("fileId"),
|
|
96
105
|
"fileName": obj.get("fileName"),
|
|
97
106
|
"fileSize": obj.get("fileSize"),
|
|
@@ -17,7 +17,7 @@ import pprint
|
|
|
17
17
|
import re # noqa: F401
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, StrictStr
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
|
21
21
|
from typing import Any, ClassVar, Dict, List
|
|
22
22
|
from typing import Optional, Set
|
|
23
23
|
from typing_extensions import Self
|
|
@@ -26,8 +26,16 @@ class AgentsExecutionActivityGenericPayload(BaseModel):
|
|
|
26
26
|
"""
|
|
27
27
|
AgentsExecutionActivityGenericPayload
|
|
28
28
|
""" # noqa: E501
|
|
29
|
+
activity_type: StrictStr = Field(alias="activityType")
|
|
29
30
|
message: StrictStr
|
|
30
|
-
__properties: ClassVar[List[str]] = ["message"]
|
|
31
|
+
__properties: ClassVar[List[str]] = ["activityType", "message"]
|
|
32
|
+
|
|
33
|
+
@field_validator('activity_type')
|
|
34
|
+
def activity_type_validate_enum(cls, value):
|
|
35
|
+
"""Validates the enum"""
|
|
36
|
+
if value not in set(['generic']):
|
|
37
|
+
raise ValueError("must be one of enum values ('generic')")
|
|
38
|
+
return value
|
|
31
39
|
|
|
32
40
|
model_config = ConfigDict(
|
|
33
41
|
populate_by_name=True,
|
|
@@ -80,6 +88,7 @@ class AgentsExecutionActivityGenericPayload(BaseModel):
|
|
|
80
88
|
return cls.model_validate(obj)
|
|
81
89
|
|
|
82
90
|
_obj = cls.model_validate({
|
|
91
|
+
"activityType": obj.get("activityType"),
|
|
83
92
|
"message": obj.get("message")
|
|
84
93
|
})
|
|
85
94
|
return _obj
|