orq-ai-sdk 4.2.16__py3-none-any.whl → 4.3.0rc0__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 +1 -0
- orq_ai_sdk/_version.py +3 -3
- orq_ai_sdk/agents.py +186 -186
- orq_ai_sdk/completions.py +1 -107
- orq_ai_sdk/edits.py +1 -107
- orq_ai_sdk/embeddings.py +1 -107
- orq_ai_sdk/generations.py +1 -99
- orq_ai_sdk/models/__init__.py +0 -405
- orq_ai_sdk/models/conversationresponse.py +1 -1
- orq_ai_sdk/models/conversationwithmessagesresponse.py +1 -1
- orq_ai_sdk/models/createagentrequestop.py +0 -24
- orq_ai_sdk/models/createchatcompletionop.py +0 -6
- orq_ai_sdk/models/createcompletionop.py +30 -218
- orq_ai_sdk/models/createcontactop.py +1 -1
- 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 +26 -221
- orq_ai_sdk/models/createevalop.py +14 -14
- orq_ai_sdk/models/createidentityop.py +1 -1
- orq_ai_sdk/models/createimageeditop.py +31 -242
- orq_ai_sdk/models/createimageop.py +22 -210
- orq_ai_sdk/models/createimagevariationop.py +31 -251
- orq_ai_sdk/models/createpromptop.py +0 -12
- orq_ai_sdk/models/creatererankop.py +26 -218
- orq_ai_sdk/models/createspeechop.py +24 -174
- orq_ai_sdk/models/createtoolop.py +6 -6
- orq_ai_sdk/models/createtranscriptionop.py +10 -180
- orq_ai_sdk/models/createtranslationop.py +10 -172
- 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/getallpromptsop.py +0 -6
- orq_ai_sdk/models/getalltoolsop.py +6 -6
- orq_ai_sdk/models/getevalsop.py +14 -14
- orq_ai_sdk/models/getonepromptop.py +0 -6
- orq_ai_sdk/models/getpromptversionop.py +0 -6
- orq_ai_sdk/models/listagentsop.py +0 -12
- 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/listpromptversionsop.py +0 -6
- orq_ai_sdk/models/partdoneevent.py +1 -1
- orq_ai_sdk/models/reasoningpart.py +1 -1
- orq_ai_sdk/models/retrieveagentrequestop.py +0 -12
- 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/retrievetoolop.py +6 -6
- orq_ai_sdk/models/runagentop.py +1 -13
- orq_ai_sdk/models/streamrunagentop.py +1 -13
- orq_ai_sdk/models/updateagentop.py +0 -24
- 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/updatepromptop.py +0 -12
- orq_ai_sdk/models/updatetoolop.py +7 -7
- orq_ai_sdk/orq_completions.py +0 -6
- orq_ai_sdk/rerank.py +0 -98
- orq_ai_sdk/speech.py +1 -83
- orq_ai_sdk/transcriptions.py +0 -90
- orq_ai_sdk/translations.py +1 -87
- orq_ai_sdk/variations.py +1 -111
- {orq_ai_sdk-4.2.16.dist-info → orq_ai_sdk-4.3.0rc0.dist-info}/METADATA +202 -202
- {orq_ai_sdk-4.2.16.dist-info → orq_ai_sdk-4.3.0rc0.dist-info}/RECORD +75 -75
- {orq_ai_sdk-4.2.16.dist-info → orq_ai_sdk-4.3.0rc0.dist-info}/WHEEL +1 -1
- {orq_ai_sdk-4.2.16.dist-info → orq_ai_sdk-4.3.0rc0.dist-info}/top_level.txt +0 -0
|
@@ -104,7 +104,7 @@ class ConversationResponse(BaseModel):
|
|
|
104
104
|
r"""Unix timestamp in milliseconds when the conversation was last modified."""
|
|
105
105
|
|
|
106
106
|
id: Annotated[Optional[str], pydantic.Field(alias="_id")] = (
|
|
107
|
-
"
|
|
107
|
+
"conv_01kfs437mvfx12bee0ymfxyqjm"
|
|
108
108
|
)
|
|
109
109
|
r"""Unique conversation identifier with `conv_` prefix."""
|
|
110
110
|
|
|
@@ -110,7 +110,7 @@ class ConversationWithMessagesResponse(BaseModel):
|
|
|
110
110
|
r"""Conversation messages ordered chronologically (oldest first)."""
|
|
111
111
|
|
|
112
112
|
id: Annotated[Optional[str], pydantic.Field(alias="_id")] = (
|
|
113
|
-
"
|
|
113
|
+
"conv_01kfs437n1j2cwbwyhw2m18jzz"
|
|
114
114
|
)
|
|
115
115
|
r"""Unique conversation identifier with `conv_` prefix."""
|
|
116
116
|
|
|
@@ -511,8 +511,6 @@ class Timeout(BaseModel):
|
|
|
511
511
|
class ParametersTypedDict(TypedDict):
|
|
512
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."""
|
|
513
513
|
|
|
514
|
-
name: NotRequired[str]
|
|
515
|
-
r"""The name to display on the trace. If not specified, the default system name will be used."""
|
|
516
514
|
audio: NotRequired[Nullable[ModelConfigurationAudioTypedDict]]
|
|
517
515
|
r"""Parameters for audio output. Required when audio output is requested with modalities: [\"audio\"]. Learn more."""
|
|
518
516
|
frequency_penalty: NotRequired[Nullable[float]]
|
|
@@ -584,9 +582,6 @@ class ParametersTypedDict(TypedDict):
|
|
|
584
582
|
class Parameters(BaseModel):
|
|
585
583
|
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."""
|
|
586
584
|
|
|
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
|
-
|
|
590
585
|
audio: OptionalNullable[ModelConfigurationAudio] = UNSET
|
|
591
586
|
r"""Parameters for audio output. Required when audio output is requested with modalities: [\"audio\"]. Learn more."""
|
|
592
587
|
|
|
@@ -682,7 +677,6 @@ class Parameters(BaseModel):
|
|
|
682
677
|
def serialize_model(self, handler):
|
|
683
678
|
optional_fields = set(
|
|
684
679
|
[
|
|
685
|
-
"name",
|
|
686
680
|
"audio",
|
|
687
681
|
"frequency_penalty",
|
|
688
682
|
"max_tokens",
|
|
@@ -1354,8 +1348,6 @@ class FallbackModelConfigurationTimeout(BaseModel):
|
|
|
1354
1348
|
class FallbackModelConfigurationParametersTypedDict(TypedDict):
|
|
1355
1349
|
r"""Optional model parameters specific to this fallback model. Overrides primary model parameters if this fallback is used."""
|
|
1356
1350
|
|
|
1357
|
-
name: NotRequired[str]
|
|
1358
|
-
r"""The name to display on the trace. If not specified, the default system name will be used."""
|
|
1359
1351
|
audio: NotRequired[Nullable[FallbackModelConfigurationAudioTypedDict]]
|
|
1360
1352
|
r"""Parameters for audio output. Required when audio output is requested with modalities: [\"audio\"]. Learn more."""
|
|
1361
1353
|
frequency_penalty: NotRequired[Nullable[float]]
|
|
@@ -1427,9 +1419,6 @@ class FallbackModelConfigurationParametersTypedDict(TypedDict):
|
|
|
1427
1419
|
class FallbackModelConfigurationParameters(BaseModel):
|
|
1428
1420
|
r"""Optional model parameters specific to this fallback model. Overrides primary model parameters if this fallback is used."""
|
|
1429
1421
|
|
|
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
|
-
|
|
1433
1422
|
audio: OptionalNullable[FallbackModelConfigurationAudio] = UNSET
|
|
1434
1423
|
r"""Parameters for audio output. Required when audio output is requested with modalities: [\"audio\"]. Learn more."""
|
|
1435
1424
|
|
|
@@ -1525,7 +1514,6 @@ class FallbackModelConfigurationParameters(BaseModel):
|
|
|
1525
1514
|
def serialize_model(self, handler):
|
|
1526
1515
|
optional_fields = set(
|
|
1527
1516
|
[
|
|
1528
|
-
"name",
|
|
1529
1517
|
"audio",
|
|
1530
1518
|
"frequency_penalty",
|
|
1531
1519
|
"max_tokens",
|
|
@@ -3508,8 +3496,6 @@ class CreateAgentRequestTimeout(BaseModel):
|
|
|
3508
3496
|
class CreateAgentRequestParametersTypedDict(TypedDict):
|
|
3509
3497
|
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."""
|
|
3510
3498
|
|
|
3511
|
-
name: NotRequired[str]
|
|
3512
|
-
r"""The name to display on the trace. If not specified, the default system name will be used."""
|
|
3513
3499
|
audio: NotRequired[Nullable[CreateAgentRequestAudioTypedDict]]
|
|
3514
3500
|
r"""Parameters for audio output. Required when audio output is requested with modalities: [\"audio\"]. Learn more."""
|
|
3515
3501
|
frequency_penalty: NotRequired[Nullable[float]]
|
|
@@ -3579,9 +3565,6 @@ class CreateAgentRequestParametersTypedDict(TypedDict):
|
|
|
3579
3565
|
class CreateAgentRequestParameters(BaseModel):
|
|
3580
3566
|
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."""
|
|
3581
3567
|
|
|
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
|
-
|
|
3585
3568
|
audio: OptionalNullable[CreateAgentRequestAudio] = UNSET
|
|
3586
3569
|
r"""Parameters for audio output. Required when audio output is requested with modalities: [\"audio\"]. Learn more."""
|
|
3587
3570
|
|
|
@@ -3677,7 +3660,6 @@ class CreateAgentRequestParameters(BaseModel):
|
|
|
3677
3660
|
def serialize_model(self, handler):
|
|
3678
3661
|
optional_fields = set(
|
|
3679
3662
|
[
|
|
3680
|
-
"name",
|
|
3681
3663
|
"audio",
|
|
3682
3664
|
"frequency_penalty",
|
|
3683
3665
|
"max_tokens",
|
|
@@ -4327,8 +4309,6 @@ class CreateAgentRequestFallbackModelConfigurationTimeout(BaseModel):
|
|
|
4327
4309
|
class CreateAgentRequestFallbackModelConfigurationParametersTypedDict(TypedDict):
|
|
4328
4310
|
r"""Optional model parameters specific to this fallback model. Overrides primary model parameters if this fallback is used."""
|
|
4329
4311
|
|
|
4330
|
-
name: NotRequired[str]
|
|
4331
|
-
r"""The name to display on the trace. If not specified, the default system name will be used."""
|
|
4332
4312
|
audio: NotRequired[
|
|
4333
4313
|
Nullable[CreateAgentRequestFallbackModelConfigurationAudioTypedDict]
|
|
4334
4314
|
]
|
|
@@ -4420,9 +4400,6 @@ class CreateAgentRequestFallbackModelConfigurationParametersTypedDict(TypedDict)
|
|
|
4420
4400
|
class CreateAgentRequestFallbackModelConfigurationParameters(BaseModel):
|
|
4421
4401
|
r"""Optional model parameters specific to this fallback model. Overrides primary model parameters if this fallback is used."""
|
|
4422
4402
|
|
|
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
|
-
|
|
4426
4403
|
audio: OptionalNullable[CreateAgentRequestFallbackModelConfigurationAudio] = UNSET
|
|
4427
4404
|
r"""Parameters for audio output. Required when audio output is requested with modalities: [\"audio\"]. Learn more."""
|
|
4428
4405
|
|
|
@@ -4534,7 +4511,6 @@ class CreateAgentRequestFallbackModelConfigurationParameters(BaseModel):
|
|
|
4534
4511
|
def serialize_model(self, handler):
|
|
4535
4512
|
optional_fields = set(
|
|
4536
4513
|
[
|
|
4537
|
-
"name",
|
|
4538
4514
|
"audio",
|
|
4539
4515
|
"frequency_penalty",
|
|
4540
4516
|
"max_tokens",
|
|
@@ -2468,8 +2468,6 @@ class CreateChatCompletionRequestBodyTypedDict(TypedDict):
|
|
|
2468
2468
|
r"""Model ID used to generate the response, like `openai/gpt-4o` or `anthropic/claude-haiku-4-5-20251001`. The AI Gateway offers a wide range of models with different capabilities, performance characteristics, and price points. Refer to the (Supported models)[/docs/proxy/supported-models] to browse available models."""
|
|
2469
2469
|
metadata: NotRequired[Dict[str, str]]
|
|
2470
2470
|
r"""Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can have a maximum length of 64 characters and values can have a maximum length of 512 characters."""
|
|
2471
|
-
name: NotRequired[str]
|
|
2472
|
-
r"""The name to display on the trace. If not specified, the default system name will be used."""
|
|
2473
2471
|
audio: NotRequired[Nullable[CreateChatCompletionAudioTypedDict]]
|
|
2474
2472
|
r"""Parameters for audio output. Required when audio output is requested with modalities: [\"audio\"]. Learn more."""
|
|
2475
2473
|
frequency_penalty: NotRequired[Nullable[float]]
|
|
@@ -2551,9 +2549,6 @@ class CreateChatCompletionRequestBody(BaseModel):
|
|
|
2551
2549
|
metadata: Optional[Dict[str, str]] = None
|
|
2552
2550
|
r"""Set of 16 key-value pairs that can be attached to an object. This can be useful for storing additional information about the object in a structured format. Keys can have a maximum length of 64 characters and values can have a maximum length of 512 characters."""
|
|
2553
2551
|
|
|
2554
|
-
name: Optional[str] = None
|
|
2555
|
-
r"""The name to display on the trace. If not specified, the default system name will be used."""
|
|
2556
|
-
|
|
2557
2552
|
audio: OptionalNullable[CreateChatCompletionAudio] = UNSET
|
|
2558
2553
|
r"""Parameters for audio output. Required when audio output is requested with modalities: [\"audio\"]. Learn more."""
|
|
2559
2554
|
|
|
@@ -2663,7 +2658,6 @@ class CreateChatCompletionRequestBody(BaseModel):
|
|
|
2663
2658
|
optional_fields = set(
|
|
2664
2659
|
[
|
|
2665
2660
|
"metadata",
|
|
2666
|
-
"name",
|
|
2667
2661
|
"audio",
|
|
2668
2662
|
"frequency_penalty",
|
|
2669
2663
|
"max_tokens",
|
|
@@ -33,16 +33,6 @@ CreateCompletionStop = TypeAliasType("CreateCompletionStop", Union[str, List[str
|
|
|
33
33
|
r"""Up to 4 sequences where the API will stop generating further tokens. The returned text will not contain the stop sequence."""
|
|
34
34
|
|
|
35
35
|
|
|
36
|
-
class CreateCompletionFallbacksTypedDict(TypedDict):
|
|
37
|
-
model: str
|
|
38
|
-
r"""Fallback model identifier"""
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
class CreateCompletionFallbacks(BaseModel):
|
|
42
|
-
model: str
|
|
43
|
-
r"""Fallback model identifier"""
|
|
44
|
-
|
|
45
|
-
|
|
46
36
|
class CreateCompletionRetryTypedDict(TypedDict):
|
|
47
37
|
r"""Retry configuration for the request"""
|
|
48
38
|
|
|
@@ -78,150 +68,12 @@ class CreateCompletionRetry(BaseModel):
|
|
|
78
68
|
return m
|
|
79
69
|
|
|
80
70
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
class CreateCompletionCacheTypedDict(TypedDict):
|
|
85
|
-
r"""Cache configuration for the request."""
|
|
86
|
-
|
|
87
|
-
type: CreateCompletionType
|
|
88
|
-
ttl: NotRequired[float]
|
|
89
|
-
r"""Time to live for cached responses in seconds. Maximum 259200 seconds (3 days)."""
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
class CreateCompletionCache(BaseModel):
|
|
93
|
-
r"""Cache configuration for the request."""
|
|
94
|
-
|
|
95
|
-
type: CreateCompletionType
|
|
96
|
-
|
|
97
|
-
ttl: Optional[float] = 1800
|
|
98
|
-
r"""Time to live for cached responses in seconds. Maximum 259200 seconds (3 days)."""
|
|
99
|
-
|
|
100
|
-
@model_serializer(mode="wrap")
|
|
101
|
-
def serialize_model(self, handler):
|
|
102
|
-
optional_fields = set(["ttl"])
|
|
103
|
-
serialized = handler(self)
|
|
104
|
-
m = {}
|
|
105
|
-
|
|
106
|
-
for n, f in type(self).model_fields.items():
|
|
107
|
-
k = f.alias or n
|
|
108
|
-
val = serialized.get(k)
|
|
109
|
-
|
|
110
|
-
if val != UNSET_SENTINEL:
|
|
111
|
-
if val is not None or k not in optional_fields:
|
|
112
|
-
m[k] = val
|
|
113
|
-
|
|
114
|
-
return m
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
CreateCompletionLoadBalancerType = Literal["weight_based",]
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
class CreateCompletionLoadBalancerModelsTypedDict(TypedDict):
|
|
121
|
-
model: str
|
|
122
|
-
r"""Model identifier for load balancing"""
|
|
123
|
-
weight: NotRequired[float]
|
|
124
|
-
r"""Weight assigned to this model for load balancing"""
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
class CreateCompletionLoadBalancerModels(BaseModel):
|
|
128
|
-
model: str
|
|
129
|
-
r"""Model identifier for load balancing"""
|
|
130
|
-
|
|
131
|
-
weight: Optional[float] = 0.5
|
|
132
|
-
r"""Weight assigned to this model for load balancing"""
|
|
133
|
-
|
|
134
|
-
@model_serializer(mode="wrap")
|
|
135
|
-
def serialize_model(self, handler):
|
|
136
|
-
optional_fields = set(["weight"])
|
|
137
|
-
serialized = handler(self)
|
|
138
|
-
m = {}
|
|
139
|
-
|
|
140
|
-
for n, f in type(self).model_fields.items():
|
|
141
|
-
k = f.alias or n
|
|
142
|
-
val = serialized.get(k)
|
|
143
|
-
|
|
144
|
-
if val != UNSET_SENTINEL:
|
|
145
|
-
if val is not None or k not in optional_fields:
|
|
146
|
-
m[k] = val
|
|
147
|
-
|
|
148
|
-
return m
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
class CreateCompletionLoadBalancer1TypedDict(TypedDict):
|
|
152
|
-
type: CreateCompletionLoadBalancerType
|
|
153
|
-
models: List[CreateCompletionLoadBalancerModelsTypedDict]
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
class CreateCompletionLoadBalancer1(BaseModel):
|
|
157
|
-
type: CreateCompletionLoadBalancerType
|
|
158
|
-
|
|
159
|
-
models: List[CreateCompletionLoadBalancerModels]
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
CreateCompletionLoadBalancerTypedDict = CreateCompletionLoadBalancer1TypedDict
|
|
163
|
-
r"""Load balancer configuration for the request."""
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
CreateCompletionLoadBalancer = CreateCompletionLoadBalancer1
|
|
167
|
-
r"""Load balancer configuration for the request."""
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
class CreateCompletionTimeoutTypedDict(TypedDict):
|
|
171
|
-
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."""
|
|
172
|
-
|
|
173
|
-
call_timeout: float
|
|
174
|
-
r"""Timeout value in milliseconds"""
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
class CreateCompletionTimeout(BaseModel):
|
|
178
|
-
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."""
|
|
179
|
-
|
|
180
|
-
call_timeout: float
|
|
181
|
-
r"""Timeout value in milliseconds"""
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
class CreateCompletionRouterCompletionsRetryTypedDict(TypedDict):
|
|
185
|
-
r"""Retry configuration for the request"""
|
|
186
|
-
|
|
187
|
-
count: NotRequired[float]
|
|
188
|
-
r"""Number of retry attempts (1-5)"""
|
|
189
|
-
on_codes: NotRequired[List[float]]
|
|
190
|
-
r"""HTTP status codes that trigger retry logic"""
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
class CreateCompletionRouterCompletionsRetry(BaseModel):
|
|
194
|
-
r"""Retry configuration for the request"""
|
|
195
|
-
|
|
196
|
-
count: Optional[float] = 3
|
|
197
|
-
r"""Number of retry attempts (1-5)"""
|
|
198
|
-
|
|
199
|
-
on_codes: Optional[List[float]] = None
|
|
200
|
-
r"""HTTP status codes that trigger retry logic"""
|
|
201
|
-
|
|
202
|
-
@model_serializer(mode="wrap")
|
|
203
|
-
def serialize_model(self, handler):
|
|
204
|
-
optional_fields = set(["count", "on_codes"])
|
|
205
|
-
serialized = handler(self)
|
|
206
|
-
m = {}
|
|
207
|
-
|
|
208
|
-
for n, f in type(self).model_fields.items():
|
|
209
|
-
k = f.alias or n
|
|
210
|
-
val = serialized.get(k)
|
|
211
|
-
|
|
212
|
-
if val != UNSET_SENTINEL:
|
|
213
|
-
if val is not None or k not in optional_fields:
|
|
214
|
-
m[k] = val
|
|
215
|
-
|
|
216
|
-
return m
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
class CreateCompletionRouterCompletionsFallbacksTypedDict(TypedDict):
|
|
71
|
+
class CreateCompletionFallbacksTypedDict(TypedDict):
|
|
220
72
|
model: str
|
|
221
73
|
r"""Fallback model identifier"""
|
|
222
74
|
|
|
223
75
|
|
|
224
|
-
class
|
|
76
|
+
class CreateCompletionFallbacks(BaseModel):
|
|
225
77
|
model: str
|
|
226
78
|
r"""Fallback model identifier"""
|
|
227
79
|
|
|
@@ -327,21 +179,21 @@ CreateCompletionInputs = TypeAliasType(
|
|
|
327
179
|
r"""Values to replace in the prompt messages using {{variableName}} syntax"""
|
|
328
180
|
|
|
329
181
|
|
|
330
|
-
|
|
182
|
+
CreateCompletionType = Literal["exact_match",]
|
|
331
183
|
|
|
332
184
|
|
|
333
|
-
class
|
|
185
|
+
class CreateCompletionCacheTypedDict(TypedDict):
|
|
334
186
|
r"""Cache configuration for the request."""
|
|
335
187
|
|
|
336
|
-
type:
|
|
188
|
+
type: CreateCompletionType
|
|
337
189
|
ttl: NotRequired[float]
|
|
338
190
|
r"""Time to live for cached responses in seconds. Maximum 259200 seconds (3 days)."""
|
|
339
191
|
|
|
340
192
|
|
|
341
|
-
class
|
|
193
|
+
class CreateCompletionCache(BaseModel):
|
|
342
194
|
r"""Cache configuration for the request."""
|
|
343
195
|
|
|
344
|
-
type:
|
|
196
|
+
type: CreateCompletionType
|
|
345
197
|
|
|
346
198
|
ttl: Optional[float] = 1800
|
|
347
199
|
r"""Time to live for cached responses in seconds. Maximum 259200 seconds (3 days)."""
|
|
@@ -1140,17 +992,17 @@ class CreateCompletionKnowledgeBases(BaseModel):
|
|
|
1140
992
|
return m
|
|
1141
993
|
|
|
1142
994
|
|
|
1143
|
-
|
|
995
|
+
CreateCompletionLoadBalancerType = Literal["weight_based",]
|
|
1144
996
|
|
|
1145
997
|
|
|
1146
|
-
class
|
|
998
|
+
class CreateCompletionLoadBalancerModelsTypedDict(TypedDict):
|
|
1147
999
|
model: str
|
|
1148
1000
|
r"""Model identifier for load balancing"""
|
|
1149
1001
|
weight: NotRequired[float]
|
|
1150
1002
|
r"""Weight assigned to this model for load balancing"""
|
|
1151
1003
|
|
|
1152
1004
|
|
|
1153
|
-
class
|
|
1005
|
+
class CreateCompletionLoadBalancerModels(BaseModel):
|
|
1154
1006
|
model: str
|
|
1155
1007
|
r"""Model identifier for load balancing"""
|
|
1156
1008
|
|
|
@@ -1174,37 +1026,33 @@ class CreateCompletionLoadBalancerRouterCompletionsModels(BaseModel):
|
|
|
1174
1026
|
return m
|
|
1175
1027
|
|
|
1176
1028
|
|
|
1177
|
-
class
|
|
1178
|
-
type:
|
|
1179
|
-
models: List[
|
|
1029
|
+
class CreateCompletionLoadBalancer1TypedDict(TypedDict):
|
|
1030
|
+
type: CreateCompletionLoadBalancerType
|
|
1031
|
+
models: List[CreateCompletionLoadBalancerModelsTypedDict]
|
|
1180
1032
|
|
|
1181
1033
|
|
|
1182
|
-
class
|
|
1183
|
-
type:
|
|
1034
|
+
class CreateCompletionLoadBalancer1(BaseModel):
|
|
1035
|
+
type: CreateCompletionLoadBalancerType
|
|
1184
1036
|
|
|
1185
|
-
models: List[
|
|
1037
|
+
models: List[CreateCompletionLoadBalancerModels]
|
|
1186
1038
|
|
|
1187
1039
|
|
|
1188
|
-
|
|
1189
|
-
CreateCompletionLoadBalancerRouterCompletions1TypedDict
|
|
1190
|
-
)
|
|
1040
|
+
CreateCompletionLoadBalancerTypedDict = CreateCompletionLoadBalancer1TypedDict
|
|
1191
1041
|
r"""Array of models with weights for load balancing requests"""
|
|
1192
1042
|
|
|
1193
1043
|
|
|
1194
|
-
|
|
1195
|
-
CreateCompletionLoadBalancerRouterCompletions1
|
|
1196
|
-
)
|
|
1044
|
+
CreateCompletionLoadBalancer = CreateCompletionLoadBalancer1
|
|
1197
1045
|
r"""Array of models with weights for load balancing requests"""
|
|
1198
1046
|
|
|
1199
1047
|
|
|
1200
|
-
class
|
|
1048
|
+
class CreateCompletionTimeoutTypedDict(TypedDict):
|
|
1201
1049
|
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."""
|
|
1202
1050
|
|
|
1203
1051
|
call_timeout: float
|
|
1204
1052
|
r"""Timeout value in milliseconds"""
|
|
1205
1053
|
|
|
1206
1054
|
|
|
1207
|
-
class
|
|
1055
|
+
class CreateCompletionTimeout(BaseModel):
|
|
1208
1056
|
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."""
|
|
1209
1057
|
|
|
1210
1058
|
call_timeout: float
|
|
@@ -1219,9 +1067,9 @@ class CreateCompletionOrqTypedDict(TypedDict):
|
|
|
1219
1067
|
|
|
1220
1068
|
name: NotRequired[str]
|
|
1221
1069
|
r"""The name to display on the trace. If not specified, the default system name will be used."""
|
|
1222
|
-
retry: NotRequired[
|
|
1070
|
+
retry: NotRequired[CreateCompletionRetryTypedDict]
|
|
1223
1071
|
r"""Retry configuration for the request"""
|
|
1224
|
-
fallbacks: NotRequired[List[
|
|
1072
|
+
fallbacks: NotRequired[List[CreateCompletionFallbacksTypedDict]]
|
|
1225
1073
|
r"""Array of fallback models to use if primary model fails"""
|
|
1226
1074
|
prompt: NotRequired[CreateCompletionPromptTypedDict]
|
|
1227
1075
|
r"""Prompt configuration for the request"""
|
|
@@ -1233,12 +1081,12 @@ class CreateCompletionOrqTypedDict(TypedDict):
|
|
|
1233
1081
|
r"""Thread information to group related requests"""
|
|
1234
1082
|
inputs: NotRequired[CreateCompletionInputsTypedDict]
|
|
1235
1083
|
r"""Values to replace in the prompt messages using {{variableName}} syntax"""
|
|
1236
|
-
cache: NotRequired[
|
|
1084
|
+
cache: NotRequired[CreateCompletionCacheTypedDict]
|
|
1237
1085
|
r"""Cache configuration for the request."""
|
|
1238
1086
|
knowledge_bases: NotRequired[List[CreateCompletionKnowledgeBasesTypedDict]]
|
|
1239
|
-
load_balancer: NotRequired[
|
|
1087
|
+
load_balancer: NotRequired[CreateCompletionLoadBalancerTypedDict]
|
|
1240
1088
|
r"""Array of models with weights for load balancing requests"""
|
|
1241
|
-
timeout: NotRequired[
|
|
1089
|
+
timeout: NotRequired[CreateCompletionTimeoutTypedDict]
|
|
1242
1090
|
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."""
|
|
1243
1091
|
|
|
1244
1092
|
|
|
@@ -1251,10 +1099,10 @@ class CreateCompletionOrq(BaseModel):
|
|
|
1251
1099
|
name: Optional[str] = None
|
|
1252
1100
|
r"""The name to display on the trace. If not specified, the default system name will be used."""
|
|
1253
1101
|
|
|
1254
|
-
retry: Optional[
|
|
1102
|
+
retry: Optional[CreateCompletionRetry] = None
|
|
1255
1103
|
r"""Retry configuration for the request"""
|
|
1256
1104
|
|
|
1257
|
-
fallbacks: Optional[List[
|
|
1105
|
+
fallbacks: Optional[List[CreateCompletionFallbacks]] = None
|
|
1258
1106
|
r"""Array of fallback models to use if primary model fails"""
|
|
1259
1107
|
|
|
1260
1108
|
prompt: Optional[CreateCompletionPrompt] = None
|
|
@@ -1277,15 +1125,15 @@ class CreateCompletionOrq(BaseModel):
|
|
|
1277
1125
|
inputs: Optional[CreateCompletionInputs] = None
|
|
1278
1126
|
r"""Values to replace in the prompt messages using {{variableName}} syntax"""
|
|
1279
1127
|
|
|
1280
|
-
cache: Optional[
|
|
1128
|
+
cache: Optional[CreateCompletionCache] = None
|
|
1281
1129
|
r"""Cache configuration for the request."""
|
|
1282
1130
|
|
|
1283
1131
|
knowledge_bases: Optional[List[CreateCompletionKnowledgeBases]] = None
|
|
1284
1132
|
|
|
1285
|
-
load_balancer: Optional[
|
|
1133
|
+
load_balancer: Optional[CreateCompletionLoadBalancer] = None
|
|
1286
1134
|
r"""Array of models with weights for load balancing requests"""
|
|
1287
1135
|
|
|
1288
|
-
timeout: Optional[
|
|
1136
|
+
timeout: Optional[CreateCompletionTimeout] = None
|
|
1289
1137
|
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."""
|
|
1290
1138
|
|
|
1291
1139
|
@model_serializer(mode="wrap")
|
|
@@ -1345,18 +1193,6 @@ class CreateCompletionRequestBodyTypedDict(TypedDict):
|
|
|
1345
1193
|
r"""How many completions to generate for each prompt. Note: Because this parameter generates many completions, it can quickly consume your token quota."""
|
|
1346
1194
|
user: NotRequired[str]
|
|
1347
1195
|
r"""A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse."""
|
|
1348
|
-
name: NotRequired[str]
|
|
1349
|
-
r"""The name to display on the trace. If not specified, the default system name will be used."""
|
|
1350
|
-
fallbacks: NotRequired[List[CreateCompletionFallbacksTypedDict]]
|
|
1351
|
-
r"""Array of fallback models to use if primary model fails"""
|
|
1352
|
-
retry: NotRequired[CreateCompletionRetryTypedDict]
|
|
1353
|
-
r"""Retry configuration for the request"""
|
|
1354
|
-
cache: NotRequired[CreateCompletionCacheTypedDict]
|
|
1355
|
-
r"""Cache configuration for the request."""
|
|
1356
|
-
load_balancer: NotRequired[CreateCompletionLoadBalancerTypedDict]
|
|
1357
|
-
r"""Load balancer configuration for the request."""
|
|
1358
|
-
timeout: NotRequired[CreateCompletionTimeoutTypedDict]
|
|
1359
|
-
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."""
|
|
1360
1196
|
orq: NotRequired[CreateCompletionOrqTypedDict]
|
|
1361
1197
|
r"""Leverage Orq's intelligent routing capabilities to enhance your AI application with enterprise-grade reliability and observability. Orq provides automatic request management including retries on failures, model fallbacks for high availability, identity-level analytics tracking, conversation threading, and dynamic prompt templating with variable substitution."""
|
|
1362
1198
|
stream: NotRequired[bool]
|
|
@@ -1399,24 +1235,6 @@ class CreateCompletionRequestBody(BaseModel):
|
|
|
1399
1235
|
user: Optional[str] = None
|
|
1400
1236
|
r"""A unique identifier representing your end-user, which can help OpenAI to monitor and detect abuse."""
|
|
1401
1237
|
|
|
1402
|
-
name: Optional[str] = None
|
|
1403
|
-
r"""The name to display on the trace. If not specified, the default system name will be used."""
|
|
1404
|
-
|
|
1405
|
-
fallbacks: Optional[List[CreateCompletionFallbacks]] = None
|
|
1406
|
-
r"""Array of fallback models to use if primary model fails"""
|
|
1407
|
-
|
|
1408
|
-
retry: Optional[CreateCompletionRetry] = None
|
|
1409
|
-
r"""Retry configuration for the request"""
|
|
1410
|
-
|
|
1411
|
-
cache: Optional[CreateCompletionCache] = None
|
|
1412
|
-
r"""Cache configuration for the request."""
|
|
1413
|
-
|
|
1414
|
-
load_balancer: Optional[CreateCompletionLoadBalancer] = None
|
|
1415
|
-
r"""Load balancer configuration for the request."""
|
|
1416
|
-
|
|
1417
|
-
timeout: Optional[CreateCompletionTimeout] = None
|
|
1418
|
-
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."""
|
|
1419
|
-
|
|
1420
1238
|
orq: Annotated[
|
|
1421
1239
|
Optional[CreateCompletionOrq],
|
|
1422
1240
|
pydantic.Field(
|
|
@@ -1441,12 +1259,6 @@ class CreateCompletionRequestBody(BaseModel):
|
|
|
1441
1259
|
"top_p",
|
|
1442
1260
|
"n",
|
|
1443
1261
|
"user",
|
|
1444
|
-
"name",
|
|
1445
|
-
"fallbacks",
|
|
1446
|
-
"retry",
|
|
1447
|
-
"cache",
|
|
1448
|
-
"load_balancer",
|
|
1449
|
-
"timeout",
|
|
1450
1262
|
"orq",
|
|
1451
1263
|
"stream",
|
|
1452
1264
|
]
|
|
@@ -132,7 +132,7 @@ class CreateContactResponseBody(BaseModel):
|
|
|
132
132
|
created: Optional[datetime] = None
|
|
133
133
|
r"""The date and time the resource was created"""
|
|
134
134
|
|
|
135
|
-
updated: Optional[datetime] = parse_datetime("2026-01-
|
|
135
|
+
updated: Optional[datetime] = parse_datetime("2026-01-24T23:05:31.950Z")
|
|
136
136
|
r"""The date and time the resource was last updated"""
|
|
137
137
|
|
|
138
138
|
@model_serializer(mode="wrap")
|
|
@@ -199,7 +199,7 @@ class CreateConversationResponseBody(BaseModel):
|
|
|
199
199
|
r"""Unix timestamp in milliseconds when the conversation was last modified."""
|
|
200
200
|
|
|
201
201
|
id: Annotated[Optional[str], pydantic.Field(alias="_id")] = (
|
|
202
|
-
"
|
|
202
|
+
"conv_01kfs437mxp90m71kew8afgfxa"
|
|
203
203
|
)
|
|
204
204
|
r"""Unique conversation identifier with `conv_` prefix."""
|
|
205
205
|
|
|
@@ -119,7 +119,7 @@ class CreateConversationResponsePartReasoningPart(BaseModel):
|
|
|
119
119
|
r"""The reasoning or thought process behind the response. Used for chain-of-thought or extended thinking."""
|
|
120
120
|
|
|
121
121
|
id: Annotated[Optional[str], pydantic.Field(alias="_id")] = (
|
|
122
|
-
"
|
|
122
|
+
"reasoning_01kfs437ny1beb7z37ay2cvvmw"
|
|
123
123
|
)
|
|
124
124
|
r"""Unique identifier for the part. Format: reasoning_{ulid} (e.g., reasoning_01hxyz...)"""
|
|
125
125
|
|
|
@@ -211,7 +211,7 @@ class DeltaReasoningPart(BaseModel):
|
|
|
211
211
|
r"""The reasoning or thought process behind the response. Used for chain-of-thought or extended thinking."""
|
|
212
212
|
|
|
213
213
|
id: Annotated[Optional[str], pydantic.Field(alias="_id")] = (
|
|
214
|
-
"
|
|
214
|
+
"reasoning_01kfs437nqnx4pmh4pz6494mp4"
|
|
215
215
|
)
|
|
216
216
|
r"""Unique identifier for the part. Format: reasoning_{ulid} (e.g., reasoning_01hxyz...)"""
|
|
217
217
|
|
|
@@ -1434,7 +1434,7 @@ class Evaluations3(BaseModel):
|
|
|
1434
1434
|
|
|
1435
1435
|
source: Optional[CreateDatasetItemEvaluationsDatasetsSource] = "orq"
|
|
1436
1436
|
|
|
1437
|
-
reviewed_at: Optional[datetime] = parse_datetime("2026-01-
|
|
1437
|
+
reviewed_at: Optional[datetime] = parse_datetime("2026-01-24T23:05:46.027Z")
|
|
1438
1438
|
r"""The date and time the item was reviewed"""
|
|
1439
1439
|
|
|
1440
1440
|
@model_serializer(mode="wrap")
|
|
@@ -1502,7 +1502,7 @@ class Evaluations2(BaseModel):
|
|
|
1502
1502
|
|
|
1503
1503
|
source: Optional[CreateDatasetItemEvaluationsSource] = "orq"
|
|
1504
1504
|
|
|
1505
|
-
reviewed_at: Optional[datetime] = parse_datetime("2026-01-
|
|
1505
|
+
reviewed_at: Optional[datetime] = parse_datetime("2026-01-24T23:05:46.026Z")
|
|
1506
1506
|
r"""The date and time the item was reviewed"""
|
|
1507
1507
|
|
|
1508
1508
|
@model_serializer(mode="wrap")
|
|
@@ -1570,7 +1570,7 @@ class Evaluations1(BaseModel):
|
|
|
1570
1570
|
|
|
1571
1571
|
source: Optional[EvaluationsSource] = "orq"
|
|
1572
1572
|
|
|
1573
|
-
reviewed_at: Optional[datetime] = parse_datetime("2026-01-
|
|
1573
|
+
reviewed_at: Optional[datetime] = parse_datetime("2026-01-24T23:05:46.025Z")
|
|
1574
1574
|
r"""The date and time the item was reviewed"""
|
|
1575
1575
|
|
|
1576
1576
|
@model_serializer(mode="wrap")
|
|
@@ -1665,7 +1665,7 @@ class CreateDatasetItemResponseBody(BaseModel):
|
|
|
1665
1665
|
created: Optional[datetime] = None
|
|
1666
1666
|
r"""The date and time the resource was created"""
|
|
1667
1667
|
|
|
1668
|
-
updated: Optional[datetime] = parse_datetime("2026-01-
|
|
1668
|
+
updated: Optional[datetime] = parse_datetime("2026-01-24T23:05:31.950Z")
|
|
1669
1669
|
r"""The date and time the resource was last updated"""
|
|
1670
1670
|
|
|
1671
1671
|
@model_serializer(mode="wrap")
|
|
@@ -94,7 +94,7 @@ class CreateDatasetResponseBody(BaseModel):
|
|
|
94
94
|
created: Optional[datetime] = None
|
|
95
95
|
r"""The date and time the resource was created"""
|
|
96
96
|
|
|
97
|
-
updated: Optional[datetime] = parse_datetime("2026-01-
|
|
97
|
+
updated: Optional[datetime] = parse_datetime("2026-01-24T23:05:31.950Z")
|
|
98
98
|
r"""The date and time the resource was last updated"""
|
|
99
99
|
|
|
100
100
|
@model_serializer(mode="wrap")
|
|
@@ -314,7 +314,7 @@ class CreateDatasourceResponseBody(BaseModel):
|
|
|
314
314
|
r"""The number of chunks in the datasource"""
|
|
315
315
|
|
|
316
316
|
id: Annotated[Optional[str], pydantic.Field(alias="_id")] = (
|
|
317
|
-
"
|
|
317
|
+
"01KFS4386722EFCV3B6AA7SVSD"
|
|
318
318
|
)
|
|
319
319
|
r"""The unique identifier of the data source"""
|
|
320
320
|
|