77from attrs import define as _attrs_define
88from attrs import field as _attrs_field
99
10+ from ..models .llm_enum_public import LLMEnumPublic
1011from ..models .public_effort_level import PublicEffortLevel
11- from ..models .public_llm import PublicLLM
1212from ..types import UNSET , Unset
1313
1414if TYPE_CHECKING :
@@ -31,19 +31,28 @@ class AgentMapOperation:
3131 session_id (None | Unset | UUID): Session ID. If not provided, a new session is auto-created for this task.
3232 response_schema (AgentMapOperationResponseSchemaType0 | None | Unset): JSON Schema for the response format. If
3333 not provided, use default answer schema.
34- llm (PublicLLM | Unset):
35- effort_level (PublicEffortLevel | Unset):
34+ llm (LLMEnumPublic | None | Unset): LLM to use for each agent. Required when effort_level is not set.
35+ effort_level (None | PublicEffortLevel | Unset): Effort level preset: low (quick), medium (balanced), high
36+ (thorough). Mutually exclusive with llm/iteration_budget/include_research - use either a preset or custom
37+ params, not both. If not specified, you must provide all individual parameters (llm, iteration_budget,
38+ include_research).
3639 join_with_input (bool | Unset): If True, merge agent output with input row. If False, output only agent results.
3740 Default: True.
41+ iteration_budget (int | None | Unset): Number of agent iterations per row (0-20). Required when effort_level is
42+ not set.
43+ include_research (bool | None | Unset): Include research notes in the response. Required when effort_level is
44+ not set.
3845 """
3946
4047 input_ : AgentMapOperationInputType2 | list [AgentMapOperationInputType1Item ] | UUID
4148 task : str
4249 session_id : None | Unset | UUID = UNSET
4350 response_schema : AgentMapOperationResponseSchemaType0 | None | Unset = UNSET
44- llm : PublicLLM | Unset = UNSET
45- effort_level : PublicEffortLevel | Unset = UNSET
51+ llm : LLMEnumPublic | None | Unset = UNSET
52+ effort_level : None | PublicEffortLevel | Unset = UNSET
4653 join_with_input : bool | Unset = True
54+ iteration_budget : int | None | Unset = UNSET
55+ include_research : bool | None | Unset = UNSET
4756 additional_properties : dict [str , Any ] = _attrs_field (init = False , factory = dict )
4857
4958 def to_dict (self ) -> dict [str , Any ]:
@@ -79,16 +88,36 @@ def to_dict(self) -> dict[str, Any]:
7988 else :
8089 response_schema = self .response_schema
8190
82- llm : str | Unset = UNSET
83- if not isinstance (self .llm , Unset ):
91+ llm : None | str | Unset
92+ if isinstance (self .llm , Unset ):
93+ llm = UNSET
94+ elif isinstance (self .llm , LLMEnumPublic ):
8495 llm = self .llm .value
96+ else :
97+ llm = self .llm
8598
86- effort_level : str | Unset = UNSET
87- if not isinstance (self .effort_level , Unset ):
99+ effort_level : None | str | Unset
100+ if isinstance (self .effort_level , Unset ):
101+ effort_level = UNSET
102+ elif isinstance (self .effort_level , PublicEffortLevel ):
88103 effort_level = self .effort_level .value
104+ else :
105+ effort_level = self .effort_level
89106
90107 join_with_input = self .join_with_input
91108
109+ iteration_budget : int | None | Unset
110+ if isinstance (self .iteration_budget , Unset ):
111+ iteration_budget = UNSET
112+ else :
113+ iteration_budget = self .iteration_budget
114+
115+ include_research : bool | None | Unset
116+ if isinstance (self .include_research , Unset ):
117+ include_research = UNSET
118+ else :
119+ include_research = self .include_research
120+
92121 field_dict : dict [str , Any ] = {}
93122 field_dict .update (self .additional_properties )
94123 field_dict .update (
@@ -107,6 +136,10 @@ def to_dict(self) -> dict[str, Any]:
107136 field_dict ["effort_level" ] = effort_level
108137 if join_with_input is not UNSET :
109138 field_dict ["join_with_input" ] = join_with_input
139+ if iteration_budget is not UNSET :
140+ field_dict ["iteration_budget" ] = iteration_budget
141+ if include_research is not UNSET :
142+ field_dict ["include_research" ] = include_research
110143
111144 return field_dict
112145
@@ -184,22 +217,60 @@ def _parse_response_schema(data: object) -> AgentMapOperationResponseSchemaType0
184217
185218 response_schema = _parse_response_schema (d .pop ("response_schema" , UNSET ))
186219
187- _llm = d .pop ("llm" , UNSET )
188- llm : PublicLLM | Unset
189- if isinstance (_llm , Unset ):
190- llm = UNSET
191- else :
192- llm = PublicLLM (_llm )
220+ def _parse_llm (data : object ) -> LLMEnumPublic | None | Unset :
221+ if data is None :
222+ return data
223+ if isinstance (data , Unset ):
224+ return data
225+ try :
226+ if not isinstance (data , str ):
227+ raise TypeError ()
228+ llm_type_0 = LLMEnumPublic (data )
193229
194- _effort_level = d .pop ("effort_level" , UNSET )
195- effort_level : PublicEffortLevel | Unset
196- if isinstance (_effort_level , Unset ):
197- effort_level = UNSET
198- else :
199- effort_level = PublicEffortLevel (_effort_level )
230+ return llm_type_0
231+ except (TypeError , ValueError , AttributeError , KeyError ):
232+ pass
233+ return cast (LLMEnumPublic | None | Unset , data )
234+
235+ llm = _parse_llm (d .pop ("llm" , UNSET ))
236+
237+ def _parse_effort_level (data : object ) -> None | PublicEffortLevel | Unset :
238+ if data is None :
239+ return data
240+ if isinstance (data , Unset ):
241+ return data
242+ try :
243+ if not isinstance (data , str ):
244+ raise TypeError ()
245+ effort_level_type_0 = PublicEffortLevel (data )
246+
247+ return effort_level_type_0
248+ except (TypeError , ValueError , AttributeError , KeyError ):
249+ pass
250+ return cast (None | PublicEffortLevel | Unset , data )
251+
252+ effort_level = _parse_effort_level (d .pop ("effort_level" , UNSET ))
200253
201254 join_with_input = d .pop ("join_with_input" , UNSET )
202255
256+ def _parse_iteration_budget (data : object ) -> int | None | Unset :
257+ if data is None :
258+ return data
259+ if isinstance (data , Unset ):
260+ return data
261+ return cast (int | None | Unset , data )
262+
263+ iteration_budget = _parse_iteration_budget (d .pop ("iteration_budget" , UNSET ))
264+
265+ def _parse_include_research (data : object ) -> bool | None | Unset :
266+ if data is None :
267+ return data
268+ if isinstance (data , Unset ):
269+ return data
270+ return cast (bool | None | Unset , data )
271+
272+ include_research = _parse_include_research (d .pop ("include_research" , UNSET ))
273+
203274 agent_map_operation = cls (
204275 input_ = input_ ,
205276 task = task ,
@@ -208,6 +279,8 @@ def _parse_response_schema(data: object) -> AgentMapOperationResponseSchemaType0
208279 llm = llm ,
209280 effort_level = effort_level ,
210281 join_with_input = join_with_input ,
282+ iteration_budget = iteration_budget ,
283+ include_research = include_research ,
211284 )
212285
213286 agent_map_operation .additional_properties = d
0 commit comments