orq-ai-sdk 4.2.0rc28__py3-none-any.whl → 4.2.6__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.
- orq_ai_sdk/_hooks/globalhook.py +0 -1
- orq_ai_sdk/_version.py +3 -3
- orq_ai_sdk/audio.py +30 -0
- orq_ai_sdk/basesdk.py +20 -6
- orq_ai_sdk/chat.py +22 -0
- orq_ai_sdk/completions.py +332 -0
- orq_ai_sdk/contacts.py +43 -855
- orq_ai_sdk/deployments.py +61 -0
- orq_ai_sdk/edits.py +258 -0
- orq_ai_sdk/embeddings.py +238 -0
- orq_ai_sdk/generations.py +272 -0
- orq_ai_sdk/identities.py +1037 -0
- orq_ai_sdk/images.py +28 -0
- orq_ai_sdk/models/__init__.py +5341 -737
- orq_ai_sdk/models/actionreviewedstreamingevent.py +18 -1
- orq_ai_sdk/models/actionreviewrequestedstreamingevent.py +44 -1
- orq_ai_sdk/models/agenterroredstreamingevent.py +18 -1
- orq_ai_sdk/models/agentinactivestreamingevent.py +168 -70
- orq_ai_sdk/models/agentmessagecreatedstreamingevent.py +18 -2
- orq_ai_sdk/models/agentresponsemessage.py +18 -2
- orq_ai_sdk/models/agentstartedstreamingevent.py +127 -2
- orq_ai_sdk/models/agentthoughtstreamingevent.py +178 -211
- orq_ai_sdk/models/conversationresponse.py +31 -20
- orq_ai_sdk/models/conversationwithmessagesresponse.py +31 -20
- orq_ai_sdk/models/createagentrequestop.py +1922 -384
- orq_ai_sdk/models/createagentresponse.py +147 -91
- orq_ai_sdk/models/createagentresponserequestop.py +111 -2
- orq_ai_sdk/models/createchatcompletionop.py +1375 -861
- orq_ai_sdk/models/createchunkop.py +46 -19
- orq_ai_sdk/models/createcompletionop.py +1890 -0
- orq_ai_sdk/models/createcontactop.py +45 -56
- orq_ai_sdk/models/createconversationop.py +61 -39
- orq_ai_sdk/models/createconversationresponseop.py +68 -4
- orq_ai_sdk/models/createdatasetitemop.py +424 -80
- orq_ai_sdk/models/createdatasetop.py +19 -2
- orq_ai_sdk/models/createdatasourceop.py +92 -26
- orq_ai_sdk/models/createembeddingop.py +384 -0
- orq_ai_sdk/models/createevalop.py +552 -24
- orq_ai_sdk/models/createidentityop.py +176 -0
- orq_ai_sdk/models/createimageeditop.py +504 -0
- orq_ai_sdk/models/createimageop.py +208 -117
- orq_ai_sdk/models/createimagevariationop.py +486 -0
- orq_ai_sdk/models/createknowledgeop.py +186 -121
- orq_ai_sdk/models/creatememorydocumentop.py +50 -1
- orq_ai_sdk/models/creatememoryop.py +34 -21
- orq_ai_sdk/models/creatememorystoreop.py +34 -1
- orq_ai_sdk/models/createmoderationop.py +521 -0
- orq_ai_sdk/models/createpromptop.py +2748 -1252
- orq_ai_sdk/models/creatererankop.py +416 -0
- orq_ai_sdk/models/createresponseop.py +2567 -0
- orq_ai_sdk/models/createspeechop.py +316 -0
- orq_ai_sdk/models/createtoolop.py +537 -12
- orq_ai_sdk/models/createtranscriptionop.py +562 -0
- orq_ai_sdk/models/createtranslationop.py +540 -0
- orq_ai_sdk/models/datapart.py +18 -1
- orq_ai_sdk/models/deletechunksop.py +34 -1
- orq_ai_sdk/models/{deletecontactop.py → deleteidentityop.py} +9 -9
- orq_ai_sdk/models/deletepromptop.py +26 -0
- orq_ai_sdk/models/deploymentcreatemetricop.py +362 -76
- orq_ai_sdk/models/deploymentgetconfigop.py +635 -194
- orq_ai_sdk/models/deploymentinvokeop.py +168 -173
- orq_ai_sdk/models/deploymentsop.py +195 -58
- orq_ai_sdk/models/deploymentstreamop.py +652 -304
- orq_ai_sdk/models/errorpart.py +18 -1
- orq_ai_sdk/models/filecontentpartschema.py +18 -1
- orq_ai_sdk/models/filegetop.py +19 -2
- orq_ai_sdk/models/filelistop.py +35 -2
- orq_ai_sdk/models/filepart.py +50 -1
- orq_ai_sdk/models/fileuploadop.py +51 -2
- orq_ai_sdk/models/generateconversationnameop.py +31 -20
- orq_ai_sdk/models/get_v2_evaluators_id_versionsop.py +34 -1
- orq_ai_sdk/models/get_v2_tools_tool_id_versions_version_id_op.py +18 -1
- orq_ai_sdk/models/get_v2_tools_tool_id_versionsop.py +34 -1
- orq_ai_sdk/models/getallmemoriesop.py +34 -21
- orq_ai_sdk/models/getallmemorydocumentsop.py +42 -1
- orq_ai_sdk/models/getallmemorystoresop.py +34 -1
- orq_ai_sdk/models/getallpromptsop.py +1690 -230
- orq_ai_sdk/models/getalltoolsop.py +325 -8
- orq_ai_sdk/models/getchunkscountop.py +34 -1
- orq_ai_sdk/models/getevalsop.py +395 -43
- orq_ai_sdk/models/getonechunkop.py +14 -19
- orq_ai_sdk/models/getoneknowledgeop.py +116 -96
- orq_ai_sdk/models/getonepromptop.py +1673 -230
- orq_ai_sdk/models/getpromptversionop.py +1670 -216
- orq_ai_sdk/models/imagecontentpartschema.py +50 -1
- orq_ai_sdk/models/internal/globals.py +18 -1
- orq_ai_sdk/models/invokeagentop.py +140 -2
- orq_ai_sdk/models/invokedeploymentrequest.py +418 -80
- orq_ai_sdk/models/invokeevalop.py +160 -131
- orq_ai_sdk/models/listagentsop.py +793 -166
- orq_ai_sdk/models/listchunksop.py +32 -19
- orq_ai_sdk/models/listchunkspaginatedop.py +46 -19
- orq_ai_sdk/models/listconversationsop.py +18 -1
- orq_ai_sdk/models/listdatasetdatapointsop.py +252 -42
- orq_ai_sdk/models/listdatasetsop.py +35 -2
- orq_ai_sdk/models/listdatasourcesop.py +35 -26
- orq_ai_sdk/models/{listcontactsop.py → listidentitiesop.py} +89 -79
- orq_ai_sdk/models/listknowledgebasesop.py +132 -96
- orq_ai_sdk/models/listmodelsop.py +1 -0
- orq_ai_sdk/models/listpromptversionsop.py +1684 -216
- orq_ai_sdk/models/parseop.py +161 -17
- orq_ai_sdk/models/partdoneevent.py +19 -2
- orq_ai_sdk/models/post_v2_router_ocrop.py +408 -0
- orq_ai_sdk/models/publiccontact.py +27 -4
- orq_ai_sdk/models/publicidentity.py +62 -0
- orq_ai_sdk/models/reasoningpart.py +19 -2
- orq_ai_sdk/models/refusalpartschema.py +18 -1
- orq_ai_sdk/models/remoteconfigsgetconfigop.py +34 -1
- orq_ai_sdk/models/responsedoneevent.py +114 -84
- orq_ai_sdk/models/responsestartedevent.py +18 -1
- orq_ai_sdk/models/retrieveagentrequestop.py +787 -166
- orq_ai_sdk/models/retrievedatapointop.py +236 -42
- orq_ai_sdk/models/retrievedatasetop.py +19 -2
- orq_ai_sdk/models/retrievedatasourceop.py +17 -26
- orq_ai_sdk/models/{retrievecontactop.py → retrieveidentityop.py} +38 -41
- orq_ai_sdk/models/retrievememorydocumentop.py +18 -1
- orq_ai_sdk/models/retrievememoryop.py +18 -21
- orq_ai_sdk/models/retrievememorystoreop.py +18 -1
- orq_ai_sdk/models/retrievetoolop.py +309 -8
- orq_ai_sdk/models/runagentop.py +1451 -197
- orq_ai_sdk/models/searchknowledgeop.py +108 -1
- orq_ai_sdk/models/security.py +18 -1
- orq_ai_sdk/models/streamagentop.py +93 -2
- orq_ai_sdk/models/streamrunagentop.py +1428 -195
- orq_ai_sdk/models/textcontentpartschema.py +34 -1
- orq_ai_sdk/models/thinkingconfigenabledschema.py +18 -1
- orq_ai_sdk/models/toolcallpart.py +18 -1
- orq_ai_sdk/models/tooldoneevent.py +18 -1
- orq_ai_sdk/models/toolexecutionfailedstreamingevent.py +50 -1
- orq_ai_sdk/models/toolexecutionfinishedstreamingevent.py +34 -1
- orq_ai_sdk/models/toolexecutionstartedstreamingevent.py +34 -1
- orq_ai_sdk/models/toolresultpart.py +18 -1
- orq_ai_sdk/models/toolreviewrequestedevent.py +18 -1
- orq_ai_sdk/models/toolstartedevent.py +18 -1
- orq_ai_sdk/models/updateagentop.py +1951 -404
- orq_ai_sdk/models/updatechunkop.py +46 -19
- orq_ai_sdk/models/updateconversationop.py +61 -39
- orq_ai_sdk/models/updatedatapointop.py +424 -80
- orq_ai_sdk/models/updatedatasetop.py +51 -2
- orq_ai_sdk/models/updatedatasourceop.py +17 -26
- orq_ai_sdk/models/updateevalop.py +577 -16
- orq_ai_sdk/models/{updatecontactop.py → updateidentityop.py} +78 -68
- orq_ai_sdk/models/updateknowledgeop.py +234 -190
- orq_ai_sdk/models/updatememorydocumentop.py +50 -1
- orq_ai_sdk/models/updatememoryop.py +50 -21
- orq_ai_sdk/models/updatememorystoreop.py +66 -1
- orq_ai_sdk/models/updatepromptop.py +2844 -1450
- orq_ai_sdk/models/updatetoolop.py +592 -9
- orq_ai_sdk/models/usermessagerequest.py +18 -2
- orq_ai_sdk/moderations.py +218 -0
- orq_ai_sdk/orq_completions.py +660 -0
- orq_ai_sdk/orq_responses.py +398 -0
- orq_ai_sdk/prompts.py +28 -36
- orq_ai_sdk/rerank.py +232 -0
- orq_ai_sdk/router.py +89 -641
- orq_ai_sdk/sdk.py +3 -0
- orq_ai_sdk/speech.py +251 -0
- orq_ai_sdk/transcriptions.py +326 -0
- orq_ai_sdk/translations.py +298 -0
- orq_ai_sdk/utils/__init__.py +13 -1
- orq_ai_sdk/variations.py +254 -0
- orq_ai_sdk-4.2.6.dist-info/METADATA +888 -0
- orq_ai_sdk-4.2.6.dist-info/RECORD +263 -0
- {orq_ai_sdk-4.2.0rc28.dist-info → orq_ai_sdk-4.2.6.dist-info}/WHEEL +2 -1
- orq_ai_sdk-4.2.6.dist-info/top_level.txt +1 -0
- orq_ai_sdk-4.2.0rc28.dist-info/METADATA +0 -867
- orq_ai_sdk-4.2.0rc28.dist-info/RECORD +0 -233
|
@@ -138,6 +138,32 @@ class RetrieveAgentRequestTools(BaseModel):
|
|
|
138
138
|
timeout: Optional[float] = 120
|
|
139
139
|
r"""Tool execution timeout in seconds (default: 2 minutes, max: 10 minutes)"""
|
|
140
140
|
|
|
141
|
+
@model_serializer(mode="wrap")
|
|
142
|
+
def serialize_model(self, handler):
|
|
143
|
+
optional_fields = set(
|
|
144
|
+
[
|
|
145
|
+
"key",
|
|
146
|
+
"display_name",
|
|
147
|
+
"description",
|
|
148
|
+
"requires_approval",
|
|
149
|
+
"tool_id",
|
|
150
|
+
"conditions",
|
|
151
|
+
"timeout",
|
|
152
|
+
]
|
|
153
|
+
)
|
|
154
|
+
serialized = handler(self)
|
|
155
|
+
m = {}
|
|
156
|
+
|
|
157
|
+
for n, f in type(self).model_fields.items():
|
|
158
|
+
k = f.alias or n
|
|
159
|
+
val = serialized.get(k)
|
|
160
|
+
|
|
161
|
+
if val != UNSET_SENTINEL:
|
|
162
|
+
if val is not None or k not in optional_fields:
|
|
163
|
+
m[k] = val
|
|
164
|
+
|
|
165
|
+
return m
|
|
166
|
+
|
|
141
167
|
|
|
142
168
|
RetrieveAgentRequestExecuteOn = Literal[
|
|
143
169
|
"input",
|
|
@@ -165,6 +191,22 @@ class RetrieveAgentRequestEvaluators(BaseModel):
|
|
|
165
191
|
sample_rate: Optional[float] = 50
|
|
166
192
|
r"""The percentage of executions to evaluate with this evaluator (1-100). For example, a value of 50 means the evaluator will run on approximately half of the executions."""
|
|
167
193
|
|
|
194
|
+
@model_serializer(mode="wrap")
|
|
195
|
+
def serialize_model(self, handler):
|
|
196
|
+
optional_fields = set(["sample_rate"])
|
|
197
|
+
serialized = handler(self)
|
|
198
|
+
m = {}
|
|
199
|
+
|
|
200
|
+
for n, f in type(self).model_fields.items():
|
|
201
|
+
k = f.alias or n
|
|
202
|
+
val = serialized.get(k)
|
|
203
|
+
|
|
204
|
+
if val != UNSET_SENTINEL:
|
|
205
|
+
if val is not None or k not in optional_fields:
|
|
206
|
+
m[k] = val
|
|
207
|
+
|
|
208
|
+
return m
|
|
209
|
+
|
|
168
210
|
|
|
169
211
|
RetrieveAgentRequestAgentsExecuteOn = Literal[
|
|
170
212
|
"input",
|
|
@@ -192,6 +234,22 @@ class RetrieveAgentRequestGuardrails(BaseModel):
|
|
|
192
234
|
sample_rate: Optional[float] = 50
|
|
193
235
|
r"""The percentage of executions to evaluate with this evaluator (1-100). For example, a value of 50 means the evaluator will run on approximately half of the executions."""
|
|
194
236
|
|
|
237
|
+
@model_serializer(mode="wrap")
|
|
238
|
+
def serialize_model(self, handler):
|
|
239
|
+
optional_fields = set(["sample_rate"])
|
|
240
|
+
serialized = handler(self)
|
|
241
|
+
m = {}
|
|
242
|
+
|
|
243
|
+
for n, f in type(self).model_fields.items():
|
|
244
|
+
k = f.alias or n
|
|
245
|
+
val = serialized.get(k)
|
|
246
|
+
|
|
247
|
+
if val != UNSET_SENTINEL:
|
|
248
|
+
if val is not None or k not in optional_fields:
|
|
249
|
+
m[k] = val
|
|
250
|
+
|
|
251
|
+
return m
|
|
252
|
+
|
|
195
253
|
|
|
196
254
|
class RetrieveAgentRequestSettingsTypedDict(TypedDict):
|
|
197
255
|
max_iterations: NotRequired[int]
|
|
@@ -227,6 +285,31 @@ class RetrieveAgentRequestSettings(BaseModel):
|
|
|
227
285
|
guardrails: Optional[List[RetrieveAgentRequestGuardrails]] = None
|
|
228
286
|
r"""Configuration for a guardrail applied to the agent"""
|
|
229
287
|
|
|
288
|
+
@model_serializer(mode="wrap")
|
|
289
|
+
def serialize_model(self, handler):
|
|
290
|
+
optional_fields = set(
|
|
291
|
+
[
|
|
292
|
+
"max_iterations",
|
|
293
|
+
"max_execution_time",
|
|
294
|
+
"tool_approval_required",
|
|
295
|
+
"tools",
|
|
296
|
+
"evaluators",
|
|
297
|
+
"guardrails",
|
|
298
|
+
]
|
|
299
|
+
)
|
|
300
|
+
serialized = handler(self)
|
|
301
|
+
m = {}
|
|
302
|
+
|
|
303
|
+
for n, f in type(self).model_fields.items():
|
|
304
|
+
k = f.alias or n
|
|
305
|
+
val = serialized.get(k)
|
|
306
|
+
|
|
307
|
+
if val != UNSET_SENTINEL:
|
|
308
|
+
if val is not None or k not in optional_fields:
|
|
309
|
+
m[k] = val
|
|
310
|
+
|
|
311
|
+
return m
|
|
312
|
+
|
|
230
313
|
|
|
231
314
|
RetrieveAgentRequestVoice = Literal[
|
|
232
315
|
"alloy",
|
|
@@ -295,6 +378,22 @@ class RetrieveAgentRequestResponseFormatJSONSchema(BaseModel):
|
|
|
295
378
|
strict: Optional[bool] = False
|
|
296
379
|
r"""Whether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is true."""
|
|
297
380
|
|
|
381
|
+
@model_serializer(mode="wrap")
|
|
382
|
+
def serialize_model(self, handler):
|
|
383
|
+
optional_fields = set(["description", "schema", "strict"])
|
|
384
|
+
serialized = handler(self)
|
|
385
|
+
m = {}
|
|
386
|
+
|
|
387
|
+
for n, f in type(self).model_fields.items():
|
|
388
|
+
k = f.alias or n
|
|
389
|
+
val = serialized.get(k)
|
|
390
|
+
|
|
391
|
+
if val != UNSET_SENTINEL:
|
|
392
|
+
if val is not None or k not in optional_fields:
|
|
393
|
+
m[k] = val
|
|
394
|
+
|
|
395
|
+
return m
|
|
396
|
+
|
|
298
397
|
|
|
299
398
|
class RetrieveAgentRequestResponseFormatAgentsJSONSchemaTypedDict(TypedDict):
|
|
300
399
|
r"""
|
|
@@ -427,6 +526,22 @@ class RetrieveAgentRequestStreamOptions(BaseModel):
|
|
|
427
526
|
include_usage: Optional[bool] = None
|
|
428
527
|
r"""If set, an additional chunk will be streamed before the data: [DONE] message. The usage field on this chunk shows the token usage statistics for the entire request, and the choices field will always be an empty array. All other chunks will also include a usage field, but with a null value."""
|
|
429
528
|
|
|
529
|
+
@model_serializer(mode="wrap")
|
|
530
|
+
def serialize_model(self, handler):
|
|
531
|
+
optional_fields = set(["include_usage"])
|
|
532
|
+
serialized = handler(self)
|
|
533
|
+
m = {}
|
|
534
|
+
|
|
535
|
+
for n, f in type(self).model_fields.items():
|
|
536
|
+
k = f.alias or n
|
|
537
|
+
val = serialized.get(k)
|
|
538
|
+
|
|
539
|
+
if val != UNSET_SENTINEL:
|
|
540
|
+
if val is not None or k not in optional_fields:
|
|
541
|
+
m[k] = val
|
|
542
|
+
|
|
543
|
+
return m
|
|
544
|
+
|
|
430
545
|
|
|
431
546
|
RetrieveAgentRequestThinkingTypedDict = TypeAliasType(
|
|
432
547
|
"RetrieveAgentRequestThinkingTypedDict",
|
|
@@ -469,6 +584,22 @@ class RetrieveAgentRequestToolChoice2(BaseModel):
|
|
|
469
584
|
type: Optional[RetrieveAgentRequestToolChoiceType] = None
|
|
470
585
|
r"""The type of the tool. Currently, only function is supported."""
|
|
471
586
|
|
|
587
|
+
@model_serializer(mode="wrap")
|
|
588
|
+
def serialize_model(self, handler):
|
|
589
|
+
optional_fields = set(["type"])
|
|
590
|
+
serialized = handler(self)
|
|
591
|
+
m = {}
|
|
592
|
+
|
|
593
|
+
for n, f in type(self).model_fields.items():
|
|
594
|
+
k = f.alias or n
|
|
595
|
+
val = serialized.get(k)
|
|
596
|
+
|
|
597
|
+
if val != UNSET_SENTINEL:
|
|
598
|
+
if val is not None or k not in optional_fields:
|
|
599
|
+
m[k] = val
|
|
600
|
+
|
|
601
|
+
return m
|
|
602
|
+
|
|
472
603
|
|
|
473
604
|
RetrieveAgentRequestToolChoice1 = Literal[
|
|
474
605
|
"none",
|
|
@@ -535,6 +666,154 @@ class RetrieveAgentRequestAgentsGuardrails(BaseModel):
|
|
|
535
666
|
r"""Determines whether the guardrail runs on the input (user message) or output (model response)."""
|
|
536
667
|
|
|
537
668
|
|
|
669
|
+
class RetrieveAgentRequestFallbacksTypedDict(TypedDict):
|
|
670
|
+
model: str
|
|
671
|
+
r"""Fallback model identifier"""
|
|
672
|
+
|
|
673
|
+
|
|
674
|
+
class RetrieveAgentRequestFallbacks(BaseModel):
|
|
675
|
+
model: str
|
|
676
|
+
r"""Fallback model identifier"""
|
|
677
|
+
|
|
678
|
+
|
|
679
|
+
class RetrieveAgentRequestAgentsRetryTypedDict(TypedDict):
|
|
680
|
+
r"""Retry configuration for the request"""
|
|
681
|
+
|
|
682
|
+
count: NotRequired[float]
|
|
683
|
+
r"""Number of retry attempts (1-5)"""
|
|
684
|
+
on_codes: NotRequired[List[float]]
|
|
685
|
+
r"""HTTP status codes that trigger retry logic"""
|
|
686
|
+
|
|
687
|
+
|
|
688
|
+
class RetrieveAgentRequestAgentsRetry(BaseModel):
|
|
689
|
+
r"""Retry configuration for the request"""
|
|
690
|
+
|
|
691
|
+
count: Optional[float] = 3
|
|
692
|
+
r"""Number of retry attempts (1-5)"""
|
|
693
|
+
|
|
694
|
+
on_codes: Optional[List[float]] = None
|
|
695
|
+
r"""HTTP status codes that trigger retry logic"""
|
|
696
|
+
|
|
697
|
+
@model_serializer(mode="wrap")
|
|
698
|
+
def serialize_model(self, handler):
|
|
699
|
+
optional_fields = set(["count", "on_codes"])
|
|
700
|
+
serialized = handler(self)
|
|
701
|
+
m = {}
|
|
702
|
+
|
|
703
|
+
for n, f in type(self).model_fields.items():
|
|
704
|
+
k = f.alias or n
|
|
705
|
+
val = serialized.get(k)
|
|
706
|
+
|
|
707
|
+
if val != UNSET_SENTINEL:
|
|
708
|
+
if val is not None or k not in optional_fields:
|
|
709
|
+
m[k] = val
|
|
710
|
+
|
|
711
|
+
return m
|
|
712
|
+
|
|
713
|
+
|
|
714
|
+
RetrieveAgentRequestType = Literal["exact_match",]
|
|
715
|
+
|
|
716
|
+
|
|
717
|
+
class RetrieveAgentRequestCacheTypedDict(TypedDict):
|
|
718
|
+
r"""Cache configuration for the request."""
|
|
719
|
+
|
|
720
|
+
type: RetrieveAgentRequestType
|
|
721
|
+
ttl: NotRequired[float]
|
|
722
|
+
r"""Time to live for cached responses in seconds. Maximum 259200 seconds (3 days)."""
|
|
723
|
+
|
|
724
|
+
|
|
725
|
+
class RetrieveAgentRequestCache(BaseModel):
|
|
726
|
+
r"""Cache configuration for the request."""
|
|
727
|
+
|
|
728
|
+
type: RetrieveAgentRequestType
|
|
729
|
+
|
|
730
|
+
ttl: Optional[float] = 1800
|
|
731
|
+
r"""Time to live for cached responses in seconds. Maximum 259200 seconds (3 days)."""
|
|
732
|
+
|
|
733
|
+
@model_serializer(mode="wrap")
|
|
734
|
+
def serialize_model(self, handler):
|
|
735
|
+
optional_fields = set(["ttl"])
|
|
736
|
+
serialized = handler(self)
|
|
737
|
+
m = {}
|
|
738
|
+
|
|
739
|
+
for n, f in type(self).model_fields.items():
|
|
740
|
+
k = f.alias or n
|
|
741
|
+
val = serialized.get(k)
|
|
742
|
+
|
|
743
|
+
if val != UNSET_SENTINEL:
|
|
744
|
+
if val is not None or k not in optional_fields:
|
|
745
|
+
m[k] = val
|
|
746
|
+
|
|
747
|
+
return m
|
|
748
|
+
|
|
749
|
+
|
|
750
|
+
RetrieveAgentRequestLoadBalancerType = Literal["weight_based",]
|
|
751
|
+
|
|
752
|
+
|
|
753
|
+
class RetrieveAgentRequestLoadBalancerModelsTypedDict(TypedDict):
|
|
754
|
+
model: str
|
|
755
|
+
r"""Model identifier for load balancing"""
|
|
756
|
+
weight: NotRequired[float]
|
|
757
|
+
r"""Weight assigned to this model for load balancing"""
|
|
758
|
+
|
|
759
|
+
|
|
760
|
+
class RetrieveAgentRequestLoadBalancerModels(BaseModel):
|
|
761
|
+
model: str
|
|
762
|
+
r"""Model identifier for load balancing"""
|
|
763
|
+
|
|
764
|
+
weight: Optional[float] = 0.5
|
|
765
|
+
r"""Weight assigned to this model for load balancing"""
|
|
766
|
+
|
|
767
|
+
@model_serializer(mode="wrap")
|
|
768
|
+
def serialize_model(self, handler):
|
|
769
|
+
optional_fields = set(["weight"])
|
|
770
|
+
serialized = handler(self)
|
|
771
|
+
m = {}
|
|
772
|
+
|
|
773
|
+
for n, f in type(self).model_fields.items():
|
|
774
|
+
k = f.alias or n
|
|
775
|
+
val = serialized.get(k)
|
|
776
|
+
|
|
777
|
+
if val != UNSET_SENTINEL:
|
|
778
|
+
if val is not None or k not in optional_fields:
|
|
779
|
+
m[k] = val
|
|
780
|
+
|
|
781
|
+
return m
|
|
782
|
+
|
|
783
|
+
|
|
784
|
+
class RetrieveAgentRequestLoadBalancer1TypedDict(TypedDict):
|
|
785
|
+
type: RetrieveAgentRequestLoadBalancerType
|
|
786
|
+
models: List[RetrieveAgentRequestLoadBalancerModelsTypedDict]
|
|
787
|
+
|
|
788
|
+
|
|
789
|
+
class RetrieveAgentRequestLoadBalancer1(BaseModel):
|
|
790
|
+
type: RetrieveAgentRequestLoadBalancerType
|
|
791
|
+
|
|
792
|
+
models: List[RetrieveAgentRequestLoadBalancerModels]
|
|
793
|
+
|
|
794
|
+
|
|
795
|
+
RetrieveAgentRequestLoadBalancerTypedDict = RetrieveAgentRequestLoadBalancer1TypedDict
|
|
796
|
+
r"""Load balancer configuration for the request."""
|
|
797
|
+
|
|
798
|
+
|
|
799
|
+
RetrieveAgentRequestLoadBalancer = RetrieveAgentRequestLoadBalancer1
|
|
800
|
+
r"""Load balancer configuration for the request."""
|
|
801
|
+
|
|
802
|
+
|
|
803
|
+
class RetrieveAgentRequestTimeoutTypedDict(TypedDict):
|
|
804
|
+
r"""Timeout configuration to apply to the request. If the request exceeds the timeout, it will be retried or fallback to the next model if configured."""
|
|
805
|
+
|
|
806
|
+
call_timeout: float
|
|
807
|
+
r"""Timeout value in milliseconds"""
|
|
808
|
+
|
|
809
|
+
|
|
810
|
+
class RetrieveAgentRequestTimeout(BaseModel):
|
|
811
|
+
r"""Timeout configuration to apply to the request. If the request exceeds the timeout, it will be retried or fallback to the next model if configured."""
|
|
812
|
+
|
|
813
|
+
call_timeout: float
|
|
814
|
+
r"""Timeout value in milliseconds"""
|
|
815
|
+
|
|
816
|
+
|
|
538
817
|
class RetrieveAgentRequestParametersTypedDict(TypedDict):
|
|
539
818
|
r"""Model behavior parameters (snake_case) stored as part of the agent configuration. These become the default parameters used when the agent is executed. Commonly used: temperature (0-1, controls randomness), max_completion_tokens (response length), top_p (nucleus sampling). Advanced: frequency_penalty, presence_penalty, response_format (JSON/structured output), reasoning_effort (for o1/thinking models), seed (reproducibility), stop sequences. Model-specific support varies. Runtime parameters in agent execution requests can override these defaults."""
|
|
540
819
|
|
|
@@ -592,6 +871,16 @@ class RetrieveAgentRequestParametersTypedDict(TypedDict):
|
|
|
592
871
|
r"""Output types that you would like the model to generate. Most models are capable of generating text, which is the default: [\"text\"]. The gpt-4o-audio-preview model can also be used to generate audio. To request that this model generate both text and audio responses, you can use: [\"text\", \"audio\"]."""
|
|
593
872
|
guardrails: NotRequired[List[RetrieveAgentRequestAgentsGuardrailsTypedDict]]
|
|
594
873
|
r"""A list of guardrails to apply to the request."""
|
|
874
|
+
fallbacks: NotRequired[List[RetrieveAgentRequestFallbacksTypedDict]]
|
|
875
|
+
r"""Array of fallback models to use if primary model fails"""
|
|
876
|
+
retry: NotRequired[RetrieveAgentRequestAgentsRetryTypedDict]
|
|
877
|
+
r"""Retry configuration for the request"""
|
|
878
|
+
cache: NotRequired[RetrieveAgentRequestCacheTypedDict]
|
|
879
|
+
r"""Cache configuration for the request."""
|
|
880
|
+
load_balancer: NotRequired[RetrieveAgentRequestLoadBalancerTypedDict]
|
|
881
|
+
r"""Load balancer configuration for the request."""
|
|
882
|
+
timeout: NotRequired[RetrieveAgentRequestTimeoutTypedDict]
|
|
883
|
+
r"""Timeout configuration to apply to the request. If the request exceeds the timeout, it will be retried or fallback to the next model if configured."""
|
|
595
884
|
|
|
596
885
|
|
|
597
886
|
class RetrieveAgentRequestParameters(BaseModel):
|
|
@@ -673,72 +962,91 @@ class RetrieveAgentRequestParameters(BaseModel):
|
|
|
673
962
|
guardrails: Optional[List[RetrieveAgentRequestAgentsGuardrails]] = None
|
|
674
963
|
r"""A list of guardrails to apply to the request."""
|
|
675
964
|
|
|
965
|
+
fallbacks: Optional[List[RetrieveAgentRequestFallbacks]] = None
|
|
966
|
+
r"""Array of fallback models to use if primary model fails"""
|
|
967
|
+
|
|
968
|
+
retry: Optional[RetrieveAgentRequestAgentsRetry] = None
|
|
969
|
+
r"""Retry configuration for the request"""
|
|
970
|
+
|
|
971
|
+
cache: Optional[RetrieveAgentRequestCache] = None
|
|
972
|
+
r"""Cache configuration for the request."""
|
|
973
|
+
|
|
974
|
+
load_balancer: Optional[RetrieveAgentRequestLoadBalancer] = None
|
|
975
|
+
r"""Load balancer configuration for the request."""
|
|
976
|
+
|
|
977
|
+
timeout: Optional[RetrieveAgentRequestTimeout] = None
|
|
978
|
+
r"""Timeout configuration to apply to the request. If the request exceeds the timeout, it will be retried or fallback to the next model if configured."""
|
|
979
|
+
|
|
676
980
|
@model_serializer(mode="wrap")
|
|
677
981
|
def serialize_model(self, handler):
|
|
678
|
-
optional_fields =
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
982
|
+
optional_fields = set(
|
|
983
|
+
[
|
|
984
|
+
"audio",
|
|
985
|
+
"frequency_penalty",
|
|
986
|
+
"max_tokens",
|
|
987
|
+
"max_completion_tokens",
|
|
988
|
+
"logprobs",
|
|
989
|
+
"top_logprobs",
|
|
990
|
+
"n",
|
|
991
|
+
"presence_penalty",
|
|
992
|
+
"response_format",
|
|
993
|
+
"reasoning_effort",
|
|
994
|
+
"verbosity",
|
|
995
|
+
"seed",
|
|
996
|
+
"stop",
|
|
997
|
+
"stream_options",
|
|
998
|
+
"thinking",
|
|
999
|
+
"temperature",
|
|
1000
|
+
"top_p",
|
|
1001
|
+
"top_k",
|
|
1002
|
+
"tool_choice",
|
|
1003
|
+
"parallel_tool_calls",
|
|
1004
|
+
"modalities",
|
|
1005
|
+
"guardrails",
|
|
1006
|
+
"fallbacks",
|
|
1007
|
+
"retry",
|
|
1008
|
+
"cache",
|
|
1009
|
+
"load_balancer",
|
|
1010
|
+
"timeout",
|
|
1011
|
+
]
|
|
1012
|
+
)
|
|
1013
|
+
nullable_fields = set(
|
|
1014
|
+
[
|
|
1015
|
+
"audio",
|
|
1016
|
+
"frequency_penalty",
|
|
1017
|
+
"max_tokens",
|
|
1018
|
+
"max_completion_tokens",
|
|
1019
|
+
"logprobs",
|
|
1020
|
+
"top_logprobs",
|
|
1021
|
+
"n",
|
|
1022
|
+
"presence_penalty",
|
|
1023
|
+
"seed",
|
|
1024
|
+
"stop",
|
|
1025
|
+
"stream_options",
|
|
1026
|
+
"temperature",
|
|
1027
|
+
"top_p",
|
|
1028
|
+
"top_k",
|
|
1029
|
+
"modalities",
|
|
1030
|
+
]
|
|
1031
|
+
)
|
|
721
1032
|
serialized = handler(self)
|
|
722
|
-
|
|
723
1033
|
m = {}
|
|
724
1034
|
|
|
725
1035
|
for n, f in type(self).model_fields.items():
|
|
726
1036
|
k = f.alias or n
|
|
727
1037
|
val = serialized.get(k)
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
):
|
|
741
|
-
m[k] = val
|
|
1038
|
+
is_nullable_and_explicitly_set = (
|
|
1039
|
+
k in nullable_fields
|
|
1040
|
+
and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member
|
|
1041
|
+
)
|
|
1042
|
+
|
|
1043
|
+
if val != UNSET_SENTINEL:
|
|
1044
|
+
if (
|
|
1045
|
+
val is not None
|
|
1046
|
+
or k not in optional_fields
|
|
1047
|
+
or is_nullable_and_explicitly_set
|
|
1048
|
+
):
|
|
1049
|
+
m[k] = val
|
|
742
1050
|
|
|
743
1051
|
return m
|
|
744
1052
|
|
|
@@ -761,6 +1069,22 @@ class RetrieveAgentRequestRetry(BaseModel):
|
|
|
761
1069
|
on_codes: Optional[List[float]] = None
|
|
762
1070
|
r"""HTTP status codes that trigger retry logic"""
|
|
763
1071
|
|
|
1072
|
+
@model_serializer(mode="wrap")
|
|
1073
|
+
def serialize_model(self, handler):
|
|
1074
|
+
optional_fields = set(["count", "on_codes"])
|
|
1075
|
+
serialized = handler(self)
|
|
1076
|
+
m = {}
|
|
1077
|
+
|
|
1078
|
+
for n, f in type(self).model_fields.items():
|
|
1079
|
+
k = f.alias or n
|
|
1080
|
+
val = serialized.get(k)
|
|
1081
|
+
|
|
1082
|
+
if val != UNSET_SENTINEL:
|
|
1083
|
+
if val is not None or k not in optional_fields:
|
|
1084
|
+
m[k] = val
|
|
1085
|
+
|
|
1086
|
+
return m
|
|
1087
|
+
|
|
764
1088
|
|
|
765
1089
|
RetrieveAgentRequestFallbackModelConfigurationVoice = Literal[
|
|
766
1090
|
"alloy",
|
|
@@ -834,6 +1158,22 @@ class RetrieveAgentRequestResponseFormatAgentsResponseJSONSchema(BaseModel):
|
|
|
834
1158
|
strict: Optional[bool] = False
|
|
835
1159
|
r"""Whether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is true."""
|
|
836
1160
|
|
|
1161
|
+
@model_serializer(mode="wrap")
|
|
1162
|
+
def serialize_model(self, handler):
|
|
1163
|
+
optional_fields = set(["description", "schema", "strict"])
|
|
1164
|
+
serialized = handler(self)
|
|
1165
|
+
m = {}
|
|
1166
|
+
|
|
1167
|
+
for n, f in type(self).model_fields.items():
|
|
1168
|
+
k = f.alias or n
|
|
1169
|
+
val = serialized.get(k)
|
|
1170
|
+
|
|
1171
|
+
if val != UNSET_SENTINEL:
|
|
1172
|
+
if val is not None or k not in optional_fields:
|
|
1173
|
+
m[k] = val
|
|
1174
|
+
|
|
1175
|
+
return m
|
|
1176
|
+
|
|
837
1177
|
|
|
838
1178
|
class RetrieveAgentRequestResponseFormatAgentsResponse200JSONSchemaTypedDict(TypedDict):
|
|
839
1179
|
r"""
|
|
@@ -971,6 +1311,22 @@ class RetrieveAgentRequestFallbackModelConfigurationStreamOptions(BaseModel):
|
|
|
971
1311
|
include_usage: Optional[bool] = None
|
|
972
1312
|
r"""If set, an additional chunk will be streamed before the data: [DONE] message. The usage field on this chunk shows the token usage statistics for the entire request, and the choices field will always be an empty array. All other chunks will also include a usage field, but with a null value."""
|
|
973
1313
|
|
|
1314
|
+
@model_serializer(mode="wrap")
|
|
1315
|
+
def serialize_model(self, handler):
|
|
1316
|
+
optional_fields = set(["include_usage"])
|
|
1317
|
+
serialized = handler(self)
|
|
1318
|
+
m = {}
|
|
1319
|
+
|
|
1320
|
+
for n, f in type(self).model_fields.items():
|
|
1321
|
+
k = f.alias or n
|
|
1322
|
+
val = serialized.get(k)
|
|
1323
|
+
|
|
1324
|
+
if val != UNSET_SENTINEL:
|
|
1325
|
+
if val is not None or k not in optional_fields:
|
|
1326
|
+
m[k] = val
|
|
1327
|
+
|
|
1328
|
+
return m
|
|
1329
|
+
|
|
974
1330
|
|
|
975
1331
|
RetrieveAgentRequestFallbackModelConfigurationThinkingTypedDict = TypeAliasType(
|
|
976
1332
|
"RetrieveAgentRequestFallbackModelConfigurationThinkingTypedDict",
|
|
@@ -1013,6 +1369,22 @@ class RetrieveAgentRequestToolChoiceAgents2(BaseModel):
|
|
|
1013
1369
|
type: Optional[RetrieveAgentRequestToolChoiceAgentsType] = None
|
|
1014
1370
|
r"""The type of the tool. Currently, only function is supported."""
|
|
1015
1371
|
|
|
1372
|
+
@model_serializer(mode="wrap")
|
|
1373
|
+
def serialize_model(self, handler):
|
|
1374
|
+
optional_fields = set(["type"])
|
|
1375
|
+
serialized = handler(self)
|
|
1376
|
+
m = {}
|
|
1377
|
+
|
|
1378
|
+
for n, f in type(self).model_fields.items():
|
|
1379
|
+
k = f.alias or n
|
|
1380
|
+
val = serialized.get(k)
|
|
1381
|
+
|
|
1382
|
+
if val != UNSET_SENTINEL:
|
|
1383
|
+
if val is not None or k not in optional_fields:
|
|
1384
|
+
m[k] = val
|
|
1385
|
+
|
|
1386
|
+
return m
|
|
1387
|
+
|
|
1016
1388
|
|
|
1017
1389
|
RetrieveAgentRequestToolChoiceAgents1 = Literal[
|
|
1018
1390
|
"none",
|
|
@@ -1084,6 +1456,158 @@ class RetrieveAgentRequestFallbackModelConfigurationGuardrails(BaseModel):
|
|
|
1084
1456
|
r"""Determines whether the guardrail runs on the input (user message) or output (model response)."""
|
|
1085
1457
|
|
|
1086
1458
|
|
|
1459
|
+
class RetrieveAgentRequestFallbackModelConfigurationFallbacksTypedDict(TypedDict):
|
|
1460
|
+
model: str
|
|
1461
|
+
r"""Fallback model identifier"""
|
|
1462
|
+
|
|
1463
|
+
|
|
1464
|
+
class RetrieveAgentRequestFallbackModelConfigurationFallbacks(BaseModel):
|
|
1465
|
+
model: str
|
|
1466
|
+
r"""Fallback model identifier"""
|
|
1467
|
+
|
|
1468
|
+
|
|
1469
|
+
class RetrieveAgentRequestFallbackModelConfigurationAgentsRetryTypedDict(TypedDict):
|
|
1470
|
+
r"""Retry configuration for the request"""
|
|
1471
|
+
|
|
1472
|
+
count: NotRequired[float]
|
|
1473
|
+
r"""Number of retry attempts (1-5)"""
|
|
1474
|
+
on_codes: NotRequired[List[float]]
|
|
1475
|
+
r"""HTTP status codes that trigger retry logic"""
|
|
1476
|
+
|
|
1477
|
+
|
|
1478
|
+
class RetrieveAgentRequestFallbackModelConfigurationAgentsRetry(BaseModel):
|
|
1479
|
+
r"""Retry configuration for the request"""
|
|
1480
|
+
|
|
1481
|
+
count: Optional[float] = 3
|
|
1482
|
+
r"""Number of retry attempts (1-5)"""
|
|
1483
|
+
|
|
1484
|
+
on_codes: Optional[List[float]] = None
|
|
1485
|
+
r"""HTTP status codes that trigger retry logic"""
|
|
1486
|
+
|
|
1487
|
+
@model_serializer(mode="wrap")
|
|
1488
|
+
def serialize_model(self, handler):
|
|
1489
|
+
optional_fields = set(["count", "on_codes"])
|
|
1490
|
+
serialized = handler(self)
|
|
1491
|
+
m = {}
|
|
1492
|
+
|
|
1493
|
+
for n, f in type(self).model_fields.items():
|
|
1494
|
+
k = f.alias or n
|
|
1495
|
+
val = serialized.get(k)
|
|
1496
|
+
|
|
1497
|
+
if val != UNSET_SENTINEL:
|
|
1498
|
+
if val is not None or k not in optional_fields:
|
|
1499
|
+
m[k] = val
|
|
1500
|
+
|
|
1501
|
+
return m
|
|
1502
|
+
|
|
1503
|
+
|
|
1504
|
+
RetrieveAgentRequestFallbackModelConfigurationType = Literal["exact_match",]
|
|
1505
|
+
|
|
1506
|
+
|
|
1507
|
+
class RetrieveAgentRequestFallbackModelConfigurationCacheTypedDict(TypedDict):
|
|
1508
|
+
r"""Cache configuration for the request."""
|
|
1509
|
+
|
|
1510
|
+
type: RetrieveAgentRequestFallbackModelConfigurationType
|
|
1511
|
+
ttl: NotRequired[float]
|
|
1512
|
+
r"""Time to live for cached responses in seconds. Maximum 259200 seconds (3 days)."""
|
|
1513
|
+
|
|
1514
|
+
|
|
1515
|
+
class RetrieveAgentRequestFallbackModelConfigurationCache(BaseModel):
|
|
1516
|
+
r"""Cache configuration for the request."""
|
|
1517
|
+
|
|
1518
|
+
type: RetrieveAgentRequestFallbackModelConfigurationType
|
|
1519
|
+
|
|
1520
|
+
ttl: Optional[float] = 1800
|
|
1521
|
+
r"""Time to live for cached responses in seconds. Maximum 259200 seconds (3 days)."""
|
|
1522
|
+
|
|
1523
|
+
@model_serializer(mode="wrap")
|
|
1524
|
+
def serialize_model(self, handler):
|
|
1525
|
+
optional_fields = set(["ttl"])
|
|
1526
|
+
serialized = handler(self)
|
|
1527
|
+
m = {}
|
|
1528
|
+
|
|
1529
|
+
for n, f in type(self).model_fields.items():
|
|
1530
|
+
k = f.alias or n
|
|
1531
|
+
val = serialized.get(k)
|
|
1532
|
+
|
|
1533
|
+
if val != UNSET_SENTINEL:
|
|
1534
|
+
if val is not None or k not in optional_fields:
|
|
1535
|
+
m[k] = val
|
|
1536
|
+
|
|
1537
|
+
return m
|
|
1538
|
+
|
|
1539
|
+
|
|
1540
|
+
RetrieveAgentRequestLoadBalancerAgentsType = Literal["weight_based",]
|
|
1541
|
+
|
|
1542
|
+
|
|
1543
|
+
class RetrieveAgentRequestLoadBalancerAgentsModelsTypedDict(TypedDict):
|
|
1544
|
+
model: str
|
|
1545
|
+
r"""Model identifier for load balancing"""
|
|
1546
|
+
weight: NotRequired[float]
|
|
1547
|
+
r"""Weight assigned to this model for load balancing"""
|
|
1548
|
+
|
|
1549
|
+
|
|
1550
|
+
class RetrieveAgentRequestLoadBalancerAgentsModels(BaseModel):
|
|
1551
|
+
model: str
|
|
1552
|
+
r"""Model identifier for load balancing"""
|
|
1553
|
+
|
|
1554
|
+
weight: Optional[float] = 0.5
|
|
1555
|
+
r"""Weight assigned to this model for load balancing"""
|
|
1556
|
+
|
|
1557
|
+
@model_serializer(mode="wrap")
|
|
1558
|
+
def serialize_model(self, handler):
|
|
1559
|
+
optional_fields = set(["weight"])
|
|
1560
|
+
serialized = handler(self)
|
|
1561
|
+
m = {}
|
|
1562
|
+
|
|
1563
|
+
for n, f in type(self).model_fields.items():
|
|
1564
|
+
k = f.alias or n
|
|
1565
|
+
val = serialized.get(k)
|
|
1566
|
+
|
|
1567
|
+
if val != UNSET_SENTINEL:
|
|
1568
|
+
if val is not None or k not in optional_fields:
|
|
1569
|
+
m[k] = val
|
|
1570
|
+
|
|
1571
|
+
return m
|
|
1572
|
+
|
|
1573
|
+
|
|
1574
|
+
class RetrieveAgentRequestLoadBalancerAgents1TypedDict(TypedDict):
|
|
1575
|
+
type: RetrieveAgentRequestLoadBalancerAgentsType
|
|
1576
|
+
models: List[RetrieveAgentRequestLoadBalancerAgentsModelsTypedDict]
|
|
1577
|
+
|
|
1578
|
+
|
|
1579
|
+
class RetrieveAgentRequestLoadBalancerAgents1(BaseModel):
|
|
1580
|
+
type: RetrieveAgentRequestLoadBalancerAgentsType
|
|
1581
|
+
|
|
1582
|
+
models: List[RetrieveAgentRequestLoadBalancerAgentsModels]
|
|
1583
|
+
|
|
1584
|
+
|
|
1585
|
+
RetrieveAgentRequestFallbackModelConfigurationLoadBalancerTypedDict = (
|
|
1586
|
+
RetrieveAgentRequestLoadBalancerAgents1TypedDict
|
|
1587
|
+
)
|
|
1588
|
+
r"""Load balancer configuration for the request."""
|
|
1589
|
+
|
|
1590
|
+
|
|
1591
|
+
RetrieveAgentRequestFallbackModelConfigurationLoadBalancer = (
|
|
1592
|
+
RetrieveAgentRequestLoadBalancerAgents1
|
|
1593
|
+
)
|
|
1594
|
+
r"""Load balancer configuration for the request."""
|
|
1595
|
+
|
|
1596
|
+
|
|
1597
|
+
class RetrieveAgentRequestFallbackModelConfigurationTimeoutTypedDict(TypedDict):
|
|
1598
|
+
r"""Timeout configuration to apply to the request. If the request exceeds the timeout, it will be retried or fallback to the next model if configured."""
|
|
1599
|
+
|
|
1600
|
+
call_timeout: float
|
|
1601
|
+
r"""Timeout value in milliseconds"""
|
|
1602
|
+
|
|
1603
|
+
|
|
1604
|
+
class RetrieveAgentRequestFallbackModelConfigurationTimeout(BaseModel):
|
|
1605
|
+
r"""Timeout configuration to apply to the request. If the request exceeds the timeout, it will be retried or fallback to the next model if configured."""
|
|
1606
|
+
|
|
1607
|
+
call_timeout: float
|
|
1608
|
+
r"""Timeout value in milliseconds"""
|
|
1609
|
+
|
|
1610
|
+
|
|
1087
1611
|
class RetrieveAgentRequestFallbackModelConfigurationParametersTypedDict(TypedDict):
|
|
1088
1612
|
r"""Optional model parameters specific to this fallback model. Overrides primary model parameters if this fallback is used."""
|
|
1089
1613
|
|
|
@@ -1159,6 +1683,22 @@ class RetrieveAgentRequestFallbackModelConfigurationParametersTypedDict(TypedDic
|
|
|
1159
1683
|
List[RetrieveAgentRequestFallbackModelConfigurationGuardrailsTypedDict]
|
|
1160
1684
|
]
|
|
1161
1685
|
r"""A list of guardrails to apply to the request."""
|
|
1686
|
+
fallbacks: NotRequired[
|
|
1687
|
+
List[RetrieveAgentRequestFallbackModelConfigurationFallbacksTypedDict]
|
|
1688
|
+
]
|
|
1689
|
+
r"""Array of fallback models to use if primary model fails"""
|
|
1690
|
+
retry: NotRequired[
|
|
1691
|
+
RetrieveAgentRequestFallbackModelConfigurationAgentsRetryTypedDict
|
|
1692
|
+
]
|
|
1693
|
+
r"""Retry configuration for the request"""
|
|
1694
|
+
cache: NotRequired[RetrieveAgentRequestFallbackModelConfigurationCacheTypedDict]
|
|
1695
|
+
r"""Cache configuration for the request."""
|
|
1696
|
+
load_balancer: NotRequired[
|
|
1697
|
+
RetrieveAgentRequestFallbackModelConfigurationLoadBalancerTypedDict
|
|
1698
|
+
]
|
|
1699
|
+
r"""Load balancer configuration for the request."""
|
|
1700
|
+
timeout: NotRequired[RetrieveAgentRequestFallbackModelConfigurationTimeoutTypedDict]
|
|
1701
|
+
r"""Timeout configuration to apply to the request. If the request exceeds the timeout, it will be retried or fallback to the next model if configured."""
|
|
1162
1702
|
|
|
1163
1703
|
|
|
1164
1704
|
class RetrieveAgentRequestFallbackModelConfigurationParameters(BaseModel):
|
|
@@ -1252,72 +1792,95 @@ class RetrieveAgentRequestFallbackModelConfigurationParameters(BaseModel):
|
|
|
1252
1792
|
] = None
|
|
1253
1793
|
r"""A list of guardrails to apply to the request."""
|
|
1254
1794
|
|
|
1795
|
+
fallbacks: Optional[
|
|
1796
|
+
List[RetrieveAgentRequestFallbackModelConfigurationFallbacks]
|
|
1797
|
+
] = None
|
|
1798
|
+
r"""Array of fallback models to use if primary model fails"""
|
|
1799
|
+
|
|
1800
|
+
retry: Optional[RetrieveAgentRequestFallbackModelConfigurationAgentsRetry] = None
|
|
1801
|
+
r"""Retry configuration for the request"""
|
|
1802
|
+
|
|
1803
|
+
cache: Optional[RetrieveAgentRequestFallbackModelConfigurationCache] = None
|
|
1804
|
+
r"""Cache configuration for the request."""
|
|
1805
|
+
|
|
1806
|
+
load_balancer: Optional[
|
|
1807
|
+
RetrieveAgentRequestFallbackModelConfigurationLoadBalancer
|
|
1808
|
+
] = None
|
|
1809
|
+
r"""Load balancer configuration for the request."""
|
|
1810
|
+
|
|
1811
|
+
timeout: Optional[RetrieveAgentRequestFallbackModelConfigurationTimeout] = None
|
|
1812
|
+
r"""Timeout configuration to apply to the request. If the request exceeds the timeout, it will be retried or fallback to the next model if configured."""
|
|
1813
|
+
|
|
1255
1814
|
@model_serializer(mode="wrap")
|
|
1256
1815
|
def serialize_model(self, handler):
|
|
1257
|
-
optional_fields =
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1816
|
+
optional_fields = set(
|
|
1817
|
+
[
|
|
1818
|
+
"audio",
|
|
1819
|
+
"frequency_penalty",
|
|
1820
|
+
"max_tokens",
|
|
1821
|
+
"max_completion_tokens",
|
|
1822
|
+
"logprobs",
|
|
1823
|
+
"top_logprobs",
|
|
1824
|
+
"n",
|
|
1825
|
+
"presence_penalty",
|
|
1826
|
+
"response_format",
|
|
1827
|
+
"reasoning_effort",
|
|
1828
|
+
"verbosity",
|
|
1829
|
+
"seed",
|
|
1830
|
+
"stop",
|
|
1831
|
+
"stream_options",
|
|
1832
|
+
"thinking",
|
|
1833
|
+
"temperature",
|
|
1834
|
+
"top_p",
|
|
1835
|
+
"top_k",
|
|
1836
|
+
"tool_choice",
|
|
1837
|
+
"parallel_tool_calls",
|
|
1838
|
+
"modalities",
|
|
1839
|
+
"guardrails",
|
|
1840
|
+
"fallbacks",
|
|
1841
|
+
"retry",
|
|
1842
|
+
"cache",
|
|
1843
|
+
"load_balancer",
|
|
1844
|
+
"timeout",
|
|
1845
|
+
]
|
|
1846
|
+
)
|
|
1847
|
+
nullable_fields = set(
|
|
1848
|
+
[
|
|
1849
|
+
"audio",
|
|
1850
|
+
"frequency_penalty",
|
|
1851
|
+
"max_tokens",
|
|
1852
|
+
"max_completion_tokens",
|
|
1853
|
+
"logprobs",
|
|
1854
|
+
"top_logprobs",
|
|
1855
|
+
"n",
|
|
1856
|
+
"presence_penalty",
|
|
1857
|
+
"seed",
|
|
1858
|
+
"stop",
|
|
1859
|
+
"stream_options",
|
|
1860
|
+
"temperature",
|
|
1861
|
+
"top_p",
|
|
1862
|
+
"top_k",
|
|
1863
|
+
"modalities",
|
|
1864
|
+
]
|
|
1865
|
+
)
|
|
1300
1866
|
serialized = handler(self)
|
|
1301
|
-
|
|
1302
1867
|
m = {}
|
|
1303
1868
|
|
|
1304
1869
|
for n, f in type(self).model_fields.items():
|
|
1305
1870
|
k = f.alias or n
|
|
1306
1871
|
val = serialized.get(k)
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
):
|
|
1320
|
-
m[k] = val
|
|
1872
|
+
is_nullable_and_explicitly_set = (
|
|
1873
|
+
k in nullable_fields
|
|
1874
|
+
and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member
|
|
1875
|
+
)
|
|
1876
|
+
|
|
1877
|
+
if val != UNSET_SENTINEL:
|
|
1878
|
+
if (
|
|
1879
|
+
val is not None
|
|
1880
|
+
or k not in optional_fields
|
|
1881
|
+
or is_nullable_and_explicitly_set
|
|
1882
|
+
):
|
|
1883
|
+
m[k] = val
|
|
1321
1884
|
|
|
1322
1885
|
return m
|
|
1323
1886
|
|
|
@@ -1340,6 +1903,22 @@ class RetrieveAgentRequestFallbackModelConfigurationRetry(BaseModel):
|
|
|
1340
1903
|
on_codes: Optional[List[float]] = None
|
|
1341
1904
|
r"""HTTP status codes that trigger retry logic"""
|
|
1342
1905
|
|
|
1906
|
+
@model_serializer(mode="wrap")
|
|
1907
|
+
def serialize_model(self, handler):
|
|
1908
|
+
optional_fields = set(["count", "on_codes"])
|
|
1909
|
+
serialized = handler(self)
|
|
1910
|
+
m = {}
|
|
1911
|
+
|
|
1912
|
+
for n, f in type(self).model_fields.items():
|
|
1913
|
+
k = f.alias or n
|
|
1914
|
+
val = serialized.get(k)
|
|
1915
|
+
|
|
1916
|
+
if val != UNSET_SENTINEL:
|
|
1917
|
+
if val is not None or k not in optional_fields:
|
|
1918
|
+
m[k] = val
|
|
1919
|
+
|
|
1920
|
+
return m
|
|
1921
|
+
|
|
1343
1922
|
|
|
1344
1923
|
class RetrieveAgentRequestFallbackModelConfiguration2TypedDict(TypedDict):
|
|
1345
1924
|
r"""Fallback model configuration with optional parameters and retry settings."""
|
|
@@ -1368,6 +1947,22 @@ class RetrieveAgentRequestFallbackModelConfiguration2(BaseModel):
|
|
|
1368
1947
|
retry: Optional[RetrieveAgentRequestFallbackModelConfigurationRetry] = None
|
|
1369
1948
|
r"""Retry configuration for this fallback model. Allows customizing retry count (1-5) and HTTP status codes that trigger retries."""
|
|
1370
1949
|
|
|
1950
|
+
@model_serializer(mode="wrap")
|
|
1951
|
+
def serialize_model(self, handler):
|
|
1952
|
+
optional_fields = set(["parameters", "retry"])
|
|
1953
|
+
serialized = handler(self)
|
|
1954
|
+
m = {}
|
|
1955
|
+
|
|
1956
|
+
for n, f in type(self).model_fields.items():
|
|
1957
|
+
k = f.alias or n
|
|
1958
|
+
val = serialized.get(k)
|
|
1959
|
+
|
|
1960
|
+
if val != UNSET_SENTINEL:
|
|
1961
|
+
if val is not None or k not in optional_fields:
|
|
1962
|
+
m[k] = val
|
|
1963
|
+
|
|
1964
|
+
return m
|
|
1965
|
+
|
|
1371
1966
|
|
|
1372
1967
|
RetrieveAgentRequestFallbackModelConfigurationTypedDict = TypeAliasType(
|
|
1373
1968
|
"RetrieveAgentRequestFallbackModelConfigurationTypedDict",
|
|
@@ -1418,31 +2013,28 @@ class RetrieveAgentRequestModel(BaseModel):
|
|
|
1418
2013
|
|
|
1419
2014
|
@model_serializer(mode="wrap")
|
|
1420
2015
|
def serialize_model(self, handler):
|
|
1421
|
-
optional_fields =
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
2016
|
+
optional_fields = set(
|
|
2017
|
+
["integration_id", "parameters", "retry", "fallback_models"]
|
|
2018
|
+
)
|
|
2019
|
+
nullable_fields = set(["integration_id", "fallback_models"])
|
|
1425
2020
|
serialized = handler(self)
|
|
1426
|
-
|
|
1427
2021
|
m = {}
|
|
1428
2022
|
|
|
1429
2023
|
for n, f in type(self).model_fields.items():
|
|
1430
2024
|
k = f.alias or n
|
|
1431
2025
|
val = serialized.get(k)
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
):
|
|
1445
|
-
m[k] = val
|
|
2026
|
+
is_nullable_and_explicitly_set = (
|
|
2027
|
+
k in nullable_fields
|
|
2028
|
+
and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member
|
|
2029
|
+
)
|
|
2030
|
+
|
|
2031
|
+
if val != UNSET_SENTINEL:
|
|
2032
|
+
if (
|
|
2033
|
+
val is not None
|
|
2034
|
+
or k not in optional_fields
|
|
2035
|
+
or is_nullable_and_explicitly_set
|
|
2036
|
+
):
|
|
2037
|
+
m[k] = val
|
|
1446
2038
|
|
|
1447
2039
|
return m
|
|
1448
2040
|
|
|
@@ -1461,6 +2053,22 @@ class RetrieveAgentRequestTeamOfAgents(BaseModel):
|
|
|
1461
2053
|
role: Optional[str] = None
|
|
1462
2054
|
r"""The role of the agent in this context. This is used to give extra information to the leader to help it decide which agent to hand off to."""
|
|
1463
2055
|
|
|
2056
|
+
@model_serializer(mode="wrap")
|
|
2057
|
+
def serialize_model(self, handler):
|
|
2058
|
+
optional_fields = set(["role"])
|
|
2059
|
+
serialized = handler(self)
|
|
2060
|
+
m = {}
|
|
2061
|
+
|
|
2062
|
+
for n, f in type(self).model_fields.items():
|
|
2063
|
+
k = f.alias or n
|
|
2064
|
+
val = serialized.get(k)
|
|
2065
|
+
|
|
2066
|
+
if val != UNSET_SENTINEL:
|
|
2067
|
+
if val is not None or k not in optional_fields:
|
|
2068
|
+
m[k] = val
|
|
2069
|
+
|
|
2070
|
+
return m
|
|
2071
|
+
|
|
1464
2072
|
|
|
1465
2073
|
class RetrieveAgentRequestMetricsTypedDict(TypedDict):
|
|
1466
2074
|
total_cost: NotRequired[float]
|
|
@@ -1469,6 +2077,22 @@ class RetrieveAgentRequestMetricsTypedDict(TypedDict):
|
|
|
1469
2077
|
class RetrieveAgentRequestMetrics(BaseModel):
|
|
1470
2078
|
total_cost: Optional[float] = 0
|
|
1471
2079
|
|
|
2080
|
+
@model_serializer(mode="wrap")
|
|
2081
|
+
def serialize_model(self, handler):
|
|
2082
|
+
optional_fields = set(["total_cost"])
|
|
2083
|
+
serialized = handler(self)
|
|
2084
|
+
m = {}
|
|
2085
|
+
|
|
2086
|
+
for n, f in type(self).model_fields.items():
|
|
2087
|
+
k = f.alias or n
|
|
2088
|
+
val = serialized.get(k)
|
|
2089
|
+
|
|
2090
|
+
if val != UNSET_SENTINEL:
|
|
2091
|
+
if val is not None or k not in optional_fields:
|
|
2092
|
+
m[k] = val
|
|
2093
|
+
|
|
2094
|
+
return m
|
|
2095
|
+
|
|
1472
2096
|
|
|
1473
2097
|
class RetrieveAgentRequestKnowledgeBasesTypedDict(TypedDict):
|
|
1474
2098
|
knowledge_id: str
|
|
@@ -1593,42 +2217,39 @@ class RetrieveAgentRequestResponseBody(BaseModel):
|
|
|
1593
2217
|
|
|
1594
2218
|
@model_serializer(mode="wrap")
|
|
1595
2219
|
def serialize_model(self, handler):
|
|
1596
|
-
optional_fields =
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
2220
|
+
optional_fields = set(
|
|
2221
|
+
[
|
|
2222
|
+
"created_by_id",
|
|
2223
|
+
"updated_by_id",
|
|
2224
|
+
"created",
|
|
2225
|
+
"updated",
|
|
2226
|
+
"system_prompt",
|
|
2227
|
+
"settings",
|
|
2228
|
+
"version_hash",
|
|
2229
|
+
"metrics",
|
|
2230
|
+
"variables",
|
|
2231
|
+
"knowledge_bases",
|
|
2232
|
+
"source",
|
|
2233
|
+
]
|
|
2234
|
+
)
|
|
2235
|
+
nullable_fields = set(["created_by_id", "updated_by_id"])
|
|
1612
2236
|
serialized = handler(self)
|
|
1613
|
-
|
|
1614
2237
|
m = {}
|
|
1615
2238
|
|
|
1616
2239
|
for n, f in type(self).model_fields.items():
|
|
1617
2240
|
k = f.alias or n
|
|
1618
2241
|
val = serialized.get(k)
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
):
|
|
1632
|
-
m[k] = val
|
|
2242
|
+
is_nullable_and_explicitly_set = (
|
|
2243
|
+
k in nullable_fields
|
|
2244
|
+
and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member
|
|
2245
|
+
)
|
|
2246
|
+
|
|
2247
|
+
if val != UNSET_SENTINEL:
|
|
2248
|
+
if (
|
|
2249
|
+
val is not None
|
|
2250
|
+
or k not in optional_fields
|
|
2251
|
+
or is_nullable_and_explicitly_set
|
|
2252
|
+
):
|
|
2253
|
+
m[k] = val
|
|
1633
2254
|
|
|
1634
2255
|
return m
|