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
orq_ai_sdk/edits.py
CHANGED
|
@@ -7,7 +7,7 @@ from orq_ai_sdk.models import createimageeditop as models_createimageeditop
|
|
|
7
7
|
from orq_ai_sdk.types import OptionalNullable, UNSET
|
|
8
8
|
from orq_ai_sdk.utils import get_security_from_env
|
|
9
9
|
from orq_ai_sdk.utils.unmarshal_json_response import unmarshal_json_response
|
|
10
|
-
from typing import Any,
|
|
10
|
+
from typing import Any, Mapping, Optional, Union
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
class Edits(BaseSDK):
|
|
@@ -26,37 +26,6 @@ class Edits(BaseSDK):
|
|
|
26
26
|
models_createimageeditop.CreateImageEditResponseFormat
|
|
27
27
|
] = None,
|
|
28
28
|
user: Optional[str] = None,
|
|
29
|
-
name: Optional[str] = None,
|
|
30
|
-
fallbacks: Optional[
|
|
31
|
-
Union[
|
|
32
|
-
List[models_createimageeditop.CreateImageEditFallbacks],
|
|
33
|
-
List[models_createimageeditop.CreateImageEditFallbacksTypedDict],
|
|
34
|
-
]
|
|
35
|
-
] = None,
|
|
36
|
-
retry: Optional[
|
|
37
|
-
Union[
|
|
38
|
-
models_createimageeditop.CreateImageEditRetry,
|
|
39
|
-
models_createimageeditop.CreateImageEditRetryTypedDict,
|
|
40
|
-
]
|
|
41
|
-
] = None,
|
|
42
|
-
cache: Optional[
|
|
43
|
-
Union[
|
|
44
|
-
models_createimageeditop.CreateImageEditCache,
|
|
45
|
-
models_createimageeditop.CreateImageEditCacheTypedDict,
|
|
46
|
-
]
|
|
47
|
-
] = None,
|
|
48
|
-
load_balancer: Optional[
|
|
49
|
-
Union[
|
|
50
|
-
models_createimageeditop.CreateImageEditLoadBalancer,
|
|
51
|
-
models_createimageeditop.CreateImageEditLoadBalancerTypedDict,
|
|
52
|
-
]
|
|
53
|
-
] = None,
|
|
54
|
-
timeout: Optional[
|
|
55
|
-
Union[
|
|
56
|
-
models_createimageeditop.CreateImageEditTimeout,
|
|
57
|
-
models_createimageeditop.CreateImageEditTimeoutTypedDict,
|
|
58
|
-
]
|
|
59
|
-
] = None,
|
|
60
29
|
orq: Optional[
|
|
61
30
|
Union[
|
|
62
31
|
models_createimageeditop.CreateImageEditOrq,
|
|
@@ -80,12 +49,6 @@ class Edits(BaseSDK):
|
|
|
80
49
|
:param quality: The quality of the image that will be generated. Auto will automatically select the best quality for the given model.
|
|
81
50
|
:param response_format: The format in which the generated images are returned. Some of the models only return the image in base64 format.
|
|
82
51
|
:param user: A unique identifier representing your end-user, which can help to monitor and detect abuse.
|
|
83
|
-
:param name: The name to display on the trace. If not specified, the default system name will be used.
|
|
84
|
-
:param fallbacks: Array of fallback models to use if primary model fails
|
|
85
|
-
:param retry: Retry configuration for the request
|
|
86
|
-
:param cache: Cache configuration for the request.
|
|
87
|
-
:param load_balancer: Load balancer configuration for the request.
|
|
88
|
-
:param timeout: 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.
|
|
89
52
|
:param orq:
|
|
90
53
|
:param retries: Override the default retry configuration for this method
|
|
91
54
|
:param server_url: Override the default server URL for this method
|
|
@@ -114,22 +77,6 @@ class Edits(BaseSDK):
|
|
|
114
77
|
quality=quality,
|
|
115
78
|
response_format=response_format,
|
|
116
79
|
user=user,
|
|
117
|
-
name=name,
|
|
118
|
-
fallbacks=utils.get_pydantic_model(
|
|
119
|
-
fallbacks, Optional[List[models.CreateImageEditFallbacks]]
|
|
120
|
-
),
|
|
121
|
-
retry=utils.get_pydantic_model(
|
|
122
|
-
retry, Optional[models.CreateImageEditRetry]
|
|
123
|
-
),
|
|
124
|
-
cache=utils.get_pydantic_model(
|
|
125
|
-
cache, Optional[models.CreateImageEditCache]
|
|
126
|
-
),
|
|
127
|
-
load_balancer=utils.get_pydantic_model(
|
|
128
|
-
load_balancer, Optional[models.CreateImageEditLoadBalancer]
|
|
129
|
-
),
|
|
130
|
-
timeout=utils.get_pydantic_model(
|
|
131
|
-
timeout, Optional[models.CreateImageEditTimeout]
|
|
132
|
-
),
|
|
133
80
|
orq=utils.get_pydantic_model(orq, Optional[models.CreateImageEditOrq]),
|
|
134
81
|
)
|
|
135
82
|
|
|
@@ -202,37 +149,6 @@ class Edits(BaseSDK):
|
|
|
202
149
|
models_createimageeditop.CreateImageEditResponseFormat
|
|
203
150
|
] = None,
|
|
204
151
|
user: Optional[str] = None,
|
|
205
|
-
name: Optional[str] = None,
|
|
206
|
-
fallbacks: Optional[
|
|
207
|
-
Union[
|
|
208
|
-
List[models_createimageeditop.CreateImageEditFallbacks],
|
|
209
|
-
List[models_createimageeditop.CreateImageEditFallbacksTypedDict],
|
|
210
|
-
]
|
|
211
|
-
] = None,
|
|
212
|
-
retry: Optional[
|
|
213
|
-
Union[
|
|
214
|
-
models_createimageeditop.CreateImageEditRetry,
|
|
215
|
-
models_createimageeditop.CreateImageEditRetryTypedDict,
|
|
216
|
-
]
|
|
217
|
-
] = None,
|
|
218
|
-
cache: Optional[
|
|
219
|
-
Union[
|
|
220
|
-
models_createimageeditop.CreateImageEditCache,
|
|
221
|
-
models_createimageeditop.CreateImageEditCacheTypedDict,
|
|
222
|
-
]
|
|
223
|
-
] = None,
|
|
224
|
-
load_balancer: Optional[
|
|
225
|
-
Union[
|
|
226
|
-
models_createimageeditop.CreateImageEditLoadBalancer,
|
|
227
|
-
models_createimageeditop.CreateImageEditLoadBalancerTypedDict,
|
|
228
|
-
]
|
|
229
|
-
] = None,
|
|
230
|
-
timeout: Optional[
|
|
231
|
-
Union[
|
|
232
|
-
models_createimageeditop.CreateImageEditTimeout,
|
|
233
|
-
models_createimageeditop.CreateImageEditTimeoutTypedDict,
|
|
234
|
-
]
|
|
235
|
-
] = None,
|
|
236
152
|
orq: Optional[
|
|
237
153
|
Union[
|
|
238
154
|
models_createimageeditop.CreateImageEditOrq,
|
|
@@ -256,12 +172,6 @@ class Edits(BaseSDK):
|
|
|
256
172
|
:param quality: The quality of the image that will be generated. Auto will automatically select the best quality for the given model.
|
|
257
173
|
:param response_format: The format in which the generated images are returned. Some of the models only return the image in base64 format.
|
|
258
174
|
:param user: A unique identifier representing your end-user, which can help to monitor and detect abuse.
|
|
259
|
-
:param name: The name to display on the trace. If not specified, the default system name will be used.
|
|
260
|
-
:param fallbacks: Array of fallback models to use if primary model fails
|
|
261
|
-
:param retry: Retry configuration for the request
|
|
262
|
-
:param cache: Cache configuration for the request.
|
|
263
|
-
:param load_balancer: Load balancer configuration for the request.
|
|
264
|
-
:param timeout: 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.
|
|
265
175
|
:param orq:
|
|
266
176
|
:param retries: Override the default retry configuration for this method
|
|
267
177
|
:param server_url: Override the default server URL for this method
|
|
@@ -290,22 +200,6 @@ class Edits(BaseSDK):
|
|
|
290
200
|
quality=quality,
|
|
291
201
|
response_format=response_format,
|
|
292
202
|
user=user,
|
|
293
|
-
name=name,
|
|
294
|
-
fallbacks=utils.get_pydantic_model(
|
|
295
|
-
fallbacks, Optional[List[models.CreateImageEditFallbacks]]
|
|
296
|
-
),
|
|
297
|
-
retry=utils.get_pydantic_model(
|
|
298
|
-
retry, Optional[models.CreateImageEditRetry]
|
|
299
|
-
),
|
|
300
|
-
cache=utils.get_pydantic_model(
|
|
301
|
-
cache, Optional[models.CreateImageEditCache]
|
|
302
|
-
),
|
|
303
|
-
load_balancer=utils.get_pydantic_model(
|
|
304
|
-
load_balancer, Optional[models.CreateImageEditLoadBalancer]
|
|
305
|
-
),
|
|
306
|
-
timeout=utils.get_pydantic_model(
|
|
307
|
-
timeout, Optional[models.CreateImageEditTimeout]
|
|
308
|
-
),
|
|
309
203
|
orq=utils.get_pydantic_model(orq, Optional[models.CreateImageEditOrq]),
|
|
310
204
|
)
|
|
311
205
|
|
orq_ai_sdk/embeddings.py
CHANGED
|
@@ -7,7 +7,7 @@ from orq_ai_sdk.models import createembeddingop as models_createembeddingop
|
|
|
7
7
|
from orq_ai_sdk.types import OptionalNullable, UNSET
|
|
8
8
|
from orq_ai_sdk.utils import get_security_from_env
|
|
9
9
|
from orq_ai_sdk.utils.unmarshal_json_response import unmarshal_json_response
|
|
10
|
-
from typing import
|
|
10
|
+
from typing import Mapping, Optional, Union
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
class Embeddings(BaseSDK):
|
|
@@ -22,37 +22,6 @@ class Embeddings(BaseSDK):
|
|
|
22
22
|
encoding_format: Optional[models_createembeddingop.EncodingFormat] = "float",
|
|
23
23
|
dimensions: Optional[float] = None,
|
|
24
24
|
user: Optional[str] = None,
|
|
25
|
-
name: Optional[str] = None,
|
|
26
|
-
fallbacks: Optional[
|
|
27
|
-
Union[
|
|
28
|
-
List[models_createembeddingop.CreateEmbeddingFallbacks],
|
|
29
|
-
List[models_createembeddingop.CreateEmbeddingFallbacksTypedDict],
|
|
30
|
-
]
|
|
31
|
-
] = None,
|
|
32
|
-
retry: Optional[
|
|
33
|
-
Union[
|
|
34
|
-
models_createembeddingop.CreateEmbeddingRetry,
|
|
35
|
-
models_createembeddingop.CreateEmbeddingRetryTypedDict,
|
|
36
|
-
]
|
|
37
|
-
] = None,
|
|
38
|
-
cache: Optional[
|
|
39
|
-
Union[
|
|
40
|
-
models_createembeddingop.CreateEmbeddingCache,
|
|
41
|
-
models_createembeddingop.CreateEmbeddingCacheTypedDict,
|
|
42
|
-
]
|
|
43
|
-
] = None,
|
|
44
|
-
load_balancer: Optional[
|
|
45
|
-
Union[
|
|
46
|
-
models_createembeddingop.CreateEmbeddingLoadBalancer,
|
|
47
|
-
models_createembeddingop.CreateEmbeddingLoadBalancerTypedDict,
|
|
48
|
-
]
|
|
49
|
-
] = None,
|
|
50
|
-
timeout: Optional[
|
|
51
|
-
Union[
|
|
52
|
-
models_createembeddingop.CreateEmbeddingTimeout,
|
|
53
|
-
models_createembeddingop.CreateEmbeddingTimeoutTypedDict,
|
|
54
|
-
]
|
|
55
|
-
] = None,
|
|
56
25
|
orq: Optional[
|
|
57
26
|
Union[
|
|
58
27
|
models_createembeddingop.CreateEmbeddingOrq,
|
|
@@ -73,12 +42,6 @@ class Embeddings(BaseSDK):
|
|
|
73
42
|
:param encoding_format: Type of the document element
|
|
74
43
|
:param dimensions: The number of dimensions the resulting output embeddings should have.
|
|
75
44
|
:param user: A unique identifier representing your end-user
|
|
76
|
-
:param name: The name to display on the trace. If not specified, the default system name will be used.
|
|
77
|
-
:param fallbacks: Array of fallback models to use if primary model fails
|
|
78
|
-
:param retry: Retry configuration for the request
|
|
79
|
-
:param cache: Cache configuration for the request.
|
|
80
|
-
:param load_balancer: Load balancer configuration for the request.
|
|
81
|
-
:param timeout: 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.
|
|
82
45
|
:param orq:
|
|
83
46
|
:param retries: Override the default retry configuration for this method
|
|
84
47
|
:param server_url: Override the default server URL for this method
|
|
@@ -104,22 +67,6 @@ class Embeddings(BaseSDK):
|
|
|
104
67
|
encoding_format=encoding_format,
|
|
105
68
|
dimensions=dimensions,
|
|
106
69
|
user=user,
|
|
107
|
-
name=name,
|
|
108
|
-
fallbacks=utils.get_pydantic_model(
|
|
109
|
-
fallbacks, Optional[List[models.CreateEmbeddingFallbacks]]
|
|
110
|
-
),
|
|
111
|
-
retry=utils.get_pydantic_model(
|
|
112
|
-
retry, Optional[models.CreateEmbeddingRetry]
|
|
113
|
-
),
|
|
114
|
-
cache=utils.get_pydantic_model(
|
|
115
|
-
cache, Optional[models.CreateEmbeddingCache]
|
|
116
|
-
),
|
|
117
|
-
load_balancer=utils.get_pydantic_model(
|
|
118
|
-
load_balancer, Optional[models.CreateEmbeddingLoadBalancer]
|
|
119
|
-
),
|
|
120
|
-
timeout=utils.get_pydantic_model(
|
|
121
|
-
timeout, Optional[models.CreateEmbeddingTimeout]
|
|
122
|
-
),
|
|
123
70
|
orq=utils.get_pydantic_model(orq, Optional[models.CreateEmbeddingOrq]),
|
|
124
71
|
)
|
|
125
72
|
|
|
@@ -188,37 +135,6 @@ class Embeddings(BaseSDK):
|
|
|
188
135
|
encoding_format: Optional[models_createembeddingop.EncodingFormat] = "float",
|
|
189
136
|
dimensions: Optional[float] = None,
|
|
190
137
|
user: Optional[str] = None,
|
|
191
|
-
name: Optional[str] = None,
|
|
192
|
-
fallbacks: Optional[
|
|
193
|
-
Union[
|
|
194
|
-
List[models_createembeddingop.CreateEmbeddingFallbacks],
|
|
195
|
-
List[models_createembeddingop.CreateEmbeddingFallbacksTypedDict],
|
|
196
|
-
]
|
|
197
|
-
] = None,
|
|
198
|
-
retry: Optional[
|
|
199
|
-
Union[
|
|
200
|
-
models_createembeddingop.CreateEmbeddingRetry,
|
|
201
|
-
models_createembeddingop.CreateEmbeddingRetryTypedDict,
|
|
202
|
-
]
|
|
203
|
-
] = None,
|
|
204
|
-
cache: Optional[
|
|
205
|
-
Union[
|
|
206
|
-
models_createembeddingop.CreateEmbeddingCache,
|
|
207
|
-
models_createembeddingop.CreateEmbeddingCacheTypedDict,
|
|
208
|
-
]
|
|
209
|
-
] = None,
|
|
210
|
-
load_balancer: Optional[
|
|
211
|
-
Union[
|
|
212
|
-
models_createembeddingop.CreateEmbeddingLoadBalancer,
|
|
213
|
-
models_createembeddingop.CreateEmbeddingLoadBalancerTypedDict,
|
|
214
|
-
]
|
|
215
|
-
] = None,
|
|
216
|
-
timeout: Optional[
|
|
217
|
-
Union[
|
|
218
|
-
models_createembeddingop.CreateEmbeddingTimeout,
|
|
219
|
-
models_createembeddingop.CreateEmbeddingTimeoutTypedDict,
|
|
220
|
-
]
|
|
221
|
-
] = None,
|
|
222
138
|
orq: Optional[
|
|
223
139
|
Union[
|
|
224
140
|
models_createembeddingop.CreateEmbeddingOrq,
|
|
@@ -239,12 +155,6 @@ class Embeddings(BaseSDK):
|
|
|
239
155
|
:param encoding_format: Type of the document element
|
|
240
156
|
:param dimensions: The number of dimensions the resulting output embeddings should have.
|
|
241
157
|
:param user: A unique identifier representing your end-user
|
|
242
|
-
:param name: The name to display on the trace. If not specified, the default system name will be used.
|
|
243
|
-
:param fallbacks: Array of fallback models to use if primary model fails
|
|
244
|
-
:param retry: Retry configuration for the request
|
|
245
|
-
:param cache: Cache configuration for the request.
|
|
246
|
-
:param load_balancer: Load balancer configuration for the request.
|
|
247
|
-
:param timeout: 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.
|
|
248
158
|
:param orq:
|
|
249
159
|
:param retries: Override the default retry configuration for this method
|
|
250
160
|
:param server_url: Override the default server URL for this method
|
|
@@ -270,22 +180,6 @@ class Embeddings(BaseSDK):
|
|
|
270
180
|
encoding_format=encoding_format,
|
|
271
181
|
dimensions=dimensions,
|
|
272
182
|
user=user,
|
|
273
|
-
name=name,
|
|
274
|
-
fallbacks=utils.get_pydantic_model(
|
|
275
|
-
fallbacks, Optional[List[models.CreateEmbeddingFallbacks]]
|
|
276
|
-
),
|
|
277
|
-
retry=utils.get_pydantic_model(
|
|
278
|
-
retry, Optional[models.CreateEmbeddingRetry]
|
|
279
|
-
),
|
|
280
|
-
cache=utils.get_pydantic_model(
|
|
281
|
-
cache, Optional[models.CreateEmbeddingCache]
|
|
282
|
-
),
|
|
283
|
-
load_balancer=utils.get_pydantic_model(
|
|
284
|
-
load_balancer, Optional[models.CreateEmbeddingLoadBalancer]
|
|
285
|
-
),
|
|
286
|
-
timeout=utils.get_pydantic_model(
|
|
287
|
-
timeout, Optional[models.CreateEmbeddingTimeout]
|
|
288
|
-
),
|
|
289
183
|
orq=utils.get_pydantic_model(orq, Optional[models.CreateEmbeddingOrq]),
|
|
290
184
|
)
|
|
291
185
|
|
orq_ai_sdk/generations.py
CHANGED
|
@@ -7,7 +7,7 @@ from orq_ai_sdk.models import createimageop as models_createimageop
|
|
|
7
7
|
from orq_ai_sdk.types import OptionalNullable, UNSET
|
|
8
8
|
from orq_ai_sdk.utils import get_security_from_env
|
|
9
9
|
from orq_ai_sdk.utils.unmarshal_json_response import unmarshal_json_response
|
|
10
|
-
from typing import
|
|
10
|
+
from typing import Mapping, Optional, Union
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
class Generations(BaseSDK):
|
|
@@ -27,37 +27,6 @@ class Generations(BaseSDK):
|
|
|
27
27
|
] = UNSET,
|
|
28
28
|
size: OptionalNullable[str] = UNSET,
|
|
29
29
|
style: OptionalNullable[models_createimageop.Style] = UNSET,
|
|
30
|
-
name: Optional[str] = None,
|
|
31
|
-
fallbacks: Optional[
|
|
32
|
-
Union[
|
|
33
|
-
List[models_createimageop.CreateImageFallbacks],
|
|
34
|
-
List[models_createimageop.CreateImageFallbacksTypedDict],
|
|
35
|
-
]
|
|
36
|
-
] = None,
|
|
37
|
-
retry: Optional[
|
|
38
|
-
Union[
|
|
39
|
-
models_createimageop.CreateImageRetry,
|
|
40
|
-
models_createimageop.CreateImageRetryTypedDict,
|
|
41
|
-
]
|
|
42
|
-
] = None,
|
|
43
|
-
cache: Optional[
|
|
44
|
-
Union[
|
|
45
|
-
models_createimageop.CreateImageCache,
|
|
46
|
-
models_createimageop.CreateImageCacheTypedDict,
|
|
47
|
-
]
|
|
48
|
-
] = None,
|
|
49
|
-
load_balancer: Optional[
|
|
50
|
-
Union[
|
|
51
|
-
models_createimageop.CreateImageLoadBalancer,
|
|
52
|
-
models_createimageop.CreateImageLoadBalancerTypedDict,
|
|
53
|
-
]
|
|
54
|
-
] = None,
|
|
55
|
-
timeout: Optional[
|
|
56
|
-
Union[
|
|
57
|
-
models_createimageop.CreateImageTimeout,
|
|
58
|
-
models_createimageop.CreateImageTimeoutTypedDict,
|
|
59
|
-
]
|
|
60
|
-
] = None,
|
|
61
30
|
orq: Optional[
|
|
62
31
|
Union[
|
|
63
32
|
models_createimageop.CreateImageOrq,
|
|
@@ -84,12 +53,6 @@ class Generations(BaseSDK):
|
|
|
84
53
|
:param response_format: The format in which generated images are returned. Must be one of `url` or `b64_json`. This parameter isn't supported for `gpt-image-1` which will always return base64-encoded images.
|
|
85
54
|
:param size: The size of the generated images. Must be one of the specified sizes for each model.
|
|
86
55
|
:param style: The style of the generated images. This parameter is only supported for `openai/dall-e-3`. Must be one of `vivid` or `natural`.
|
|
87
|
-
:param name: The name to display on the trace. If not specified, the default system name will be used.
|
|
88
|
-
:param fallbacks: Array of fallback models to use if primary model fails
|
|
89
|
-
:param retry: Retry configuration for the request
|
|
90
|
-
:param cache: Cache configuration for the request.
|
|
91
|
-
:param load_balancer: Load balancer configuration for the request.
|
|
92
|
-
:param timeout: 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.
|
|
93
56
|
:param orq:
|
|
94
57
|
:param retries: Override the default retry configuration for this method
|
|
95
58
|
:param server_url: Override the default server URL for this method
|
|
@@ -121,18 +84,6 @@ class Generations(BaseSDK):
|
|
|
121
84
|
response_format=response_format,
|
|
122
85
|
size=size,
|
|
123
86
|
style=style,
|
|
124
|
-
name=name,
|
|
125
|
-
fallbacks=utils.get_pydantic_model(
|
|
126
|
-
fallbacks, Optional[List[models.CreateImageFallbacks]]
|
|
127
|
-
),
|
|
128
|
-
retry=utils.get_pydantic_model(retry, Optional[models.CreateImageRetry]),
|
|
129
|
-
cache=utils.get_pydantic_model(cache, Optional[models.CreateImageCache]),
|
|
130
|
-
load_balancer=utils.get_pydantic_model(
|
|
131
|
-
load_balancer, Optional[models.CreateImageLoadBalancer]
|
|
132
|
-
),
|
|
133
|
-
timeout=utils.get_pydantic_model(
|
|
134
|
-
timeout, Optional[models.CreateImageTimeout]
|
|
135
|
-
),
|
|
136
87
|
orq=utils.get_pydantic_model(orq, Optional[models.CreateImageOrq]),
|
|
137
88
|
)
|
|
138
89
|
|
|
@@ -206,37 +157,6 @@ class Generations(BaseSDK):
|
|
|
206
157
|
] = UNSET,
|
|
207
158
|
size: OptionalNullable[str] = UNSET,
|
|
208
159
|
style: OptionalNullable[models_createimageop.Style] = UNSET,
|
|
209
|
-
name: Optional[str] = None,
|
|
210
|
-
fallbacks: Optional[
|
|
211
|
-
Union[
|
|
212
|
-
List[models_createimageop.CreateImageFallbacks],
|
|
213
|
-
List[models_createimageop.CreateImageFallbacksTypedDict],
|
|
214
|
-
]
|
|
215
|
-
] = None,
|
|
216
|
-
retry: Optional[
|
|
217
|
-
Union[
|
|
218
|
-
models_createimageop.CreateImageRetry,
|
|
219
|
-
models_createimageop.CreateImageRetryTypedDict,
|
|
220
|
-
]
|
|
221
|
-
] = None,
|
|
222
|
-
cache: Optional[
|
|
223
|
-
Union[
|
|
224
|
-
models_createimageop.CreateImageCache,
|
|
225
|
-
models_createimageop.CreateImageCacheTypedDict,
|
|
226
|
-
]
|
|
227
|
-
] = None,
|
|
228
|
-
load_balancer: Optional[
|
|
229
|
-
Union[
|
|
230
|
-
models_createimageop.CreateImageLoadBalancer,
|
|
231
|
-
models_createimageop.CreateImageLoadBalancerTypedDict,
|
|
232
|
-
]
|
|
233
|
-
] = None,
|
|
234
|
-
timeout: Optional[
|
|
235
|
-
Union[
|
|
236
|
-
models_createimageop.CreateImageTimeout,
|
|
237
|
-
models_createimageop.CreateImageTimeoutTypedDict,
|
|
238
|
-
]
|
|
239
|
-
] = None,
|
|
240
160
|
orq: Optional[
|
|
241
161
|
Union[
|
|
242
162
|
models_createimageop.CreateImageOrq,
|
|
@@ -263,12 +183,6 @@ class Generations(BaseSDK):
|
|
|
263
183
|
:param response_format: The format in which generated images are returned. Must be one of `url` or `b64_json`. This parameter isn't supported for `gpt-image-1` which will always return base64-encoded images.
|
|
264
184
|
:param size: The size of the generated images. Must be one of the specified sizes for each model.
|
|
265
185
|
:param style: The style of the generated images. This parameter is only supported for `openai/dall-e-3`. Must be one of `vivid` or `natural`.
|
|
266
|
-
:param name: The name to display on the trace. If not specified, the default system name will be used.
|
|
267
|
-
:param fallbacks: Array of fallback models to use if primary model fails
|
|
268
|
-
:param retry: Retry configuration for the request
|
|
269
|
-
:param cache: Cache configuration for the request.
|
|
270
|
-
:param load_balancer: Load balancer configuration for the request.
|
|
271
|
-
:param timeout: 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.
|
|
272
186
|
:param orq:
|
|
273
187
|
:param retries: Override the default retry configuration for this method
|
|
274
188
|
:param server_url: Override the default server URL for this method
|
|
@@ -300,18 +214,6 @@ class Generations(BaseSDK):
|
|
|
300
214
|
response_format=response_format,
|
|
301
215
|
size=size,
|
|
302
216
|
style=style,
|
|
303
|
-
name=name,
|
|
304
|
-
fallbacks=utils.get_pydantic_model(
|
|
305
|
-
fallbacks, Optional[List[models.CreateImageFallbacks]]
|
|
306
|
-
),
|
|
307
|
-
retry=utils.get_pydantic_model(retry, Optional[models.CreateImageRetry]),
|
|
308
|
-
cache=utils.get_pydantic_model(cache, Optional[models.CreateImageCache]),
|
|
309
|
-
load_balancer=utils.get_pydantic_model(
|
|
310
|
-
load_balancer, Optional[models.CreateImageLoadBalancer]
|
|
311
|
-
),
|
|
312
|
-
timeout=utils.get_pydantic_model(
|
|
313
|
-
timeout, Optional[models.CreateImageTimeout]
|
|
314
|
-
),
|
|
315
217
|
orq=utils.get_pydantic_model(orq, Optional[models.CreateImageOrq]),
|
|
316
218
|
)
|
|
317
219
|
|