orq-ai-sdk 4.2.8__py3-none-any.whl → 4.2.10__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/_version.py +2 -2
- orq_ai_sdk/completions.py +107 -1
- orq_ai_sdk/edits.py +107 -1
- orq_ai_sdk/embeddings.py +107 -1
- orq_ai_sdk/generations.py +99 -1
- orq_ai_sdk/models/__init__.py +405 -0
- orq_ai_sdk/models/conversationresponse.py +1 -1
- orq_ai_sdk/models/conversationwithmessagesresponse.py +1 -1
- orq_ai_sdk/models/createagentrequestop.py +24 -0
- orq_ai_sdk/models/createchatcompletionop.py +6 -0
- orq_ai_sdk/models/createcompletionop.py +218 -30
- 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 +221 -26
- orq_ai_sdk/models/createevalop.py +14 -14
- orq_ai_sdk/models/createidentityop.py +1 -1
- orq_ai_sdk/models/createimageeditop.py +242 -31
- orq_ai_sdk/models/createimageop.py +210 -22
- orq_ai_sdk/models/createimagevariationop.py +251 -31
- orq_ai_sdk/models/createpromptop.py +12 -0
- orq_ai_sdk/models/creatererankop.py +218 -26
- orq_ai_sdk/models/createspeechop.py +174 -24
- orq_ai_sdk/models/createtoolop.py +6 -6
- orq_ai_sdk/models/createtranscriptionop.py +180 -10
- orq_ai_sdk/models/createtranslationop.py +172 -10
- 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 +6 -0
- orq_ai_sdk/models/getalltoolsop.py +6 -6
- orq_ai_sdk/models/getevalsop.py +14 -14
- orq_ai_sdk/models/getonepromptop.py +6 -0
- orq_ai_sdk/models/getpromptversionop.py +6 -0
- orq_ai_sdk/models/listagentsop.py +12 -0
- orq_ai_sdk/models/listdatasetdatapointsop.py +4 -4
- orq_ai_sdk/models/listdatasetsop.py +1 -1
- orq_ai_sdk/models/listdatasourcesop.py +1 -1
- orq_ai_sdk/models/listidentitiesop.py +1 -1
- orq_ai_sdk/models/listpromptversionsop.py +6 -0
- orq_ai_sdk/models/partdoneevent.py +1 -1
- orq_ai_sdk/models/reasoningpart.py +1 -1
- orq_ai_sdk/models/retrieveagentrequestop.py +12 -0
- orq_ai_sdk/models/retrievedatapointop.py +4 -4
- orq_ai_sdk/models/retrievedatasetop.py +1 -1
- orq_ai_sdk/models/retrievedatasourceop.py +1 -1
- orq_ai_sdk/models/retrieveidentityop.py +1 -1
- orq_ai_sdk/models/retrievetoolop.py +6 -6
- orq_ai_sdk/models/runagentop.py +13 -1
- orq_ai_sdk/models/streamrunagentop.py +13 -1
- orq_ai_sdk/models/updateagentop.py +24 -0
- 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 +12 -0
- orq_ai_sdk/models/updatetoolop.py +7 -7
- orq_ai_sdk/orq_completions.py +6 -0
- orq_ai_sdk/rerank.py +98 -0
- orq_ai_sdk/speech.py +83 -1
- orq_ai_sdk/transcriptions.py +90 -0
- orq_ai_sdk/translations.py +87 -1
- orq_ai_sdk/variations.py +111 -1
- {orq_ai_sdk-4.2.8.dist-info → orq_ai_sdk-4.2.10.dist-info}/METADATA +1 -1
- {orq_ai_sdk-4.2.8.dist-info → orq_ai_sdk-4.2.10.dist-info}/RECORD +73 -73
- {orq_ai_sdk-4.2.8.dist-info → orq_ai_sdk-4.2.10.dist-info}/WHEEL +1 -1
- {orq_ai_sdk-4.2.8.dist-info → orq_ai_sdk-4.2.10.dist-info}/top_level.txt +0 -0
|
@@ -64,6 +64,16 @@ Style = Literal[
|
|
|
64
64
|
r"""The style of the generated images. This parameter is only supported for `openai/dall-e-3`. Must be one of `vivid` or `natural`."""
|
|
65
65
|
|
|
66
66
|
|
|
67
|
+
class CreateImageFallbacksTypedDict(TypedDict):
|
|
68
|
+
model: str
|
|
69
|
+
r"""Fallback model identifier"""
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
class CreateImageFallbacks(BaseModel):
|
|
73
|
+
model: str
|
|
74
|
+
r"""Fallback model identifier"""
|
|
75
|
+
|
|
76
|
+
|
|
67
77
|
class CreateImageRetryTypedDict(TypedDict):
|
|
68
78
|
r"""Retry configuration for the request"""
|
|
69
79
|
|
|
@@ -99,16 +109,6 @@ class CreateImageRetry(BaseModel):
|
|
|
99
109
|
return m
|
|
100
110
|
|
|
101
111
|
|
|
102
|
-
class CreateImageFallbacksTypedDict(TypedDict):
|
|
103
|
-
model: str
|
|
104
|
-
r"""Fallback model identifier"""
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
class CreateImageFallbacks(BaseModel):
|
|
108
|
-
model: str
|
|
109
|
-
r"""Fallback model identifier"""
|
|
110
|
-
|
|
111
|
-
|
|
112
112
|
CreateImageType = Literal["exact_match",]
|
|
113
113
|
|
|
114
114
|
|
|
@@ -190,12 +190,54 @@ class CreateImageLoadBalancer1(BaseModel):
|
|
|
190
190
|
models: List[CreateImageLoadBalancerModels]
|
|
191
191
|
|
|
192
192
|
|
|
193
|
+
class CreateImageLoadBalancerRouterImagesGenerationsModelsTypedDict(TypedDict):
|
|
194
|
+
model: str
|
|
195
|
+
r"""Model identifier for load balancing"""
|
|
196
|
+
weight: NotRequired[float]
|
|
197
|
+
r"""Weight assigned to this model for load balancing"""
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
class CreateImageLoadBalancerRouterImagesGenerationsModels(BaseModel):
|
|
201
|
+
model: str
|
|
202
|
+
r"""Model identifier for load balancing"""
|
|
203
|
+
|
|
204
|
+
weight: Optional[float] = 0.5
|
|
205
|
+
r"""Weight assigned to this model for load balancing"""
|
|
206
|
+
|
|
207
|
+
@model_serializer(mode="wrap")
|
|
208
|
+
def serialize_model(self, handler):
|
|
209
|
+
optional_fields = set(["weight"])
|
|
210
|
+
serialized = handler(self)
|
|
211
|
+
m = {}
|
|
212
|
+
|
|
213
|
+
for n, f in type(self).model_fields.items():
|
|
214
|
+
k = f.alias or n
|
|
215
|
+
val = serialized.get(k)
|
|
216
|
+
|
|
217
|
+
if val != UNSET_SENTINEL:
|
|
218
|
+
if val is not None or k not in optional_fields:
|
|
219
|
+
m[k] = val
|
|
220
|
+
|
|
221
|
+
return m
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
class CreateImageLoadBalancerRouterImagesGenerations1TypedDict(TypedDict):
|
|
225
|
+
type: CreateImageLoadBalancerRouterImagesGenerationsType
|
|
226
|
+
models: List[CreateImageLoadBalancerRouterImagesGenerationsModelsTypedDict]
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
class CreateImageLoadBalancerRouterImagesGenerations1(BaseModel):
|
|
230
|
+
type: CreateImageLoadBalancerRouterImagesGenerationsType
|
|
231
|
+
|
|
232
|
+
models: List[CreateImageLoadBalancerRouterImagesGenerationsModels]
|
|
233
|
+
|
|
234
|
+
|
|
193
235
|
CreateImageLoadBalancerTypedDict = CreateImageLoadBalancer1TypedDict
|
|
194
|
-
r"""
|
|
236
|
+
r"""Load balancer configuration for the request."""
|
|
195
237
|
|
|
196
238
|
|
|
197
239
|
CreateImageLoadBalancer = CreateImageLoadBalancer1
|
|
198
|
-
r"""
|
|
240
|
+
r"""Load balancer configuration for the request."""
|
|
199
241
|
|
|
200
242
|
|
|
201
243
|
class CreateImageTimeoutTypedDict(TypedDict):
|
|
@@ -212,22 +254,132 @@ class CreateImageTimeout(BaseModel):
|
|
|
212
254
|
r"""Timeout value in milliseconds"""
|
|
213
255
|
|
|
214
256
|
|
|
257
|
+
class CreateImageRouterImagesGenerationsRetryTypedDict(TypedDict):
|
|
258
|
+
r"""Retry configuration for the request"""
|
|
259
|
+
|
|
260
|
+
count: NotRequired[float]
|
|
261
|
+
r"""Number of retry attempts (1-5)"""
|
|
262
|
+
on_codes: NotRequired[List[float]]
|
|
263
|
+
r"""HTTP status codes that trigger retry logic"""
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
class CreateImageRouterImagesGenerationsRetry(BaseModel):
|
|
267
|
+
r"""Retry configuration for the request"""
|
|
268
|
+
|
|
269
|
+
count: Optional[float] = 3
|
|
270
|
+
r"""Number of retry attempts (1-5)"""
|
|
271
|
+
|
|
272
|
+
on_codes: Optional[List[float]] = None
|
|
273
|
+
r"""HTTP status codes that trigger retry logic"""
|
|
274
|
+
|
|
275
|
+
@model_serializer(mode="wrap")
|
|
276
|
+
def serialize_model(self, handler):
|
|
277
|
+
optional_fields = set(["count", "on_codes"])
|
|
278
|
+
serialized = handler(self)
|
|
279
|
+
m = {}
|
|
280
|
+
|
|
281
|
+
for n, f in type(self).model_fields.items():
|
|
282
|
+
k = f.alias or n
|
|
283
|
+
val = serialized.get(k)
|
|
284
|
+
|
|
285
|
+
if val != UNSET_SENTINEL:
|
|
286
|
+
if val is not None or k not in optional_fields:
|
|
287
|
+
m[k] = val
|
|
288
|
+
|
|
289
|
+
return m
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
class CreateImageRouterImagesGenerationsFallbacksTypedDict(TypedDict):
|
|
293
|
+
model: str
|
|
294
|
+
r"""Fallback model identifier"""
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
class CreateImageRouterImagesGenerationsFallbacks(BaseModel):
|
|
298
|
+
model: str
|
|
299
|
+
r"""Fallback model identifier"""
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
CreateImageRouterImagesGenerationsType = Literal["exact_match",]
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
class CreateImageRouterImagesGenerationsCacheTypedDict(TypedDict):
|
|
306
|
+
r"""Cache configuration for the request."""
|
|
307
|
+
|
|
308
|
+
type: CreateImageRouterImagesGenerationsType
|
|
309
|
+
ttl: NotRequired[float]
|
|
310
|
+
r"""Time to live for cached responses in seconds. Maximum 259200 seconds (3 days)."""
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
class CreateImageRouterImagesGenerationsCache(BaseModel):
|
|
314
|
+
r"""Cache configuration for the request."""
|
|
315
|
+
|
|
316
|
+
type: CreateImageRouterImagesGenerationsType
|
|
317
|
+
|
|
318
|
+
ttl: Optional[float] = 1800
|
|
319
|
+
r"""Time to live for cached responses in seconds. Maximum 259200 seconds (3 days)."""
|
|
320
|
+
|
|
321
|
+
@model_serializer(mode="wrap")
|
|
322
|
+
def serialize_model(self, handler):
|
|
323
|
+
optional_fields = set(["ttl"])
|
|
324
|
+
serialized = handler(self)
|
|
325
|
+
m = {}
|
|
326
|
+
|
|
327
|
+
for n, f in type(self).model_fields.items():
|
|
328
|
+
k = f.alias or n
|
|
329
|
+
val = serialized.get(k)
|
|
330
|
+
|
|
331
|
+
if val != UNSET_SENTINEL:
|
|
332
|
+
if val is not None or k not in optional_fields:
|
|
333
|
+
m[k] = val
|
|
334
|
+
|
|
335
|
+
return m
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
CreateImageLoadBalancerRouterImagesGenerationsType = Literal["weight_based",]
|
|
339
|
+
|
|
340
|
+
|
|
341
|
+
CreateImageRouterImagesGenerationsLoadBalancerTypedDict = (
|
|
342
|
+
CreateImageLoadBalancerRouterImagesGenerations1TypedDict
|
|
343
|
+
)
|
|
344
|
+
r"""Array of models with weights for load balancing requests"""
|
|
345
|
+
|
|
346
|
+
|
|
347
|
+
CreateImageRouterImagesGenerationsLoadBalancer = (
|
|
348
|
+
CreateImageLoadBalancerRouterImagesGenerations1
|
|
349
|
+
)
|
|
350
|
+
r"""Array of models with weights for load balancing requests"""
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
class CreateImageRouterImagesGenerationsTimeoutTypedDict(TypedDict):
|
|
354
|
+
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."""
|
|
355
|
+
|
|
356
|
+
call_timeout: float
|
|
357
|
+
r"""Timeout value in milliseconds"""
|
|
358
|
+
|
|
359
|
+
|
|
360
|
+
class CreateImageRouterImagesGenerationsTimeout(BaseModel):
|
|
361
|
+
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."""
|
|
362
|
+
|
|
363
|
+
call_timeout: float
|
|
364
|
+
r"""Timeout value in milliseconds"""
|
|
365
|
+
|
|
366
|
+
|
|
215
367
|
class CreateImageOrqTypedDict(TypedDict):
|
|
216
368
|
name: NotRequired[str]
|
|
217
369
|
r"""The name to display on the trace. If not specified, the default system name will be used."""
|
|
218
|
-
retry: NotRequired[
|
|
370
|
+
retry: NotRequired[CreateImageRouterImagesGenerationsRetryTypedDict]
|
|
219
371
|
r"""Retry configuration for the request"""
|
|
220
|
-
fallbacks: NotRequired[List[
|
|
372
|
+
fallbacks: NotRequired[List[CreateImageRouterImagesGenerationsFallbacksTypedDict]]
|
|
221
373
|
r"""Array of fallback models to use if primary model fails"""
|
|
222
374
|
identity: NotRequired[PublicIdentityTypedDict]
|
|
223
375
|
r"""Information about the identity making the request. If the identity does not exist, it will be created automatically."""
|
|
224
376
|
contact: NotRequired[PublicContactTypedDict]
|
|
225
377
|
r"""@deprecated Use identity instead. Information about the contact making the request."""
|
|
226
|
-
cache: NotRequired[
|
|
378
|
+
cache: NotRequired[CreateImageRouterImagesGenerationsCacheTypedDict]
|
|
227
379
|
r"""Cache configuration for the request."""
|
|
228
|
-
load_balancer: NotRequired[
|
|
380
|
+
load_balancer: NotRequired[CreateImageRouterImagesGenerationsLoadBalancerTypedDict]
|
|
229
381
|
r"""Array of models with weights for load balancing requests"""
|
|
230
|
-
timeout: NotRequired[
|
|
382
|
+
timeout: NotRequired[CreateImageRouterImagesGenerationsTimeoutTypedDict]
|
|
231
383
|
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."""
|
|
232
384
|
|
|
233
385
|
|
|
@@ -235,10 +387,10 @@ class CreateImageOrq(BaseModel):
|
|
|
235
387
|
name: Optional[str] = None
|
|
236
388
|
r"""The name to display on the trace. If not specified, the default system name will be used."""
|
|
237
389
|
|
|
238
|
-
retry: Optional[
|
|
390
|
+
retry: Optional[CreateImageRouterImagesGenerationsRetry] = None
|
|
239
391
|
r"""Retry configuration for the request"""
|
|
240
392
|
|
|
241
|
-
fallbacks: Optional[List[
|
|
393
|
+
fallbacks: Optional[List[CreateImageRouterImagesGenerationsFallbacks]] = None
|
|
242
394
|
r"""Array of fallback models to use if primary model fails"""
|
|
243
395
|
|
|
244
396
|
identity: Optional[PublicIdentity] = None
|
|
@@ -252,13 +404,13 @@ class CreateImageOrq(BaseModel):
|
|
|
252
404
|
] = None
|
|
253
405
|
r"""@deprecated Use identity instead. Information about the contact making the request."""
|
|
254
406
|
|
|
255
|
-
cache: Optional[
|
|
407
|
+
cache: Optional[CreateImageRouterImagesGenerationsCache] = None
|
|
256
408
|
r"""Cache configuration for the request."""
|
|
257
409
|
|
|
258
|
-
load_balancer: Optional[
|
|
410
|
+
load_balancer: Optional[CreateImageRouterImagesGenerationsLoadBalancer] = None
|
|
259
411
|
r"""Array of models with weights for load balancing requests"""
|
|
260
412
|
|
|
261
|
-
timeout: Optional[
|
|
413
|
+
timeout: Optional[CreateImageRouterImagesGenerationsTimeout] = None
|
|
262
414
|
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."""
|
|
263
415
|
|
|
264
416
|
@model_serializer(mode="wrap")
|
|
@@ -314,6 +466,18 @@ class CreateImageRequestBodyTypedDict(TypedDict):
|
|
|
314
466
|
r"""The size of the generated images. Must be one of the specified sizes for each model."""
|
|
315
467
|
style: NotRequired[Nullable[Style]]
|
|
316
468
|
r"""The style of the generated images. This parameter is only supported for `openai/dall-e-3`. Must be one of `vivid` or `natural`."""
|
|
469
|
+
name: NotRequired[str]
|
|
470
|
+
r"""The name to display on the trace. If not specified, the default system name will be used."""
|
|
471
|
+
fallbacks: NotRequired[List[CreateImageFallbacksTypedDict]]
|
|
472
|
+
r"""Array of fallback models to use if primary model fails"""
|
|
473
|
+
retry: NotRequired[CreateImageRetryTypedDict]
|
|
474
|
+
r"""Retry configuration for the request"""
|
|
475
|
+
cache: NotRequired[CreateImageCacheTypedDict]
|
|
476
|
+
r"""Cache configuration for the request."""
|
|
477
|
+
load_balancer: NotRequired[CreateImageLoadBalancerTypedDict]
|
|
478
|
+
r"""Load balancer configuration for the request."""
|
|
479
|
+
timeout: NotRequired[CreateImageTimeoutTypedDict]
|
|
480
|
+
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."""
|
|
317
481
|
orq: NotRequired[CreateImageOrqTypedDict]
|
|
318
482
|
|
|
319
483
|
|
|
@@ -353,6 +517,24 @@ class CreateImageRequestBody(BaseModel):
|
|
|
353
517
|
style: OptionalNullable[Style] = UNSET
|
|
354
518
|
r"""The style of the generated images. This parameter is only supported for `openai/dall-e-3`. Must be one of `vivid` or `natural`."""
|
|
355
519
|
|
|
520
|
+
name: Optional[str] = None
|
|
521
|
+
r"""The name to display on the trace. If not specified, the default system name will be used."""
|
|
522
|
+
|
|
523
|
+
fallbacks: Optional[List[CreateImageFallbacks]] = None
|
|
524
|
+
r"""Array of fallback models to use if primary model fails"""
|
|
525
|
+
|
|
526
|
+
retry: Optional[CreateImageRetry] = None
|
|
527
|
+
r"""Retry configuration for the request"""
|
|
528
|
+
|
|
529
|
+
cache: Optional[CreateImageCache] = None
|
|
530
|
+
r"""Cache configuration for the request."""
|
|
531
|
+
|
|
532
|
+
load_balancer: Optional[CreateImageLoadBalancer] = None
|
|
533
|
+
r"""Load balancer configuration for the request."""
|
|
534
|
+
|
|
535
|
+
timeout: Optional[CreateImageTimeout] = None
|
|
536
|
+
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."""
|
|
537
|
+
|
|
356
538
|
orq: Optional[CreateImageOrq] = None
|
|
357
539
|
|
|
358
540
|
@model_serializer(mode="wrap")
|
|
@@ -368,6 +550,12 @@ class CreateImageRequestBody(BaseModel):
|
|
|
368
550
|
"response_format",
|
|
369
551
|
"size",
|
|
370
552
|
"style",
|
|
553
|
+
"name",
|
|
554
|
+
"fallbacks",
|
|
555
|
+
"retry",
|
|
556
|
+
"cache",
|
|
557
|
+
"load_balancer",
|
|
558
|
+
"timeout",
|
|
371
559
|
"orq",
|
|
372
560
|
]
|
|
373
561
|
)
|