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.
Files changed (103) hide show
  1. orq_ai_sdk/_hooks/globalhook.py +0 -1
  2. orq_ai_sdk/_version.py +3 -3
  3. orq_ai_sdk/audio.py +30 -0
  4. orq_ai_sdk/chat.py +22 -0
  5. orq_ai_sdk/completions.py +438 -0
  6. orq_ai_sdk/contacts.py +43 -886
  7. orq_ai_sdk/deployments.py +61 -0
  8. orq_ai_sdk/edits.py +364 -0
  9. orq_ai_sdk/embeddings.py +344 -0
  10. orq_ai_sdk/generations.py +370 -0
  11. orq_ai_sdk/images.py +28 -0
  12. orq_ai_sdk/models/__init__.py +3839 -424
  13. orq_ai_sdk/models/conversationresponse.py +1 -1
  14. orq_ai_sdk/models/conversationwithmessagesresponse.py +1 -1
  15. orq_ai_sdk/models/createagentrequestop.py +768 -12
  16. orq_ai_sdk/models/createagentresponse.py +68 -2
  17. orq_ai_sdk/models/createchatcompletionop.py +538 -313
  18. orq_ai_sdk/models/createcompletionop.py +2078 -0
  19. orq_ai_sdk/models/createcontactop.py +5 -10
  20. orq_ai_sdk/models/createconversationop.py +1 -1
  21. orq_ai_sdk/models/createconversationresponseop.py +2 -2
  22. orq_ai_sdk/models/createdatasetitemop.py +4 -4
  23. orq_ai_sdk/models/createdatasetop.py +1 -1
  24. orq_ai_sdk/models/createdatasourceop.py +1 -1
  25. orq_ai_sdk/models/createembeddingop.py +579 -0
  26. orq_ai_sdk/models/createevalop.py +14 -14
  27. orq_ai_sdk/models/createidentityop.py +1 -1
  28. orq_ai_sdk/models/createimageeditop.py +715 -0
  29. orq_ai_sdk/models/createimageop.py +228 -82
  30. orq_ai_sdk/models/createimagevariationop.py +706 -0
  31. orq_ai_sdk/models/creatememoryop.py +4 -2
  32. orq_ai_sdk/models/createmoderationop.py +521 -0
  33. orq_ai_sdk/models/createpromptop.py +375 -6
  34. orq_ai_sdk/models/creatererankop.py +608 -0
  35. orq_ai_sdk/models/createresponseop.py +2567 -0
  36. orq_ai_sdk/models/createspeechop.py +466 -0
  37. orq_ai_sdk/models/createtoolop.py +6 -6
  38. orq_ai_sdk/models/createtranscriptionop.py +732 -0
  39. orq_ai_sdk/models/createtranslationop.py +702 -0
  40. orq_ai_sdk/models/deploymentgetconfigop.py +17 -7
  41. orq_ai_sdk/models/deploymentsop.py +1 -0
  42. orq_ai_sdk/models/deploymentstreamop.py +7 -0
  43. orq_ai_sdk/models/filegetop.py +1 -1
  44. orq_ai_sdk/models/filelistop.py +1 -1
  45. orq_ai_sdk/models/fileuploadop.py +1 -1
  46. orq_ai_sdk/models/generateconversationnameop.py +1 -1
  47. orq_ai_sdk/models/getallmemoriesop.py +4 -2
  48. orq_ai_sdk/models/getallpromptsop.py +188 -3
  49. orq_ai_sdk/models/getalltoolsop.py +6 -6
  50. orq_ai_sdk/models/getevalsop.py +17 -17
  51. orq_ai_sdk/models/getonepromptop.py +188 -3
  52. orq_ai_sdk/models/getpromptversionop.py +188 -3
  53. orq_ai_sdk/models/invokedeploymentrequest.py +11 -4
  54. orq_ai_sdk/models/listagentsop.py +372 -0
  55. orq_ai_sdk/models/listdatasetdatapointsop.py +4 -4
  56. orq_ai_sdk/models/listdatasetsop.py +1 -1
  57. orq_ai_sdk/models/listdatasourcesop.py +1 -1
  58. orq_ai_sdk/models/listidentitiesop.py +1 -1
  59. orq_ai_sdk/models/listmodelsop.py +1 -0
  60. orq_ai_sdk/models/listpromptversionsop.py +188 -3
  61. orq_ai_sdk/models/partdoneevent.py +1 -1
  62. orq_ai_sdk/models/post_v2_router_ocrop.py +408 -0
  63. orq_ai_sdk/models/publiccontact.py +9 -3
  64. orq_ai_sdk/models/publicidentity.py +62 -0
  65. orq_ai_sdk/models/reasoningpart.py +1 -1
  66. orq_ai_sdk/models/responsedoneevent.py +14 -11
  67. orq_ai_sdk/models/retrieveagentrequestop.py +382 -0
  68. orq_ai_sdk/models/retrievedatapointop.py +4 -4
  69. orq_ai_sdk/models/retrievedatasetop.py +1 -1
  70. orq_ai_sdk/models/retrievedatasourceop.py +1 -1
  71. orq_ai_sdk/models/retrieveidentityop.py +1 -1
  72. orq_ai_sdk/models/retrievememoryop.py +4 -2
  73. orq_ai_sdk/models/retrievetoolop.py +6 -6
  74. orq_ai_sdk/models/runagentop.py +379 -9
  75. orq_ai_sdk/models/streamrunagentop.py +385 -9
  76. orq_ai_sdk/models/updateagentop.py +770 -12
  77. orq_ai_sdk/models/updateconversationop.py +1 -1
  78. orq_ai_sdk/models/updatedatapointop.py +4 -4
  79. orq_ai_sdk/models/updatedatasetop.py +1 -1
  80. orq_ai_sdk/models/updatedatasourceop.py +1 -1
  81. orq_ai_sdk/models/updateevalop.py +14 -14
  82. orq_ai_sdk/models/updateidentityop.py +1 -1
  83. orq_ai_sdk/models/updatememoryop.py +4 -2
  84. orq_ai_sdk/models/updatepromptop.py +375 -6
  85. orq_ai_sdk/models/updatetoolop.py +7 -7
  86. orq_ai_sdk/moderations.py +218 -0
  87. orq_ai_sdk/orq_completions.py +666 -0
  88. orq_ai_sdk/orq_responses.py +398 -0
  89. orq_ai_sdk/rerank.py +330 -0
  90. orq_ai_sdk/router.py +89 -641
  91. orq_ai_sdk/speech.py +333 -0
  92. orq_ai_sdk/transcriptions.py +416 -0
  93. orq_ai_sdk/translations.py +384 -0
  94. orq_ai_sdk/variations.py +364 -0
  95. orq_ai_sdk-4.2.12.dist-info/METADATA +888 -0
  96. {orq_ai_sdk-4.2.0rc49.dist-info → orq_ai_sdk-4.2.12.dist-info}/RECORD +98 -75
  97. {orq_ai_sdk-4.2.0rc49.dist-info → orq_ai_sdk-4.2.12.dist-info}/WHEEL +1 -1
  98. orq_ai_sdk/models/deletecontactop.py +0 -44
  99. orq_ai_sdk/models/listcontactsop.py +0 -265
  100. orq_ai_sdk/models/retrievecontactop.py +0 -142
  101. orq_ai_sdk/models/updatecontactop.py +0 -233
  102. orq_ai_sdk-4.2.0rc49.dist-info/METADATA +0 -788
  103. {orq_ai_sdk-4.2.0rc49.dist-info → orq_ai_sdk-4.2.12.dist-info}/top_level.txt +0 -0
@@ -4,11 +4,14 @@ from __future__ import annotations
4
4
  from orq_ai_sdk.types import BaseModel, UNSET_SENTINEL
5
5
  from pydantic import model_serializer
6
6
  from typing import Any, Dict, List, Optional
7
- from typing_extensions import NotRequired, TypedDict
7
+ from typing_extensions import NotRequired, TypedDict, deprecated
8
8
 
9
9
 
10
+ @deprecated(
11
+ "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
12
+ )
10
13
  class PublicContactTypedDict(TypedDict):
11
- r"""Information about the identity making the request. If the identity does not exist, it will be created automatically."""
14
+ r"""@deprecated Use identity instead. Information about the contact making the request."""
12
15
 
13
16
  id: str
14
17
  r"""Unique identifier for the contact"""
@@ -24,8 +27,11 @@ class PublicContactTypedDict(TypedDict):
24
27
  r"""A list of tags associated with the contact"""
25
28
 
26
29
 
30
+ @deprecated(
31
+ "warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
32
+ )
27
33
  class PublicContact(BaseModel):
28
- r"""Information about the identity making the request. If the identity does not exist, it will be created automatically."""
34
+ r"""@deprecated Use identity instead. Information about the contact making the request."""
29
35
 
30
36
  id: str
31
37
  r"""Unique identifier for the contact"""
@@ -0,0 +1,62 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from orq_ai_sdk.types import BaseModel, UNSET_SENTINEL
5
+ from pydantic import model_serializer
6
+ from typing import Any, Dict, List, Optional
7
+ from typing_extensions import NotRequired, TypedDict
8
+
9
+
10
+ class PublicIdentityTypedDict(TypedDict):
11
+ r"""Information about the identity making the request. If the identity does not exist, it will be created automatically."""
12
+
13
+ id: str
14
+ r"""Unique identifier for the contact"""
15
+ display_name: NotRequired[str]
16
+ r"""Display name of the contact"""
17
+ email: NotRequired[str]
18
+ r"""Email address of the contact"""
19
+ metadata: NotRequired[List[Dict[str, Any]]]
20
+ r"""A hash of key/value pairs containing any other data about the contact"""
21
+ logo_url: NotRequired[str]
22
+ r"""URL to the contact's avatar or logo"""
23
+ tags: NotRequired[List[str]]
24
+ r"""A list of tags associated with the contact"""
25
+
26
+
27
+ class PublicIdentity(BaseModel):
28
+ r"""Information about the identity making the request. If the identity does not exist, it will be created automatically."""
29
+
30
+ id: str
31
+ r"""Unique identifier for the contact"""
32
+
33
+ display_name: Optional[str] = None
34
+ r"""Display name of the contact"""
35
+
36
+ email: Optional[str] = None
37
+ r"""Email address of the contact"""
38
+
39
+ metadata: Optional[List[Dict[str, Any]]] = None
40
+ r"""A hash of key/value pairs containing any other data about the contact"""
41
+
42
+ logo_url: Optional[str] = None
43
+ r"""URL to the contact's avatar or logo"""
44
+
45
+ tags: Optional[List[str]] = None
46
+ r"""A list of tags associated with the contact"""
47
+
48
+ @model_serializer(mode="wrap")
49
+ def serialize_model(self, handler):
50
+ optional_fields = set(["display_name", "email", "metadata", "logo_url", "tags"])
51
+ serialized = handler(self)
52
+ m = {}
53
+
54
+ for n, f in type(self).model_fields.items():
55
+ k = f.alias or n
56
+ val = serialized.get(k)
57
+
58
+ if val != UNSET_SENTINEL:
59
+ if val is not None or k not in optional_fields:
60
+ m[k] = val
61
+
62
+ return m
@@ -37,7 +37,7 @@ class ReasoningPart(BaseModel):
37
37
  r"""The reasoning or thought process behind the response. Used for chain-of-thought or extended thinking."""
38
38
 
39
39
  id: Annotated[Optional[str], pydantic.Field(alias="_id")] = (
40
- "reasoning_01kfds3avk2eyg3jz9fghcmt6b"
40
+ "reasoning_01kfzbgfgy030sq7agj1m0y240"
41
41
  )
42
42
  r"""Unique identifier for the part. Format: reasoning_{ulid} (e.g., reasoning_01hxyz...)"""
43
43
 
@@ -17,7 +17,7 @@ from typing_extensions import Annotated, NotRequired, TypedDict
17
17
  ResponseDoneEventType = Literal["response.done",]
18
18
 
19
19
 
20
- FinishReason = Literal[
20
+ ResponseDoneEventFinishReason = Literal[
21
21
  "stop",
22
22
  "length",
23
23
  "tool_calls",
@@ -206,14 +206,14 @@ class ResponseDoneEventUsage(BaseModel):
206
206
  ResponseDoneEventDataType = Literal["function",]
207
207
 
208
208
 
209
- class FunctionTypedDict(TypedDict):
209
+ class ResponseDoneEventFunctionTypedDict(TypedDict):
210
210
  name: NotRequired[str]
211
211
  r"""The name of the function to call"""
212
212
  arguments: NotRequired[str]
213
213
  r"""The arguments to pass to the function as JSON string"""
214
214
 
215
215
 
216
- class Function(BaseModel):
216
+ class ResponseDoneEventFunction(BaseModel):
217
217
  name: Optional[str] = None
218
218
  r"""The name of the function to call"""
219
219
 
@@ -237,40 +237,43 @@ class Function(BaseModel):
237
237
  return m
238
238
 
239
239
 
240
- class PendingToolCallsTypedDict(TypedDict):
240
+ class ResponseDoneEventPendingToolCallsTypedDict(TypedDict):
241
241
  id: str
242
242
  r"""Unique identifier for the tool call"""
243
243
  type: ResponseDoneEventDataType
244
- function: FunctionTypedDict
244
+ function: ResponseDoneEventFunctionTypedDict
245
245
 
246
246
 
247
- class PendingToolCalls(BaseModel):
247
+ class ResponseDoneEventPendingToolCalls(BaseModel):
248
248
  id: str
249
249
  r"""Unique identifier for the tool call"""
250
250
 
251
251
  type: ResponseDoneEventDataType
252
252
 
253
- function: Function
253
+ function: ResponseDoneEventFunction
254
254
 
255
255
 
256
256
  class ResponseDoneEventDataTypedDict(TypedDict):
257
- finish_reason: FinishReason
257
+ finish_reason: ResponseDoneEventFinishReason
258
258
  r"""The reason why the agent stopped generating"""
259
259
  usage: NotRequired[ResponseDoneEventUsageTypedDict]
260
260
  r"""Token usage statistics for the complete response"""
261
- pending_tool_calls: NotRequired[List[PendingToolCallsTypedDict]]
261
+ pending_tool_calls: NotRequired[List[ResponseDoneEventPendingToolCallsTypedDict]]
262
262
  r"""Tool calls awaiting user response (when finishReason is function_call)"""
263
263
 
264
264
 
265
265
  class ResponseDoneEventData(BaseModel):
266
- finish_reason: Annotated[FinishReason, pydantic.Field(alias="finishReason")]
266
+ finish_reason: Annotated[
267
+ ResponseDoneEventFinishReason, pydantic.Field(alias="finishReason")
268
+ ]
267
269
  r"""The reason why the agent stopped generating"""
268
270
 
269
271
  usage: Optional[ResponseDoneEventUsage] = None
270
272
  r"""Token usage statistics for the complete response"""
271
273
 
272
274
  pending_tool_calls: Annotated[
273
- Optional[List[PendingToolCalls]], pydantic.Field(alias="pendingToolCalls")
275
+ Optional[List[ResponseDoneEventPendingToolCalls]],
276
+ pydantic.Field(alias="pendingToolCalls"),
274
277
  ] = None
275
278
  r"""Tool calls awaiting user response (when finishReason is function_call)"""
276
279
 
@@ -666,9 +666,159 @@ class RetrieveAgentRequestAgentsGuardrails(BaseModel):
666
666
  r"""Determines whether the guardrail runs on the input (user message) or output (model response)."""
667
667
 
668
668
 
669
+ class RetrieveAgentRequestFallbacksTypedDict(TypedDict):
670
+ model: str
671
+ r"""Fallback model identifier"""
672
+
673
+
674
+ class RetrieveAgentRequestFallbacks(BaseModel):
675
+ model: str
676
+ r"""Fallback model identifier"""
677
+
678
+
679
+ class RetrieveAgentRequestAgentsRetryTypedDict(TypedDict):
680
+ r"""Retry configuration for the request"""
681
+
682
+ count: NotRequired[float]
683
+ r"""Number of retry attempts (1-5)"""
684
+ on_codes: NotRequired[List[float]]
685
+ r"""HTTP status codes that trigger retry logic"""
686
+
687
+
688
+ class RetrieveAgentRequestAgentsRetry(BaseModel):
689
+ r"""Retry configuration for the request"""
690
+
691
+ count: Optional[float] = 3
692
+ r"""Number of retry attempts (1-5)"""
693
+
694
+ on_codes: Optional[List[float]] = None
695
+ r"""HTTP status codes that trigger retry logic"""
696
+
697
+ @model_serializer(mode="wrap")
698
+ def serialize_model(self, handler):
699
+ optional_fields = set(["count", "on_codes"])
700
+ serialized = handler(self)
701
+ m = {}
702
+
703
+ for n, f in type(self).model_fields.items():
704
+ k = f.alias or n
705
+ val = serialized.get(k)
706
+
707
+ if val != UNSET_SENTINEL:
708
+ if val is not None or k not in optional_fields:
709
+ m[k] = val
710
+
711
+ return m
712
+
713
+
714
+ RetrieveAgentRequestType = Literal["exact_match",]
715
+
716
+
717
+ class RetrieveAgentRequestCacheTypedDict(TypedDict):
718
+ r"""Cache configuration for the request."""
719
+
720
+ type: RetrieveAgentRequestType
721
+ ttl: NotRequired[float]
722
+ r"""Time to live for cached responses in seconds. Maximum 259200 seconds (3 days)."""
723
+
724
+
725
+ class RetrieveAgentRequestCache(BaseModel):
726
+ r"""Cache configuration for the request."""
727
+
728
+ type: RetrieveAgentRequestType
729
+
730
+ ttl: Optional[float] = 1800
731
+ r"""Time to live for cached responses in seconds. Maximum 259200 seconds (3 days)."""
732
+
733
+ @model_serializer(mode="wrap")
734
+ def serialize_model(self, handler):
735
+ optional_fields = set(["ttl"])
736
+ serialized = handler(self)
737
+ m = {}
738
+
739
+ for n, f in type(self).model_fields.items():
740
+ k = f.alias or n
741
+ val = serialized.get(k)
742
+
743
+ if val != UNSET_SENTINEL:
744
+ if val is not None or k not in optional_fields:
745
+ m[k] = val
746
+
747
+ return m
748
+
749
+
750
+ RetrieveAgentRequestLoadBalancerType = Literal["weight_based",]
751
+
752
+
753
+ class RetrieveAgentRequestLoadBalancerModelsTypedDict(TypedDict):
754
+ model: str
755
+ r"""Model identifier for load balancing"""
756
+ weight: NotRequired[float]
757
+ r"""Weight assigned to this model for load balancing"""
758
+
759
+
760
+ class RetrieveAgentRequestLoadBalancerModels(BaseModel):
761
+ model: str
762
+ r"""Model identifier for load balancing"""
763
+
764
+ weight: Optional[float] = 0.5
765
+ r"""Weight assigned to this model for load balancing"""
766
+
767
+ @model_serializer(mode="wrap")
768
+ def serialize_model(self, handler):
769
+ optional_fields = set(["weight"])
770
+ serialized = handler(self)
771
+ m = {}
772
+
773
+ for n, f in type(self).model_fields.items():
774
+ k = f.alias or n
775
+ val = serialized.get(k)
776
+
777
+ if val != UNSET_SENTINEL:
778
+ if val is not None or k not in optional_fields:
779
+ m[k] = val
780
+
781
+ return m
782
+
783
+
784
+ class RetrieveAgentRequestLoadBalancer1TypedDict(TypedDict):
785
+ type: RetrieveAgentRequestLoadBalancerType
786
+ models: List[RetrieveAgentRequestLoadBalancerModelsTypedDict]
787
+
788
+
789
+ class RetrieveAgentRequestLoadBalancer1(BaseModel):
790
+ type: RetrieveAgentRequestLoadBalancerType
791
+
792
+ models: List[RetrieveAgentRequestLoadBalancerModels]
793
+
794
+
795
+ RetrieveAgentRequestLoadBalancerTypedDict = RetrieveAgentRequestLoadBalancer1TypedDict
796
+ r"""Load balancer configuration for the request."""
797
+
798
+
799
+ RetrieveAgentRequestLoadBalancer = RetrieveAgentRequestLoadBalancer1
800
+ r"""Load balancer configuration for the request."""
801
+
802
+
803
+ class RetrieveAgentRequestTimeoutTypedDict(TypedDict):
804
+ r"""Timeout configuration to apply to the request. If the request exceeds the timeout, it will be retried or fallback to the next model if configured."""
805
+
806
+ call_timeout: float
807
+ r"""Timeout value in milliseconds"""
808
+
809
+
810
+ class RetrieveAgentRequestTimeout(BaseModel):
811
+ r"""Timeout configuration to apply to the request. If the request exceeds the timeout, it will be retried or fallback to the next model if configured."""
812
+
813
+ call_timeout: float
814
+ r"""Timeout value in milliseconds"""
815
+
816
+
669
817
  class RetrieveAgentRequestParametersTypedDict(TypedDict):
670
818
  r"""Model behavior parameters (snake_case) stored as part of the agent configuration. These become the default parameters used when the agent is executed. Commonly used: temperature (0-1, controls randomness), max_completion_tokens (response length), top_p (nucleus sampling). Advanced: frequency_penalty, presence_penalty, response_format (JSON/structured output), reasoning_effort (for o1/thinking models), seed (reproducibility), stop sequences. Model-specific support varies. Runtime parameters in agent execution requests can override these defaults."""
671
819
 
820
+ name: NotRequired[str]
821
+ r"""The name to display on the trace. If not specified, the default system name will be used."""
672
822
  audio: NotRequired[Nullable[RetrieveAgentRequestAudioTypedDict]]
673
823
  r"""Parameters for audio output. Required when audio output is requested with modalities: [\"audio\"]. Learn more."""
674
824
  frequency_penalty: NotRequired[Nullable[float]]
@@ -723,11 +873,24 @@ class RetrieveAgentRequestParametersTypedDict(TypedDict):
723
873
  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\"]."""
724
874
  guardrails: NotRequired[List[RetrieveAgentRequestAgentsGuardrailsTypedDict]]
725
875
  r"""A list of guardrails to apply to the request."""
876
+ fallbacks: NotRequired[List[RetrieveAgentRequestFallbacksTypedDict]]
877
+ r"""Array of fallback models to use if primary model fails"""
878
+ retry: NotRequired[RetrieveAgentRequestAgentsRetryTypedDict]
879
+ r"""Retry configuration for the request"""
880
+ cache: NotRequired[RetrieveAgentRequestCacheTypedDict]
881
+ r"""Cache configuration for the request."""
882
+ load_balancer: NotRequired[RetrieveAgentRequestLoadBalancerTypedDict]
883
+ r"""Load balancer configuration for the request."""
884
+ timeout: NotRequired[RetrieveAgentRequestTimeoutTypedDict]
885
+ 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."""
726
886
 
727
887
 
728
888
  class RetrieveAgentRequestParameters(BaseModel):
729
889
  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."""
730
890
 
891
+ name: Optional[str] = None
892
+ r"""The name to display on the trace. If not specified, the default system name will be used."""
893
+
731
894
  audio: OptionalNullable[RetrieveAgentRequestAudio] = UNSET
732
895
  r"""Parameters for audio output. Required when audio output is requested with modalities: [\"audio\"]. Learn more."""
733
896
 
@@ -804,10 +967,26 @@ class RetrieveAgentRequestParameters(BaseModel):
804
967
  guardrails: Optional[List[RetrieveAgentRequestAgentsGuardrails]] = None
805
968
  r"""A list of guardrails to apply to the request."""
806
969
 
970
+ fallbacks: Optional[List[RetrieveAgentRequestFallbacks]] = None
971
+ r"""Array of fallback models to use if primary model fails"""
972
+
973
+ retry: Optional[RetrieveAgentRequestAgentsRetry] = None
974
+ r"""Retry configuration for the request"""
975
+
976
+ cache: Optional[RetrieveAgentRequestCache] = None
977
+ r"""Cache configuration for the request."""
978
+
979
+ load_balancer: Optional[RetrieveAgentRequestLoadBalancer] = None
980
+ r"""Load balancer configuration for the request."""
981
+
982
+ timeout: Optional[RetrieveAgentRequestTimeout] = None
983
+ 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."""
984
+
807
985
  @model_serializer(mode="wrap")
808
986
  def serialize_model(self, handler):
809
987
  optional_fields = set(
810
988
  [
989
+ "name",
811
990
  "audio",
812
991
  "frequency_penalty",
813
992
  "max_tokens",
@@ -830,6 +1009,11 @@ class RetrieveAgentRequestParameters(BaseModel):
830
1009
  "parallel_tool_calls",
831
1010
  "modalities",
832
1011
  "guardrails",
1012
+ "fallbacks",
1013
+ "retry",
1014
+ "cache",
1015
+ "load_balancer",
1016
+ "timeout",
833
1017
  ]
834
1018
  )
835
1019
  nullable_fields = set(
@@ -1278,9 +1462,163 @@ class RetrieveAgentRequestFallbackModelConfigurationGuardrails(BaseModel):
1278
1462
  r"""Determines whether the guardrail runs on the input (user message) or output (model response)."""
1279
1463
 
1280
1464
 
1465
+ class RetrieveAgentRequestFallbackModelConfigurationFallbacksTypedDict(TypedDict):
1466
+ model: str
1467
+ r"""Fallback model identifier"""
1468
+
1469
+
1470
+ class RetrieveAgentRequestFallbackModelConfigurationFallbacks(BaseModel):
1471
+ model: str
1472
+ r"""Fallback model identifier"""
1473
+
1474
+
1475
+ class RetrieveAgentRequestFallbackModelConfigurationAgentsRetryTypedDict(TypedDict):
1476
+ r"""Retry configuration for the request"""
1477
+
1478
+ count: NotRequired[float]
1479
+ r"""Number of retry attempts (1-5)"""
1480
+ on_codes: NotRequired[List[float]]
1481
+ r"""HTTP status codes that trigger retry logic"""
1482
+
1483
+
1484
+ class RetrieveAgentRequestFallbackModelConfigurationAgentsRetry(BaseModel):
1485
+ r"""Retry configuration for the request"""
1486
+
1487
+ count: Optional[float] = 3
1488
+ r"""Number of retry attempts (1-5)"""
1489
+
1490
+ on_codes: Optional[List[float]] = None
1491
+ r"""HTTP status codes that trigger retry logic"""
1492
+
1493
+ @model_serializer(mode="wrap")
1494
+ def serialize_model(self, handler):
1495
+ optional_fields = set(["count", "on_codes"])
1496
+ serialized = handler(self)
1497
+ m = {}
1498
+
1499
+ for n, f in type(self).model_fields.items():
1500
+ k = f.alias or n
1501
+ val = serialized.get(k)
1502
+
1503
+ if val != UNSET_SENTINEL:
1504
+ if val is not None or k not in optional_fields:
1505
+ m[k] = val
1506
+
1507
+ return m
1508
+
1509
+
1510
+ RetrieveAgentRequestFallbackModelConfigurationType = Literal["exact_match",]
1511
+
1512
+
1513
+ class RetrieveAgentRequestFallbackModelConfigurationCacheTypedDict(TypedDict):
1514
+ r"""Cache configuration for the request."""
1515
+
1516
+ type: RetrieveAgentRequestFallbackModelConfigurationType
1517
+ ttl: NotRequired[float]
1518
+ r"""Time to live for cached responses in seconds. Maximum 259200 seconds (3 days)."""
1519
+
1520
+
1521
+ class RetrieveAgentRequestFallbackModelConfigurationCache(BaseModel):
1522
+ r"""Cache configuration for the request."""
1523
+
1524
+ type: RetrieveAgentRequestFallbackModelConfigurationType
1525
+
1526
+ ttl: Optional[float] = 1800
1527
+ r"""Time to live for cached responses in seconds. Maximum 259200 seconds (3 days)."""
1528
+
1529
+ @model_serializer(mode="wrap")
1530
+ def serialize_model(self, handler):
1531
+ optional_fields = set(["ttl"])
1532
+ serialized = handler(self)
1533
+ m = {}
1534
+
1535
+ for n, f in type(self).model_fields.items():
1536
+ k = f.alias or n
1537
+ val = serialized.get(k)
1538
+
1539
+ if val != UNSET_SENTINEL:
1540
+ if val is not None or k not in optional_fields:
1541
+ m[k] = val
1542
+
1543
+ return m
1544
+
1545
+
1546
+ RetrieveAgentRequestLoadBalancerAgentsType = Literal["weight_based",]
1547
+
1548
+
1549
+ class RetrieveAgentRequestLoadBalancerAgentsModelsTypedDict(TypedDict):
1550
+ model: str
1551
+ r"""Model identifier for load balancing"""
1552
+ weight: NotRequired[float]
1553
+ r"""Weight assigned to this model for load balancing"""
1554
+
1555
+
1556
+ class RetrieveAgentRequestLoadBalancerAgentsModels(BaseModel):
1557
+ model: str
1558
+ r"""Model identifier for load balancing"""
1559
+
1560
+ weight: Optional[float] = 0.5
1561
+ r"""Weight assigned to this model for load balancing"""
1562
+
1563
+ @model_serializer(mode="wrap")
1564
+ def serialize_model(self, handler):
1565
+ optional_fields = set(["weight"])
1566
+ serialized = handler(self)
1567
+ m = {}
1568
+
1569
+ for n, f in type(self).model_fields.items():
1570
+ k = f.alias or n
1571
+ val = serialized.get(k)
1572
+
1573
+ if val != UNSET_SENTINEL:
1574
+ if val is not None or k not in optional_fields:
1575
+ m[k] = val
1576
+
1577
+ return m
1578
+
1579
+
1580
+ class RetrieveAgentRequestLoadBalancerAgents1TypedDict(TypedDict):
1581
+ type: RetrieveAgentRequestLoadBalancerAgentsType
1582
+ models: List[RetrieveAgentRequestLoadBalancerAgentsModelsTypedDict]
1583
+
1584
+
1585
+ class RetrieveAgentRequestLoadBalancerAgents1(BaseModel):
1586
+ type: RetrieveAgentRequestLoadBalancerAgentsType
1587
+
1588
+ models: List[RetrieveAgentRequestLoadBalancerAgentsModels]
1589
+
1590
+
1591
+ RetrieveAgentRequestFallbackModelConfigurationLoadBalancerTypedDict = (
1592
+ RetrieveAgentRequestLoadBalancerAgents1TypedDict
1593
+ )
1594
+ r"""Load balancer configuration for the request."""
1595
+
1596
+
1597
+ RetrieveAgentRequestFallbackModelConfigurationLoadBalancer = (
1598
+ RetrieveAgentRequestLoadBalancerAgents1
1599
+ )
1600
+ r"""Load balancer configuration for the request."""
1601
+
1602
+
1603
+ class RetrieveAgentRequestFallbackModelConfigurationTimeoutTypedDict(TypedDict):
1604
+ 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."""
1605
+
1606
+ call_timeout: float
1607
+ r"""Timeout value in milliseconds"""
1608
+
1609
+
1610
+ class RetrieveAgentRequestFallbackModelConfigurationTimeout(BaseModel):
1611
+ 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."""
1612
+
1613
+ call_timeout: float
1614
+ r"""Timeout value in milliseconds"""
1615
+
1616
+
1281
1617
  class RetrieveAgentRequestFallbackModelConfigurationParametersTypedDict(TypedDict):
1282
1618
  r"""Optional model parameters specific to this fallback model. Overrides primary model parameters if this fallback is used."""
1283
1619
 
1620
+ name: NotRequired[str]
1621
+ r"""The name to display on the trace. If not specified, the default system name will be used."""
1284
1622
  audio: NotRequired[
1285
1623
  Nullable[RetrieveAgentRequestFallbackModelConfigurationAudioTypedDict]
1286
1624
  ]
@@ -1353,11 +1691,30 @@ class RetrieveAgentRequestFallbackModelConfigurationParametersTypedDict(TypedDic
1353
1691
  List[RetrieveAgentRequestFallbackModelConfigurationGuardrailsTypedDict]
1354
1692
  ]
1355
1693
  r"""A list of guardrails to apply to the request."""
1694
+ fallbacks: NotRequired[
1695
+ List[RetrieveAgentRequestFallbackModelConfigurationFallbacksTypedDict]
1696
+ ]
1697
+ r"""Array of fallback models to use if primary model fails"""
1698
+ retry: NotRequired[
1699
+ RetrieveAgentRequestFallbackModelConfigurationAgentsRetryTypedDict
1700
+ ]
1701
+ r"""Retry configuration for the request"""
1702
+ cache: NotRequired[RetrieveAgentRequestFallbackModelConfigurationCacheTypedDict]
1703
+ r"""Cache configuration for the request."""
1704
+ load_balancer: NotRequired[
1705
+ RetrieveAgentRequestFallbackModelConfigurationLoadBalancerTypedDict
1706
+ ]
1707
+ r"""Load balancer configuration for the request."""
1708
+ timeout: NotRequired[RetrieveAgentRequestFallbackModelConfigurationTimeoutTypedDict]
1709
+ 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."""
1356
1710
 
1357
1711
 
1358
1712
  class RetrieveAgentRequestFallbackModelConfigurationParameters(BaseModel):
1359
1713
  r"""Optional model parameters specific to this fallback model. Overrides primary model parameters if this fallback is used."""
1360
1714
 
1715
+ name: Optional[str] = None
1716
+ r"""The name to display on the trace. If not specified, the default system name will be used."""
1717
+
1361
1718
  audio: OptionalNullable[RetrieveAgentRequestFallbackModelConfigurationAudio] = UNSET
1362
1719
  r"""Parameters for audio output. Required when audio output is requested with modalities: [\"audio\"]. Learn more."""
1363
1720
 
@@ -1446,10 +1803,30 @@ class RetrieveAgentRequestFallbackModelConfigurationParameters(BaseModel):
1446
1803
  ] = None
1447
1804
  r"""A list of guardrails to apply to the request."""
1448
1805
 
1806
+ fallbacks: Optional[
1807
+ List[RetrieveAgentRequestFallbackModelConfigurationFallbacks]
1808
+ ] = None
1809
+ r"""Array of fallback models to use if primary model fails"""
1810
+
1811
+ retry: Optional[RetrieveAgentRequestFallbackModelConfigurationAgentsRetry] = None
1812
+ r"""Retry configuration for the request"""
1813
+
1814
+ cache: Optional[RetrieveAgentRequestFallbackModelConfigurationCache] = None
1815
+ r"""Cache configuration for the request."""
1816
+
1817
+ load_balancer: Optional[
1818
+ RetrieveAgentRequestFallbackModelConfigurationLoadBalancer
1819
+ ] = None
1820
+ r"""Load balancer configuration for the request."""
1821
+
1822
+ timeout: Optional[RetrieveAgentRequestFallbackModelConfigurationTimeout] = None
1823
+ 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."""
1824
+
1449
1825
  @model_serializer(mode="wrap")
1450
1826
  def serialize_model(self, handler):
1451
1827
  optional_fields = set(
1452
1828
  [
1829
+ "name",
1453
1830
  "audio",
1454
1831
  "frequency_penalty",
1455
1832
  "max_tokens",
@@ -1472,6 +1849,11 @@ class RetrieveAgentRequestFallbackModelConfigurationParameters(BaseModel):
1472
1849
  "parallel_tool_calls",
1473
1850
  "modalities",
1474
1851
  "guardrails",
1852
+ "fallbacks",
1853
+ "retry",
1854
+ "cache",
1855
+ "load_balancer",
1856
+ "timeout",
1475
1857
  ]
1476
1858
  )
1477
1859
  nullable_fields = set(
@@ -738,7 +738,7 @@ class RetrieveDatapointEvaluations3(BaseModel):
738
738
 
739
739
  source: Optional[RetrieveDatapointEvaluationsDatasetsResponseSource] = "orq"
740
740
 
741
- reviewed_at: Optional[datetime] = parse_datetime("2026-01-20T13:21:57.016Z")
741
+ reviewed_at: Optional[datetime] = parse_datetime("2026-01-27T09:10:46.903Z")
742
742
  r"""The date and time the item was reviewed"""
743
743
 
744
744
  @model_serializer(mode="wrap")
@@ -806,7 +806,7 @@ class RetrieveDatapointEvaluations2(BaseModel):
806
806
 
807
807
  source: Optional[RetrieveDatapointEvaluationsDatasetsSource] = "orq"
808
808
 
809
- reviewed_at: Optional[datetime] = parse_datetime("2026-01-20T13:21:57.015Z")
809
+ reviewed_at: Optional[datetime] = parse_datetime("2026-01-27T09:10:46.903Z")
810
810
  r"""The date and time the item was reviewed"""
811
811
 
812
812
  @model_serializer(mode="wrap")
@@ -874,7 +874,7 @@ class RetrieveDatapointEvaluations1(BaseModel):
874
874
 
875
875
  source: Optional[RetrieveDatapointEvaluationsSource] = "orq"
876
876
 
877
- reviewed_at: Optional[datetime] = parse_datetime("2026-01-20T13:21:57.014Z")
877
+ reviewed_at: Optional[datetime] = parse_datetime("2026-01-27T09:10:46.902Z")
878
878
  r"""The date and time the item was reviewed"""
879
879
 
880
880
  @model_serializer(mode="wrap")
@@ -977,7 +977,7 @@ class RetrieveDatapointResponseBody(BaseModel):
977
977
  created: Optional[datetime] = None
978
978
  r"""The date and time the resource was created"""
979
979
 
980
- updated: Optional[datetime] = parse_datetime("2026-01-20T13:21:43.266Z")
980
+ updated: Optional[datetime] = parse_datetime("2026-01-27T09:10:34.517Z")
981
981
  r"""The date and time the resource was last updated"""
982
982
 
983
983
  @model_serializer(mode="wrap")