orq-ai-sdk 4.2.0rc48__py3-none-any.whl → 4.2.12__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- orq_ai_sdk/_hooks/globalhook.py +0 -1
- orq_ai_sdk/_version.py +3 -3
- orq_ai_sdk/audio.py +30 -0
- orq_ai_sdk/chat.py +22 -0
- orq_ai_sdk/completions.py +438 -0
- orq_ai_sdk/contacts.py +43 -886
- orq_ai_sdk/deployments.py +61 -0
- orq_ai_sdk/edits.py +364 -0
- orq_ai_sdk/embeddings.py +344 -0
- orq_ai_sdk/generations.py +370 -0
- orq_ai_sdk/images.py +28 -0
- orq_ai_sdk/models/__init__.py +3839 -424
- orq_ai_sdk/models/conversationresponse.py +1 -1
- orq_ai_sdk/models/conversationwithmessagesresponse.py +1 -1
- orq_ai_sdk/models/createagentrequestop.py +768 -12
- orq_ai_sdk/models/createagentresponse.py +68 -2
- orq_ai_sdk/models/createchatcompletionop.py +538 -313
- orq_ai_sdk/models/createcompletionop.py +2078 -0
- orq_ai_sdk/models/createcontactop.py +5 -10
- 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 +579 -0
- orq_ai_sdk/models/createevalop.py +14 -14
- orq_ai_sdk/models/createidentityop.py +1 -1
- orq_ai_sdk/models/createimageeditop.py +715 -0
- orq_ai_sdk/models/createimageop.py +228 -82
- orq_ai_sdk/models/createimagevariationop.py +706 -0
- orq_ai_sdk/models/creatememoryop.py +4 -2
- orq_ai_sdk/models/createmoderationop.py +521 -0
- orq_ai_sdk/models/createpromptop.py +375 -6
- orq_ai_sdk/models/creatererankop.py +608 -0
- orq_ai_sdk/models/createresponseop.py +2567 -0
- orq_ai_sdk/models/createspeechop.py +466 -0
- orq_ai_sdk/models/createtoolop.py +6 -6
- orq_ai_sdk/models/createtranscriptionop.py +732 -0
- orq_ai_sdk/models/createtranslationop.py +702 -0
- orq_ai_sdk/models/deploymentgetconfigop.py +17 -7
- orq_ai_sdk/models/deploymentsop.py +1 -0
- orq_ai_sdk/models/deploymentstreamop.py +7 -0
- 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/getallmemoriesop.py +4 -2
- orq_ai_sdk/models/getallpromptsop.py +188 -3
- orq_ai_sdk/models/getalltoolsop.py +6 -6
- orq_ai_sdk/models/getevalsop.py +17 -17
- orq_ai_sdk/models/getonepromptop.py +188 -3
- orq_ai_sdk/models/getpromptversionop.py +188 -3
- orq_ai_sdk/models/invokedeploymentrequest.py +11 -4
- orq_ai_sdk/models/listagentsop.py +372 -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/listmodelsop.py +1 -0
- orq_ai_sdk/models/listpromptversionsop.py +188 -3
- orq_ai_sdk/models/partdoneevent.py +1 -1
- orq_ai_sdk/models/post_v2_router_ocrop.py +408 -0
- orq_ai_sdk/models/publiccontact.py +9 -3
- orq_ai_sdk/models/publicidentity.py +62 -0
- orq_ai_sdk/models/reasoningpart.py +1 -1
- orq_ai_sdk/models/responsedoneevent.py +14 -11
- orq_ai_sdk/models/retrieveagentrequestop.py +382 -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/retrievememoryop.py +4 -2
- orq_ai_sdk/models/retrievetoolop.py +6 -6
- orq_ai_sdk/models/runagentop.py +379 -9
- orq_ai_sdk/models/streamrunagentop.py +385 -9
- orq_ai_sdk/models/updateagentop.py +770 -12
- 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/updatememoryop.py +4 -2
- orq_ai_sdk/models/updatepromptop.py +375 -6
- orq_ai_sdk/models/updatetoolop.py +7 -7
- orq_ai_sdk/moderations.py +218 -0
- orq_ai_sdk/orq_completions.py +666 -0
- orq_ai_sdk/orq_responses.py +398 -0
- orq_ai_sdk/rerank.py +330 -0
- orq_ai_sdk/router.py +89 -641
- orq_ai_sdk/speech.py +333 -0
- orq_ai_sdk/transcriptions.py +416 -0
- orq_ai_sdk/translations.py +384 -0
- orq_ai_sdk/variations.py +364 -0
- orq_ai_sdk-4.2.12.dist-info/METADATA +888 -0
- {orq_ai_sdk-4.2.0rc48.dist-info → orq_ai_sdk-4.2.12.dist-info}/RECORD +98 -75
- {orq_ai_sdk-4.2.0rc48.dist-info → orq_ai_sdk-4.2.12.dist-info}/WHEEL +1 -1
- orq_ai_sdk/models/deletecontactop.py +0 -44
- orq_ai_sdk/models/listcontactsop.py +0 -265
- orq_ai_sdk/models/retrievecontactop.py +0 -142
- orq_ai_sdk/models/updatecontactop.py +0 -233
- orq_ai_sdk-4.2.0rc48.dist-info/METADATA +0 -788
- {orq_ai_sdk-4.2.0rc48.dist-info → orq_ai_sdk-4.2.12.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,579 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from .publiccontact import PublicContact, PublicContactTypedDict
|
|
5
|
+
from .publicidentity import PublicIdentity, PublicIdentityTypedDict
|
|
6
|
+
from orq_ai_sdk.types import BaseModel, UNSET_SENTINEL
|
|
7
|
+
import pydantic
|
|
8
|
+
from pydantic import model_serializer
|
|
9
|
+
from typing import List, Literal, Optional, Union
|
|
10
|
+
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
CreateEmbeddingInputTypedDict = TypeAliasType(
|
|
14
|
+
"CreateEmbeddingInputTypedDict", Union[str, List[str]]
|
|
15
|
+
)
|
|
16
|
+
r"""Input text to embed, encoded as a string or array of tokens."""
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
CreateEmbeddingInput = TypeAliasType("CreateEmbeddingInput", Union[str, List[str]])
|
|
20
|
+
r"""Input text to embed, encoded as a string or array of tokens."""
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
EncodingFormat = Literal[
|
|
24
|
+
"base64",
|
|
25
|
+
"float",
|
|
26
|
+
]
|
|
27
|
+
r"""Type of the document element"""
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class CreateEmbeddingFallbacksTypedDict(TypedDict):
|
|
31
|
+
model: str
|
|
32
|
+
r"""Fallback model identifier"""
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class CreateEmbeddingFallbacks(BaseModel):
|
|
36
|
+
model: str
|
|
37
|
+
r"""Fallback model identifier"""
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class CreateEmbeddingRetryTypedDict(TypedDict):
|
|
41
|
+
r"""Retry configuration for the request"""
|
|
42
|
+
|
|
43
|
+
count: NotRequired[float]
|
|
44
|
+
r"""Number of retry attempts (1-5)"""
|
|
45
|
+
on_codes: NotRequired[List[float]]
|
|
46
|
+
r"""HTTP status codes that trigger retry logic"""
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
class CreateEmbeddingRetry(BaseModel):
|
|
50
|
+
r"""Retry configuration for the request"""
|
|
51
|
+
|
|
52
|
+
count: Optional[float] = 3
|
|
53
|
+
r"""Number of retry attempts (1-5)"""
|
|
54
|
+
|
|
55
|
+
on_codes: Optional[List[float]] = None
|
|
56
|
+
r"""HTTP status codes that trigger retry logic"""
|
|
57
|
+
|
|
58
|
+
@model_serializer(mode="wrap")
|
|
59
|
+
def serialize_model(self, handler):
|
|
60
|
+
optional_fields = set(["count", "on_codes"])
|
|
61
|
+
serialized = handler(self)
|
|
62
|
+
m = {}
|
|
63
|
+
|
|
64
|
+
for n, f in type(self).model_fields.items():
|
|
65
|
+
k = f.alias or n
|
|
66
|
+
val = serialized.get(k)
|
|
67
|
+
|
|
68
|
+
if val != UNSET_SENTINEL:
|
|
69
|
+
if val is not None or k not in optional_fields:
|
|
70
|
+
m[k] = val
|
|
71
|
+
|
|
72
|
+
return m
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
CreateEmbeddingType = Literal["exact_match",]
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
class CreateEmbeddingCacheTypedDict(TypedDict):
|
|
79
|
+
r"""Cache configuration for the request."""
|
|
80
|
+
|
|
81
|
+
type: CreateEmbeddingType
|
|
82
|
+
ttl: NotRequired[float]
|
|
83
|
+
r"""Time to live for cached responses in seconds. Maximum 259200 seconds (3 days)."""
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
class CreateEmbeddingCache(BaseModel):
|
|
87
|
+
r"""Cache configuration for the request."""
|
|
88
|
+
|
|
89
|
+
type: CreateEmbeddingType
|
|
90
|
+
|
|
91
|
+
ttl: Optional[float] = 1800
|
|
92
|
+
r"""Time to live for cached responses in seconds. Maximum 259200 seconds (3 days)."""
|
|
93
|
+
|
|
94
|
+
@model_serializer(mode="wrap")
|
|
95
|
+
def serialize_model(self, handler):
|
|
96
|
+
optional_fields = set(["ttl"])
|
|
97
|
+
serialized = handler(self)
|
|
98
|
+
m = {}
|
|
99
|
+
|
|
100
|
+
for n, f in type(self).model_fields.items():
|
|
101
|
+
k = f.alias or n
|
|
102
|
+
val = serialized.get(k)
|
|
103
|
+
|
|
104
|
+
if val != UNSET_SENTINEL:
|
|
105
|
+
if val is not None or k not in optional_fields:
|
|
106
|
+
m[k] = val
|
|
107
|
+
|
|
108
|
+
return m
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
CreateEmbeddingLoadBalancerType = Literal["weight_based",]
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
class CreateEmbeddingLoadBalancerModelsTypedDict(TypedDict):
|
|
115
|
+
model: str
|
|
116
|
+
r"""Model identifier for load balancing"""
|
|
117
|
+
weight: NotRequired[float]
|
|
118
|
+
r"""Weight assigned to this model for load balancing"""
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
class CreateEmbeddingLoadBalancerModels(BaseModel):
|
|
122
|
+
model: str
|
|
123
|
+
r"""Model identifier for load balancing"""
|
|
124
|
+
|
|
125
|
+
weight: Optional[float] = 0.5
|
|
126
|
+
r"""Weight assigned to this model for load balancing"""
|
|
127
|
+
|
|
128
|
+
@model_serializer(mode="wrap")
|
|
129
|
+
def serialize_model(self, handler):
|
|
130
|
+
optional_fields = set(["weight"])
|
|
131
|
+
serialized = handler(self)
|
|
132
|
+
m = {}
|
|
133
|
+
|
|
134
|
+
for n, f in type(self).model_fields.items():
|
|
135
|
+
k = f.alias or n
|
|
136
|
+
val = serialized.get(k)
|
|
137
|
+
|
|
138
|
+
if val != UNSET_SENTINEL:
|
|
139
|
+
if val is not None or k not in optional_fields:
|
|
140
|
+
m[k] = val
|
|
141
|
+
|
|
142
|
+
return m
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
class CreateEmbeddingLoadBalancer1TypedDict(TypedDict):
|
|
146
|
+
type: CreateEmbeddingLoadBalancerType
|
|
147
|
+
models: List[CreateEmbeddingLoadBalancerModelsTypedDict]
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
class CreateEmbeddingLoadBalancer1(BaseModel):
|
|
151
|
+
type: CreateEmbeddingLoadBalancerType
|
|
152
|
+
|
|
153
|
+
models: List[CreateEmbeddingLoadBalancerModels]
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
CreateEmbeddingLoadBalancerTypedDict = CreateEmbeddingLoadBalancer1TypedDict
|
|
157
|
+
r"""Load balancer configuration for the request."""
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
CreateEmbeddingLoadBalancer = CreateEmbeddingLoadBalancer1
|
|
161
|
+
r"""Load balancer configuration for the request."""
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
class CreateEmbeddingTimeoutTypedDict(TypedDict):
|
|
165
|
+
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."""
|
|
166
|
+
|
|
167
|
+
call_timeout: float
|
|
168
|
+
r"""Timeout value in milliseconds"""
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
class CreateEmbeddingTimeout(BaseModel):
|
|
172
|
+
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."""
|
|
173
|
+
|
|
174
|
+
call_timeout: float
|
|
175
|
+
r"""Timeout value in milliseconds"""
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
class CreateEmbeddingRouterEmbeddingsFallbacksTypedDict(TypedDict):
|
|
179
|
+
model: str
|
|
180
|
+
r"""Fallback model identifier"""
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
class CreateEmbeddingRouterEmbeddingsFallbacks(BaseModel):
|
|
184
|
+
model: str
|
|
185
|
+
r"""Fallback model identifier"""
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
CreateEmbeddingRouterEmbeddingsType = Literal["exact_match",]
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
class CreateEmbeddingRouterEmbeddingsCacheTypedDict(TypedDict):
|
|
192
|
+
r"""Cache configuration for the request."""
|
|
193
|
+
|
|
194
|
+
type: CreateEmbeddingRouterEmbeddingsType
|
|
195
|
+
ttl: NotRequired[float]
|
|
196
|
+
r"""Time to live for cached responses in seconds. Maximum 259200 seconds (3 days)."""
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
class CreateEmbeddingRouterEmbeddingsCache(BaseModel):
|
|
200
|
+
r"""Cache configuration for the request."""
|
|
201
|
+
|
|
202
|
+
type: CreateEmbeddingRouterEmbeddingsType
|
|
203
|
+
|
|
204
|
+
ttl: Optional[float] = 1800
|
|
205
|
+
r"""Time to live for cached responses in seconds. Maximum 259200 seconds (3 days)."""
|
|
206
|
+
|
|
207
|
+
@model_serializer(mode="wrap")
|
|
208
|
+
def serialize_model(self, handler):
|
|
209
|
+
optional_fields = set(["ttl"])
|
|
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 CreateEmbeddingRouterEmbeddingsRetryTypedDict(TypedDict):
|
|
225
|
+
r"""Retry configuration for the request"""
|
|
226
|
+
|
|
227
|
+
count: NotRequired[float]
|
|
228
|
+
r"""Number of retry attempts (1-5)"""
|
|
229
|
+
on_codes: NotRequired[List[float]]
|
|
230
|
+
r"""HTTP status codes that trigger retry logic"""
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
class CreateEmbeddingRouterEmbeddingsRetry(BaseModel):
|
|
234
|
+
r"""Retry configuration for the request"""
|
|
235
|
+
|
|
236
|
+
count: Optional[float] = 3
|
|
237
|
+
r"""Number of retry attempts (1-5)"""
|
|
238
|
+
|
|
239
|
+
on_codes: Optional[List[float]] = None
|
|
240
|
+
r"""HTTP status codes that trigger retry logic"""
|
|
241
|
+
|
|
242
|
+
@model_serializer(mode="wrap")
|
|
243
|
+
def serialize_model(self, handler):
|
|
244
|
+
optional_fields = set(["count", "on_codes"])
|
|
245
|
+
serialized = handler(self)
|
|
246
|
+
m = {}
|
|
247
|
+
|
|
248
|
+
for n, f in type(self).model_fields.items():
|
|
249
|
+
k = f.alias or n
|
|
250
|
+
val = serialized.get(k)
|
|
251
|
+
|
|
252
|
+
if val != UNSET_SENTINEL:
|
|
253
|
+
if val is not None or k not in optional_fields:
|
|
254
|
+
m[k] = val
|
|
255
|
+
|
|
256
|
+
return m
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
CreateEmbeddingLoadBalancerRouterEmbeddingsType = Literal["weight_based",]
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
class CreateEmbeddingLoadBalancerRouterEmbeddingsModelsTypedDict(TypedDict):
|
|
263
|
+
model: str
|
|
264
|
+
r"""Model identifier for load balancing"""
|
|
265
|
+
weight: NotRequired[float]
|
|
266
|
+
r"""Weight assigned to this model for load balancing"""
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
class CreateEmbeddingLoadBalancerRouterEmbeddingsModels(BaseModel):
|
|
270
|
+
model: str
|
|
271
|
+
r"""Model identifier for load balancing"""
|
|
272
|
+
|
|
273
|
+
weight: Optional[float] = 0.5
|
|
274
|
+
r"""Weight assigned to this model for load balancing"""
|
|
275
|
+
|
|
276
|
+
@model_serializer(mode="wrap")
|
|
277
|
+
def serialize_model(self, handler):
|
|
278
|
+
optional_fields = set(["weight"])
|
|
279
|
+
serialized = handler(self)
|
|
280
|
+
m = {}
|
|
281
|
+
|
|
282
|
+
for n, f in type(self).model_fields.items():
|
|
283
|
+
k = f.alias or n
|
|
284
|
+
val = serialized.get(k)
|
|
285
|
+
|
|
286
|
+
if val != UNSET_SENTINEL:
|
|
287
|
+
if val is not None or k not in optional_fields:
|
|
288
|
+
m[k] = val
|
|
289
|
+
|
|
290
|
+
return m
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
class CreateEmbeddingLoadBalancerRouterEmbeddings1TypedDict(TypedDict):
|
|
294
|
+
type: CreateEmbeddingLoadBalancerRouterEmbeddingsType
|
|
295
|
+
models: List[CreateEmbeddingLoadBalancerRouterEmbeddingsModelsTypedDict]
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
class CreateEmbeddingLoadBalancerRouterEmbeddings1(BaseModel):
|
|
299
|
+
type: CreateEmbeddingLoadBalancerRouterEmbeddingsType
|
|
300
|
+
|
|
301
|
+
models: List[CreateEmbeddingLoadBalancerRouterEmbeddingsModels]
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
CreateEmbeddingRouterEmbeddingsLoadBalancerTypedDict = (
|
|
305
|
+
CreateEmbeddingLoadBalancerRouterEmbeddings1TypedDict
|
|
306
|
+
)
|
|
307
|
+
r"""Array of models with weights for load balancing requests"""
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
CreateEmbeddingRouterEmbeddingsLoadBalancer = (
|
|
311
|
+
CreateEmbeddingLoadBalancerRouterEmbeddings1
|
|
312
|
+
)
|
|
313
|
+
r"""Array of models with weights for load balancing requests"""
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
class CreateEmbeddingRouterEmbeddingsTimeoutTypedDict(TypedDict):
|
|
317
|
+
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."""
|
|
318
|
+
|
|
319
|
+
call_timeout: float
|
|
320
|
+
r"""Timeout value in milliseconds"""
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
class CreateEmbeddingRouterEmbeddingsTimeout(BaseModel):
|
|
324
|
+
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."""
|
|
325
|
+
|
|
326
|
+
call_timeout: float
|
|
327
|
+
r"""Timeout value in milliseconds"""
|
|
328
|
+
|
|
329
|
+
|
|
330
|
+
class CreateEmbeddingOrqTypedDict(TypedDict):
|
|
331
|
+
name: NotRequired[str]
|
|
332
|
+
r"""The name to display on the trace. If not specified, the default system name will be used."""
|
|
333
|
+
fallbacks: NotRequired[List[CreateEmbeddingRouterEmbeddingsFallbacksTypedDict]]
|
|
334
|
+
r"""Array of fallback models to use if primary model fails"""
|
|
335
|
+
cache: NotRequired[CreateEmbeddingRouterEmbeddingsCacheTypedDict]
|
|
336
|
+
r"""Cache configuration for the request."""
|
|
337
|
+
retry: NotRequired[CreateEmbeddingRouterEmbeddingsRetryTypedDict]
|
|
338
|
+
r"""Retry configuration for the request"""
|
|
339
|
+
identity: NotRequired[PublicIdentityTypedDict]
|
|
340
|
+
r"""Information about the identity making the request. If the identity does not exist, it will be created automatically."""
|
|
341
|
+
contact: NotRequired[PublicContactTypedDict]
|
|
342
|
+
r"""@deprecated Use identity instead. Information about the contact making the request."""
|
|
343
|
+
load_balancer: NotRequired[CreateEmbeddingRouterEmbeddingsLoadBalancerTypedDict]
|
|
344
|
+
r"""Array of models with weights for load balancing requests"""
|
|
345
|
+
timeout: NotRequired[CreateEmbeddingRouterEmbeddingsTimeoutTypedDict]
|
|
346
|
+
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."""
|
|
347
|
+
|
|
348
|
+
|
|
349
|
+
class CreateEmbeddingOrq(BaseModel):
|
|
350
|
+
name: Optional[str] = None
|
|
351
|
+
r"""The name to display on the trace. If not specified, the default system name will be used."""
|
|
352
|
+
|
|
353
|
+
fallbacks: Optional[List[CreateEmbeddingRouterEmbeddingsFallbacks]] = None
|
|
354
|
+
r"""Array of fallback models to use if primary model fails"""
|
|
355
|
+
|
|
356
|
+
cache: Optional[CreateEmbeddingRouterEmbeddingsCache] = None
|
|
357
|
+
r"""Cache configuration for the request."""
|
|
358
|
+
|
|
359
|
+
retry: Optional[CreateEmbeddingRouterEmbeddingsRetry] = None
|
|
360
|
+
r"""Retry configuration for the request"""
|
|
361
|
+
|
|
362
|
+
identity: Optional[PublicIdentity] = None
|
|
363
|
+
r"""Information about the identity making the request. If the identity does not exist, it will be created automatically."""
|
|
364
|
+
|
|
365
|
+
contact: Annotated[
|
|
366
|
+
Optional[PublicContact],
|
|
367
|
+
pydantic.Field(
|
|
368
|
+
deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
369
|
+
),
|
|
370
|
+
] = None
|
|
371
|
+
r"""@deprecated Use identity instead. Information about the contact making the request."""
|
|
372
|
+
|
|
373
|
+
load_balancer: Optional[CreateEmbeddingRouterEmbeddingsLoadBalancer] = None
|
|
374
|
+
r"""Array of models with weights for load balancing requests"""
|
|
375
|
+
|
|
376
|
+
timeout: Optional[CreateEmbeddingRouterEmbeddingsTimeout] = None
|
|
377
|
+
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."""
|
|
378
|
+
|
|
379
|
+
@model_serializer(mode="wrap")
|
|
380
|
+
def serialize_model(self, handler):
|
|
381
|
+
optional_fields = set(
|
|
382
|
+
[
|
|
383
|
+
"name",
|
|
384
|
+
"fallbacks",
|
|
385
|
+
"cache",
|
|
386
|
+
"retry",
|
|
387
|
+
"identity",
|
|
388
|
+
"contact",
|
|
389
|
+
"load_balancer",
|
|
390
|
+
"timeout",
|
|
391
|
+
]
|
|
392
|
+
)
|
|
393
|
+
serialized = handler(self)
|
|
394
|
+
m = {}
|
|
395
|
+
|
|
396
|
+
for n, f in type(self).model_fields.items():
|
|
397
|
+
k = f.alias or n
|
|
398
|
+
val = serialized.get(k)
|
|
399
|
+
|
|
400
|
+
if val != UNSET_SENTINEL:
|
|
401
|
+
if val is not None or k not in optional_fields:
|
|
402
|
+
m[k] = val
|
|
403
|
+
|
|
404
|
+
return m
|
|
405
|
+
|
|
406
|
+
|
|
407
|
+
class CreateEmbeddingRequestBodyTypedDict(TypedDict):
|
|
408
|
+
r"""input"""
|
|
409
|
+
|
|
410
|
+
input: CreateEmbeddingInputTypedDict
|
|
411
|
+
r"""Input text to embed, encoded as a string or array of tokens."""
|
|
412
|
+
model: str
|
|
413
|
+
r"""ID of the model to use"""
|
|
414
|
+
encoding_format: NotRequired[EncodingFormat]
|
|
415
|
+
r"""Type of the document element"""
|
|
416
|
+
dimensions: NotRequired[float]
|
|
417
|
+
r"""The number of dimensions the resulting output embeddings should have."""
|
|
418
|
+
user: NotRequired[str]
|
|
419
|
+
r"""A unique identifier representing your end-user"""
|
|
420
|
+
name: NotRequired[str]
|
|
421
|
+
r"""The name to display on the trace. If not specified, the default system name will be used."""
|
|
422
|
+
fallbacks: NotRequired[List[CreateEmbeddingFallbacksTypedDict]]
|
|
423
|
+
r"""Array of fallback models to use if primary model fails"""
|
|
424
|
+
retry: NotRequired[CreateEmbeddingRetryTypedDict]
|
|
425
|
+
r"""Retry configuration for the request"""
|
|
426
|
+
cache: NotRequired[CreateEmbeddingCacheTypedDict]
|
|
427
|
+
r"""Cache configuration for the request."""
|
|
428
|
+
load_balancer: NotRequired[CreateEmbeddingLoadBalancerTypedDict]
|
|
429
|
+
r"""Load balancer configuration for the request."""
|
|
430
|
+
timeout: NotRequired[CreateEmbeddingTimeoutTypedDict]
|
|
431
|
+
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."""
|
|
432
|
+
orq: NotRequired[CreateEmbeddingOrqTypedDict]
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
class CreateEmbeddingRequestBody(BaseModel):
|
|
436
|
+
r"""input"""
|
|
437
|
+
|
|
438
|
+
input: CreateEmbeddingInput
|
|
439
|
+
r"""Input text to embed, encoded as a string or array of tokens."""
|
|
440
|
+
|
|
441
|
+
model: str
|
|
442
|
+
r"""ID of the model to use"""
|
|
443
|
+
|
|
444
|
+
encoding_format: Optional[EncodingFormat] = "float"
|
|
445
|
+
r"""Type of the document element"""
|
|
446
|
+
|
|
447
|
+
dimensions: Optional[float] = None
|
|
448
|
+
r"""The number of dimensions the resulting output embeddings should have."""
|
|
449
|
+
|
|
450
|
+
user: Optional[str] = None
|
|
451
|
+
r"""A unique identifier representing your end-user"""
|
|
452
|
+
|
|
453
|
+
name: Optional[str] = None
|
|
454
|
+
r"""The name to display on the trace. If not specified, the default system name will be used."""
|
|
455
|
+
|
|
456
|
+
fallbacks: Optional[List[CreateEmbeddingFallbacks]] = None
|
|
457
|
+
r"""Array of fallback models to use if primary model fails"""
|
|
458
|
+
|
|
459
|
+
retry: Optional[CreateEmbeddingRetry] = None
|
|
460
|
+
r"""Retry configuration for the request"""
|
|
461
|
+
|
|
462
|
+
cache: Optional[CreateEmbeddingCache] = None
|
|
463
|
+
r"""Cache configuration for the request."""
|
|
464
|
+
|
|
465
|
+
load_balancer: Optional[CreateEmbeddingLoadBalancer] = None
|
|
466
|
+
r"""Load balancer configuration for the request."""
|
|
467
|
+
|
|
468
|
+
timeout: Optional[CreateEmbeddingTimeout] = None
|
|
469
|
+
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."""
|
|
470
|
+
|
|
471
|
+
orq: Optional[CreateEmbeddingOrq] = None
|
|
472
|
+
|
|
473
|
+
@model_serializer(mode="wrap")
|
|
474
|
+
def serialize_model(self, handler):
|
|
475
|
+
optional_fields = set(
|
|
476
|
+
[
|
|
477
|
+
"encoding_format",
|
|
478
|
+
"dimensions",
|
|
479
|
+
"user",
|
|
480
|
+
"name",
|
|
481
|
+
"fallbacks",
|
|
482
|
+
"retry",
|
|
483
|
+
"cache",
|
|
484
|
+
"load_balancer",
|
|
485
|
+
"timeout",
|
|
486
|
+
"orq",
|
|
487
|
+
]
|
|
488
|
+
)
|
|
489
|
+
serialized = handler(self)
|
|
490
|
+
m = {}
|
|
491
|
+
|
|
492
|
+
for n, f in type(self).model_fields.items():
|
|
493
|
+
k = f.alias or n
|
|
494
|
+
val = serialized.get(k)
|
|
495
|
+
|
|
496
|
+
if val != UNSET_SENTINEL:
|
|
497
|
+
if val is not None or k not in optional_fields:
|
|
498
|
+
m[k] = val
|
|
499
|
+
|
|
500
|
+
return m
|
|
501
|
+
|
|
502
|
+
|
|
503
|
+
CreateEmbeddingObject = Literal["list",]
|
|
504
|
+
|
|
505
|
+
|
|
506
|
+
CreateEmbeddingRouterEmbeddingsObject = Literal["embedding",]
|
|
507
|
+
r"""The object type, which is always `embedding`."""
|
|
508
|
+
|
|
509
|
+
|
|
510
|
+
EmbeddingTypedDict = TypeAliasType("EmbeddingTypedDict", Union[List[float], str])
|
|
511
|
+
r"""The embedding vector, which is a list of floats. The length of vector depends on the model."""
|
|
512
|
+
|
|
513
|
+
|
|
514
|
+
Embedding = TypeAliasType("Embedding", Union[List[float], str])
|
|
515
|
+
r"""The embedding vector, which is a list of floats. The length of vector depends on the model."""
|
|
516
|
+
|
|
517
|
+
|
|
518
|
+
class CreateEmbeddingDataTypedDict(TypedDict):
|
|
519
|
+
object: CreateEmbeddingRouterEmbeddingsObject
|
|
520
|
+
r"""The object type, which is always `embedding`."""
|
|
521
|
+
embedding: EmbeddingTypedDict
|
|
522
|
+
r"""The embedding vector, which is a list of floats. The length of vector depends on the model."""
|
|
523
|
+
index: float
|
|
524
|
+
r"""The index of the embedding in the list of embeddings."""
|
|
525
|
+
|
|
526
|
+
|
|
527
|
+
class CreateEmbeddingData(BaseModel):
|
|
528
|
+
object: CreateEmbeddingRouterEmbeddingsObject
|
|
529
|
+
r"""The object type, which is always `embedding`."""
|
|
530
|
+
|
|
531
|
+
embedding: Embedding
|
|
532
|
+
r"""The embedding vector, which is a list of floats. The length of vector depends on the model."""
|
|
533
|
+
|
|
534
|
+
index: float
|
|
535
|
+
r"""The index of the embedding in the list of embeddings."""
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
class CreateEmbeddingUsageTypedDict(TypedDict):
|
|
539
|
+
r"""The usage information for the request."""
|
|
540
|
+
|
|
541
|
+
prompt_tokens: float
|
|
542
|
+
r"""The number of tokens used by the prompt."""
|
|
543
|
+
total_tokens: float
|
|
544
|
+
r"""The total number of tokens used by the request."""
|
|
545
|
+
|
|
546
|
+
|
|
547
|
+
class CreateEmbeddingUsage(BaseModel):
|
|
548
|
+
r"""The usage information for the request."""
|
|
549
|
+
|
|
550
|
+
prompt_tokens: float
|
|
551
|
+
r"""The number of tokens used by the prompt."""
|
|
552
|
+
|
|
553
|
+
total_tokens: float
|
|
554
|
+
r"""The total number of tokens used by the request."""
|
|
555
|
+
|
|
556
|
+
|
|
557
|
+
class CreateEmbeddingResponseBodyTypedDict(TypedDict):
|
|
558
|
+
r"""Returns the embedding vector."""
|
|
559
|
+
|
|
560
|
+
object: CreateEmbeddingObject
|
|
561
|
+
data: List[CreateEmbeddingDataTypedDict]
|
|
562
|
+
model: str
|
|
563
|
+
r"""ID of the model to used."""
|
|
564
|
+
usage: CreateEmbeddingUsageTypedDict
|
|
565
|
+
r"""The usage information for the request."""
|
|
566
|
+
|
|
567
|
+
|
|
568
|
+
class CreateEmbeddingResponseBody(BaseModel):
|
|
569
|
+
r"""Returns the embedding vector."""
|
|
570
|
+
|
|
571
|
+
object: CreateEmbeddingObject
|
|
572
|
+
|
|
573
|
+
data: List[CreateEmbeddingData]
|
|
574
|
+
|
|
575
|
+
model: str
|
|
576
|
+
r"""ID of the model to used."""
|
|
577
|
+
|
|
578
|
+
usage: CreateEmbeddingUsage
|
|
579
|
+
r"""The usage information for the request."""
|
|
@@ -884,9 +884,9 @@ class Typescript(BaseModel):
|
|
|
884
884
|
|
|
885
885
|
key: str
|
|
886
886
|
|
|
887
|
-
created: Optional[str] = "2026-01-
|
|
887
|
+
created: Optional[str] = "2026-01-27T09:10:36.045Z"
|
|
888
888
|
|
|
889
|
-
updated: Optional[str] = "2026-01-
|
|
889
|
+
updated: Optional[str] = "2026-01-27T09:10:36.045Z"
|
|
890
890
|
|
|
891
891
|
guardrail_config: Optional[
|
|
892
892
|
CreateEvalResponseBodyEvalsResponse200ApplicationJSON7GuardrailConfig
|
|
@@ -1080,9 +1080,9 @@ class Ragas(BaseModel):
|
|
|
1080
1080
|
|
|
1081
1081
|
model: str
|
|
1082
1082
|
|
|
1083
|
-
created: Optional[str] = "2026-01-
|
|
1083
|
+
created: Optional[str] = "2026-01-27T09:10:36.045Z"
|
|
1084
1084
|
|
|
1085
|
-
updated: Optional[str] = "2026-01-
|
|
1085
|
+
updated: Optional[str] = "2026-01-27T09:10:36.045Z"
|
|
1086
1086
|
|
|
1087
1087
|
guardrail_config: Optional[
|
|
1088
1088
|
CreateEvalResponseBodyEvalsResponse200ApplicationJSONGuardrailConfig
|
|
@@ -1775,9 +1775,9 @@ class CreateEvalResponseBodyFunction(BaseModel):
|
|
|
1775
1775
|
|
|
1776
1776
|
key: str
|
|
1777
1777
|
|
|
1778
|
-
created: Optional[str] = "2026-01-
|
|
1778
|
+
created: Optional[str] = "2026-01-27T09:10:36.045Z"
|
|
1779
1779
|
|
|
1780
|
-
updated: Optional[str] = "2026-01-
|
|
1780
|
+
updated: Optional[str] = "2026-01-27T09:10:36.045Z"
|
|
1781
1781
|
|
|
1782
1782
|
guardrail_config: Optional[
|
|
1783
1783
|
CreateEvalResponseBodyEvalsResponse200GuardrailConfig
|
|
@@ -1952,9 +1952,9 @@ class ResponseBodyPython(BaseModel):
|
|
|
1952
1952
|
|
|
1953
1953
|
key: str
|
|
1954
1954
|
|
|
1955
|
-
created: Optional[str] = "2026-01-
|
|
1955
|
+
created: Optional[str] = "2026-01-27T09:10:36.045Z"
|
|
1956
1956
|
|
|
1957
|
-
updated: Optional[str] = "2026-01-
|
|
1957
|
+
updated: Optional[str] = "2026-01-27T09:10:36.045Z"
|
|
1958
1958
|
|
|
1959
1959
|
guardrail_config: Optional[CreateEvalResponseBodyEvalsResponseGuardrailConfig] = (
|
|
1960
1960
|
None
|
|
@@ -2134,9 +2134,9 @@ class ResponseBodyHTTP(BaseModel):
|
|
|
2134
2134
|
|
|
2135
2135
|
key: str
|
|
2136
2136
|
|
|
2137
|
-
created: Optional[str] = "2026-01-
|
|
2137
|
+
created: Optional[str] = "2026-01-27T09:10:36.045Z"
|
|
2138
2138
|
|
|
2139
|
-
updated: Optional[str] = "2026-01-
|
|
2139
|
+
updated: Optional[str] = "2026-01-27T09:10:36.045Z"
|
|
2140
2140
|
|
|
2141
2141
|
guardrail_config: Optional[CreateEvalResponseBodyEvalsGuardrailConfig] = None
|
|
2142
2142
|
|
|
@@ -2287,9 +2287,9 @@ class ResponseBodyJSON(BaseModel):
|
|
|
2287
2287
|
|
|
2288
2288
|
key: str
|
|
2289
2289
|
|
|
2290
|
-
created: Optional[str] = "2026-01-
|
|
2290
|
+
created: Optional[str] = "2026-01-27T09:10:36.045Z"
|
|
2291
2291
|
|
|
2292
|
-
updated: Optional[str] = "2026-01-
|
|
2292
|
+
updated: Optional[str] = "2026-01-27T09:10:36.045Z"
|
|
2293
2293
|
|
|
2294
2294
|
guardrail_config: Optional[CreateEvalResponseBodyGuardrailConfig] = None
|
|
2295
2295
|
|
|
@@ -2441,9 +2441,9 @@ class ResponseBodyLLM(BaseModel):
|
|
|
2441
2441
|
|
|
2442
2442
|
model: str
|
|
2443
2443
|
|
|
2444
|
-
created: Optional[str] = "2026-01-
|
|
2444
|
+
created: Optional[str] = "2026-01-27T09:10:36.045Z"
|
|
2445
2445
|
|
|
2446
|
-
updated: Optional[str] = "2026-01-
|
|
2446
|
+
updated: Optional[str] = "2026-01-27T09:10:36.045Z"
|
|
2447
2447
|
|
|
2448
2448
|
guardrail_config: Optional[ResponseBodyGuardrailConfig] = None
|
|
2449
2449
|
|
|
@@ -137,7 +137,7 @@ class CreateIdentityResponseBody(BaseModel):
|
|
|
137
137
|
created: Optional[datetime] = None
|
|
138
138
|
r"""The date and time the resource was created"""
|
|
139
139
|
|
|
140
|
-
updated: Optional[datetime] = parse_datetime("2026-01-
|
|
140
|
+
updated: Optional[datetime] = parse_datetime("2026-01-27T09:10:34.517Z")
|
|
141
141
|
r"""The date and time the resource was last updated"""
|
|
142
142
|
|
|
143
143
|
@model_serializer(mode="wrap")
|