orq-ai-sdk 4.2.0rc49__py3-none-any.whl → 4.2.12__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/chat.py +22 -0
- orq_ai_sdk/completions.py +438 -0
- orq_ai_sdk/contacts.py +43 -886
- orq_ai_sdk/deployments.py +61 -0
- orq_ai_sdk/edits.py +364 -0
- orq_ai_sdk/embeddings.py +344 -0
- orq_ai_sdk/generations.py +370 -0
- orq_ai_sdk/images.py +28 -0
- orq_ai_sdk/models/__init__.py +3839 -424
- orq_ai_sdk/models/conversationresponse.py +1 -1
- orq_ai_sdk/models/conversationwithmessagesresponse.py +1 -1
- orq_ai_sdk/models/createagentrequestop.py +768 -12
- orq_ai_sdk/models/createagentresponse.py +68 -2
- orq_ai_sdk/models/createchatcompletionop.py +538 -313
- orq_ai_sdk/models/createcompletionop.py +2078 -0
- orq_ai_sdk/models/createcontactop.py +5 -10
- orq_ai_sdk/models/createconversationop.py +1 -1
- orq_ai_sdk/models/createconversationresponseop.py +2 -2
- orq_ai_sdk/models/createdatasetitemop.py +4 -4
- orq_ai_sdk/models/createdatasetop.py +1 -1
- orq_ai_sdk/models/createdatasourceop.py +1 -1
- orq_ai_sdk/models/createembeddingop.py +579 -0
- orq_ai_sdk/models/createevalop.py +14 -14
- orq_ai_sdk/models/createidentityop.py +1 -1
- orq_ai_sdk/models/createimageeditop.py +715 -0
- orq_ai_sdk/models/createimageop.py +228 -82
- orq_ai_sdk/models/createimagevariationop.py +706 -0
- orq_ai_sdk/models/creatememoryop.py +4 -2
- orq_ai_sdk/models/createmoderationop.py +521 -0
- orq_ai_sdk/models/createpromptop.py +375 -6
- orq_ai_sdk/models/creatererankop.py +608 -0
- orq_ai_sdk/models/createresponseop.py +2567 -0
- orq_ai_sdk/models/createspeechop.py +466 -0
- orq_ai_sdk/models/createtoolop.py +6 -6
- orq_ai_sdk/models/createtranscriptionop.py +732 -0
- orq_ai_sdk/models/createtranslationop.py +702 -0
- orq_ai_sdk/models/deploymentgetconfigop.py +17 -7
- orq_ai_sdk/models/deploymentsop.py +1 -0
- orq_ai_sdk/models/deploymentstreamop.py +7 -0
- orq_ai_sdk/models/filegetop.py +1 -1
- orq_ai_sdk/models/filelistop.py +1 -1
- orq_ai_sdk/models/fileuploadop.py +1 -1
- orq_ai_sdk/models/generateconversationnameop.py +1 -1
- orq_ai_sdk/models/getallmemoriesop.py +4 -2
- orq_ai_sdk/models/getallpromptsop.py +188 -3
- orq_ai_sdk/models/getalltoolsop.py +6 -6
- orq_ai_sdk/models/getevalsop.py +17 -17
- orq_ai_sdk/models/getonepromptop.py +188 -3
- orq_ai_sdk/models/getpromptversionop.py +188 -3
- orq_ai_sdk/models/invokedeploymentrequest.py +11 -4
- orq_ai_sdk/models/listagentsop.py +372 -0
- orq_ai_sdk/models/listdatasetdatapointsop.py +4 -4
- orq_ai_sdk/models/listdatasetsop.py +1 -1
- orq_ai_sdk/models/listdatasourcesop.py +1 -1
- orq_ai_sdk/models/listidentitiesop.py +1 -1
- orq_ai_sdk/models/listmodelsop.py +1 -0
- orq_ai_sdk/models/listpromptversionsop.py +188 -3
- orq_ai_sdk/models/partdoneevent.py +1 -1
- orq_ai_sdk/models/post_v2_router_ocrop.py +408 -0
- orq_ai_sdk/models/publiccontact.py +9 -3
- orq_ai_sdk/models/publicidentity.py +62 -0
- orq_ai_sdk/models/reasoningpart.py +1 -1
- orq_ai_sdk/models/responsedoneevent.py +14 -11
- orq_ai_sdk/models/retrieveagentrequestop.py +382 -0
- orq_ai_sdk/models/retrievedatapointop.py +4 -4
- orq_ai_sdk/models/retrievedatasetop.py +1 -1
- orq_ai_sdk/models/retrievedatasourceop.py +1 -1
- orq_ai_sdk/models/retrieveidentityop.py +1 -1
- orq_ai_sdk/models/retrievememoryop.py +4 -2
- orq_ai_sdk/models/retrievetoolop.py +6 -6
- orq_ai_sdk/models/runagentop.py +379 -9
- orq_ai_sdk/models/streamrunagentop.py +385 -9
- orq_ai_sdk/models/updateagentop.py +770 -12
- orq_ai_sdk/models/updateconversationop.py +1 -1
- orq_ai_sdk/models/updatedatapointop.py +4 -4
- orq_ai_sdk/models/updatedatasetop.py +1 -1
- orq_ai_sdk/models/updatedatasourceop.py +1 -1
- orq_ai_sdk/models/updateevalop.py +14 -14
- orq_ai_sdk/models/updateidentityop.py +1 -1
- orq_ai_sdk/models/updatememoryop.py +4 -2
- orq_ai_sdk/models/updatepromptop.py +375 -6
- orq_ai_sdk/models/updatetoolop.py +7 -7
- orq_ai_sdk/moderations.py +218 -0
- orq_ai_sdk/orq_completions.py +666 -0
- orq_ai_sdk/orq_responses.py +398 -0
- orq_ai_sdk/rerank.py +330 -0
- orq_ai_sdk/router.py +89 -641
- orq_ai_sdk/speech.py +333 -0
- orq_ai_sdk/transcriptions.py +416 -0
- orq_ai_sdk/translations.py +384 -0
- orq_ai_sdk/variations.py +364 -0
- orq_ai_sdk-4.2.12.dist-info/METADATA +888 -0
- {orq_ai_sdk-4.2.0rc49.dist-info → orq_ai_sdk-4.2.12.dist-info}/RECORD +98 -75
- {orq_ai_sdk-4.2.0rc49.dist-info → orq_ai_sdk-4.2.12.dist-info}/WHEEL +1 -1
- orq_ai_sdk/models/deletecontactop.py +0 -44
- orq_ai_sdk/models/listcontactsop.py +0 -265
- orq_ai_sdk/models/retrievecontactop.py +0 -142
- orq_ai_sdk/models/updatecontactop.py +0 -233
- orq_ai_sdk-4.2.0rc49.dist-info/METADATA +0 -788
- {orq_ai_sdk-4.2.0rc49.dist-info → orq_ai_sdk-4.2.12.dist-info}/top_level.txt +0 -0
|
@@ -360,9 +360,159 @@ class CreateAgentRequestModelConfigurationGuardrails(BaseModel):
|
|
|
360
360
|
r"""Determines whether the guardrail runs on the input (user message) or output (model response)."""
|
|
361
361
|
|
|
362
362
|
|
|
363
|
+
class FallbacksTypedDict(TypedDict):
|
|
364
|
+
model: str
|
|
365
|
+
r"""Fallback model identifier"""
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
class Fallbacks(BaseModel):
|
|
369
|
+
model: str
|
|
370
|
+
r"""Fallback model identifier"""
|
|
371
|
+
|
|
372
|
+
|
|
373
|
+
class RetryTypedDict(TypedDict):
|
|
374
|
+
r"""Retry configuration for the request"""
|
|
375
|
+
|
|
376
|
+
count: NotRequired[float]
|
|
377
|
+
r"""Number of retry attempts (1-5)"""
|
|
378
|
+
on_codes: NotRequired[List[float]]
|
|
379
|
+
r"""HTTP status codes that trigger retry logic"""
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
class Retry(BaseModel):
|
|
383
|
+
r"""Retry configuration for the request"""
|
|
384
|
+
|
|
385
|
+
count: Optional[float] = 3
|
|
386
|
+
r"""Number of retry attempts (1-5)"""
|
|
387
|
+
|
|
388
|
+
on_codes: Optional[List[float]] = None
|
|
389
|
+
r"""HTTP status codes that trigger retry logic"""
|
|
390
|
+
|
|
391
|
+
@model_serializer(mode="wrap")
|
|
392
|
+
def serialize_model(self, handler):
|
|
393
|
+
optional_fields = set(["count", "on_codes"])
|
|
394
|
+
serialized = handler(self)
|
|
395
|
+
m = {}
|
|
396
|
+
|
|
397
|
+
for n, f in type(self).model_fields.items():
|
|
398
|
+
k = f.alias or n
|
|
399
|
+
val = serialized.get(k)
|
|
400
|
+
|
|
401
|
+
if val != UNSET_SENTINEL:
|
|
402
|
+
if val is not None or k not in optional_fields:
|
|
403
|
+
m[k] = val
|
|
404
|
+
|
|
405
|
+
return m
|
|
406
|
+
|
|
407
|
+
|
|
408
|
+
ModelConfigurationType = Literal["exact_match",]
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
class CacheTypedDict(TypedDict):
|
|
412
|
+
r"""Cache configuration for the request."""
|
|
413
|
+
|
|
414
|
+
type: ModelConfigurationType
|
|
415
|
+
ttl: NotRequired[float]
|
|
416
|
+
r"""Time to live for cached responses in seconds. Maximum 259200 seconds (3 days)."""
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
class Cache(BaseModel):
|
|
420
|
+
r"""Cache configuration for the request."""
|
|
421
|
+
|
|
422
|
+
type: ModelConfigurationType
|
|
423
|
+
|
|
424
|
+
ttl: Optional[float] = 1800
|
|
425
|
+
r"""Time to live for cached responses in seconds. Maximum 259200 seconds (3 days)."""
|
|
426
|
+
|
|
427
|
+
@model_serializer(mode="wrap")
|
|
428
|
+
def serialize_model(self, handler):
|
|
429
|
+
optional_fields = set(["ttl"])
|
|
430
|
+
serialized = handler(self)
|
|
431
|
+
m = {}
|
|
432
|
+
|
|
433
|
+
for n, f in type(self).model_fields.items():
|
|
434
|
+
k = f.alias or n
|
|
435
|
+
val = serialized.get(k)
|
|
436
|
+
|
|
437
|
+
if val != UNSET_SENTINEL:
|
|
438
|
+
if val is not None or k not in optional_fields:
|
|
439
|
+
m[k] = val
|
|
440
|
+
|
|
441
|
+
return m
|
|
442
|
+
|
|
443
|
+
|
|
444
|
+
LoadBalancerType = Literal["weight_based",]
|
|
445
|
+
|
|
446
|
+
|
|
447
|
+
class CreateAgentRequestLoadBalancerModelsTypedDict(TypedDict):
|
|
448
|
+
model: str
|
|
449
|
+
r"""Model identifier for load balancing"""
|
|
450
|
+
weight: NotRequired[float]
|
|
451
|
+
r"""Weight assigned to this model for load balancing"""
|
|
452
|
+
|
|
453
|
+
|
|
454
|
+
class CreateAgentRequestLoadBalancerModels(BaseModel):
|
|
455
|
+
model: str
|
|
456
|
+
r"""Model identifier for load balancing"""
|
|
457
|
+
|
|
458
|
+
weight: Optional[float] = 0.5
|
|
459
|
+
r"""Weight assigned to this model for load balancing"""
|
|
460
|
+
|
|
461
|
+
@model_serializer(mode="wrap")
|
|
462
|
+
def serialize_model(self, handler):
|
|
463
|
+
optional_fields = set(["weight"])
|
|
464
|
+
serialized = handler(self)
|
|
465
|
+
m = {}
|
|
466
|
+
|
|
467
|
+
for n, f in type(self).model_fields.items():
|
|
468
|
+
k = f.alias or n
|
|
469
|
+
val = serialized.get(k)
|
|
470
|
+
|
|
471
|
+
if val != UNSET_SENTINEL:
|
|
472
|
+
if val is not None or k not in optional_fields:
|
|
473
|
+
m[k] = val
|
|
474
|
+
|
|
475
|
+
return m
|
|
476
|
+
|
|
477
|
+
|
|
478
|
+
class LoadBalancer1TypedDict(TypedDict):
|
|
479
|
+
type: LoadBalancerType
|
|
480
|
+
models: List[CreateAgentRequestLoadBalancerModelsTypedDict]
|
|
481
|
+
|
|
482
|
+
|
|
483
|
+
class LoadBalancer1(BaseModel):
|
|
484
|
+
type: LoadBalancerType
|
|
485
|
+
|
|
486
|
+
models: List[CreateAgentRequestLoadBalancerModels]
|
|
487
|
+
|
|
488
|
+
|
|
489
|
+
LoadBalancerTypedDict = LoadBalancer1TypedDict
|
|
490
|
+
r"""Load balancer configuration for the request."""
|
|
491
|
+
|
|
492
|
+
|
|
493
|
+
LoadBalancer = LoadBalancer1
|
|
494
|
+
r"""Load balancer configuration for the request."""
|
|
495
|
+
|
|
496
|
+
|
|
497
|
+
class TimeoutTypedDict(TypedDict):
|
|
498
|
+
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."""
|
|
499
|
+
|
|
500
|
+
call_timeout: float
|
|
501
|
+
r"""Timeout value in milliseconds"""
|
|
502
|
+
|
|
503
|
+
|
|
504
|
+
class Timeout(BaseModel):
|
|
505
|
+
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."""
|
|
506
|
+
|
|
507
|
+
call_timeout: float
|
|
508
|
+
r"""Timeout value in milliseconds"""
|
|
509
|
+
|
|
510
|
+
|
|
363
511
|
class ParametersTypedDict(TypedDict):
|
|
364
512
|
r"""Model behavior parameters that control how the model generates responses. Common parameters: `temperature` (0-1, randomness), `max_completion_tokens` (max output length), `top_p` (sampling diversity). Advanced: `frequency_penalty`, `presence_penalty`, `response_format` (JSON/structured), `reasoning_effort`, `seed` (reproducibility). Support varies by model - consult AI Gateway documentation."""
|
|
365
513
|
|
|
514
|
+
name: NotRequired[str]
|
|
515
|
+
r"""The name to display on the trace. If not specified, the default system name will be used."""
|
|
366
516
|
audio: NotRequired[Nullable[ModelConfigurationAudioTypedDict]]
|
|
367
517
|
r"""Parameters for audio output. Required when audio output is requested with modalities: [\"audio\"]. Learn more."""
|
|
368
518
|
frequency_penalty: NotRequired[Nullable[float]]
|
|
@@ -419,11 +569,24 @@ class ParametersTypedDict(TypedDict):
|
|
|
419
569
|
List[CreateAgentRequestModelConfigurationGuardrailsTypedDict]
|
|
420
570
|
]
|
|
421
571
|
r"""A list of guardrails to apply to the request."""
|
|
572
|
+
fallbacks: NotRequired[List[FallbacksTypedDict]]
|
|
573
|
+
r"""Array of fallback models to use if primary model fails"""
|
|
574
|
+
retry: NotRequired[RetryTypedDict]
|
|
575
|
+
r"""Retry configuration for the request"""
|
|
576
|
+
cache: NotRequired[CacheTypedDict]
|
|
577
|
+
r"""Cache configuration for the request."""
|
|
578
|
+
load_balancer: NotRequired[LoadBalancerTypedDict]
|
|
579
|
+
r"""Load balancer configuration for the request."""
|
|
580
|
+
timeout: NotRequired[TimeoutTypedDict]
|
|
581
|
+
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."""
|
|
422
582
|
|
|
423
583
|
|
|
424
584
|
class Parameters(BaseModel):
|
|
425
585
|
r"""Model behavior parameters that control how the model generates responses. Common parameters: `temperature` (0-1, randomness), `max_completion_tokens` (max output length), `top_p` (sampling diversity). Advanced: `frequency_penalty`, `presence_penalty`, `response_format` (JSON/structured), `reasoning_effort`, `seed` (reproducibility). Support varies by model - consult AI Gateway documentation."""
|
|
426
586
|
|
|
587
|
+
name: Optional[str] = None
|
|
588
|
+
r"""The name to display on the trace. If not specified, the default system name will be used."""
|
|
589
|
+
|
|
427
590
|
audio: OptionalNullable[ModelConfigurationAudio] = UNSET
|
|
428
591
|
r"""Parameters for audio output. Required when audio output is requested with modalities: [\"audio\"]. Learn more."""
|
|
429
592
|
|
|
@@ -500,10 +663,26 @@ class Parameters(BaseModel):
|
|
|
500
663
|
guardrails: Optional[List[CreateAgentRequestModelConfigurationGuardrails]] = None
|
|
501
664
|
r"""A list of guardrails to apply to the request."""
|
|
502
665
|
|
|
666
|
+
fallbacks: Optional[List[Fallbacks]] = None
|
|
667
|
+
r"""Array of fallback models to use if primary model fails"""
|
|
668
|
+
|
|
669
|
+
retry: Optional[Retry] = None
|
|
670
|
+
r"""Retry configuration for the request"""
|
|
671
|
+
|
|
672
|
+
cache: Optional[Cache] = None
|
|
673
|
+
r"""Cache configuration for the request."""
|
|
674
|
+
|
|
675
|
+
load_balancer: Optional[LoadBalancer] = None
|
|
676
|
+
r"""Load balancer configuration for the request."""
|
|
677
|
+
|
|
678
|
+
timeout: Optional[Timeout] = None
|
|
679
|
+
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."""
|
|
680
|
+
|
|
503
681
|
@model_serializer(mode="wrap")
|
|
504
682
|
def serialize_model(self, handler):
|
|
505
683
|
optional_fields = set(
|
|
506
684
|
[
|
|
685
|
+
"name",
|
|
507
686
|
"audio",
|
|
508
687
|
"frequency_penalty",
|
|
509
688
|
"max_tokens",
|
|
@@ -526,6 +705,11 @@ class Parameters(BaseModel):
|
|
|
526
705
|
"parallel_tool_calls",
|
|
527
706
|
"modalities",
|
|
528
707
|
"guardrails",
|
|
708
|
+
"fallbacks",
|
|
709
|
+
"retry",
|
|
710
|
+
"cache",
|
|
711
|
+
"load_balancer",
|
|
712
|
+
"timeout",
|
|
529
713
|
]
|
|
530
714
|
)
|
|
531
715
|
nullable_fields = set(
|
|
@@ -569,7 +753,7 @@ class Parameters(BaseModel):
|
|
|
569
753
|
return m
|
|
570
754
|
|
|
571
755
|
|
|
572
|
-
class
|
|
756
|
+
class ModelConfigurationRetryTypedDict(TypedDict):
|
|
573
757
|
r"""Retry configuration for model requests. Retries are triggered for specific HTTP status codes (e.g., 500, 429, 502, 503, 504). Supports configurable retry count (1-5) and custom status codes."""
|
|
574
758
|
|
|
575
759
|
count: NotRequired[float]
|
|
@@ -578,7 +762,7 @@ class RetryTypedDict(TypedDict):
|
|
|
578
762
|
r"""HTTP status codes that trigger retry logic"""
|
|
579
763
|
|
|
580
764
|
|
|
581
|
-
class
|
|
765
|
+
class ModelConfigurationRetry(BaseModel):
|
|
582
766
|
r"""Retry configuration for model requests. Retries are triggered for specific HTTP status codes (e.g., 500, 429, 502, 503, 504). Supports configurable retry count (1-5) and custom status codes."""
|
|
583
767
|
|
|
584
768
|
count: Optional[float] = 3
|
|
@@ -614,7 +798,7 @@ class ModelConfiguration2TypedDict(TypedDict):
|
|
|
614
798
|
r"""A model ID string (e.g., `openai/gpt-4o` or `anthropic/claude-haiku-4-5-20251001`). Only models that support tool calling can be used with agents."""
|
|
615
799
|
parameters: NotRequired[ParametersTypedDict]
|
|
616
800
|
r"""Model behavior parameters that control how the model generates responses. Common parameters: `temperature` (0-1, randomness), `max_completion_tokens` (max output length), `top_p` (sampling diversity). Advanced: `frequency_penalty`, `presence_penalty`, `response_format` (JSON/structured), `reasoning_effort`, `seed` (reproducibility). Support varies by model - consult AI Gateway documentation."""
|
|
617
|
-
retry: NotRequired[
|
|
801
|
+
retry: NotRequired[ModelConfigurationRetryTypedDict]
|
|
618
802
|
r"""Retry configuration for model requests. Retries are triggered for specific HTTP status codes (e.g., 500, 429, 502, 503, 504). Supports configurable retry count (1-5) and custom status codes."""
|
|
619
803
|
|
|
620
804
|
|
|
@@ -630,7 +814,7 @@ class ModelConfiguration2(BaseModel):
|
|
|
630
814
|
parameters: Optional[Parameters] = None
|
|
631
815
|
r"""Model behavior parameters that control how the model generates responses. Common parameters: `temperature` (0-1, randomness), `max_completion_tokens` (max output length), `top_p` (sampling diversity). Advanced: `frequency_penalty`, `presence_penalty`, `response_format` (JSON/structured), `reasoning_effort`, `seed` (reproducibility). Support varies by model - consult AI Gateway documentation."""
|
|
632
816
|
|
|
633
|
-
retry: Optional[
|
|
817
|
+
retry: Optional[ModelConfigurationRetry] = None
|
|
634
818
|
r"""Retry configuration for model requests. Retries are triggered for specific HTTP status codes (e.g., 500, 429, 502, 503, 504). Supports configurable retry count (1-5) and custom status codes."""
|
|
635
819
|
|
|
636
820
|
@model_serializer(mode="wrap")
|
|
@@ -1017,9 +1201,161 @@ class FallbackModelConfigurationGuardrails(BaseModel):
|
|
|
1017
1201
|
r"""Determines whether the guardrail runs on the input (user message) or output (model response)."""
|
|
1018
1202
|
|
|
1019
1203
|
|
|
1204
|
+
class FallbackModelConfigurationFallbacksTypedDict(TypedDict):
|
|
1205
|
+
model: str
|
|
1206
|
+
r"""Fallback model identifier"""
|
|
1207
|
+
|
|
1208
|
+
|
|
1209
|
+
class FallbackModelConfigurationFallbacks(BaseModel):
|
|
1210
|
+
model: str
|
|
1211
|
+
r"""Fallback model identifier"""
|
|
1212
|
+
|
|
1213
|
+
|
|
1214
|
+
class FallbackModelConfigurationRetryTypedDict(TypedDict):
|
|
1215
|
+
r"""Retry configuration for the request"""
|
|
1216
|
+
|
|
1217
|
+
count: NotRequired[float]
|
|
1218
|
+
r"""Number of retry attempts (1-5)"""
|
|
1219
|
+
on_codes: NotRequired[List[float]]
|
|
1220
|
+
r"""HTTP status codes that trigger retry logic"""
|
|
1221
|
+
|
|
1222
|
+
|
|
1223
|
+
class FallbackModelConfigurationRetry(BaseModel):
|
|
1224
|
+
r"""Retry configuration for the request"""
|
|
1225
|
+
|
|
1226
|
+
count: Optional[float] = 3
|
|
1227
|
+
r"""Number of retry attempts (1-5)"""
|
|
1228
|
+
|
|
1229
|
+
on_codes: Optional[List[float]] = None
|
|
1230
|
+
r"""HTTP status codes that trigger retry logic"""
|
|
1231
|
+
|
|
1232
|
+
@model_serializer(mode="wrap")
|
|
1233
|
+
def serialize_model(self, handler):
|
|
1234
|
+
optional_fields = set(["count", "on_codes"])
|
|
1235
|
+
serialized = handler(self)
|
|
1236
|
+
m = {}
|
|
1237
|
+
|
|
1238
|
+
for n, f in type(self).model_fields.items():
|
|
1239
|
+
k = f.alias or n
|
|
1240
|
+
val = serialized.get(k)
|
|
1241
|
+
|
|
1242
|
+
if val != UNSET_SENTINEL:
|
|
1243
|
+
if val is not None or k not in optional_fields:
|
|
1244
|
+
m[k] = val
|
|
1245
|
+
|
|
1246
|
+
return m
|
|
1247
|
+
|
|
1248
|
+
|
|
1249
|
+
FallbackModelConfigurationType = Literal["exact_match",]
|
|
1250
|
+
|
|
1251
|
+
|
|
1252
|
+
class FallbackModelConfigurationCacheTypedDict(TypedDict):
|
|
1253
|
+
r"""Cache configuration for the request."""
|
|
1254
|
+
|
|
1255
|
+
type: FallbackModelConfigurationType
|
|
1256
|
+
ttl: NotRequired[float]
|
|
1257
|
+
r"""Time to live for cached responses in seconds. Maximum 259200 seconds (3 days)."""
|
|
1258
|
+
|
|
1259
|
+
|
|
1260
|
+
class FallbackModelConfigurationCache(BaseModel):
|
|
1261
|
+
r"""Cache configuration for the request."""
|
|
1262
|
+
|
|
1263
|
+
type: FallbackModelConfigurationType
|
|
1264
|
+
|
|
1265
|
+
ttl: Optional[float] = 1800
|
|
1266
|
+
r"""Time to live for cached responses in seconds. Maximum 259200 seconds (3 days)."""
|
|
1267
|
+
|
|
1268
|
+
@model_serializer(mode="wrap")
|
|
1269
|
+
def serialize_model(self, handler):
|
|
1270
|
+
optional_fields = set(["ttl"])
|
|
1271
|
+
serialized = handler(self)
|
|
1272
|
+
m = {}
|
|
1273
|
+
|
|
1274
|
+
for n, f in type(self).model_fields.items():
|
|
1275
|
+
k = f.alias or n
|
|
1276
|
+
val = serialized.get(k)
|
|
1277
|
+
|
|
1278
|
+
if val != UNSET_SENTINEL:
|
|
1279
|
+
if val is not None or k not in optional_fields:
|
|
1280
|
+
m[k] = val
|
|
1281
|
+
|
|
1282
|
+
return m
|
|
1283
|
+
|
|
1284
|
+
|
|
1285
|
+
CreateAgentRequestLoadBalancerType = Literal["weight_based",]
|
|
1286
|
+
|
|
1287
|
+
|
|
1288
|
+
class LoadBalancerModelsTypedDict(TypedDict):
|
|
1289
|
+
model: str
|
|
1290
|
+
r"""Model identifier for load balancing"""
|
|
1291
|
+
weight: NotRequired[float]
|
|
1292
|
+
r"""Weight assigned to this model for load balancing"""
|
|
1293
|
+
|
|
1294
|
+
|
|
1295
|
+
class LoadBalancerModels(BaseModel):
|
|
1296
|
+
model: str
|
|
1297
|
+
r"""Model identifier for load balancing"""
|
|
1298
|
+
|
|
1299
|
+
weight: Optional[float] = 0.5
|
|
1300
|
+
r"""Weight assigned to this model for load balancing"""
|
|
1301
|
+
|
|
1302
|
+
@model_serializer(mode="wrap")
|
|
1303
|
+
def serialize_model(self, handler):
|
|
1304
|
+
optional_fields = set(["weight"])
|
|
1305
|
+
serialized = handler(self)
|
|
1306
|
+
m = {}
|
|
1307
|
+
|
|
1308
|
+
for n, f in type(self).model_fields.items():
|
|
1309
|
+
k = f.alias or n
|
|
1310
|
+
val = serialized.get(k)
|
|
1311
|
+
|
|
1312
|
+
if val != UNSET_SENTINEL:
|
|
1313
|
+
if val is not None or k not in optional_fields:
|
|
1314
|
+
m[k] = val
|
|
1315
|
+
|
|
1316
|
+
return m
|
|
1317
|
+
|
|
1318
|
+
|
|
1319
|
+
class CreateAgentRequestLoadBalancer1TypedDict(TypedDict):
|
|
1320
|
+
type: CreateAgentRequestLoadBalancerType
|
|
1321
|
+
models: List[LoadBalancerModelsTypedDict]
|
|
1322
|
+
|
|
1323
|
+
|
|
1324
|
+
class CreateAgentRequestLoadBalancer1(BaseModel):
|
|
1325
|
+
type: CreateAgentRequestLoadBalancerType
|
|
1326
|
+
|
|
1327
|
+
models: List[LoadBalancerModels]
|
|
1328
|
+
|
|
1329
|
+
|
|
1330
|
+
FallbackModelConfigurationLoadBalancerTypedDict = (
|
|
1331
|
+
CreateAgentRequestLoadBalancer1TypedDict
|
|
1332
|
+
)
|
|
1333
|
+
r"""Load balancer configuration for the request."""
|
|
1334
|
+
|
|
1335
|
+
|
|
1336
|
+
FallbackModelConfigurationLoadBalancer = CreateAgentRequestLoadBalancer1
|
|
1337
|
+
r"""Load balancer configuration for the request."""
|
|
1338
|
+
|
|
1339
|
+
|
|
1340
|
+
class FallbackModelConfigurationTimeoutTypedDict(TypedDict):
|
|
1341
|
+
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."""
|
|
1342
|
+
|
|
1343
|
+
call_timeout: float
|
|
1344
|
+
r"""Timeout value in milliseconds"""
|
|
1345
|
+
|
|
1346
|
+
|
|
1347
|
+
class FallbackModelConfigurationTimeout(BaseModel):
|
|
1348
|
+
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."""
|
|
1349
|
+
|
|
1350
|
+
call_timeout: float
|
|
1351
|
+
r"""Timeout value in milliseconds"""
|
|
1352
|
+
|
|
1353
|
+
|
|
1020
1354
|
class FallbackModelConfigurationParametersTypedDict(TypedDict):
|
|
1021
1355
|
r"""Optional model parameters specific to this fallback model. Overrides primary model parameters if this fallback is used."""
|
|
1022
1356
|
|
|
1357
|
+
name: NotRequired[str]
|
|
1358
|
+
r"""The name to display on the trace. If not specified, the default system name will be used."""
|
|
1023
1359
|
audio: NotRequired[Nullable[FallbackModelConfigurationAudioTypedDict]]
|
|
1024
1360
|
r"""Parameters for audio output. Required when audio output is requested with modalities: [\"audio\"]. Learn more."""
|
|
1025
1361
|
frequency_penalty: NotRequired[Nullable[float]]
|
|
@@ -1076,11 +1412,24 @@ class FallbackModelConfigurationParametersTypedDict(TypedDict):
|
|
|
1076
1412
|
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\"]."""
|
|
1077
1413
|
guardrails: NotRequired[List[FallbackModelConfigurationGuardrailsTypedDict]]
|
|
1078
1414
|
r"""A list of guardrails to apply to the request."""
|
|
1415
|
+
fallbacks: NotRequired[List[FallbackModelConfigurationFallbacksTypedDict]]
|
|
1416
|
+
r"""Array of fallback models to use if primary model fails"""
|
|
1417
|
+
retry: NotRequired[FallbackModelConfigurationRetryTypedDict]
|
|
1418
|
+
r"""Retry configuration for the request"""
|
|
1419
|
+
cache: NotRequired[FallbackModelConfigurationCacheTypedDict]
|
|
1420
|
+
r"""Cache configuration for the request."""
|
|
1421
|
+
load_balancer: NotRequired[FallbackModelConfigurationLoadBalancerTypedDict]
|
|
1422
|
+
r"""Load balancer configuration for the request."""
|
|
1423
|
+
timeout: NotRequired[FallbackModelConfigurationTimeoutTypedDict]
|
|
1424
|
+
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."""
|
|
1079
1425
|
|
|
1080
1426
|
|
|
1081
1427
|
class FallbackModelConfigurationParameters(BaseModel):
|
|
1082
1428
|
r"""Optional model parameters specific to this fallback model. Overrides primary model parameters if this fallback is used."""
|
|
1083
1429
|
|
|
1430
|
+
name: Optional[str] = None
|
|
1431
|
+
r"""The name to display on the trace. If not specified, the default system name will be used."""
|
|
1432
|
+
|
|
1084
1433
|
audio: OptionalNullable[FallbackModelConfigurationAudio] = UNSET
|
|
1085
1434
|
r"""Parameters for audio output. Required when audio output is requested with modalities: [\"audio\"]. Learn more."""
|
|
1086
1435
|
|
|
@@ -1157,10 +1506,26 @@ class FallbackModelConfigurationParameters(BaseModel):
|
|
|
1157
1506
|
guardrails: Optional[List[FallbackModelConfigurationGuardrails]] = None
|
|
1158
1507
|
r"""A list of guardrails to apply to the request."""
|
|
1159
1508
|
|
|
1509
|
+
fallbacks: Optional[List[FallbackModelConfigurationFallbacks]] = None
|
|
1510
|
+
r"""Array of fallback models to use if primary model fails"""
|
|
1511
|
+
|
|
1512
|
+
retry: Optional[FallbackModelConfigurationRetry] = None
|
|
1513
|
+
r"""Retry configuration for the request"""
|
|
1514
|
+
|
|
1515
|
+
cache: Optional[FallbackModelConfigurationCache] = None
|
|
1516
|
+
r"""Cache configuration for the request."""
|
|
1517
|
+
|
|
1518
|
+
load_balancer: Optional[FallbackModelConfigurationLoadBalancer] = None
|
|
1519
|
+
r"""Load balancer configuration for the request."""
|
|
1520
|
+
|
|
1521
|
+
timeout: Optional[FallbackModelConfigurationTimeout] = None
|
|
1522
|
+
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."""
|
|
1523
|
+
|
|
1160
1524
|
@model_serializer(mode="wrap")
|
|
1161
1525
|
def serialize_model(self, handler):
|
|
1162
1526
|
optional_fields = set(
|
|
1163
1527
|
[
|
|
1528
|
+
"name",
|
|
1164
1529
|
"audio",
|
|
1165
1530
|
"frequency_penalty",
|
|
1166
1531
|
"max_tokens",
|
|
@@ -1183,6 +1548,11 @@ class FallbackModelConfigurationParameters(BaseModel):
|
|
|
1183
1548
|
"parallel_tool_calls",
|
|
1184
1549
|
"modalities",
|
|
1185
1550
|
"guardrails",
|
|
1551
|
+
"fallbacks",
|
|
1552
|
+
"retry",
|
|
1553
|
+
"cache",
|
|
1554
|
+
"load_balancer",
|
|
1555
|
+
"timeout",
|
|
1186
1556
|
]
|
|
1187
1557
|
)
|
|
1188
1558
|
nullable_fields = set(
|
|
@@ -1226,7 +1596,7 @@ class FallbackModelConfigurationParameters(BaseModel):
|
|
|
1226
1596
|
return m
|
|
1227
1597
|
|
|
1228
1598
|
|
|
1229
|
-
class
|
|
1599
|
+
class CreateAgentRequestFallbackModelConfigurationRetryTypedDict(TypedDict):
|
|
1230
1600
|
r"""Retry configuration for this fallback model. Allows customizing retry count (1-5) and HTTP status codes that trigger retries."""
|
|
1231
1601
|
|
|
1232
1602
|
count: NotRequired[float]
|
|
@@ -1235,7 +1605,7 @@ class FallbackModelConfigurationRetryTypedDict(TypedDict):
|
|
|
1235
1605
|
r"""HTTP status codes that trigger retry logic"""
|
|
1236
1606
|
|
|
1237
1607
|
|
|
1238
|
-
class
|
|
1608
|
+
class CreateAgentRequestFallbackModelConfigurationRetry(BaseModel):
|
|
1239
1609
|
r"""Retry configuration for this fallback model. Allows customizing retry count (1-5) and HTTP status codes that trigger retries."""
|
|
1240
1610
|
|
|
1241
1611
|
count: Optional[float] = 3
|
|
@@ -1268,7 +1638,7 @@ class FallbackModelConfiguration2TypedDict(TypedDict):
|
|
|
1268
1638
|
r"""A fallback model ID string. Must support tool calling."""
|
|
1269
1639
|
parameters: NotRequired[FallbackModelConfigurationParametersTypedDict]
|
|
1270
1640
|
r"""Optional model parameters specific to this fallback model. Overrides primary model parameters if this fallback is used."""
|
|
1271
|
-
retry: NotRequired[
|
|
1641
|
+
retry: NotRequired[CreateAgentRequestFallbackModelConfigurationRetryTypedDict]
|
|
1272
1642
|
r"""Retry configuration for this fallback model. Allows customizing retry count (1-5) and HTTP status codes that trigger retries."""
|
|
1273
1643
|
|
|
1274
1644
|
|
|
@@ -1281,7 +1651,7 @@ class FallbackModelConfiguration2(BaseModel):
|
|
|
1281
1651
|
parameters: Optional[FallbackModelConfigurationParameters] = None
|
|
1282
1652
|
r"""Optional model parameters specific to this fallback model. Overrides primary model parameters if this fallback is used."""
|
|
1283
1653
|
|
|
1284
|
-
retry: Optional[
|
|
1654
|
+
retry: Optional[CreateAgentRequestFallbackModelConfigurationRetry] = None
|
|
1285
1655
|
r"""Retry configuration for this fallback model. Allows customizing retry count (1-5) and HTTP status codes that trigger retries."""
|
|
1286
1656
|
|
|
1287
1657
|
@model_serializer(mode="wrap")
|
|
@@ -2987,9 +3357,159 @@ class CreateAgentRequestAgentsResponseGuardrails(BaseModel):
|
|
|
2987
3357
|
r"""Determines whether the guardrail runs on the input (user message) or output (model response)."""
|
|
2988
3358
|
|
|
2989
3359
|
|
|
3360
|
+
class CreateAgentRequestFallbacksTypedDict(TypedDict):
|
|
3361
|
+
model: str
|
|
3362
|
+
r"""Fallback model identifier"""
|
|
3363
|
+
|
|
3364
|
+
|
|
3365
|
+
class CreateAgentRequestFallbacks(BaseModel):
|
|
3366
|
+
model: str
|
|
3367
|
+
r"""Fallback model identifier"""
|
|
3368
|
+
|
|
3369
|
+
|
|
3370
|
+
class CreateAgentRequestAgentsRetryTypedDict(TypedDict):
|
|
3371
|
+
r"""Retry configuration for the request"""
|
|
3372
|
+
|
|
3373
|
+
count: NotRequired[float]
|
|
3374
|
+
r"""Number of retry attempts (1-5)"""
|
|
3375
|
+
on_codes: NotRequired[List[float]]
|
|
3376
|
+
r"""HTTP status codes that trigger retry logic"""
|
|
3377
|
+
|
|
3378
|
+
|
|
3379
|
+
class CreateAgentRequestAgentsRetry(BaseModel):
|
|
3380
|
+
r"""Retry configuration for the request"""
|
|
3381
|
+
|
|
3382
|
+
count: Optional[float] = 3
|
|
3383
|
+
r"""Number of retry attempts (1-5)"""
|
|
3384
|
+
|
|
3385
|
+
on_codes: Optional[List[float]] = None
|
|
3386
|
+
r"""HTTP status codes that trigger retry logic"""
|
|
3387
|
+
|
|
3388
|
+
@model_serializer(mode="wrap")
|
|
3389
|
+
def serialize_model(self, handler):
|
|
3390
|
+
optional_fields = set(["count", "on_codes"])
|
|
3391
|
+
serialized = handler(self)
|
|
3392
|
+
m = {}
|
|
3393
|
+
|
|
3394
|
+
for n, f in type(self).model_fields.items():
|
|
3395
|
+
k = f.alias or n
|
|
3396
|
+
val = serialized.get(k)
|
|
3397
|
+
|
|
3398
|
+
if val != UNSET_SENTINEL:
|
|
3399
|
+
if val is not None or k not in optional_fields:
|
|
3400
|
+
m[k] = val
|
|
3401
|
+
|
|
3402
|
+
return m
|
|
3403
|
+
|
|
3404
|
+
|
|
3405
|
+
CreateAgentRequestType = Literal["exact_match",]
|
|
3406
|
+
|
|
3407
|
+
|
|
3408
|
+
class CreateAgentRequestCacheTypedDict(TypedDict):
|
|
3409
|
+
r"""Cache configuration for the request."""
|
|
3410
|
+
|
|
3411
|
+
type: CreateAgentRequestType
|
|
3412
|
+
ttl: NotRequired[float]
|
|
3413
|
+
r"""Time to live for cached responses in seconds. Maximum 259200 seconds (3 days)."""
|
|
3414
|
+
|
|
3415
|
+
|
|
3416
|
+
class CreateAgentRequestCache(BaseModel):
|
|
3417
|
+
r"""Cache configuration for the request."""
|
|
3418
|
+
|
|
3419
|
+
type: CreateAgentRequestType
|
|
3420
|
+
|
|
3421
|
+
ttl: Optional[float] = 1800
|
|
3422
|
+
r"""Time to live for cached responses in seconds. Maximum 259200 seconds (3 days)."""
|
|
3423
|
+
|
|
3424
|
+
@model_serializer(mode="wrap")
|
|
3425
|
+
def serialize_model(self, handler):
|
|
3426
|
+
optional_fields = set(["ttl"])
|
|
3427
|
+
serialized = handler(self)
|
|
3428
|
+
m = {}
|
|
3429
|
+
|
|
3430
|
+
for n, f in type(self).model_fields.items():
|
|
3431
|
+
k = f.alias or n
|
|
3432
|
+
val = serialized.get(k)
|
|
3433
|
+
|
|
3434
|
+
if val != UNSET_SENTINEL:
|
|
3435
|
+
if val is not None or k not in optional_fields:
|
|
3436
|
+
m[k] = val
|
|
3437
|
+
|
|
3438
|
+
return m
|
|
3439
|
+
|
|
3440
|
+
|
|
3441
|
+
CreateAgentRequestLoadBalancerAgentsType = Literal["weight_based",]
|
|
3442
|
+
|
|
3443
|
+
|
|
3444
|
+
class CreateAgentRequestLoadBalancerAgentsModelsTypedDict(TypedDict):
|
|
3445
|
+
model: str
|
|
3446
|
+
r"""Model identifier for load balancing"""
|
|
3447
|
+
weight: NotRequired[float]
|
|
3448
|
+
r"""Weight assigned to this model for load balancing"""
|
|
3449
|
+
|
|
3450
|
+
|
|
3451
|
+
class CreateAgentRequestLoadBalancerAgentsModels(BaseModel):
|
|
3452
|
+
model: str
|
|
3453
|
+
r"""Model identifier for load balancing"""
|
|
3454
|
+
|
|
3455
|
+
weight: Optional[float] = 0.5
|
|
3456
|
+
r"""Weight assigned to this model for load balancing"""
|
|
3457
|
+
|
|
3458
|
+
@model_serializer(mode="wrap")
|
|
3459
|
+
def serialize_model(self, handler):
|
|
3460
|
+
optional_fields = set(["weight"])
|
|
3461
|
+
serialized = handler(self)
|
|
3462
|
+
m = {}
|
|
3463
|
+
|
|
3464
|
+
for n, f in type(self).model_fields.items():
|
|
3465
|
+
k = f.alias or n
|
|
3466
|
+
val = serialized.get(k)
|
|
3467
|
+
|
|
3468
|
+
if val != UNSET_SENTINEL:
|
|
3469
|
+
if val is not None or k not in optional_fields:
|
|
3470
|
+
m[k] = val
|
|
3471
|
+
|
|
3472
|
+
return m
|
|
3473
|
+
|
|
3474
|
+
|
|
3475
|
+
class CreateAgentRequestLoadBalancerAgents1TypedDict(TypedDict):
|
|
3476
|
+
type: CreateAgentRequestLoadBalancerAgentsType
|
|
3477
|
+
models: List[CreateAgentRequestLoadBalancerAgentsModelsTypedDict]
|
|
3478
|
+
|
|
3479
|
+
|
|
3480
|
+
class CreateAgentRequestLoadBalancerAgents1(BaseModel):
|
|
3481
|
+
type: CreateAgentRequestLoadBalancerAgentsType
|
|
3482
|
+
|
|
3483
|
+
models: List[CreateAgentRequestLoadBalancerAgentsModels]
|
|
3484
|
+
|
|
3485
|
+
|
|
3486
|
+
CreateAgentRequestLoadBalancerTypedDict = CreateAgentRequestLoadBalancerAgents1TypedDict
|
|
3487
|
+
r"""Load balancer configuration for the request."""
|
|
3488
|
+
|
|
3489
|
+
|
|
3490
|
+
CreateAgentRequestLoadBalancer = CreateAgentRequestLoadBalancerAgents1
|
|
3491
|
+
r"""Load balancer configuration for the request."""
|
|
3492
|
+
|
|
3493
|
+
|
|
3494
|
+
class CreateAgentRequestTimeoutTypedDict(TypedDict):
|
|
3495
|
+
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."""
|
|
3496
|
+
|
|
3497
|
+
call_timeout: float
|
|
3498
|
+
r"""Timeout value in milliseconds"""
|
|
3499
|
+
|
|
3500
|
+
|
|
3501
|
+
class CreateAgentRequestTimeout(BaseModel):
|
|
3502
|
+
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."""
|
|
3503
|
+
|
|
3504
|
+
call_timeout: float
|
|
3505
|
+
r"""Timeout value in milliseconds"""
|
|
3506
|
+
|
|
3507
|
+
|
|
2990
3508
|
class CreateAgentRequestParametersTypedDict(TypedDict):
|
|
2991
3509
|
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."""
|
|
2992
3510
|
|
|
3511
|
+
name: NotRequired[str]
|
|
3512
|
+
r"""The name to display on the trace. If not specified, the default system name will be used."""
|
|
2993
3513
|
audio: NotRequired[Nullable[CreateAgentRequestAudioTypedDict]]
|
|
2994
3514
|
r"""Parameters for audio output. Required when audio output is requested with modalities: [\"audio\"]. Learn more."""
|
|
2995
3515
|
frequency_penalty: NotRequired[Nullable[float]]
|
|
@@ -3044,11 +3564,24 @@ class CreateAgentRequestParametersTypedDict(TypedDict):
|
|
|
3044
3564
|
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\"]."""
|
|
3045
3565
|
guardrails: NotRequired[List[CreateAgentRequestAgentsResponseGuardrailsTypedDict]]
|
|
3046
3566
|
r"""A list of guardrails to apply to the request."""
|
|
3567
|
+
fallbacks: NotRequired[List[CreateAgentRequestFallbacksTypedDict]]
|
|
3568
|
+
r"""Array of fallback models to use if primary model fails"""
|
|
3569
|
+
retry: NotRequired[CreateAgentRequestAgentsRetryTypedDict]
|
|
3570
|
+
r"""Retry configuration for the request"""
|
|
3571
|
+
cache: NotRequired[CreateAgentRequestCacheTypedDict]
|
|
3572
|
+
r"""Cache configuration for the request."""
|
|
3573
|
+
load_balancer: NotRequired[CreateAgentRequestLoadBalancerTypedDict]
|
|
3574
|
+
r"""Load balancer configuration for the request."""
|
|
3575
|
+
timeout: NotRequired[CreateAgentRequestTimeoutTypedDict]
|
|
3576
|
+
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."""
|
|
3047
3577
|
|
|
3048
3578
|
|
|
3049
3579
|
class CreateAgentRequestParameters(BaseModel):
|
|
3050
3580
|
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."""
|
|
3051
3581
|
|
|
3582
|
+
name: Optional[str] = None
|
|
3583
|
+
r"""The name to display on the trace. If not specified, the default system name will be used."""
|
|
3584
|
+
|
|
3052
3585
|
audio: OptionalNullable[CreateAgentRequestAudio] = UNSET
|
|
3053
3586
|
r"""Parameters for audio output. Required when audio output is requested with modalities: [\"audio\"]. Learn more."""
|
|
3054
3587
|
|
|
@@ -3125,10 +3658,26 @@ class CreateAgentRequestParameters(BaseModel):
|
|
|
3125
3658
|
guardrails: Optional[List[CreateAgentRequestAgentsResponseGuardrails]] = None
|
|
3126
3659
|
r"""A list of guardrails to apply to the request."""
|
|
3127
3660
|
|
|
3661
|
+
fallbacks: Optional[List[CreateAgentRequestFallbacks]] = None
|
|
3662
|
+
r"""Array of fallback models to use if primary model fails"""
|
|
3663
|
+
|
|
3664
|
+
retry: Optional[CreateAgentRequestAgentsRetry] = None
|
|
3665
|
+
r"""Retry configuration for the request"""
|
|
3666
|
+
|
|
3667
|
+
cache: Optional[CreateAgentRequestCache] = None
|
|
3668
|
+
r"""Cache configuration for the request."""
|
|
3669
|
+
|
|
3670
|
+
load_balancer: Optional[CreateAgentRequestLoadBalancer] = None
|
|
3671
|
+
r"""Load balancer configuration for the request."""
|
|
3672
|
+
|
|
3673
|
+
timeout: Optional[CreateAgentRequestTimeout] = None
|
|
3674
|
+
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."""
|
|
3675
|
+
|
|
3128
3676
|
@model_serializer(mode="wrap")
|
|
3129
3677
|
def serialize_model(self, handler):
|
|
3130
3678
|
optional_fields = set(
|
|
3131
3679
|
[
|
|
3680
|
+
"name",
|
|
3132
3681
|
"audio",
|
|
3133
3682
|
"frequency_penalty",
|
|
3134
3683
|
"max_tokens",
|
|
@@ -3151,6 +3700,11 @@ class CreateAgentRequestParameters(BaseModel):
|
|
|
3151
3700
|
"parallel_tool_calls",
|
|
3152
3701
|
"modalities",
|
|
3153
3702
|
"guardrails",
|
|
3703
|
+
"fallbacks",
|
|
3704
|
+
"retry",
|
|
3705
|
+
"cache",
|
|
3706
|
+
"load_balancer",
|
|
3707
|
+
"timeout",
|
|
3154
3708
|
]
|
|
3155
3709
|
)
|
|
3156
3710
|
nullable_fields = set(
|
|
@@ -3616,9 +4170,165 @@ class CreateAgentRequestFallbackModelConfigurationGuardrails(BaseModel):
|
|
|
3616
4170
|
r"""Determines whether the guardrail runs on the input (user message) or output (model response)."""
|
|
3617
4171
|
|
|
3618
4172
|
|
|
4173
|
+
class CreateAgentRequestFallbackModelConfigurationFallbacksTypedDict(TypedDict):
|
|
4174
|
+
model: str
|
|
4175
|
+
r"""Fallback model identifier"""
|
|
4176
|
+
|
|
4177
|
+
|
|
4178
|
+
class CreateAgentRequestFallbackModelConfigurationFallbacks(BaseModel):
|
|
4179
|
+
model: str
|
|
4180
|
+
r"""Fallback model identifier"""
|
|
4181
|
+
|
|
4182
|
+
|
|
4183
|
+
class CreateAgentRequestFallbackModelConfigurationAgentsResponseRetryTypedDict(
|
|
4184
|
+
TypedDict
|
|
4185
|
+
):
|
|
4186
|
+
r"""Retry configuration for the request"""
|
|
4187
|
+
|
|
4188
|
+
count: NotRequired[float]
|
|
4189
|
+
r"""Number of retry attempts (1-5)"""
|
|
4190
|
+
on_codes: NotRequired[List[float]]
|
|
4191
|
+
r"""HTTP status codes that trigger retry logic"""
|
|
4192
|
+
|
|
4193
|
+
|
|
4194
|
+
class CreateAgentRequestFallbackModelConfigurationAgentsResponseRetry(BaseModel):
|
|
4195
|
+
r"""Retry configuration for the request"""
|
|
4196
|
+
|
|
4197
|
+
count: Optional[float] = 3
|
|
4198
|
+
r"""Number of retry attempts (1-5)"""
|
|
4199
|
+
|
|
4200
|
+
on_codes: Optional[List[float]] = None
|
|
4201
|
+
r"""HTTP status codes that trigger retry logic"""
|
|
4202
|
+
|
|
4203
|
+
@model_serializer(mode="wrap")
|
|
4204
|
+
def serialize_model(self, handler):
|
|
4205
|
+
optional_fields = set(["count", "on_codes"])
|
|
4206
|
+
serialized = handler(self)
|
|
4207
|
+
m = {}
|
|
4208
|
+
|
|
4209
|
+
for n, f in type(self).model_fields.items():
|
|
4210
|
+
k = f.alias or n
|
|
4211
|
+
val = serialized.get(k)
|
|
4212
|
+
|
|
4213
|
+
if val != UNSET_SENTINEL:
|
|
4214
|
+
if val is not None or k not in optional_fields:
|
|
4215
|
+
m[k] = val
|
|
4216
|
+
|
|
4217
|
+
return m
|
|
4218
|
+
|
|
4219
|
+
|
|
4220
|
+
CreateAgentRequestFallbackModelConfigurationType = Literal["exact_match",]
|
|
4221
|
+
|
|
4222
|
+
|
|
4223
|
+
class CreateAgentRequestFallbackModelConfigurationCacheTypedDict(TypedDict):
|
|
4224
|
+
r"""Cache configuration for the request."""
|
|
4225
|
+
|
|
4226
|
+
type: CreateAgentRequestFallbackModelConfigurationType
|
|
4227
|
+
ttl: NotRequired[float]
|
|
4228
|
+
r"""Time to live for cached responses in seconds. Maximum 259200 seconds (3 days)."""
|
|
4229
|
+
|
|
4230
|
+
|
|
4231
|
+
class CreateAgentRequestFallbackModelConfigurationCache(BaseModel):
|
|
4232
|
+
r"""Cache configuration for the request."""
|
|
4233
|
+
|
|
4234
|
+
type: CreateAgentRequestFallbackModelConfigurationType
|
|
4235
|
+
|
|
4236
|
+
ttl: Optional[float] = 1800
|
|
4237
|
+
r"""Time to live for cached responses in seconds. Maximum 259200 seconds (3 days)."""
|
|
4238
|
+
|
|
4239
|
+
@model_serializer(mode="wrap")
|
|
4240
|
+
def serialize_model(self, handler):
|
|
4241
|
+
optional_fields = set(["ttl"])
|
|
4242
|
+
serialized = handler(self)
|
|
4243
|
+
m = {}
|
|
4244
|
+
|
|
4245
|
+
for n, f in type(self).model_fields.items():
|
|
4246
|
+
k = f.alias or n
|
|
4247
|
+
val = serialized.get(k)
|
|
4248
|
+
|
|
4249
|
+
if val != UNSET_SENTINEL:
|
|
4250
|
+
if val is not None or k not in optional_fields:
|
|
4251
|
+
m[k] = val
|
|
4252
|
+
|
|
4253
|
+
return m
|
|
4254
|
+
|
|
4255
|
+
|
|
4256
|
+
CreateAgentRequestLoadBalancerAgentsResponseType = Literal["weight_based",]
|
|
4257
|
+
|
|
4258
|
+
|
|
4259
|
+
class CreateAgentRequestLoadBalancerAgentsResponseModelsTypedDict(TypedDict):
|
|
4260
|
+
model: str
|
|
4261
|
+
r"""Model identifier for load balancing"""
|
|
4262
|
+
weight: NotRequired[float]
|
|
4263
|
+
r"""Weight assigned to this model for load balancing"""
|
|
4264
|
+
|
|
4265
|
+
|
|
4266
|
+
class CreateAgentRequestLoadBalancerAgentsResponseModels(BaseModel):
|
|
4267
|
+
model: str
|
|
4268
|
+
r"""Model identifier for load balancing"""
|
|
4269
|
+
|
|
4270
|
+
weight: Optional[float] = 0.5
|
|
4271
|
+
r"""Weight assigned to this model for load balancing"""
|
|
4272
|
+
|
|
4273
|
+
@model_serializer(mode="wrap")
|
|
4274
|
+
def serialize_model(self, handler):
|
|
4275
|
+
optional_fields = set(["weight"])
|
|
4276
|
+
serialized = handler(self)
|
|
4277
|
+
m = {}
|
|
4278
|
+
|
|
4279
|
+
for n, f in type(self).model_fields.items():
|
|
4280
|
+
k = f.alias or n
|
|
4281
|
+
val = serialized.get(k)
|
|
4282
|
+
|
|
4283
|
+
if val != UNSET_SENTINEL:
|
|
4284
|
+
if val is not None or k not in optional_fields:
|
|
4285
|
+
m[k] = val
|
|
4286
|
+
|
|
4287
|
+
return m
|
|
4288
|
+
|
|
4289
|
+
|
|
4290
|
+
class CreateAgentRequestLoadBalancerAgentsResponse1TypedDict(TypedDict):
|
|
4291
|
+
type: CreateAgentRequestLoadBalancerAgentsResponseType
|
|
4292
|
+
models: List[CreateAgentRequestLoadBalancerAgentsResponseModelsTypedDict]
|
|
4293
|
+
|
|
4294
|
+
|
|
4295
|
+
class CreateAgentRequestLoadBalancerAgentsResponse1(BaseModel):
|
|
4296
|
+
type: CreateAgentRequestLoadBalancerAgentsResponseType
|
|
4297
|
+
|
|
4298
|
+
models: List[CreateAgentRequestLoadBalancerAgentsResponseModels]
|
|
4299
|
+
|
|
4300
|
+
|
|
4301
|
+
CreateAgentRequestFallbackModelConfigurationLoadBalancerTypedDict = (
|
|
4302
|
+
CreateAgentRequestLoadBalancerAgentsResponse1TypedDict
|
|
4303
|
+
)
|
|
4304
|
+
r"""Load balancer configuration for the request."""
|
|
4305
|
+
|
|
4306
|
+
|
|
4307
|
+
CreateAgentRequestFallbackModelConfigurationLoadBalancer = (
|
|
4308
|
+
CreateAgentRequestLoadBalancerAgentsResponse1
|
|
4309
|
+
)
|
|
4310
|
+
r"""Load balancer configuration for the request."""
|
|
4311
|
+
|
|
4312
|
+
|
|
4313
|
+
class CreateAgentRequestFallbackModelConfigurationTimeoutTypedDict(TypedDict):
|
|
4314
|
+
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."""
|
|
4315
|
+
|
|
4316
|
+
call_timeout: float
|
|
4317
|
+
r"""Timeout value in milliseconds"""
|
|
4318
|
+
|
|
4319
|
+
|
|
4320
|
+
class CreateAgentRequestFallbackModelConfigurationTimeout(BaseModel):
|
|
4321
|
+
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."""
|
|
4322
|
+
|
|
4323
|
+
call_timeout: float
|
|
4324
|
+
r"""Timeout value in milliseconds"""
|
|
4325
|
+
|
|
4326
|
+
|
|
3619
4327
|
class CreateAgentRequestFallbackModelConfigurationParametersTypedDict(TypedDict):
|
|
3620
4328
|
r"""Optional model parameters specific to this fallback model. Overrides primary model parameters if this fallback is used."""
|
|
3621
4329
|
|
|
4330
|
+
name: NotRequired[str]
|
|
4331
|
+
r"""The name to display on the trace. If not specified, the default system name will be used."""
|
|
3622
4332
|
audio: NotRequired[
|
|
3623
4333
|
Nullable[CreateAgentRequestFallbackModelConfigurationAudioTypedDict]
|
|
3624
4334
|
]
|
|
@@ -3689,11 +4399,30 @@ class CreateAgentRequestFallbackModelConfigurationParametersTypedDict(TypedDict)
|
|
|
3689
4399
|
List[CreateAgentRequestFallbackModelConfigurationGuardrailsTypedDict]
|
|
3690
4400
|
]
|
|
3691
4401
|
r"""A list of guardrails to apply to the request."""
|
|
4402
|
+
fallbacks: NotRequired[
|
|
4403
|
+
List[CreateAgentRequestFallbackModelConfigurationFallbacksTypedDict]
|
|
4404
|
+
]
|
|
4405
|
+
r"""Array of fallback models to use if primary model fails"""
|
|
4406
|
+
retry: NotRequired[
|
|
4407
|
+
CreateAgentRequestFallbackModelConfigurationAgentsResponseRetryTypedDict
|
|
4408
|
+
]
|
|
4409
|
+
r"""Retry configuration for the request"""
|
|
4410
|
+
cache: NotRequired[CreateAgentRequestFallbackModelConfigurationCacheTypedDict]
|
|
4411
|
+
r"""Cache configuration for the request."""
|
|
4412
|
+
load_balancer: NotRequired[
|
|
4413
|
+
CreateAgentRequestFallbackModelConfigurationLoadBalancerTypedDict
|
|
4414
|
+
]
|
|
4415
|
+
r"""Load balancer configuration for the request."""
|
|
4416
|
+
timeout: NotRequired[CreateAgentRequestFallbackModelConfigurationTimeoutTypedDict]
|
|
4417
|
+
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."""
|
|
3692
4418
|
|
|
3693
4419
|
|
|
3694
4420
|
class CreateAgentRequestFallbackModelConfigurationParameters(BaseModel):
|
|
3695
4421
|
r"""Optional model parameters specific to this fallback model. Overrides primary model parameters if this fallback is used."""
|
|
3696
4422
|
|
|
4423
|
+
name: Optional[str] = None
|
|
4424
|
+
r"""The name to display on the trace. If not specified, the default system name will be used."""
|
|
4425
|
+
|
|
3697
4426
|
audio: OptionalNullable[CreateAgentRequestFallbackModelConfigurationAudio] = UNSET
|
|
3698
4427
|
r"""Parameters for audio output. Required when audio output is requested with modalities: [\"audio\"]. Learn more."""
|
|
3699
4428
|
|
|
@@ -3780,10 +4509,32 @@ class CreateAgentRequestFallbackModelConfigurationParameters(BaseModel):
|
|
|
3780
4509
|
] = None
|
|
3781
4510
|
r"""A list of guardrails to apply to the request."""
|
|
3782
4511
|
|
|
4512
|
+
fallbacks: Optional[List[CreateAgentRequestFallbackModelConfigurationFallbacks]] = (
|
|
4513
|
+
None
|
|
4514
|
+
)
|
|
4515
|
+
r"""Array of fallback models to use if primary model fails"""
|
|
4516
|
+
|
|
4517
|
+
retry: Optional[CreateAgentRequestFallbackModelConfigurationAgentsResponseRetry] = (
|
|
4518
|
+
None
|
|
4519
|
+
)
|
|
4520
|
+
r"""Retry configuration for the request"""
|
|
4521
|
+
|
|
4522
|
+
cache: Optional[CreateAgentRequestFallbackModelConfigurationCache] = None
|
|
4523
|
+
r"""Cache configuration for the request."""
|
|
4524
|
+
|
|
4525
|
+
load_balancer: Optional[
|
|
4526
|
+
CreateAgentRequestFallbackModelConfigurationLoadBalancer
|
|
4527
|
+
] = None
|
|
4528
|
+
r"""Load balancer configuration for the request."""
|
|
4529
|
+
|
|
4530
|
+
timeout: Optional[CreateAgentRequestFallbackModelConfigurationTimeout] = None
|
|
4531
|
+
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."""
|
|
4532
|
+
|
|
3783
4533
|
@model_serializer(mode="wrap")
|
|
3784
4534
|
def serialize_model(self, handler):
|
|
3785
4535
|
optional_fields = set(
|
|
3786
4536
|
[
|
|
4537
|
+
"name",
|
|
3787
4538
|
"audio",
|
|
3788
4539
|
"frequency_penalty",
|
|
3789
4540
|
"max_tokens",
|
|
@@ -3806,6 +4557,11 @@ class CreateAgentRequestFallbackModelConfigurationParameters(BaseModel):
|
|
|
3806
4557
|
"parallel_tool_calls",
|
|
3807
4558
|
"modalities",
|
|
3808
4559
|
"guardrails",
|
|
4560
|
+
"fallbacks",
|
|
4561
|
+
"retry",
|
|
4562
|
+
"cache",
|
|
4563
|
+
"load_balancer",
|
|
4564
|
+
"timeout",
|
|
3809
4565
|
]
|
|
3810
4566
|
)
|
|
3811
4567
|
nullable_fields = set(
|
|
@@ -3849,7 +4605,7 @@ class CreateAgentRequestFallbackModelConfigurationParameters(BaseModel):
|
|
|
3849
4605
|
return m
|
|
3850
4606
|
|
|
3851
4607
|
|
|
3852
|
-
class
|
|
4608
|
+
class CreateAgentRequestFallbackModelConfigurationAgentsRetryTypedDict(TypedDict):
|
|
3853
4609
|
r"""Retry configuration for this fallback model. Allows customizing retry count (1-5) and HTTP status codes that trigger retries."""
|
|
3854
4610
|
|
|
3855
4611
|
count: NotRequired[float]
|
|
@@ -3858,7 +4614,7 @@ class CreateAgentRequestFallbackModelConfigurationRetryTypedDict(TypedDict):
|
|
|
3858
4614
|
r"""HTTP status codes that trigger retry logic"""
|
|
3859
4615
|
|
|
3860
4616
|
|
|
3861
|
-
class
|
|
4617
|
+
class CreateAgentRequestFallbackModelConfigurationAgentsRetry(BaseModel):
|
|
3862
4618
|
r"""Retry configuration for this fallback model. Allows customizing retry count (1-5) and HTTP status codes that trigger retries."""
|
|
3863
4619
|
|
|
3864
4620
|
count: Optional[float] = 3
|
|
@@ -3893,7 +4649,7 @@ class CreateAgentRequestFallbackModelConfiguration2TypedDict(TypedDict):
|
|
|
3893
4649
|
CreateAgentRequestFallbackModelConfigurationParametersTypedDict
|
|
3894
4650
|
]
|
|
3895
4651
|
r"""Optional model parameters specific to this fallback model. Overrides primary model parameters if this fallback is used."""
|
|
3896
|
-
retry: NotRequired[
|
|
4652
|
+
retry: NotRequired[CreateAgentRequestFallbackModelConfigurationAgentsRetryTypedDict]
|
|
3897
4653
|
r"""Retry configuration for this fallback model. Allows customizing retry count (1-5) and HTTP status codes that trigger retries."""
|
|
3898
4654
|
|
|
3899
4655
|
|
|
@@ -3906,7 +4662,7 @@ class CreateAgentRequestFallbackModelConfiguration2(BaseModel):
|
|
|
3906
4662
|
parameters: Optional[CreateAgentRequestFallbackModelConfigurationParameters] = None
|
|
3907
4663
|
r"""Optional model parameters specific to this fallback model. Overrides primary model parameters if this fallback is used."""
|
|
3908
4664
|
|
|
3909
|
-
retry: Optional[
|
|
4665
|
+
retry: Optional[CreateAgentRequestFallbackModelConfigurationAgentsRetry] = None
|
|
3910
4666
|
r"""Retry configuration for this fallback model. Allows customizing retry count (1-5) and HTTP status codes that trigger retries."""
|
|
3911
4667
|
|
|
3912
4668
|
@model_serializer(mode="wrap")
|