orq-ai-sdk 4.2.0rc49__py3-none-any.whl → 4.2.15__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.
Files changed (104) hide show
  1. orq_ai_sdk/_hooks/globalhook.py +0 -1
  2. orq_ai_sdk/_version.py +3 -3
  3. orq_ai_sdk/agents.py +186 -186
  4. orq_ai_sdk/audio.py +30 -0
  5. orq_ai_sdk/chat.py +22 -0
  6. orq_ai_sdk/completions.py +438 -0
  7. orq_ai_sdk/contacts.py +43 -886
  8. orq_ai_sdk/deployments.py +61 -0
  9. orq_ai_sdk/edits.py +364 -0
  10. orq_ai_sdk/embeddings.py +344 -0
  11. orq_ai_sdk/generations.py +370 -0
  12. orq_ai_sdk/images.py +28 -0
  13. orq_ai_sdk/models/__init__.py +3839 -424
  14. orq_ai_sdk/models/conversationresponse.py +1 -1
  15. orq_ai_sdk/models/conversationwithmessagesresponse.py +1 -1
  16. orq_ai_sdk/models/createagentrequestop.py +768 -12
  17. orq_ai_sdk/models/createagentresponse.py +68 -2
  18. orq_ai_sdk/models/createchatcompletionop.py +538 -313
  19. orq_ai_sdk/models/createcompletionop.py +2078 -0
  20. orq_ai_sdk/models/createcontactop.py +5 -10
  21. orq_ai_sdk/models/createconversationop.py +1 -1
  22. orq_ai_sdk/models/createconversationresponseop.py +2 -2
  23. orq_ai_sdk/models/createdatasetitemop.py +4 -4
  24. orq_ai_sdk/models/createdatasetop.py +1 -1
  25. orq_ai_sdk/models/createdatasourceop.py +1 -1
  26. orq_ai_sdk/models/createembeddingop.py +579 -0
  27. orq_ai_sdk/models/createevalop.py +14 -14
  28. orq_ai_sdk/models/createidentityop.py +1 -1
  29. orq_ai_sdk/models/createimageeditop.py +715 -0
  30. orq_ai_sdk/models/createimageop.py +228 -82
  31. orq_ai_sdk/models/createimagevariationop.py +706 -0
  32. orq_ai_sdk/models/creatememoryop.py +4 -2
  33. orq_ai_sdk/models/createmoderationop.py +521 -0
  34. orq_ai_sdk/models/createpromptop.py +375 -6
  35. orq_ai_sdk/models/creatererankop.py +608 -0
  36. orq_ai_sdk/models/createresponseop.py +2567 -0
  37. orq_ai_sdk/models/createspeechop.py +466 -0
  38. orq_ai_sdk/models/createtoolop.py +6 -6
  39. orq_ai_sdk/models/createtranscriptionop.py +732 -0
  40. orq_ai_sdk/models/createtranslationop.py +702 -0
  41. orq_ai_sdk/models/deploymentgetconfigop.py +17 -7
  42. orq_ai_sdk/models/deploymentsop.py +1 -0
  43. orq_ai_sdk/models/deploymentstreamop.py +7 -0
  44. orq_ai_sdk/models/filegetop.py +1 -1
  45. orq_ai_sdk/models/filelistop.py +1 -1
  46. orq_ai_sdk/models/fileuploadop.py +1 -1
  47. orq_ai_sdk/models/generateconversationnameop.py +1 -1
  48. orq_ai_sdk/models/getallmemoriesop.py +4 -2
  49. orq_ai_sdk/models/getallpromptsop.py +188 -3
  50. orq_ai_sdk/models/getalltoolsop.py +6 -6
  51. orq_ai_sdk/models/getevalsop.py +17 -17
  52. orq_ai_sdk/models/getonepromptop.py +188 -3
  53. orq_ai_sdk/models/getpromptversionop.py +188 -3
  54. orq_ai_sdk/models/invokedeploymentrequest.py +11 -4
  55. orq_ai_sdk/models/listagentsop.py +372 -0
  56. orq_ai_sdk/models/listdatasetdatapointsop.py +4 -4
  57. orq_ai_sdk/models/listdatasetsop.py +1 -1
  58. orq_ai_sdk/models/listdatasourcesop.py +1 -1
  59. orq_ai_sdk/models/listidentitiesop.py +1 -1
  60. orq_ai_sdk/models/listmodelsop.py +1 -0
  61. orq_ai_sdk/models/listpromptversionsop.py +188 -3
  62. orq_ai_sdk/models/partdoneevent.py +1 -1
  63. orq_ai_sdk/models/post_v2_router_ocrop.py +408 -0
  64. orq_ai_sdk/models/publiccontact.py +9 -3
  65. orq_ai_sdk/models/publicidentity.py +62 -0
  66. orq_ai_sdk/models/reasoningpart.py +1 -1
  67. orq_ai_sdk/models/responsedoneevent.py +14 -11
  68. orq_ai_sdk/models/retrieveagentrequestop.py +382 -0
  69. orq_ai_sdk/models/retrievedatapointop.py +4 -4
  70. orq_ai_sdk/models/retrievedatasetop.py +1 -1
  71. orq_ai_sdk/models/retrievedatasourceop.py +1 -1
  72. orq_ai_sdk/models/retrieveidentityop.py +1 -1
  73. orq_ai_sdk/models/retrievememoryop.py +4 -2
  74. orq_ai_sdk/models/retrievetoolop.py +6 -6
  75. orq_ai_sdk/models/runagentop.py +379 -9
  76. orq_ai_sdk/models/streamrunagentop.py +385 -9
  77. orq_ai_sdk/models/updateagentop.py +770 -12
  78. orq_ai_sdk/models/updateconversationop.py +1 -1
  79. orq_ai_sdk/models/updatedatapointop.py +4 -4
  80. orq_ai_sdk/models/updatedatasetop.py +1 -1
  81. orq_ai_sdk/models/updatedatasourceop.py +1 -1
  82. orq_ai_sdk/models/updateevalop.py +14 -14
  83. orq_ai_sdk/models/updateidentityop.py +1 -1
  84. orq_ai_sdk/models/updatememoryop.py +4 -2
  85. orq_ai_sdk/models/updatepromptop.py +375 -6
  86. orq_ai_sdk/models/updatetoolop.py +7 -7
  87. orq_ai_sdk/moderations.py +218 -0
  88. orq_ai_sdk/orq_completions.py +666 -0
  89. orq_ai_sdk/orq_responses.py +398 -0
  90. orq_ai_sdk/rerank.py +330 -0
  91. orq_ai_sdk/router.py +89 -641
  92. orq_ai_sdk/speech.py +333 -0
  93. orq_ai_sdk/transcriptions.py +416 -0
  94. orq_ai_sdk/translations.py +384 -0
  95. orq_ai_sdk/variations.py +364 -0
  96. orq_ai_sdk-4.2.15.dist-info/METADATA +888 -0
  97. {orq_ai_sdk-4.2.0rc49.dist-info → orq_ai_sdk-4.2.15.dist-info}/RECORD +99 -76
  98. {orq_ai_sdk-4.2.0rc49.dist-info → orq_ai_sdk-4.2.15.dist-info}/WHEEL +1 -1
  99. orq_ai_sdk/models/deletecontactop.py +0 -44
  100. orq_ai_sdk/models/listcontactsop.py +0 -265
  101. orq_ai_sdk/models/retrievecontactop.py +0 -142
  102. orq_ai_sdk/models/updatecontactop.py +0 -233
  103. orq_ai_sdk-4.2.0rc49.dist-info/METADATA +0 -788
  104. {orq_ai_sdk-4.2.0rc49.dist-info → orq_ai_sdk-4.2.15.dist-info}/top_level.txt +0 -0
@@ -382,9 +382,159 @@ class ModelConfigurationGuardrails(BaseModel):
382
382
  r"""Determines whether the guardrail runs on the input (user message) or output (model response)."""
383
383
 
384
384
 
385
+ class ModelConfigurationFallbacksTypedDict(TypedDict):
386
+ model: str
387
+ r"""Fallback model identifier"""
388
+
389
+
390
+ class ModelConfigurationFallbacks(BaseModel):
391
+ model: str
392
+ r"""Fallback model identifier"""
393
+
394
+
395
+ class UpdateAgentModelConfigurationRetryTypedDict(TypedDict):
396
+ r"""Retry configuration for the request"""
397
+
398
+ count: NotRequired[float]
399
+ r"""Number of retry attempts (1-5)"""
400
+ on_codes: NotRequired[List[float]]
401
+ r"""HTTP status codes that trigger retry logic"""
402
+
403
+
404
+ class UpdateAgentModelConfigurationRetry(BaseModel):
405
+ r"""Retry configuration for the request"""
406
+
407
+ count: Optional[float] = 3
408
+ r"""Number of retry attempts (1-5)"""
409
+
410
+ on_codes: Optional[List[float]] = None
411
+ r"""HTTP status codes that trigger retry logic"""
412
+
413
+ @model_serializer(mode="wrap")
414
+ def serialize_model(self, handler):
415
+ optional_fields = set(["count", "on_codes"])
416
+ serialized = handler(self)
417
+ m = {}
418
+
419
+ for n, f in type(self).model_fields.items():
420
+ k = f.alias or n
421
+ val = serialized.get(k)
422
+
423
+ if val != UNSET_SENTINEL:
424
+ if val is not None or k not in optional_fields:
425
+ m[k] = val
426
+
427
+ return m
428
+
429
+
430
+ UpdateAgentModelConfigurationType = Literal["exact_match",]
431
+
432
+
433
+ class ModelConfigurationCacheTypedDict(TypedDict):
434
+ r"""Cache configuration for the request."""
435
+
436
+ type: UpdateAgentModelConfigurationType
437
+ ttl: NotRequired[float]
438
+ r"""Time to live for cached responses in seconds. Maximum 259200 seconds (3 days)."""
439
+
440
+
441
+ class ModelConfigurationCache(BaseModel):
442
+ r"""Cache configuration for the request."""
443
+
444
+ type: UpdateAgentModelConfigurationType
445
+
446
+ ttl: Optional[float] = 1800
447
+ r"""Time to live for cached responses in seconds. Maximum 259200 seconds (3 days)."""
448
+
449
+ @model_serializer(mode="wrap")
450
+ def serialize_model(self, handler):
451
+ optional_fields = set(["ttl"])
452
+ serialized = handler(self)
453
+ m = {}
454
+
455
+ for n, f in type(self).model_fields.items():
456
+ k = f.alias or n
457
+ val = serialized.get(k)
458
+
459
+ if val != UNSET_SENTINEL:
460
+ if val is not None or k not in optional_fields:
461
+ m[k] = val
462
+
463
+ return m
464
+
465
+
466
+ UpdateAgentLoadBalancerType = Literal["weight_based",]
467
+
468
+
469
+ class UpdateAgentLoadBalancerModelsTypedDict(TypedDict):
470
+ model: str
471
+ r"""Model identifier for load balancing"""
472
+ weight: NotRequired[float]
473
+ r"""Weight assigned to this model for load balancing"""
474
+
475
+
476
+ class UpdateAgentLoadBalancerModels(BaseModel):
477
+ model: str
478
+ r"""Model identifier for load balancing"""
479
+
480
+ weight: Optional[float] = 0.5
481
+ r"""Weight assigned to this model for load balancing"""
482
+
483
+ @model_serializer(mode="wrap")
484
+ def serialize_model(self, handler):
485
+ optional_fields = set(["weight"])
486
+ serialized = handler(self)
487
+ m = {}
488
+
489
+ for n, f in type(self).model_fields.items():
490
+ k = f.alias or n
491
+ val = serialized.get(k)
492
+
493
+ if val != UNSET_SENTINEL:
494
+ if val is not None or k not in optional_fields:
495
+ m[k] = val
496
+
497
+ return m
498
+
499
+
500
+ class UpdateAgentLoadBalancer1TypedDict(TypedDict):
501
+ type: UpdateAgentLoadBalancerType
502
+ models: List[UpdateAgentLoadBalancerModelsTypedDict]
503
+
504
+
505
+ class UpdateAgentLoadBalancer1(BaseModel):
506
+ type: UpdateAgentLoadBalancerType
507
+
508
+ models: List[UpdateAgentLoadBalancerModels]
509
+
510
+
511
+ ModelConfigurationLoadBalancerTypedDict = UpdateAgentLoadBalancer1TypedDict
512
+ r"""Load balancer configuration for the request."""
513
+
514
+
515
+ ModelConfigurationLoadBalancer = UpdateAgentLoadBalancer1
516
+ r"""Load balancer configuration for the request."""
517
+
518
+
519
+ class ModelConfigurationTimeoutTypedDict(TypedDict):
520
+ 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."""
521
+
522
+ call_timeout: float
523
+ r"""Timeout value in milliseconds"""
524
+
525
+
526
+ class ModelConfigurationTimeout(BaseModel):
527
+ 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."""
528
+
529
+ call_timeout: float
530
+ r"""Timeout value in milliseconds"""
531
+
532
+
385
533
  class ModelConfigurationParametersTypedDict(TypedDict):
386
534
  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."""
387
535
 
536
+ name: NotRequired[str]
537
+ r"""The name to display on the trace. If not specified, the default system name will be used."""
388
538
  audio: NotRequired[Nullable[UpdateAgentModelConfigurationAudioTypedDict]]
389
539
  r"""Parameters for audio output. Required when audio output is requested with modalities: [\"audio\"]. Learn more."""
390
540
  frequency_penalty: NotRequired[Nullable[float]]
@@ -439,11 +589,24 @@ class ModelConfigurationParametersTypedDict(TypedDict):
439
589
  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\"]."""
440
590
  guardrails: NotRequired[List[ModelConfigurationGuardrailsTypedDict]]
441
591
  r"""A list of guardrails to apply to the request."""
592
+ fallbacks: NotRequired[List[ModelConfigurationFallbacksTypedDict]]
593
+ r"""Array of fallback models to use if primary model fails"""
594
+ retry: NotRequired[UpdateAgentModelConfigurationRetryTypedDict]
595
+ r"""Retry configuration for the request"""
596
+ cache: NotRequired[ModelConfigurationCacheTypedDict]
597
+ r"""Cache configuration for the request."""
598
+ load_balancer: NotRequired[ModelConfigurationLoadBalancerTypedDict]
599
+ r"""Load balancer configuration for the request."""
600
+ timeout: NotRequired[ModelConfigurationTimeoutTypedDict]
601
+ 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."""
442
602
 
443
603
 
444
604
  class ModelConfigurationParameters(BaseModel):
445
605
  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."""
446
606
 
607
+ name: Optional[str] = None
608
+ r"""The name to display on the trace. If not specified, the default system name will be used."""
609
+
447
610
  audio: OptionalNullable[UpdateAgentModelConfigurationAudio] = UNSET
448
611
  r"""Parameters for audio output. Required when audio output is requested with modalities: [\"audio\"]. Learn more."""
449
612
 
@@ -520,10 +683,26 @@ class ModelConfigurationParameters(BaseModel):
520
683
  guardrails: Optional[List[ModelConfigurationGuardrails]] = None
521
684
  r"""A list of guardrails to apply to the request."""
522
685
 
686
+ fallbacks: Optional[List[ModelConfigurationFallbacks]] = None
687
+ r"""Array of fallback models to use if primary model fails"""
688
+
689
+ retry: Optional[UpdateAgentModelConfigurationRetry] = None
690
+ r"""Retry configuration for the request"""
691
+
692
+ cache: Optional[ModelConfigurationCache] = None
693
+ r"""Cache configuration for the request."""
694
+
695
+ load_balancer: Optional[ModelConfigurationLoadBalancer] = None
696
+ r"""Load balancer configuration for the request."""
697
+
698
+ timeout: Optional[ModelConfigurationTimeout] = None
699
+ 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."""
700
+
523
701
  @model_serializer(mode="wrap")
524
702
  def serialize_model(self, handler):
525
703
  optional_fields = set(
526
704
  [
705
+ "name",
527
706
  "audio",
528
707
  "frequency_penalty",
529
708
  "max_tokens",
@@ -546,6 +725,11 @@ class ModelConfigurationParameters(BaseModel):
546
725
  "parallel_tool_calls",
547
726
  "modalities",
548
727
  "guardrails",
728
+ "fallbacks",
729
+ "retry",
730
+ "cache",
731
+ "load_balancer",
732
+ "timeout",
549
733
  ]
550
734
  )
551
735
  nullable_fields = set(
@@ -589,7 +773,7 @@ class ModelConfigurationParameters(BaseModel):
589
773
  return m
590
774
 
591
775
 
592
- class ModelConfigurationRetryTypedDict(TypedDict):
776
+ class UpdateAgentModelConfigurationAgentsRetryTypedDict(TypedDict):
593
777
  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."""
594
778
 
595
779
  count: NotRequired[float]
@@ -598,7 +782,7 @@ class ModelConfigurationRetryTypedDict(TypedDict):
598
782
  r"""HTTP status codes that trigger retry logic"""
599
783
 
600
784
 
601
- class ModelConfigurationRetry(BaseModel):
785
+ class UpdateAgentModelConfigurationAgentsRetry(BaseModel):
602
786
  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."""
603
787
 
604
788
  count: Optional[float] = 3
@@ -634,7 +818,7 @@ class UpdateAgentModelConfiguration2TypedDict(TypedDict):
634
818
  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."""
635
819
  parameters: NotRequired[ModelConfigurationParametersTypedDict]
636
820
  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."""
637
- retry: NotRequired[ModelConfigurationRetryTypedDict]
821
+ retry: NotRequired[UpdateAgentModelConfigurationAgentsRetryTypedDict]
638
822
  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."""
639
823
 
640
824
 
@@ -650,7 +834,7 @@ class UpdateAgentModelConfiguration2(BaseModel):
650
834
  parameters: Optional[ModelConfigurationParameters] = None
651
835
  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."""
652
836
 
653
- retry: Optional[ModelConfigurationRetry] = None
837
+ retry: Optional[UpdateAgentModelConfigurationAgentsRetry] = None
654
838
  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."""
655
839
 
656
840
  @model_serializer(mode="wrap")
@@ -1042,9 +1226,161 @@ class UpdateAgentFallbackModelConfigurationGuardrails(BaseModel):
1042
1226
  r"""Determines whether the guardrail runs on the input (user message) or output (model response)."""
1043
1227
 
1044
1228
 
1229
+ class UpdateAgentFallbackModelConfigurationFallbacksTypedDict(TypedDict):
1230
+ model: str
1231
+ r"""Fallback model identifier"""
1232
+
1233
+
1234
+ class UpdateAgentFallbackModelConfigurationFallbacks(BaseModel):
1235
+ model: str
1236
+ r"""Fallback model identifier"""
1237
+
1238
+
1239
+ class UpdateAgentFallbackModelConfigurationRetryTypedDict(TypedDict):
1240
+ r"""Retry configuration for the request"""
1241
+
1242
+ count: NotRequired[float]
1243
+ r"""Number of retry attempts (1-5)"""
1244
+ on_codes: NotRequired[List[float]]
1245
+ r"""HTTP status codes that trigger retry logic"""
1246
+
1247
+
1248
+ class UpdateAgentFallbackModelConfigurationRetry(BaseModel):
1249
+ r"""Retry configuration for the request"""
1250
+
1251
+ count: Optional[float] = 3
1252
+ r"""Number of retry attempts (1-5)"""
1253
+
1254
+ on_codes: Optional[List[float]] = None
1255
+ r"""HTTP status codes that trigger retry logic"""
1256
+
1257
+ @model_serializer(mode="wrap")
1258
+ def serialize_model(self, handler):
1259
+ optional_fields = set(["count", "on_codes"])
1260
+ serialized = handler(self)
1261
+ m = {}
1262
+
1263
+ for n, f in type(self).model_fields.items():
1264
+ k = f.alias or n
1265
+ val = serialized.get(k)
1266
+
1267
+ if val != UNSET_SENTINEL:
1268
+ if val is not None or k not in optional_fields:
1269
+ m[k] = val
1270
+
1271
+ return m
1272
+
1273
+
1274
+ UpdateAgentFallbackModelConfigurationType = Literal["exact_match",]
1275
+
1276
+
1277
+ class UpdateAgentFallbackModelConfigurationCacheTypedDict(TypedDict):
1278
+ r"""Cache configuration for the request."""
1279
+
1280
+ type: UpdateAgentFallbackModelConfigurationType
1281
+ ttl: NotRequired[float]
1282
+ r"""Time to live for cached responses in seconds. Maximum 259200 seconds (3 days)."""
1283
+
1284
+
1285
+ class UpdateAgentFallbackModelConfigurationCache(BaseModel):
1286
+ r"""Cache configuration for the request."""
1287
+
1288
+ type: UpdateAgentFallbackModelConfigurationType
1289
+
1290
+ ttl: Optional[float] = 1800
1291
+ r"""Time to live for cached responses in seconds. Maximum 259200 seconds (3 days)."""
1292
+
1293
+ @model_serializer(mode="wrap")
1294
+ def serialize_model(self, handler):
1295
+ optional_fields = set(["ttl"])
1296
+ serialized = handler(self)
1297
+ m = {}
1298
+
1299
+ for n, f in type(self).model_fields.items():
1300
+ k = f.alias or n
1301
+ val = serialized.get(k)
1302
+
1303
+ if val != UNSET_SENTINEL:
1304
+ if val is not None or k not in optional_fields:
1305
+ m[k] = val
1306
+
1307
+ return m
1308
+
1309
+
1310
+ UpdateAgentLoadBalancerAgentsType = Literal["weight_based",]
1311
+
1312
+
1313
+ class UpdateAgentLoadBalancerAgentsModelsTypedDict(TypedDict):
1314
+ model: str
1315
+ r"""Model identifier for load balancing"""
1316
+ weight: NotRequired[float]
1317
+ r"""Weight assigned to this model for load balancing"""
1318
+
1319
+
1320
+ class UpdateAgentLoadBalancerAgentsModels(BaseModel):
1321
+ model: str
1322
+ r"""Model identifier for load balancing"""
1323
+
1324
+ weight: Optional[float] = 0.5
1325
+ r"""Weight assigned to this model for load balancing"""
1326
+
1327
+ @model_serializer(mode="wrap")
1328
+ def serialize_model(self, handler):
1329
+ optional_fields = set(["weight"])
1330
+ serialized = handler(self)
1331
+ m = {}
1332
+
1333
+ for n, f in type(self).model_fields.items():
1334
+ k = f.alias or n
1335
+ val = serialized.get(k)
1336
+
1337
+ if val != UNSET_SENTINEL:
1338
+ if val is not None or k not in optional_fields:
1339
+ m[k] = val
1340
+
1341
+ return m
1342
+
1343
+
1344
+ class UpdateAgentLoadBalancerAgents1TypedDict(TypedDict):
1345
+ type: UpdateAgentLoadBalancerAgentsType
1346
+ models: List[UpdateAgentLoadBalancerAgentsModelsTypedDict]
1347
+
1348
+
1349
+ class UpdateAgentLoadBalancerAgents1(BaseModel):
1350
+ type: UpdateAgentLoadBalancerAgentsType
1351
+
1352
+ models: List[UpdateAgentLoadBalancerAgentsModels]
1353
+
1354
+
1355
+ UpdateAgentFallbackModelConfigurationLoadBalancerTypedDict = (
1356
+ UpdateAgentLoadBalancerAgents1TypedDict
1357
+ )
1358
+ r"""Load balancer configuration for the request."""
1359
+
1360
+
1361
+ UpdateAgentFallbackModelConfigurationLoadBalancer = UpdateAgentLoadBalancerAgents1
1362
+ r"""Load balancer configuration for the request."""
1363
+
1364
+
1365
+ class UpdateAgentFallbackModelConfigurationTimeoutTypedDict(TypedDict):
1366
+ 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."""
1367
+
1368
+ call_timeout: float
1369
+ r"""Timeout value in milliseconds"""
1370
+
1371
+
1372
+ class UpdateAgentFallbackModelConfigurationTimeout(BaseModel):
1373
+ 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."""
1374
+
1375
+ call_timeout: float
1376
+ r"""Timeout value in milliseconds"""
1377
+
1378
+
1045
1379
  class UpdateAgentFallbackModelConfigurationParametersTypedDict(TypedDict):
1046
1380
  r"""Optional model parameters specific to this fallback model. Overrides primary model parameters if this fallback is used."""
1047
1381
 
1382
+ name: NotRequired[str]
1383
+ r"""The name to display on the trace. If not specified, the default system name will be used."""
1048
1384
  audio: NotRequired[Nullable[UpdateAgentFallbackModelConfigurationAudioTypedDict]]
1049
1385
  r"""Parameters for audio output. Required when audio output is requested with modalities: [\"audio\"]. Learn more."""
1050
1386
  frequency_penalty: NotRequired[Nullable[float]]
@@ -1107,11 +1443,28 @@ class UpdateAgentFallbackModelConfigurationParametersTypedDict(TypedDict):
1107
1443
  List[UpdateAgentFallbackModelConfigurationGuardrailsTypedDict]
1108
1444
  ]
1109
1445
  r"""A list of guardrails to apply to the request."""
1446
+ fallbacks: NotRequired[
1447
+ List[UpdateAgentFallbackModelConfigurationFallbacksTypedDict]
1448
+ ]
1449
+ r"""Array of fallback models to use if primary model fails"""
1450
+ retry: NotRequired[UpdateAgentFallbackModelConfigurationRetryTypedDict]
1451
+ r"""Retry configuration for the request"""
1452
+ cache: NotRequired[UpdateAgentFallbackModelConfigurationCacheTypedDict]
1453
+ r"""Cache configuration for the request."""
1454
+ load_balancer: NotRequired[
1455
+ UpdateAgentFallbackModelConfigurationLoadBalancerTypedDict
1456
+ ]
1457
+ r"""Load balancer configuration for the request."""
1458
+ timeout: NotRequired[UpdateAgentFallbackModelConfigurationTimeoutTypedDict]
1459
+ 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."""
1110
1460
 
1111
1461
 
1112
1462
  class UpdateAgentFallbackModelConfigurationParameters(BaseModel):
1113
1463
  r"""Optional model parameters specific to this fallback model. Overrides primary model parameters if this fallback is used."""
1114
1464
 
1465
+ name: Optional[str] = None
1466
+ r"""The name to display on the trace. If not specified, the default system name will be used."""
1467
+
1115
1468
  audio: OptionalNullable[UpdateAgentFallbackModelConfigurationAudio] = UNSET
1116
1469
  r"""Parameters for audio output. Required when audio output is requested with modalities: [\"audio\"]. Learn more."""
1117
1470
 
@@ -1196,10 +1549,26 @@ class UpdateAgentFallbackModelConfigurationParameters(BaseModel):
1196
1549
  guardrails: Optional[List[UpdateAgentFallbackModelConfigurationGuardrails]] = None
1197
1550
  r"""A list of guardrails to apply to the request."""
1198
1551
 
1552
+ fallbacks: Optional[List[UpdateAgentFallbackModelConfigurationFallbacks]] = None
1553
+ r"""Array of fallback models to use if primary model fails"""
1554
+
1555
+ retry: Optional[UpdateAgentFallbackModelConfigurationRetry] = None
1556
+ r"""Retry configuration for the request"""
1557
+
1558
+ cache: Optional[UpdateAgentFallbackModelConfigurationCache] = None
1559
+ r"""Cache configuration for the request."""
1560
+
1561
+ load_balancer: Optional[UpdateAgentFallbackModelConfigurationLoadBalancer] = None
1562
+ r"""Load balancer configuration for the request."""
1563
+
1564
+ timeout: Optional[UpdateAgentFallbackModelConfigurationTimeout] = None
1565
+ 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."""
1566
+
1199
1567
  @model_serializer(mode="wrap")
1200
1568
  def serialize_model(self, handler):
1201
1569
  optional_fields = set(
1202
1570
  [
1571
+ "name",
1203
1572
  "audio",
1204
1573
  "frequency_penalty",
1205
1574
  "max_tokens",
@@ -1222,6 +1591,11 @@ class UpdateAgentFallbackModelConfigurationParameters(BaseModel):
1222
1591
  "parallel_tool_calls",
1223
1592
  "modalities",
1224
1593
  "guardrails",
1594
+ "fallbacks",
1595
+ "retry",
1596
+ "cache",
1597
+ "load_balancer",
1598
+ "timeout",
1225
1599
  ]
1226
1600
  )
1227
1601
  nullable_fields = set(
@@ -1265,7 +1639,7 @@ class UpdateAgentFallbackModelConfigurationParameters(BaseModel):
1265
1639
  return m
1266
1640
 
1267
1641
 
1268
- class UpdateAgentFallbackModelConfigurationRetryTypedDict(TypedDict):
1642
+ class UpdateAgentFallbackModelConfigurationAgentsRetryTypedDict(TypedDict):
1269
1643
  r"""Retry configuration for this fallback model. Allows customizing retry count (1-5) and HTTP status codes that trigger retries."""
1270
1644
 
1271
1645
  count: NotRequired[float]
@@ -1274,7 +1648,7 @@ class UpdateAgentFallbackModelConfigurationRetryTypedDict(TypedDict):
1274
1648
  r"""HTTP status codes that trigger retry logic"""
1275
1649
 
1276
1650
 
1277
- class UpdateAgentFallbackModelConfigurationRetry(BaseModel):
1651
+ class UpdateAgentFallbackModelConfigurationAgentsRetry(BaseModel):
1278
1652
  r"""Retry configuration for this fallback model. Allows customizing retry count (1-5) and HTTP status codes that trigger retries."""
1279
1653
 
1280
1654
  count: Optional[float] = 3
@@ -1307,7 +1681,7 @@ class UpdateAgentFallbackModelConfiguration2TypedDict(TypedDict):
1307
1681
  r"""A fallback model ID string. Must support tool calling."""
1308
1682
  parameters: NotRequired[UpdateAgentFallbackModelConfigurationParametersTypedDict]
1309
1683
  r"""Optional model parameters specific to this fallback model. Overrides primary model parameters if this fallback is used."""
1310
- retry: NotRequired[UpdateAgentFallbackModelConfigurationRetryTypedDict]
1684
+ retry: NotRequired[UpdateAgentFallbackModelConfigurationAgentsRetryTypedDict]
1311
1685
  r"""Retry configuration for this fallback model. Allows customizing retry count (1-5) and HTTP status codes that trigger retries."""
1312
1686
 
1313
1687
 
@@ -1320,7 +1694,7 @@ class UpdateAgentFallbackModelConfiguration2(BaseModel):
1320
1694
  parameters: Optional[UpdateAgentFallbackModelConfigurationParameters] = None
1321
1695
  r"""Optional model parameters specific to this fallback model. Overrides primary model parameters if this fallback is used."""
1322
1696
 
1323
- retry: Optional[UpdateAgentFallbackModelConfigurationRetry] = None
1697
+ retry: Optional[UpdateAgentFallbackModelConfigurationAgentsRetry] = None
1324
1698
  r"""Retry configuration for this fallback model. Allows customizing retry count (1-5) and HTTP status codes that trigger retries."""
1325
1699
 
1326
1700
  @model_serializer(mode="wrap")
@@ -3048,9 +3422,159 @@ class UpdateAgentAgentsResponseGuardrails(BaseModel):
3048
3422
  r"""Determines whether the guardrail runs on the input (user message) or output (model response)."""
3049
3423
 
3050
3424
 
3425
+ class UpdateAgentFallbacksTypedDict(TypedDict):
3426
+ model: str
3427
+ r"""Fallback model identifier"""
3428
+
3429
+
3430
+ class UpdateAgentFallbacks(BaseModel):
3431
+ model: str
3432
+ r"""Fallback model identifier"""
3433
+
3434
+
3435
+ class UpdateAgentAgentsRetryTypedDict(TypedDict):
3436
+ r"""Retry configuration for the request"""
3437
+
3438
+ count: NotRequired[float]
3439
+ r"""Number of retry attempts (1-5)"""
3440
+ on_codes: NotRequired[List[float]]
3441
+ r"""HTTP status codes that trigger retry logic"""
3442
+
3443
+
3444
+ class UpdateAgentAgentsRetry(BaseModel):
3445
+ r"""Retry configuration for the request"""
3446
+
3447
+ count: Optional[float] = 3
3448
+ r"""Number of retry attempts (1-5)"""
3449
+
3450
+ on_codes: Optional[List[float]] = None
3451
+ r"""HTTP status codes that trigger retry logic"""
3452
+
3453
+ @model_serializer(mode="wrap")
3454
+ def serialize_model(self, handler):
3455
+ optional_fields = set(["count", "on_codes"])
3456
+ serialized = handler(self)
3457
+ m = {}
3458
+
3459
+ for n, f in type(self).model_fields.items():
3460
+ k = f.alias or n
3461
+ val = serialized.get(k)
3462
+
3463
+ if val != UNSET_SENTINEL:
3464
+ if val is not None or k not in optional_fields:
3465
+ m[k] = val
3466
+
3467
+ return m
3468
+
3469
+
3470
+ UpdateAgentType = Literal["exact_match",]
3471
+
3472
+
3473
+ class UpdateAgentCacheTypedDict(TypedDict):
3474
+ r"""Cache configuration for the request."""
3475
+
3476
+ type: UpdateAgentType
3477
+ ttl: NotRequired[float]
3478
+ r"""Time to live for cached responses in seconds. Maximum 259200 seconds (3 days)."""
3479
+
3480
+
3481
+ class UpdateAgentCache(BaseModel):
3482
+ r"""Cache configuration for the request."""
3483
+
3484
+ type: UpdateAgentType
3485
+
3486
+ ttl: Optional[float] = 1800
3487
+ r"""Time to live for cached responses in seconds. Maximum 259200 seconds (3 days)."""
3488
+
3489
+ @model_serializer(mode="wrap")
3490
+ def serialize_model(self, handler):
3491
+ optional_fields = set(["ttl"])
3492
+ serialized = handler(self)
3493
+ m = {}
3494
+
3495
+ for n, f in type(self).model_fields.items():
3496
+ k = f.alias or n
3497
+ val = serialized.get(k)
3498
+
3499
+ if val != UNSET_SENTINEL:
3500
+ if val is not None or k not in optional_fields:
3501
+ m[k] = val
3502
+
3503
+ return m
3504
+
3505
+
3506
+ UpdateAgentLoadBalancerAgentsResponseType = Literal["weight_based",]
3507
+
3508
+
3509
+ class UpdateAgentLoadBalancerAgentsResponseModelsTypedDict(TypedDict):
3510
+ model: str
3511
+ r"""Model identifier for load balancing"""
3512
+ weight: NotRequired[float]
3513
+ r"""Weight assigned to this model for load balancing"""
3514
+
3515
+
3516
+ class UpdateAgentLoadBalancerAgentsResponseModels(BaseModel):
3517
+ model: str
3518
+ r"""Model identifier for load balancing"""
3519
+
3520
+ weight: Optional[float] = 0.5
3521
+ r"""Weight assigned to this model for load balancing"""
3522
+
3523
+ @model_serializer(mode="wrap")
3524
+ def serialize_model(self, handler):
3525
+ optional_fields = set(["weight"])
3526
+ serialized = handler(self)
3527
+ m = {}
3528
+
3529
+ for n, f in type(self).model_fields.items():
3530
+ k = f.alias or n
3531
+ val = serialized.get(k)
3532
+
3533
+ if val != UNSET_SENTINEL:
3534
+ if val is not None or k not in optional_fields:
3535
+ m[k] = val
3536
+
3537
+ return m
3538
+
3539
+
3540
+ class UpdateAgentLoadBalancerAgentsResponse1TypedDict(TypedDict):
3541
+ type: UpdateAgentLoadBalancerAgentsResponseType
3542
+ models: List[UpdateAgentLoadBalancerAgentsResponseModelsTypedDict]
3543
+
3544
+
3545
+ class UpdateAgentLoadBalancerAgentsResponse1(BaseModel):
3546
+ type: UpdateAgentLoadBalancerAgentsResponseType
3547
+
3548
+ models: List[UpdateAgentLoadBalancerAgentsResponseModels]
3549
+
3550
+
3551
+ UpdateAgentLoadBalancerTypedDict = UpdateAgentLoadBalancerAgentsResponse1TypedDict
3552
+ r"""Load balancer configuration for the request."""
3553
+
3554
+
3555
+ UpdateAgentLoadBalancer = UpdateAgentLoadBalancerAgentsResponse1
3556
+ r"""Load balancer configuration for the request."""
3557
+
3558
+
3559
+ class UpdateAgentTimeoutTypedDict(TypedDict):
3560
+ 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."""
3561
+
3562
+ call_timeout: float
3563
+ r"""Timeout value in milliseconds"""
3564
+
3565
+
3566
+ class UpdateAgentTimeout(BaseModel):
3567
+ 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."""
3568
+
3569
+ call_timeout: float
3570
+ r"""Timeout value in milliseconds"""
3571
+
3572
+
3051
3573
  class UpdateAgentParametersTypedDict(TypedDict):
3052
3574
  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."""
3053
3575
 
3576
+ name: NotRequired[str]
3577
+ r"""The name to display on the trace. If not specified, the default system name will be used."""
3054
3578
  audio: NotRequired[Nullable[UpdateAgentAudioTypedDict]]
3055
3579
  r"""Parameters for audio output. Required when audio output is requested with modalities: [\"audio\"]. Learn more."""
3056
3580
  frequency_penalty: NotRequired[Nullable[float]]
@@ -3105,11 +3629,24 @@ class UpdateAgentParametersTypedDict(TypedDict):
3105
3629
  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\"]."""
3106
3630
  guardrails: NotRequired[List[UpdateAgentAgentsResponseGuardrailsTypedDict]]
3107
3631
  r"""A list of guardrails to apply to the request."""
3632
+ fallbacks: NotRequired[List[UpdateAgentFallbacksTypedDict]]
3633
+ r"""Array of fallback models to use if primary model fails"""
3634
+ retry: NotRequired[UpdateAgentAgentsRetryTypedDict]
3635
+ r"""Retry configuration for the request"""
3636
+ cache: NotRequired[UpdateAgentCacheTypedDict]
3637
+ r"""Cache configuration for the request."""
3638
+ load_balancer: NotRequired[UpdateAgentLoadBalancerTypedDict]
3639
+ r"""Load balancer configuration for the request."""
3640
+ timeout: NotRequired[UpdateAgentTimeoutTypedDict]
3641
+ 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."""
3108
3642
 
3109
3643
 
3110
3644
  class UpdateAgentParameters(BaseModel):
3111
3645
  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."""
3112
3646
 
3647
+ name: Optional[str] = None
3648
+ r"""The name to display on the trace. If not specified, the default system name will be used."""
3649
+
3113
3650
  audio: OptionalNullable[UpdateAgentAudio] = UNSET
3114
3651
  r"""Parameters for audio output. Required when audio output is requested with modalities: [\"audio\"]. Learn more."""
3115
3652
 
@@ -3186,10 +3723,26 @@ class UpdateAgentParameters(BaseModel):
3186
3723
  guardrails: Optional[List[UpdateAgentAgentsResponseGuardrails]] = None
3187
3724
  r"""A list of guardrails to apply to the request."""
3188
3725
 
3726
+ fallbacks: Optional[List[UpdateAgentFallbacks]] = None
3727
+ r"""Array of fallback models to use if primary model fails"""
3728
+
3729
+ retry: Optional[UpdateAgentAgentsRetry] = None
3730
+ r"""Retry configuration for the request"""
3731
+
3732
+ cache: Optional[UpdateAgentCache] = None
3733
+ r"""Cache configuration for the request."""
3734
+
3735
+ load_balancer: Optional[UpdateAgentLoadBalancer] = None
3736
+ r"""Load balancer configuration for the request."""
3737
+
3738
+ timeout: Optional[UpdateAgentTimeout] = None
3739
+ 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."""
3740
+
3189
3741
  @model_serializer(mode="wrap")
3190
3742
  def serialize_model(self, handler):
3191
3743
  optional_fields = set(
3192
3744
  [
3745
+ "name",
3193
3746
  "audio",
3194
3747
  "frequency_penalty",
3195
3748
  "max_tokens",
@@ -3212,6 +3765,11 @@ class UpdateAgentParameters(BaseModel):
3212
3765
  "parallel_tool_calls",
3213
3766
  "modalities",
3214
3767
  "guardrails",
3768
+ "fallbacks",
3769
+ "retry",
3770
+ "cache",
3771
+ "load_balancer",
3772
+ "timeout",
3215
3773
  ]
3216
3774
  )
3217
3775
  nullable_fields = set(
@@ -3672,9 +4230,163 @@ class UpdateAgentFallbackModelConfigurationAgentsGuardrails(BaseModel):
3672
4230
  r"""Determines whether the guardrail runs on the input (user message) or output (model response)."""
3673
4231
 
3674
4232
 
4233
+ class UpdateAgentFallbackModelConfigurationAgentsFallbacksTypedDict(TypedDict):
4234
+ model: str
4235
+ r"""Fallback model identifier"""
4236
+
4237
+
4238
+ class UpdateAgentFallbackModelConfigurationAgentsFallbacks(BaseModel):
4239
+ model: str
4240
+ r"""Fallback model identifier"""
4241
+
4242
+
4243
+ class UpdateAgentFallbackModelConfigurationAgentsResponse200RetryTypedDict(TypedDict):
4244
+ r"""Retry configuration for the request"""
4245
+
4246
+ count: NotRequired[float]
4247
+ r"""Number of retry attempts (1-5)"""
4248
+ on_codes: NotRequired[List[float]]
4249
+ r"""HTTP status codes that trigger retry logic"""
4250
+
4251
+
4252
+ class UpdateAgentFallbackModelConfigurationAgentsResponse200Retry(BaseModel):
4253
+ r"""Retry configuration for the request"""
4254
+
4255
+ count: Optional[float] = 3
4256
+ r"""Number of retry attempts (1-5)"""
4257
+
4258
+ on_codes: Optional[List[float]] = None
4259
+ r"""HTTP status codes that trigger retry logic"""
4260
+
4261
+ @model_serializer(mode="wrap")
4262
+ def serialize_model(self, handler):
4263
+ optional_fields = set(["count", "on_codes"])
4264
+ serialized = handler(self)
4265
+ m = {}
4266
+
4267
+ for n, f in type(self).model_fields.items():
4268
+ k = f.alias or n
4269
+ val = serialized.get(k)
4270
+
4271
+ if val != UNSET_SENTINEL:
4272
+ if val is not None or k not in optional_fields:
4273
+ m[k] = val
4274
+
4275
+ return m
4276
+
4277
+
4278
+ UpdateAgentFallbackModelConfigurationAgentsType = Literal["exact_match",]
4279
+
4280
+
4281
+ class UpdateAgentFallbackModelConfigurationAgentsCacheTypedDict(TypedDict):
4282
+ r"""Cache configuration for the request."""
4283
+
4284
+ type: UpdateAgentFallbackModelConfigurationAgentsType
4285
+ ttl: NotRequired[float]
4286
+ r"""Time to live for cached responses in seconds. Maximum 259200 seconds (3 days)."""
4287
+
4288
+
4289
+ class UpdateAgentFallbackModelConfigurationAgentsCache(BaseModel):
4290
+ r"""Cache configuration for the request."""
4291
+
4292
+ type: UpdateAgentFallbackModelConfigurationAgentsType
4293
+
4294
+ ttl: Optional[float] = 1800
4295
+ r"""Time to live for cached responses in seconds. Maximum 259200 seconds (3 days)."""
4296
+
4297
+ @model_serializer(mode="wrap")
4298
+ def serialize_model(self, handler):
4299
+ optional_fields = set(["ttl"])
4300
+ serialized = handler(self)
4301
+ m = {}
4302
+
4303
+ for n, f in type(self).model_fields.items():
4304
+ k = f.alias or n
4305
+ val = serialized.get(k)
4306
+
4307
+ if val != UNSET_SENTINEL:
4308
+ if val is not None or k not in optional_fields:
4309
+ m[k] = val
4310
+
4311
+ return m
4312
+
4313
+
4314
+ UpdateAgentLoadBalancerAgentsResponse200Type = Literal["weight_based",]
4315
+
4316
+
4317
+ class UpdateAgentLoadBalancerAgentsResponse200ModelsTypedDict(TypedDict):
4318
+ model: str
4319
+ r"""Model identifier for load balancing"""
4320
+ weight: NotRequired[float]
4321
+ r"""Weight assigned to this model for load balancing"""
4322
+
4323
+
4324
+ class UpdateAgentLoadBalancerAgentsResponse200Models(BaseModel):
4325
+ model: str
4326
+ r"""Model identifier for load balancing"""
4327
+
4328
+ weight: Optional[float] = 0.5
4329
+ r"""Weight assigned to this model for load balancing"""
4330
+
4331
+ @model_serializer(mode="wrap")
4332
+ def serialize_model(self, handler):
4333
+ optional_fields = set(["weight"])
4334
+ serialized = handler(self)
4335
+ m = {}
4336
+
4337
+ for n, f in type(self).model_fields.items():
4338
+ k = f.alias or n
4339
+ val = serialized.get(k)
4340
+
4341
+ if val != UNSET_SENTINEL:
4342
+ if val is not None or k not in optional_fields:
4343
+ m[k] = val
4344
+
4345
+ return m
4346
+
4347
+
4348
+ class UpdateAgentLoadBalancerAgentsResponse2001TypedDict(TypedDict):
4349
+ type: UpdateAgentLoadBalancerAgentsResponse200Type
4350
+ models: List[UpdateAgentLoadBalancerAgentsResponse200ModelsTypedDict]
4351
+
4352
+
4353
+ class UpdateAgentLoadBalancerAgentsResponse2001(BaseModel):
4354
+ type: UpdateAgentLoadBalancerAgentsResponse200Type
4355
+
4356
+ models: List[UpdateAgentLoadBalancerAgentsResponse200Models]
4357
+
4358
+
4359
+ UpdateAgentFallbackModelConfigurationAgentsLoadBalancerTypedDict = (
4360
+ UpdateAgentLoadBalancerAgentsResponse2001TypedDict
4361
+ )
4362
+ r"""Load balancer configuration for the request."""
4363
+
4364
+
4365
+ UpdateAgentFallbackModelConfigurationAgentsLoadBalancer = (
4366
+ UpdateAgentLoadBalancerAgentsResponse2001
4367
+ )
4368
+ r"""Load balancer configuration for the request."""
4369
+
4370
+
4371
+ class UpdateAgentFallbackModelConfigurationAgentsTimeoutTypedDict(TypedDict):
4372
+ 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."""
4373
+
4374
+ call_timeout: float
4375
+ r"""Timeout value in milliseconds"""
4376
+
4377
+
4378
+ class UpdateAgentFallbackModelConfigurationAgentsTimeout(BaseModel):
4379
+ 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."""
4380
+
4381
+ call_timeout: float
4382
+ r"""Timeout value in milliseconds"""
4383
+
4384
+
3675
4385
  class UpdateAgentFallbackModelConfigurationAgentsParametersTypedDict(TypedDict):
3676
4386
  r"""Optional model parameters specific to this fallback model. Overrides primary model parameters if this fallback is used."""
3677
4387
 
4388
+ name: NotRequired[str]
4389
+ r"""The name to display on the trace. If not specified, the default system name will be used."""
3678
4390
  audio: NotRequired[
3679
4391
  Nullable[UpdateAgentFallbackModelConfigurationAgentsAudioTypedDict]
3680
4392
  ]
@@ -3745,11 +4457,30 @@ class UpdateAgentFallbackModelConfigurationAgentsParametersTypedDict(TypedDict):
3745
4457
  List[UpdateAgentFallbackModelConfigurationAgentsGuardrailsTypedDict]
3746
4458
  ]
3747
4459
  r"""A list of guardrails to apply to the request."""
4460
+ fallbacks: NotRequired[
4461
+ List[UpdateAgentFallbackModelConfigurationAgentsFallbacksTypedDict]
4462
+ ]
4463
+ r"""Array of fallback models to use if primary model fails"""
4464
+ retry: NotRequired[
4465
+ UpdateAgentFallbackModelConfigurationAgentsResponse200RetryTypedDict
4466
+ ]
4467
+ r"""Retry configuration for the request"""
4468
+ cache: NotRequired[UpdateAgentFallbackModelConfigurationAgentsCacheTypedDict]
4469
+ r"""Cache configuration for the request."""
4470
+ load_balancer: NotRequired[
4471
+ UpdateAgentFallbackModelConfigurationAgentsLoadBalancerTypedDict
4472
+ ]
4473
+ r"""Load balancer configuration for the request."""
4474
+ timeout: NotRequired[UpdateAgentFallbackModelConfigurationAgentsTimeoutTypedDict]
4475
+ 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."""
3748
4476
 
3749
4477
 
3750
4478
  class UpdateAgentFallbackModelConfigurationAgentsParameters(BaseModel):
3751
4479
  r"""Optional model parameters specific to this fallback model. Overrides primary model parameters if this fallback is used."""
3752
4480
 
4481
+ name: Optional[str] = None
4482
+ r"""The name to display on the trace. If not specified, the default system name will be used."""
4483
+
3753
4484
  audio: OptionalNullable[UpdateAgentFallbackModelConfigurationAgentsAudio] = UNSET
3754
4485
  r"""Parameters for audio output. Required when audio output is requested with modalities: [\"audio\"]. Learn more."""
3755
4486
 
@@ -3836,10 +4567,30 @@ class UpdateAgentFallbackModelConfigurationAgentsParameters(BaseModel):
3836
4567
  ] = None
3837
4568
  r"""A list of guardrails to apply to the request."""
3838
4569
 
4570
+ fallbacks: Optional[List[UpdateAgentFallbackModelConfigurationAgentsFallbacks]] = (
4571
+ None
4572
+ )
4573
+ r"""Array of fallback models to use if primary model fails"""
4574
+
4575
+ retry: Optional[UpdateAgentFallbackModelConfigurationAgentsResponse200Retry] = None
4576
+ r"""Retry configuration for the request"""
4577
+
4578
+ cache: Optional[UpdateAgentFallbackModelConfigurationAgentsCache] = None
4579
+ r"""Cache configuration for the request."""
4580
+
4581
+ load_balancer: Optional[UpdateAgentFallbackModelConfigurationAgentsLoadBalancer] = (
4582
+ None
4583
+ )
4584
+ r"""Load balancer configuration for the request."""
4585
+
4586
+ timeout: Optional[UpdateAgentFallbackModelConfigurationAgentsTimeout] = None
4587
+ 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."""
4588
+
3839
4589
  @model_serializer(mode="wrap")
3840
4590
  def serialize_model(self, handler):
3841
4591
  optional_fields = set(
3842
4592
  [
4593
+ "name",
3843
4594
  "audio",
3844
4595
  "frequency_penalty",
3845
4596
  "max_tokens",
@@ -3862,6 +4613,11 @@ class UpdateAgentFallbackModelConfigurationAgentsParameters(BaseModel):
3862
4613
  "parallel_tool_calls",
3863
4614
  "modalities",
3864
4615
  "guardrails",
4616
+ "fallbacks",
4617
+ "retry",
4618
+ "cache",
4619
+ "load_balancer",
4620
+ "timeout",
3865
4621
  ]
3866
4622
  )
3867
4623
  nullable_fields = set(
@@ -3905,7 +4661,7 @@ class UpdateAgentFallbackModelConfigurationAgentsParameters(BaseModel):
3905
4661
  return m
3906
4662
 
3907
4663
 
3908
- class UpdateAgentFallbackModelConfigurationAgentsRetryTypedDict(TypedDict):
4664
+ class UpdateAgentFallbackModelConfigurationAgentsResponseRetryTypedDict(TypedDict):
3909
4665
  r"""Retry configuration for this fallback model. Allows customizing retry count (1-5) and HTTP status codes that trigger retries."""
3910
4666
 
3911
4667
  count: NotRequired[float]
@@ -3914,7 +4670,7 @@ class UpdateAgentFallbackModelConfigurationAgentsRetryTypedDict(TypedDict):
3914
4670
  r"""HTTP status codes that trigger retry logic"""
3915
4671
 
3916
4672
 
3917
- class UpdateAgentFallbackModelConfigurationAgentsRetry(BaseModel):
4673
+ class UpdateAgentFallbackModelConfigurationAgentsResponseRetry(BaseModel):
3918
4674
  r"""Retry configuration for this fallback model. Allows customizing retry count (1-5) and HTTP status codes that trigger retries."""
3919
4675
 
3920
4676
  count: Optional[float] = 3
@@ -3949,7 +4705,9 @@ class UpdateAgentFallbackModelConfigurationAgents2TypedDict(TypedDict):
3949
4705
  UpdateAgentFallbackModelConfigurationAgentsParametersTypedDict
3950
4706
  ]
3951
4707
  r"""Optional model parameters specific to this fallback model. Overrides primary model parameters if this fallback is used."""
3952
- retry: NotRequired[UpdateAgentFallbackModelConfigurationAgentsRetryTypedDict]
4708
+ retry: NotRequired[
4709
+ UpdateAgentFallbackModelConfigurationAgentsResponseRetryTypedDict
4710
+ ]
3953
4711
  r"""Retry configuration for this fallback model. Allows customizing retry count (1-5) and HTTP status codes that trigger retries."""
3954
4712
 
3955
4713
 
@@ -3962,7 +4720,7 @@ class UpdateAgentFallbackModelConfigurationAgents2(BaseModel):
3962
4720
  parameters: Optional[UpdateAgentFallbackModelConfigurationAgentsParameters] = None
3963
4721
  r"""Optional model parameters specific to this fallback model. Overrides primary model parameters if this fallback is used."""
3964
4722
 
3965
- retry: Optional[UpdateAgentFallbackModelConfigurationAgentsRetry] = None
4723
+ retry: Optional[UpdateAgentFallbackModelConfigurationAgentsResponseRetry] = None
3966
4724
  r"""Retry configuration for this fallback model. Allows customizing retry count (1-5) and HTTP status codes that trigger retries."""
3967
4725
 
3968
4726
  @model_serializer(mode="wrap")