orq-ai-sdk 4.2.17__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.
Files changed (75) hide show
  1. orq_ai_sdk/_hooks/globalhook.py +1 -0
  2. orq_ai_sdk/_version.py +3 -3
  3. orq_ai_sdk/agents.py +186 -186
  4. orq_ai_sdk/completions.py +1 -107
  5. orq_ai_sdk/edits.py +1 -107
  6. orq_ai_sdk/embeddings.py +1 -107
  7. orq_ai_sdk/generations.py +1 -99
  8. orq_ai_sdk/models/__init__.py +0 -405
  9. orq_ai_sdk/models/conversationresponse.py +1 -1
  10. orq_ai_sdk/models/conversationwithmessagesresponse.py +1 -1
  11. orq_ai_sdk/models/createagentrequestop.py +0 -24
  12. orq_ai_sdk/models/createchatcompletionop.py +0 -6
  13. orq_ai_sdk/models/createcompletionop.py +30 -218
  14. orq_ai_sdk/models/createcontactop.py +1 -1
  15. orq_ai_sdk/models/createconversationop.py +1 -1
  16. orq_ai_sdk/models/createconversationresponseop.py +2 -2
  17. orq_ai_sdk/models/createdatasetitemop.py +4 -4
  18. orq_ai_sdk/models/createdatasetop.py +1 -1
  19. orq_ai_sdk/models/createdatasourceop.py +1 -1
  20. orq_ai_sdk/models/createembeddingop.py +26 -221
  21. orq_ai_sdk/models/createevalop.py +14 -14
  22. orq_ai_sdk/models/createidentityop.py +1 -1
  23. orq_ai_sdk/models/createimageeditop.py +31 -242
  24. orq_ai_sdk/models/createimageop.py +22 -210
  25. orq_ai_sdk/models/createimagevariationop.py +31 -251
  26. orq_ai_sdk/models/createpromptop.py +0 -12
  27. orq_ai_sdk/models/creatererankop.py +26 -218
  28. orq_ai_sdk/models/createspeechop.py +24 -174
  29. orq_ai_sdk/models/createtoolop.py +6 -6
  30. orq_ai_sdk/models/createtranscriptionop.py +10 -180
  31. orq_ai_sdk/models/createtranslationop.py +10 -172
  32. orq_ai_sdk/models/filegetop.py +1 -1
  33. orq_ai_sdk/models/filelistop.py +1 -1
  34. orq_ai_sdk/models/fileuploadop.py +1 -1
  35. orq_ai_sdk/models/generateconversationnameop.py +1 -1
  36. orq_ai_sdk/models/getallpromptsop.py +0 -6
  37. orq_ai_sdk/models/getalltoolsop.py +6 -6
  38. orq_ai_sdk/models/getevalsop.py +14 -14
  39. orq_ai_sdk/models/getonepromptop.py +0 -6
  40. orq_ai_sdk/models/getpromptversionop.py +0 -6
  41. orq_ai_sdk/models/listagentsop.py +0 -12
  42. orq_ai_sdk/models/listdatasetdatapointsop.py +4 -4
  43. orq_ai_sdk/models/listdatasetsop.py +1 -1
  44. orq_ai_sdk/models/listdatasourcesop.py +1 -1
  45. orq_ai_sdk/models/listidentitiesop.py +1 -1
  46. orq_ai_sdk/models/listpromptversionsop.py +0 -6
  47. orq_ai_sdk/models/partdoneevent.py +1 -1
  48. orq_ai_sdk/models/reasoningpart.py +1 -1
  49. orq_ai_sdk/models/retrieveagentrequestop.py +0 -12
  50. orq_ai_sdk/models/retrievedatapointop.py +4 -4
  51. orq_ai_sdk/models/retrievedatasetop.py +1 -1
  52. orq_ai_sdk/models/retrievedatasourceop.py +1 -1
  53. orq_ai_sdk/models/retrieveidentityop.py +1 -1
  54. orq_ai_sdk/models/retrievetoolop.py +6 -6
  55. orq_ai_sdk/models/runagentop.py +1 -13
  56. orq_ai_sdk/models/streamrunagentop.py +1 -13
  57. orq_ai_sdk/models/updateagentop.py +0 -24
  58. orq_ai_sdk/models/updateconversationop.py +1 -1
  59. orq_ai_sdk/models/updatedatapointop.py +4 -4
  60. orq_ai_sdk/models/updatedatasetop.py +1 -1
  61. orq_ai_sdk/models/updatedatasourceop.py +1 -1
  62. orq_ai_sdk/models/updateevalop.py +14 -14
  63. orq_ai_sdk/models/updateidentityop.py +1 -1
  64. orq_ai_sdk/models/updatepromptop.py +0 -12
  65. orq_ai_sdk/models/updatetoolop.py +7 -7
  66. orq_ai_sdk/orq_completions.py +0 -6
  67. orq_ai_sdk/rerank.py +0 -98
  68. orq_ai_sdk/speech.py +1 -83
  69. orq_ai_sdk/transcriptions.py +0 -90
  70. orq_ai_sdk/translations.py +1 -87
  71. orq_ai_sdk/variations.py +1 -111
  72. {orq_ai_sdk-4.2.17.dist-info → orq_ai_sdk-4.3.0rc0.dist-info}/METADATA +202 -202
  73. {orq_ai_sdk-4.2.17.dist-info → orq_ai_sdk-4.3.0rc0.dist-info}/RECORD +75 -75
  74. {orq_ai_sdk-4.2.17.dist-info → orq_ai_sdk-4.3.0rc0.dist-info}/WHEEL +1 -1
  75. {orq_ai_sdk-4.2.17.dist-info → orq_ai_sdk-4.3.0rc0.dist-info}/top_level.txt +0 -0
@@ -64,16 +64,6 @@ 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
-
77
67
  class CreateImageRetryTypedDict(TypedDict):
78
68
  r"""Retry configuration for the request"""
79
69
 
@@ -109,6 +99,16 @@ class CreateImageRetry(BaseModel):
109
99
  return m
110
100
 
111
101
 
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,54 +190,12 @@ 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
-
235
193
  CreateImageLoadBalancerTypedDict = CreateImageLoadBalancer1TypedDict
236
- r"""Load balancer configuration for the request."""
194
+ r"""Array of models with weights for load balancing requests"""
237
195
 
238
196
 
239
197
  CreateImageLoadBalancer = CreateImageLoadBalancer1
240
- r"""Load balancer configuration for the request."""
198
+ r"""Array of models with weights for load balancing requests"""
241
199
 
242
200
 
243
201
  class CreateImageTimeoutTypedDict(TypedDict):
@@ -254,132 +212,22 @@ class CreateImageTimeout(BaseModel):
254
212
  r"""Timeout value in milliseconds"""
255
213
 
256
214
 
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
-
367
215
  class CreateImageOrqTypedDict(TypedDict):
368
216
  name: NotRequired[str]
369
217
  r"""The name to display on the trace. If not specified, the default system name will be used."""
370
- retry: NotRequired[CreateImageRouterImagesGenerationsRetryTypedDict]
218
+ retry: NotRequired[CreateImageRetryTypedDict]
371
219
  r"""Retry configuration for the request"""
372
- fallbacks: NotRequired[List[CreateImageRouterImagesGenerationsFallbacksTypedDict]]
220
+ fallbacks: NotRequired[List[CreateImageFallbacksTypedDict]]
373
221
  r"""Array of fallback models to use if primary model fails"""
374
222
  identity: NotRequired[PublicIdentityTypedDict]
375
223
  r"""Information about the identity making the request. If the identity does not exist, it will be created automatically."""
376
224
  contact: NotRequired[PublicContactTypedDict]
377
225
  r"""@deprecated Use identity instead. Information about the contact making the request."""
378
- cache: NotRequired[CreateImageRouterImagesGenerationsCacheTypedDict]
226
+ cache: NotRequired[CreateImageCacheTypedDict]
379
227
  r"""Cache configuration for the request."""
380
- load_balancer: NotRequired[CreateImageRouterImagesGenerationsLoadBalancerTypedDict]
228
+ load_balancer: NotRequired[CreateImageLoadBalancerTypedDict]
381
229
  r"""Array of models with weights for load balancing requests"""
382
- timeout: NotRequired[CreateImageRouterImagesGenerationsTimeoutTypedDict]
230
+ timeout: NotRequired[CreateImageTimeoutTypedDict]
383
231
  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."""
384
232
 
385
233
 
@@ -387,10 +235,10 @@ class CreateImageOrq(BaseModel):
387
235
  name: Optional[str] = None
388
236
  r"""The name to display on the trace. If not specified, the default system name will be used."""
389
237
 
390
- retry: Optional[CreateImageRouterImagesGenerationsRetry] = None
238
+ retry: Optional[CreateImageRetry] = None
391
239
  r"""Retry configuration for the request"""
392
240
 
393
- fallbacks: Optional[List[CreateImageRouterImagesGenerationsFallbacks]] = None
241
+ fallbacks: Optional[List[CreateImageFallbacks]] = None
394
242
  r"""Array of fallback models to use if primary model fails"""
395
243
 
396
244
  identity: Optional[PublicIdentity] = None
@@ -404,13 +252,13 @@ class CreateImageOrq(BaseModel):
404
252
  ] = None
405
253
  r"""@deprecated Use identity instead. Information about the contact making the request."""
406
254
 
407
- cache: Optional[CreateImageRouterImagesGenerationsCache] = None
255
+ cache: Optional[CreateImageCache] = None
408
256
  r"""Cache configuration for the request."""
409
257
 
410
- load_balancer: Optional[CreateImageRouterImagesGenerationsLoadBalancer] = None
258
+ load_balancer: Optional[CreateImageLoadBalancer] = None
411
259
  r"""Array of models with weights for load balancing requests"""
412
260
 
413
- timeout: Optional[CreateImageRouterImagesGenerationsTimeout] = None
261
+ timeout: Optional[CreateImageTimeout] = None
414
262
  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."""
415
263
 
416
264
  @model_serializer(mode="wrap")
@@ -466,18 +314,6 @@ class CreateImageRequestBodyTypedDict(TypedDict):
466
314
  r"""The size of the generated images. Must be one of the specified sizes for each model."""
467
315
  style: NotRequired[Nullable[Style]]
468
316
  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."""
481
317
  orq: NotRequired[CreateImageOrqTypedDict]
482
318
 
483
319
 
@@ -517,24 +353,6 @@ class CreateImageRequestBody(BaseModel):
517
353
  style: OptionalNullable[Style] = UNSET
518
354
  r"""The style of the generated images. This parameter is only supported for `openai/dall-e-3`. Must be one of `vivid` or `natural`."""
519
355
 
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
-
538
356
  orq: Optional[CreateImageOrq] = None
539
357
 
540
358
  @model_serializer(mode="wrap")
@@ -550,12 +368,6 @@ class CreateImageRequestBody(BaseModel):
550
368
  "response_format",
551
369
  "size",
552
370
  "style",
553
- "name",
554
- "fallbacks",
555
- "retry",
556
- "cache",
557
- "load_balancer",
558
- "timeout",
559
371
  "orq",
560
372
  ]
561
373
  )