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
|
@@ -68,6 +68,7 @@ GetOnePromptModelType = Literal[
|
|
|
68
68
|
"tts",
|
|
69
69
|
"stt",
|
|
70
70
|
"rerank",
|
|
71
|
+
"ocr",
|
|
71
72
|
"moderation",
|
|
72
73
|
"vision",
|
|
73
74
|
]
|
|
@@ -666,7 +667,7 @@ GetOnePromptContent = TypeAliasType(
|
|
|
666
667
|
r"""The contents of the user message. Either the text content of the message or an array of content parts with a defined type, each can be of type `text` or `image_url` when passing in images. You can pass multiple images by adding multiple `image_url` content parts. Can be null for tool messages in certain scenarios."""
|
|
667
668
|
|
|
668
669
|
|
|
669
|
-
|
|
670
|
+
GetOnePromptPromptsResponseType = Literal["function",]
|
|
670
671
|
|
|
671
672
|
|
|
672
673
|
class GetOnePromptFunctionTypedDict(TypedDict):
|
|
@@ -683,14 +684,14 @@ class GetOnePromptFunction(BaseModel):
|
|
|
683
684
|
|
|
684
685
|
|
|
685
686
|
class GetOnePromptToolCallsTypedDict(TypedDict):
|
|
686
|
-
type:
|
|
687
|
+
type: GetOnePromptPromptsResponseType
|
|
687
688
|
function: GetOnePromptFunctionTypedDict
|
|
688
689
|
id: NotRequired[str]
|
|
689
690
|
index: NotRequired[float]
|
|
690
691
|
|
|
691
692
|
|
|
692
693
|
class GetOnePromptToolCalls(BaseModel):
|
|
693
|
-
type:
|
|
694
|
+
type: GetOnePromptPromptsResponseType
|
|
694
695
|
|
|
695
696
|
function: GetOnePromptFunction
|
|
696
697
|
|
|
@@ -1197,6 +1198,154 @@ class GetOnePromptGuardrails(BaseModel):
|
|
|
1197
1198
|
r"""Determines whether the guardrail runs on the input (user message) or output (model response)."""
|
|
1198
1199
|
|
|
1199
1200
|
|
|
1201
|
+
class GetOnePromptFallbacksTypedDict(TypedDict):
|
|
1202
|
+
model: str
|
|
1203
|
+
r"""Fallback model identifier"""
|
|
1204
|
+
|
|
1205
|
+
|
|
1206
|
+
class GetOnePromptFallbacks(BaseModel):
|
|
1207
|
+
model: str
|
|
1208
|
+
r"""Fallback model identifier"""
|
|
1209
|
+
|
|
1210
|
+
|
|
1211
|
+
class GetOnePromptRetryTypedDict(TypedDict):
|
|
1212
|
+
r"""Retry configuration for the request"""
|
|
1213
|
+
|
|
1214
|
+
count: NotRequired[float]
|
|
1215
|
+
r"""Number of retry attempts (1-5)"""
|
|
1216
|
+
on_codes: NotRequired[List[float]]
|
|
1217
|
+
r"""HTTP status codes that trigger retry logic"""
|
|
1218
|
+
|
|
1219
|
+
|
|
1220
|
+
class GetOnePromptRetry(BaseModel):
|
|
1221
|
+
r"""Retry configuration for the request"""
|
|
1222
|
+
|
|
1223
|
+
count: Optional[float] = 3
|
|
1224
|
+
r"""Number of retry attempts (1-5)"""
|
|
1225
|
+
|
|
1226
|
+
on_codes: Optional[List[float]] = None
|
|
1227
|
+
r"""HTTP status codes that trigger retry logic"""
|
|
1228
|
+
|
|
1229
|
+
@model_serializer(mode="wrap")
|
|
1230
|
+
def serialize_model(self, handler):
|
|
1231
|
+
optional_fields = set(["count", "on_codes"])
|
|
1232
|
+
serialized = handler(self)
|
|
1233
|
+
m = {}
|
|
1234
|
+
|
|
1235
|
+
for n, f in type(self).model_fields.items():
|
|
1236
|
+
k = f.alias or n
|
|
1237
|
+
val = serialized.get(k)
|
|
1238
|
+
|
|
1239
|
+
if val != UNSET_SENTINEL:
|
|
1240
|
+
if val is not None or k not in optional_fields:
|
|
1241
|
+
m[k] = val
|
|
1242
|
+
|
|
1243
|
+
return m
|
|
1244
|
+
|
|
1245
|
+
|
|
1246
|
+
GetOnePromptPromptsType = Literal["exact_match",]
|
|
1247
|
+
|
|
1248
|
+
|
|
1249
|
+
class GetOnePromptCacheTypedDict(TypedDict):
|
|
1250
|
+
r"""Cache configuration for the request."""
|
|
1251
|
+
|
|
1252
|
+
type: GetOnePromptPromptsType
|
|
1253
|
+
ttl: NotRequired[float]
|
|
1254
|
+
r"""Time to live for cached responses in seconds. Maximum 259200 seconds (3 days)."""
|
|
1255
|
+
|
|
1256
|
+
|
|
1257
|
+
class GetOnePromptCache(BaseModel):
|
|
1258
|
+
r"""Cache configuration for the request."""
|
|
1259
|
+
|
|
1260
|
+
type: GetOnePromptPromptsType
|
|
1261
|
+
|
|
1262
|
+
ttl: Optional[float] = 1800
|
|
1263
|
+
r"""Time to live for cached responses in seconds. Maximum 259200 seconds (3 days)."""
|
|
1264
|
+
|
|
1265
|
+
@model_serializer(mode="wrap")
|
|
1266
|
+
def serialize_model(self, handler):
|
|
1267
|
+
optional_fields = set(["ttl"])
|
|
1268
|
+
serialized = handler(self)
|
|
1269
|
+
m = {}
|
|
1270
|
+
|
|
1271
|
+
for n, f in type(self).model_fields.items():
|
|
1272
|
+
k = f.alias or n
|
|
1273
|
+
val = serialized.get(k)
|
|
1274
|
+
|
|
1275
|
+
if val != UNSET_SENTINEL:
|
|
1276
|
+
if val is not None or k not in optional_fields:
|
|
1277
|
+
m[k] = val
|
|
1278
|
+
|
|
1279
|
+
return m
|
|
1280
|
+
|
|
1281
|
+
|
|
1282
|
+
GetOnePromptLoadBalancerType = Literal["weight_based",]
|
|
1283
|
+
|
|
1284
|
+
|
|
1285
|
+
class GetOnePromptLoadBalancerModelsTypedDict(TypedDict):
|
|
1286
|
+
model: str
|
|
1287
|
+
r"""Model identifier for load balancing"""
|
|
1288
|
+
weight: NotRequired[float]
|
|
1289
|
+
r"""Weight assigned to this model for load balancing"""
|
|
1290
|
+
|
|
1291
|
+
|
|
1292
|
+
class GetOnePromptLoadBalancerModels(BaseModel):
|
|
1293
|
+
model: str
|
|
1294
|
+
r"""Model identifier for load balancing"""
|
|
1295
|
+
|
|
1296
|
+
weight: Optional[float] = 0.5
|
|
1297
|
+
r"""Weight assigned to this model for load balancing"""
|
|
1298
|
+
|
|
1299
|
+
@model_serializer(mode="wrap")
|
|
1300
|
+
def serialize_model(self, handler):
|
|
1301
|
+
optional_fields = set(["weight"])
|
|
1302
|
+
serialized = handler(self)
|
|
1303
|
+
m = {}
|
|
1304
|
+
|
|
1305
|
+
for n, f in type(self).model_fields.items():
|
|
1306
|
+
k = f.alias or n
|
|
1307
|
+
val = serialized.get(k)
|
|
1308
|
+
|
|
1309
|
+
if val != UNSET_SENTINEL:
|
|
1310
|
+
if val is not None or k not in optional_fields:
|
|
1311
|
+
m[k] = val
|
|
1312
|
+
|
|
1313
|
+
return m
|
|
1314
|
+
|
|
1315
|
+
|
|
1316
|
+
class GetOnePromptLoadBalancer1TypedDict(TypedDict):
|
|
1317
|
+
type: GetOnePromptLoadBalancerType
|
|
1318
|
+
models: List[GetOnePromptLoadBalancerModelsTypedDict]
|
|
1319
|
+
|
|
1320
|
+
|
|
1321
|
+
class GetOnePromptLoadBalancer1(BaseModel):
|
|
1322
|
+
type: GetOnePromptLoadBalancerType
|
|
1323
|
+
|
|
1324
|
+
models: List[GetOnePromptLoadBalancerModels]
|
|
1325
|
+
|
|
1326
|
+
|
|
1327
|
+
GetOnePromptLoadBalancerTypedDict = GetOnePromptLoadBalancer1TypedDict
|
|
1328
|
+
r"""Load balancer configuration for the request."""
|
|
1329
|
+
|
|
1330
|
+
|
|
1331
|
+
GetOnePromptLoadBalancer = GetOnePromptLoadBalancer1
|
|
1332
|
+
r"""Load balancer configuration for the request."""
|
|
1333
|
+
|
|
1334
|
+
|
|
1335
|
+
class GetOnePromptTimeoutTypedDict(TypedDict):
|
|
1336
|
+
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."""
|
|
1337
|
+
|
|
1338
|
+
call_timeout: float
|
|
1339
|
+
r"""Timeout value in milliseconds"""
|
|
1340
|
+
|
|
1341
|
+
|
|
1342
|
+
class GetOnePromptTimeout(BaseModel):
|
|
1343
|
+
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."""
|
|
1344
|
+
|
|
1345
|
+
call_timeout: float
|
|
1346
|
+
r"""Timeout value in milliseconds"""
|
|
1347
|
+
|
|
1348
|
+
|
|
1200
1349
|
GetOnePromptMessagesPromptsResponse200Role = Literal["tool",]
|
|
1201
1350
|
r"""The role of the messages author, in this case tool."""
|
|
1202
1351
|
|
|
@@ -1772,6 +1921,8 @@ GetOnePromptPromptsMessages = Annotated[
|
|
|
1772
1921
|
class GetOnePromptPromptFieldTypedDict(TypedDict):
|
|
1773
1922
|
r"""Prompt configuration with model and messages. Use this instead of prompt_config."""
|
|
1774
1923
|
|
|
1924
|
+
name: NotRequired[str]
|
|
1925
|
+
r"""The name to display on the trace. If not specified, the default system name will be used."""
|
|
1775
1926
|
audio: NotRequired[Nullable[GetOnePromptAudioTypedDict]]
|
|
1776
1927
|
r"""Parameters for audio output. Required when audio output is requested with modalities: [\"audio\"]. Learn more."""
|
|
1777
1928
|
frequency_penalty: NotRequired[Nullable[float]]
|
|
@@ -1826,6 +1977,16 @@ class GetOnePromptPromptFieldTypedDict(TypedDict):
|
|
|
1826
1977
|
r"""Output types that you would like the model to generate. Most models are capable of generating text, which is the default: [\"text\"]. The gpt-4o-audio-preview model can also be used to generate audio. To request that this model generate both text and audio responses, you can use: [\"text\", \"audio\"]."""
|
|
1827
1978
|
guardrails: NotRequired[List[GetOnePromptGuardrailsTypedDict]]
|
|
1828
1979
|
r"""A list of guardrails to apply to the request."""
|
|
1980
|
+
fallbacks: NotRequired[List[GetOnePromptFallbacksTypedDict]]
|
|
1981
|
+
r"""Array of fallback models to use if primary model fails"""
|
|
1982
|
+
retry: NotRequired[GetOnePromptRetryTypedDict]
|
|
1983
|
+
r"""Retry configuration for the request"""
|
|
1984
|
+
cache: NotRequired[GetOnePromptCacheTypedDict]
|
|
1985
|
+
r"""Cache configuration for the request."""
|
|
1986
|
+
load_balancer: NotRequired[GetOnePromptLoadBalancerTypedDict]
|
|
1987
|
+
r"""Load balancer configuration for the request."""
|
|
1988
|
+
timeout: NotRequired[GetOnePromptTimeoutTypedDict]
|
|
1989
|
+
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."""
|
|
1829
1990
|
messages: NotRequired[List[GetOnePromptPromptsMessagesTypedDict]]
|
|
1830
1991
|
r"""Array of messages that make up the conversation. Each message has a role (system, user, assistant, or tool) and content."""
|
|
1831
1992
|
model: NotRequired[Nullable[str]]
|
|
@@ -1836,6 +1997,9 @@ class GetOnePromptPromptFieldTypedDict(TypedDict):
|
|
|
1836
1997
|
class GetOnePromptPromptField(BaseModel):
|
|
1837
1998
|
r"""Prompt configuration with model and messages. Use this instead of prompt_config."""
|
|
1838
1999
|
|
|
2000
|
+
name: Optional[str] = None
|
|
2001
|
+
r"""The name to display on the trace. If not specified, the default system name will be used."""
|
|
2002
|
+
|
|
1839
2003
|
audio: OptionalNullable[GetOnePromptAudio] = UNSET
|
|
1840
2004
|
r"""Parameters for audio output. Required when audio output is requested with modalities: [\"audio\"]. Learn more."""
|
|
1841
2005
|
|
|
@@ -1912,6 +2076,21 @@ class GetOnePromptPromptField(BaseModel):
|
|
|
1912
2076
|
guardrails: Optional[List[GetOnePromptGuardrails]] = None
|
|
1913
2077
|
r"""A list of guardrails to apply to the request."""
|
|
1914
2078
|
|
|
2079
|
+
fallbacks: Optional[List[GetOnePromptFallbacks]] = None
|
|
2080
|
+
r"""Array of fallback models to use if primary model fails"""
|
|
2081
|
+
|
|
2082
|
+
retry: Optional[GetOnePromptRetry] = None
|
|
2083
|
+
r"""Retry configuration for the request"""
|
|
2084
|
+
|
|
2085
|
+
cache: Optional[GetOnePromptCache] = None
|
|
2086
|
+
r"""Cache configuration for the request."""
|
|
2087
|
+
|
|
2088
|
+
load_balancer: Optional[GetOnePromptLoadBalancer] = None
|
|
2089
|
+
r"""Load balancer configuration for the request."""
|
|
2090
|
+
|
|
2091
|
+
timeout: Optional[GetOnePromptTimeout] = None
|
|
2092
|
+
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."""
|
|
2093
|
+
|
|
1915
2094
|
messages: Optional[List[GetOnePromptPromptsMessages]] = None
|
|
1916
2095
|
r"""Array of messages that make up the conversation. Each message has a role (system, user, assistant, or tool) and content."""
|
|
1917
2096
|
|
|
@@ -1924,6 +2103,7 @@ class GetOnePromptPromptField(BaseModel):
|
|
|
1924
2103
|
def serialize_model(self, handler):
|
|
1925
2104
|
optional_fields = set(
|
|
1926
2105
|
[
|
|
2106
|
+
"name",
|
|
1927
2107
|
"audio",
|
|
1928
2108
|
"frequency_penalty",
|
|
1929
2109
|
"max_tokens",
|
|
@@ -1946,6 +2126,11 @@ class GetOnePromptPromptField(BaseModel):
|
|
|
1946
2126
|
"parallel_tool_calls",
|
|
1947
2127
|
"modalities",
|
|
1948
2128
|
"guardrails",
|
|
2129
|
+
"fallbacks",
|
|
2130
|
+
"retry",
|
|
2131
|
+
"cache",
|
|
2132
|
+
"load_balancer",
|
|
2133
|
+
"timeout",
|
|
1949
2134
|
"messages",
|
|
1950
2135
|
"model",
|
|
1951
2136
|
"version",
|
|
@@ -97,6 +97,7 @@ GetPromptVersionModelType = Literal[
|
|
|
97
97
|
"tts",
|
|
98
98
|
"stt",
|
|
99
99
|
"rerank",
|
|
100
|
+
"ocr",
|
|
100
101
|
"moderation",
|
|
101
102
|
"vision",
|
|
102
103
|
]
|
|
@@ -707,7 +708,7 @@ GetPromptVersionContent = TypeAliasType(
|
|
|
707
708
|
r"""The contents of the user message. Either the text content of the message or an array of content parts with a defined type, each can be of type `text` or `image_url` when passing in images. You can pass multiple images by adding multiple `image_url` content parts. Can be null for tool messages in certain scenarios."""
|
|
708
709
|
|
|
709
710
|
|
|
710
|
-
|
|
711
|
+
GetPromptVersionPromptsType = Literal["function",]
|
|
711
712
|
|
|
712
713
|
|
|
713
714
|
class GetPromptVersionFunctionTypedDict(TypedDict):
|
|
@@ -724,14 +725,14 @@ class GetPromptVersionFunction(BaseModel):
|
|
|
724
725
|
|
|
725
726
|
|
|
726
727
|
class GetPromptVersionToolCallsTypedDict(TypedDict):
|
|
727
|
-
type:
|
|
728
|
+
type: GetPromptVersionPromptsType
|
|
728
729
|
function: GetPromptVersionFunctionTypedDict
|
|
729
730
|
id: NotRequired[str]
|
|
730
731
|
index: NotRequired[float]
|
|
731
732
|
|
|
732
733
|
|
|
733
734
|
class GetPromptVersionToolCalls(BaseModel):
|
|
734
|
-
type:
|
|
735
|
+
type: GetPromptVersionPromptsType
|
|
735
736
|
|
|
736
737
|
function: GetPromptVersionFunction
|
|
737
738
|
|
|
@@ -1241,6 +1242,154 @@ class GetPromptVersionGuardrails(BaseModel):
|
|
|
1241
1242
|
r"""Determines whether the guardrail runs on the input (user message) or output (model response)."""
|
|
1242
1243
|
|
|
1243
1244
|
|
|
1245
|
+
class GetPromptVersionFallbacksTypedDict(TypedDict):
|
|
1246
|
+
model: str
|
|
1247
|
+
r"""Fallback model identifier"""
|
|
1248
|
+
|
|
1249
|
+
|
|
1250
|
+
class GetPromptVersionFallbacks(BaseModel):
|
|
1251
|
+
model: str
|
|
1252
|
+
r"""Fallback model identifier"""
|
|
1253
|
+
|
|
1254
|
+
|
|
1255
|
+
class GetPromptVersionRetryTypedDict(TypedDict):
|
|
1256
|
+
r"""Retry configuration for the request"""
|
|
1257
|
+
|
|
1258
|
+
count: NotRequired[float]
|
|
1259
|
+
r"""Number of retry attempts (1-5)"""
|
|
1260
|
+
on_codes: NotRequired[List[float]]
|
|
1261
|
+
r"""HTTP status codes that trigger retry logic"""
|
|
1262
|
+
|
|
1263
|
+
|
|
1264
|
+
class GetPromptVersionRetry(BaseModel):
|
|
1265
|
+
r"""Retry configuration for the request"""
|
|
1266
|
+
|
|
1267
|
+
count: Optional[float] = 3
|
|
1268
|
+
r"""Number of retry attempts (1-5)"""
|
|
1269
|
+
|
|
1270
|
+
on_codes: Optional[List[float]] = None
|
|
1271
|
+
r"""HTTP status codes that trigger retry logic"""
|
|
1272
|
+
|
|
1273
|
+
@model_serializer(mode="wrap")
|
|
1274
|
+
def serialize_model(self, handler):
|
|
1275
|
+
optional_fields = set(["count", "on_codes"])
|
|
1276
|
+
serialized = handler(self)
|
|
1277
|
+
m = {}
|
|
1278
|
+
|
|
1279
|
+
for n, f in type(self).model_fields.items():
|
|
1280
|
+
k = f.alias or n
|
|
1281
|
+
val = serialized.get(k)
|
|
1282
|
+
|
|
1283
|
+
if val != UNSET_SENTINEL:
|
|
1284
|
+
if val is not None or k not in optional_fields:
|
|
1285
|
+
m[k] = val
|
|
1286
|
+
|
|
1287
|
+
return m
|
|
1288
|
+
|
|
1289
|
+
|
|
1290
|
+
GetPromptVersionType = Literal["exact_match",]
|
|
1291
|
+
|
|
1292
|
+
|
|
1293
|
+
class GetPromptVersionCacheTypedDict(TypedDict):
|
|
1294
|
+
r"""Cache configuration for the request."""
|
|
1295
|
+
|
|
1296
|
+
type: GetPromptVersionType
|
|
1297
|
+
ttl: NotRequired[float]
|
|
1298
|
+
r"""Time to live for cached responses in seconds. Maximum 259200 seconds (3 days)."""
|
|
1299
|
+
|
|
1300
|
+
|
|
1301
|
+
class GetPromptVersionCache(BaseModel):
|
|
1302
|
+
r"""Cache configuration for the request."""
|
|
1303
|
+
|
|
1304
|
+
type: GetPromptVersionType
|
|
1305
|
+
|
|
1306
|
+
ttl: Optional[float] = 1800
|
|
1307
|
+
r"""Time to live for cached responses in seconds. Maximum 259200 seconds (3 days)."""
|
|
1308
|
+
|
|
1309
|
+
@model_serializer(mode="wrap")
|
|
1310
|
+
def serialize_model(self, handler):
|
|
1311
|
+
optional_fields = set(["ttl"])
|
|
1312
|
+
serialized = handler(self)
|
|
1313
|
+
m = {}
|
|
1314
|
+
|
|
1315
|
+
for n, f in type(self).model_fields.items():
|
|
1316
|
+
k = f.alias or n
|
|
1317
|
+
val = serialized.get(k)
|
|
1318
|
+
|
|
1319
|
+
if val != UNSET_SENTINEL:
|
|
1320
|
+
if val is not None or k not in optional_fields:
|
|
1321
|
+
m[k] = val
|
|
1322
|
+
|
|
1323
|
+
return m
|
|
1324
|
+
|
|
1325
|
+
|
|
1326
|
+
GetPromptVersionLoadBalancerType = Literal["weight_based",]
|
|
1327
|
+
|
|
1328
|
+
|
|
1329
|
+
class GetPromptVersionLoadBalancerModelsTypedDict(TypedDict):
|
|
1330
|
+
model: str
|
|
1331
|
+
r"""Model identifier for load balancing"""
|
|
1332
|
+
weight: NotRequired[float]
|
|
1333
|
+
r"""Weight assigned to this model for load balancing"""
|
|
1334
|
+
|
|
1335
|
+
|
|
1336
|
+
class GetPromptVersionLoadBalancerModels(BaseModel):
|
|
1337
|
+
model: str
|
|
1338
|
+
r"""Model identifier for load balancing"""
|
|
1339
|
+
|
|
1340
|
+
weight: Optional[float] = 0.5
|
|
1341
|
+
r"""Weight assigned to this model for load balancing"""
|
|
1342
|
+
|
|
1343
|
+
@model_serializer(mode="wrap")
|
|
1344
|
+
def serialize_model(self, handler):
|
|
1345
|
+
optional_fields = set(["weight"])
|
|
1346
|
+
serialized = handler(self)
|
|
1347
|
+
m = {}
|
|
1348
|
+
|
|
1349
|
+
for n, f in type(self).model_fields.items():
|
|
1350
|
+
k = f.alias or n
|
|
1351
|
+
val = serialized.get(k)
|
|
1352
|
+
|
|
1353
|
+
if val != UNSET_SENTINEL:
|
|
1354
|
+
if val is not None or k not in optional_fields:
|
|
1355
|
+
m[k] = val
|
|
1356
|
+
|
|
1357
|
+
return m
|
|
1358
|
+
|
|
1359
|
+
|
|
1360
|
+
class GetPromptVersionLoadBalancer1TypedDict(TypedDict):
|
|
1361
|
+
type: GetPromptVersionLoadBalancerType
|
|
1362
|
+
models: List[GetPromptVersionLoadBalancerModelsTypedDict]
|
|
1363
|
+
|
|
1364
|
+
|
|
1365
|
+
class GetPromptVersionLoadBalancer1(BaseModel):
|
|
1366
|
+
type: GetPromptVersionLoadBalancerType
|
|
1367
|
+
|
|
1368
|
+
models: List[GetPromptVersionLoadBalancerModels]
|
|
1369
|
+
|
|
1370
|
+
|
|
1371
|
+
GetPromptVersionLoadBalancerTypedDict = GetPromptVersionLoadBalancer1TypedDict
|
|
1372
|
+
r"""Load balancer configuration for the request."""
|
|
1373
|
+
|
|
1374
|
+
|
|
1375
|
+
GetPromptVersionLoadBalancer = GetPromptVersionLoadBalancer1
|
|
1376
|
+
r"""Load balancer configuration for the request."""
|
|
1377
|
+
|
|
1378
|
+
|
|
1379
|
+
class GetPromptVersionTimeoutTypedDict(TypedDict):
|
|
1380
|
+
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."""
|
|
1381
|
+
|
|
1382
|
+
call_timeout: float
|
|
1383
|
+
r"""Timeout value in milliseconds"""
|
|
1384
|
+
|
|
1385
|
+
|
|
1386
|
+
class GetPromptVersionTimeout(BaseModel):
|
|
1387
|
+
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."""
|
|
1388
|
+
|
|
1389
|
+
call_timeout: float
|
|
1390
|
+
r"""Timeout value in milliseconds"""
|
|
1391
|
+
|
|
1392
|
+
|
|
1244
1393
|
GetPromptVersionMessagesPromptsResponse200Role = Literal["tool",]
|
|
1245
1394
|
r"""The role of the messages author, in this case tool."""
|
|
1246
1395
|
|
|
@@ -1819,6 +1968,8 @@ GetPromptVersionPromptsMessages = Annotated[
|
|
|
1819
1968
|
class GetPromptVersionPromptFieldTypedDict(TypedDict):
|
|
1820
1969
|
r"""Prompt configuration with model and messages. Use this instead of prompt_config."""
|
|
1821
1970
|
|
|
1971
|
+
name: NotRequired[str]
|
|
1972
|
+
r"""The name to display on the trace. If not specified, the default system name will be used."""
|
|
1822
1973
|
audio: NotRequired[Nullable[GetPromptVersionAudioTypedDict]]
|
|
1823
1974
|
r"""Parameters for audio output. Required when audio output is requested with modalities: [\"audio\"]. Learn more."""
|
|
1824
1975
|
frequency_penalty: NotRequired[Nullable[float]]
|
|
@@ -1873,6 +2024,16 @@ class GetPromptVersionPromptFieldTypedDict(TypedDict):
|
|
|
1873
2024
|
r"""Output types that you would like the model to generate. Most models are capable of generating text, which is the default: [\"text\"]. The gpt-4o-audio-preview model can also be used to generate audio. To request that this model generate both text and audio responses, you can use: [\"text\", \"audio\"]."""
|
|
1874
2025
|
guardrails: NotRequired[List[GetPromptVersionGuardrailsTypedDict]]
|
|
1875
2026
|
r"""A list of guardrails to apply to the request."""
|
|
2027
|
+
fallbacks: NotRequired[List[GetPromptVersionFallbacksTypedDict]]
|
|
2028
|
+
r"""Array of fallback models to use if primary model fails"""
|
|
2029
|
+
retry: NotRequired[GetPromptVersionRetryTypedDict]
|
|
2030
|
+
r"""Retry configuration for the request"""
|
|
2031
|
+
cache: NotRequired[GetPromptVersionCacheTypedDict]
|
|
2032
|
+
r"""Cache configuration for the request."""
|
|
2033
|
+
load_balancer: NotRequired[GetPromptVersionLoadBalancerTypedDict]
|
|
2034
|
+
r"""Load balancer configuration for the request."""
|
|
2035
|
+
timeout: NotRequired[GetPromptVersionTimeoutTypedDict]
|
|
2036
|
+
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."""
|
|
1876
2037
|
messages: NotRequired[List[GetPromptVersionPromptsMessagesTypedDict]]
|
|
1877
2038
|
r"""Array of messages that make up the conversation. Each message has a role (system, user, assistant, or tool) and content."""
|
|
1878
2039
|
model: NotRequired[Nullable[str]]
|
|
@@ -1883,6 +2044,9 @@ class GetPromptVersionPromptFieldTypedDict(TypedDict):
|
|
|
1883
2044
|
class GetPromptVersionPromptField(BaseModel):
|
|
1884
2045
|
r"""Prompt configuration with model and messages. Use this instead of prompt_config."""
|
|
1885
2046
|
|
|
2047
|
+
name: Optional[str] = None
|
|
2048
|
+
r"""The name to display on the trace. If not specified, the default system name will be used."""
|
|
2049
|
+
|
|
1886
2050
|
audio: OptionalNullable[GetPromptVersionAudio] = UNSET
|
|
1887
2051
|
r"""Parameters for audio output. Required when audio output is requested with modalities: [\"audio\"]. Learn more."""
|
|
1888
2052
|
|
|
@@ -1959,6 +2123,21 @@ class GetPromptVersionPromptField(BaseModel):
|
|
|
1959
2123
|
guardrails: Optional[List[GetPromptVersionGuardrails]] = None
|
|
1960
2124
|
r"""A list of guardrails to apply to the request."""
|
|
1961
2125
|
|
|
2126
|
+
fallbacks: Optional[List[GetPromptVersionFallbacks]] = None
|
|
2127
|
+
r"""Array of fallback models to use if primary model fails"""
|
|
2128
|
+
|
|
2129
|
+
retry: Optional[GetPromptVersionRetry] = None
|
|
2130
|
+
r"""Retry configuration for the request"""
|
|
2131
|
+
|
|
2132
|
+
cache: Optional[GetPromptVersionCache] = None
|
|
2133
|
+
r"""Cache configuration for the request."""
|
|
2134
|
+
|
|
2135
|
+
load_balancer: Optional[GetPromptVersionLoadBalancer] = None
|
|
2136
|
+
r"""Load balancer configuration for the request."""
|
|
2137
|
+
|
|
2138
|
+
timeout: Optional[GetPromptVersionTimeout] = None
|
|
2139
|
+
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."""
|
|
2140
|
+
|
|
1962
2141
|
messages: Optional[List[GetPromptVersionPromptsMessages]] = None
|
|
1963
2142
|
r"""Array of messages that make up the conversation. Each message has a role (system, user, assistant, or tool) and content."""
|
|
1964
2143
|
|
|
@@ -1971,6 +2150,7 @@ class GetPromptVersionPromptField(BaseModel):
|
|
|
1971
2150
|
def serialize_model(self, handler):
|
|
1972
2151
|
optional_fields = set(
|
|
1973
2152
|
[
|
|
2153
|
+
"name",
|
|
1974
2154
|
"audio",
|
|
1975
2155
|
"frequency_penalty",
|
|
1976
2156
|
"max_tokens",
|
|
@@ -1993,6 +2173,11 @@ class GetPromptVersionPromptField(BaseModel):
|
|
|
1993
2173
|
"parallel_tool_calls",
|
|
1994
2174
|
"modalities",
|
|
1995
2175
|
"guardrails",
|
|
2176
|
+
"fallbacks",
|
|
2177
|
+
"retry",
|
|
2178
|
+
"cache",
|
|
2179
|
+
"load_balancer",
|
|
2180
|
+
"timeout",
|
|
1996
2181
|
"messages",
|
|
1997
2182
|
"model",
|
|
1998
2183
|
"version",
|
|
@@ -10,6 +10,7 @@ from .imagecontentpartschema import (
|
|
|
10
10
|
ImageContentPartSchema,
|
|
11
11
|
ImageContentPartSchemaTypedDict,
|
|
12
12
|
)
|
|
13
|
+
from .publicidentity import PublicIdentity, PublicIdentityTypedDict
|
|
13
14
|
from .reasoningpartschema import ReasoningPartSchema, ReasoningPartSchemaTypedDict
|
|
14
15
|
from .redactedreasoningpartschema import (
|
|
15
16
|
RedactedReasoningPartSchema,
|
|
@@ -202,14 +203,14 @@ InvokeDeploymentRequestPrefixMessages4Role = Literal["assistant",]
|
|
|
202
203
|
r"""The role of the messages author, in this case `assistant`."""
|
|
203
204
|
|
|
204
205
|
|
|
205
|
-
class
|
|
206
|
+
class AudioModelTypedDict(TypedDict):
|
|
206
207
|
r"""Data about a previous audio response from the model."""
|
|
207
208
|
|
|
208
209
|
id: str
|
|
209
210
|
r"""Unique identifier for a previous audio response from the model."""
|
|
210
211
|
|
|
211
212
|
|
|
212
|
-
class
|
|
213
|
+
class AudioModel(BaseModel):
|
|
213
214
|
r"""Data about a previous audio response from the model."""
|
|
214
215
|
|
|
215
216
|
id: str
|
|
@@ -301,7 +302,7 @@ class AssistantMessageTypedDict(TypedDict):
|
|
|
301
302
|
r"""The refusal message by the assistant."""
|
|
302
303
|
name: NotRequired[str]
|
|
303
304
|
r"""An optional name for the participant. Provides the model information to differentiate between participants of the same role."""
|
|
304
|
-
audio: NotRequired[Nullable[
|
|
305
|
+
audio: NotRequired[Nullable[AudioModelTypedDict]]
|
|
305
306
|
r"""Data about a previous audio response from the model."""
|
|
306
307
|
tool_calls: NotRequired[List[ToolCallsTypedDict]]
|
|
307
308
|
r"""The tool calls generated by the model, such as function calls."""
|
|
@@ -320,7 +321,7 @@ class AssistantMessage(BaseModel):
|
|
|
320
321
|
name: Optional[str] = None
|
|
321
322
|
r"""An optional name for the participant. Provides the model information to differentiate between participants of the same role."""
|
|
322
323
|
|
|
323
|
-
audio: OptionalNullable[
|
|
324
|
+
audio: OptionalNullable[AudioModel] = UNSET
|
|
324
325
|
r"""Data about a previous audio response from the model."""
|
|
325
326
|
|
|
326
327
|
tool_calls: Optional[List[ToolCalls]] = None
|
|
@@ -1953,6 +1954,8 @@ class InvokeDeploymentRequestTypedDict(TypedDict):
|
|
|
1953
1954
|
r"""A list of messages to include after the `System` message, but before the `User` and `Assistant` pairs configured in your deployment."""
|
|
1954
1955
|
messages: NotRequired[List[MessagesTypedDict]]
|
|
1955
1956
|
r"""A list of messages to send to the deployment."""
|
|
1957
|
+
identity: NotRequired[PublicIdentityTypedDict]
|
|
1958
|
+
r"""Information about the identity making the request. If the identity does not exist, it will be created automatically."""
|
|
1956
1959
|
file_ids: NotRequired[List[str]]
|
|
1957
1960
|
r"""A list of file IDs that are associated with the deployment request."""
|
|
1958
1961
|
metadata: NotRequired[Dict[str, Any]]
|
|
@@ -1988,6 +1991,9 @@ class InvokeDeploymentRequest(BaseModel):
|
|
|
1988
1991
|
messages: Optional[List[Messages]] = None
|
|
1989
1992
|
r"""A list of messages to send to the deployment."""
|
|
1990
1993
|
|
|
1994
|
+
identity: Optional[PublicIdentity] = None
|
|
1995
|
+
r"""Information about the identity making the request. If the identity does not exist, it will be created automatically."""
|
|
1996
|
+
|
|
1991
1997
|
file_ids: Optional[List[str]] = None
|
|
1992
1998
|
r"""A list of file IDs that are associated with the deployment request."""
|
|
1993
1999
|
|
|
@@ -2016,6 +2022,7 @@ class InvokeDeploymentRequest(BaseModel):
|
|
|
2016
2022
|
"context",
|
|
2017
2023
|
"prefix_messages",
|
|
2018
2024
|
"messages",
|
|
2025
|
+
"identity",
|
|
2019
2026
|
"file_ids",
|
|
2020
2027
|
"metadata",
|
|
2021
2028
|
"extra_params",
|