orq-ai-sdk 4.2.0rc28__py3-none-any.whl → 4.2.6__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/basesdk.py +20 -6
- orq_ai_sdk/chat.py +22 -0
- orq_ai_sdk/completions.py +332 -0
- orq_ai_sdk/contacts.py +43 -855
- orq_ai_sdk/deployments.py +61 -0
- orq_ai_sdk/edits.py +258 -0
- orq_ai_sdk/embeddings.py +238 -0
- orq_ai_sdk/generations.py +272 -0
- orq_ai_sdk/identities.py +1037 -0
- orq_ai_sdk/images.py +28 -0
- orq_ai_sdk/models/__init__.py +5341 -737
- orq_ai_sdk/models/actionreviewedstreamingevent.py +18 -1
- orq_ai_sdk/models/actionreviewrequestedstreamingevent.py +44 -1
- orq_ai_sdk/models/agenterroredstreamingevent.py +18 -1
- orq_ai_sdk/models/agentinactivestreamingevent.py +168 -70
- orq_ai_sdk/models/agentmessagecreatedstreamingevent.py +18 -2
- orq_ai_sdk/models/agentresponsemessage.py +18 -2
- orq_ai_sdk/models/agentstartedstreamingevent.py +127 -2
- orq_ai_sdk/models/agentthoughtstreamingevent.py +178 -211
- orq_ai_sdk/models/conversationresponse.py +31 -20
- orq_ai_sdk/models/conversationwithmessagesresponse.py +31 -20
- orq_ai_sdk/models/createagentrequestop.py +1922 -384
- orq_ai_sdk/models/createagentresponse.py +147 -91
- orq_ai_sdk/models/createagentresponserequestop.py +111 -2
- orq_ai_sdk/models/createchatcompletionop.py +1375 -861
- orq_ai_sdk/models/createchunkop.py +46 -19
- orq_ai_sdk/models/createcompletionop.py +1890 -0
- orq_ai_sdk/models/createcontactop.py +45 -56
- orq_ai_sdk/models/createconversationop.py +61 -39
- orq_ai_sdk/models/createconversationresponseop.py +68 -4
- orq_ai_sdk/models/createdatasetitemop.py +424 -80
- orq_ai_sdk/models/createdatasetop.py +19 -2
- orq_ai_sdk/models/createdatasourceop.py +92 -26
- orq_ai_sdk/models/createembeddingop.py +384 -0
- orq_ai_sdk/models/createevalop.py +552 -24
- orq_ai_sdk/models/createidentityop.py +176 -0
- orq_ai_sdk/models/createimageeditop.py +504 -0
- orq_ai_sdk/models/createimageop.py +208 -117
- orq_ai_sdk/models/createimagevariationop.py +486 -0
- orq_ai_sdk/models/createknowledgeop.py +186 -121
- orq_ai_sdk/models/creatememorydocumentop.py +50 -1
- orq_ai_sdk/models/creatememoryop.py +34 -21
- orq_ai_sdk/models/creatememorystoreop.py +34 -1
- orq_ai_sdk/models/createmoderationop.py +521 -0
- orq_ai_sdk/models/createpromptop.py +2748 -1252
- orq_ai_sdk/models/creatererankop.py +416 -0
- orq_ai_sdk/models/createresponseop.py +2567 -0
- orq_ai_sdk/models/createspeechop.py +316 -0
- orq_ai_sdk/models/createtoolop.py +537 -12
- orq_ai_sdk/models/createtranscriptionop.py +562 -0
- orq_ai_sdk/models/createtranslationop.py +540 -0
- orq_ai_sdk/models/datapart.py +18 -1
- orq_ai_sdk/models/deletechunksop.py +34 -1
- orq_ai_sdk/models/{deletecontactop.py → deleteidentityop.py} +9 -9
- orq_ai_sdk/models/deletepromptop.py +26 -0
- orq_ai_sdk/models/deploymentcreatemetricop.py +362 -76
- orq_ai_sdk/models/deploymentgetconfigop.py +635 -194
- orq_ai_sdk/models/deploymentinvokeop.py +168 -173
- orq_ai_sdk/models/deploymentsop.py +195 -58
- orq_ai_sdk/models/deploymentstreamop.py +652 -304
- orq_ai_sdk/models/errorpart.py +18 -1
- orq_ai_sdk/models/filecontentpartschema.py +18 -1
- orq_ai_sdk/models/filegetop.py +19 -2
- orq_ai_sdk/models/filelistop.py +35 -2
- orq_ai_sdk/models/filepart.py +50 -1
- orq_ai_sdk/models/fileuploadop.py +51 -2
- orq_ai_sdk/models/generateconversationnameop.py +31 -20
- orq_ai_sdk/models/get_v2_evaluators_id_versionsop.py +34 -1
- orq_ai_sdk/models/get_v2_tools_tool_id_versions_version_id_op.py +18 -1
- orq_ai_sdk/models/get_v2_tools_tool_id_versionsop.py +34 -1
- orq_ai_sdk/models/getallmemoriesop.py +34 -21
- orq_ai_sdk/models/getallmemorydocumentsop.py +42 -1
- orq_ai_sdk/models/getallmemorystoresop.py +34 -1
- orq_ai_sdk/models/getallpromptsop.py +1690 -230
- orq_ai_sdk/models/getalltoolsop.py +325 -8
- orq_ai_sdk/models/getchunkscountop.py +34 -1
- orq_ai_sdk/models/getevalsop.py +395 -43
- orq_ai_sdk/models/getonechunkop.py +14 -19
- orq_ai_sdk/models/getoneknowledgeop.py +116 -96
- orq_ai_sdk/models/getonepromptop.py +1673 -230
- orq_ai_sdk/models/getpromptversionop.py +1670 -216
- orq_ai_sdk/models/imagecontentpartschema.py +50 -1
- orq_ai_sdk/models/internal/globals.py +18 -1
- orq_ai_sdk/models/invokeagentop.py +140 -2
- orq_ai_sdk/models/invokedeploymentrequest.py +418 -80
- orq_ai_sdk/models/invokeevalop.py +160 -131
- orq_ai_sdk/models/listagentsop.py +793 -166
- orq_ai_sdk/models/listchunksop.py +32 -19
- orq_ai_sdk/models/listchunkspaginatedop.py +46 -19
- orq_ai_sdk/models/listconversationsop.py +18 -1
- orq_ai_sdk/models/listdatasetdatapointsop.py +252 -42
- orq_ai_sdk/models/listdatasetsop.py +35 -2
- orq_ai_sdk/models/listdatasourcesop.py +35 -26
- orq_ai_sdk/models/{listcontactsop.py → listidentitiesop.py} +89 -79
- orq_ai_sdk/models/listknowledgebasesop.py +132 -96
- orq_ai_sdk/models/listmodelsop.py +1 -0
- orq_ai_sdk/models/listpromptversionsop.py +1684 -216
- orq_ai_sdk/models/parseop.py +161 -17
- orq_ai_sdk/models/partdoneevent.py +19 -2
- orq_ai_sdk/models/post_v2_router_ocrop.py +408 -0
- orq_ai_sdk/models/publiccontact.py +27 -4
- orq_ai_sdk/models/publicidentity.py +62 -0
- orq_ai_sdk/models/reasoningpart.py +19 -2
- orq_ai_sdk/models/refusalpartschema.py +18 -1
- orq_ai_sdk/models/remoteconfigsgetconfigop.py +34 -1
- orq_ai_sdk/models/responsedoneevent.py +114 -84
- orq_ai_sdk/models/responsestartedevent.py +18 -1
- orq_ai_sdk/models/retrieveagentrequestop.py +787 -166
- orq_ai_sdk/models/retrievedatapointop.py +236 -42
- orq_ai_sdk/models/retrievedatasetop.py +19 -2
- orq_ai_sdk/models/retrievedatasourceop.py +17 -26
- orq_ai_sdk/models/{retrievecontactop.py → retrieveidentityop.py} +38 -41
- orq_ai_sdk/models/retrievememorydocumentop.py +18 -1
- orq_ai_sdk/models/retrievememoryop.py +18 -21
- orq_ai_sdk/models/retrievememorystoreop.py +18 -1
- orq_ai_sdk/models/retrievetoolop.py +309 -8
- orq_ai_sdk/models/runagentop.py +1451 -197
- orq_ai_sdk/models/searchknowledgeop.py +108 -1
- orq_ai_sdk/models/security.py +18 -1
- orq_ai_sdk/models/streamagentop.py +93 -2
- orq_ai_sdk/models/streamrunagentop.py +1428 -195
- orq_ai_sdk/models/textcontentpartschema.py +34 -1
- orq_ai_sdk/models/thinkingconfigenabledschema.py +18 -1
- orq_ai_sdk/models/toolcallpart.py +18 -1
- orq_ai_sdk/models/tooldoneevent.py +18 -1
- orq_ai_sdk/models/toolexecutionfailedstreamingevent.py +50 -1
- orq_ai_sdk/models/toolexecutionfinishedstreamingevent.py +34 -1
- orq_ai_sdk/models/toolexecutionstartedstreamingevent.py +34 -1
- orq_ai_sdk/models/toolresultpart.py +18 -1
- orq_ai_sdk/models/toolreviewrequestedevent.py +18 -1
- orq_ai_sdk/models/toolstartedevent.py +18 -1
- orq_ai_sdk/models/updateagentop.py +1951 -404
- orq_ai_sdk/models/updatechunkop.py +46 -19
- orq_ai_sdk/models/updateconversationop.py +61 -39
- orq_ai_sdk/models/updatedatapointop.py +424 -80
- orq_ai_sdk/models/updatedatasetop.py +51 -2
- orq_ai_sdk/models/updatedatasourceop.py +17 -26
- orq_ai_sdk/models/updateevalop.py +577 -16
- orq_ai_sdk/models/{updatecontactop.py → updateidentityop.py} +78 -68
- orq_ai_sdk/models/updateknowledgeop.py +234 -190
- orq_ai_sdk/models/updatememorydocumentop.py +50 -1
- orq_ai_sdk/models/updatememoryop.py +50 -21
- orq_ai_sdk/models/updatememorystoreop.py +66 -1
- orq_ai_sdk/models/updatepromptop.py +2844 -1450
- orq_ai_sdk/models/updatetoolop.py +592 -9
- orq_ai_sdk/models/usermessagerequest.py +18 -2
- orq_ai_sdk/moderations.py +218 -0
- orq_ai_sdk/orq_completions.py +660 -0
- orq_ai_sdk/orq_responses.py +398 -0
- orq_ai_sdk/prompts.py +28 -36
- orq_ai_sdk/rerank.py +232 -0
- orq_ai_sdk/router.py +89 -641
- orq_ai_sdk/sdk.py +3 -0
- orq_ai_sdk/speech.py +251 -0
- orq_ai_sdk/transcriptions.py +326 -0
- orq_ai_sdk/translations.py +298 -0
- orq_ai_sdk/utils/__init__.py +13 -1
- orq_ai_sdk/variations.py +254 -0
- orq_ai_sdk-4.2.6.dist-info/METADATA +888 -0
- orq_ai_sdk-4.2.6.dist-info/RECORD +263 -0
- {orq_ai_sdk-4.2.0rc28.dist-info → orq_ai_sdk-4.2.6.dist-info}/WHEEL +2 -1
- orq_ai_sdk-4.2.6.dist-info/top_level.txt +1 -0
- orq_ai_sdk-4.2.0rc28.dist-info/METADATA +0 -867
- orq_ai_sdk-4.2.0rc28.dist-info/RECORD +0 -233
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
|
-
from orq_ai_sdk.types import BaseModel
|
|
4
|
+
from orq_ai_sdk.types import BaseModel, UNSET_SENTINEL
|
|
5
5
|
from orq_ai_sdk.utils import get_discriminator
|
|
6
6
|
import pydantic
|
|
7
|
-
from pydantic import ConfigDict, Discriminator, Tag
|
|
7
|
+
from pydantic import ConfigDict, Discriminator, Tag, model_serializer
|
|
8
8
|
from typing import Any, Dict, List, Literal, Optional, Union
|
|
9
9
|
from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
|
|
10
10
|
|
|
@@ -82,6 +82,22 @@ class RequestBodyCodeTool(BaseModel):
|
|
|
82
82
|
parameters: Optional[CreateToolRequestBodyParameters] = None
|
|
83
83
|
r"""The parameters the functions accepts, described as a JSON Schema object. See the `OpenAI` [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format."""
|
|
84
84
|
|
|
85
|
+
@model_serializer(mode="wrap")
|
|
86
|
+
def serialize_model(self, handler):
|
|
87
|
+
optional_fields = set(["parameters"])
|
|
88
|
+
serialized = handler(self)
|
|
89
|
+
m = {}
|
|
90
|
+
|
|
91
|
+
for n, f in type(self).model_fields.items():
|
|
92
|
+
k = f.alias or n
|
|
93
|
+
val = serialized.get(k)
|
|
94
|
+
|
|
95
|
+
if val != UNSET_SENTINEL:
|
|
96
|
+
if val is not None or k not in optional_fields:
|
|
97
|
+
m[k] = val
|
|
98
|
+
|
|
99
|
+
return m
|
|
100
|
+
|
|
85
101
|
|
|
86
102
|
class RequestBodyCodeExecutionToolTypedDict(TypedDict):
|
|
87
103
|
r"""Executes code snippets in a sandboxed environment, currently supporting Python."""
|
|
@@ -132,6 +148,22 @@ class RequestBodyCodeExecutionTool(BaseModel):
|
|
|
132
148
|
status: Optional[CreateToolRequestBodyToolsRequestStatus] = "live"
|
|
133
149
|
r"""The status of the tool. `Live` is the latest version of the tool. `Draft` is a version that is not yet published. `Pending` is a version that is pending approval. `Published` is a version that was live and has been replaced by a new version."""
|
|
134
150
|
|
|
151
|
+
@model_serializer(mode="wrap")
|
|
152
|
+
def serialize_model(self, handler):
|
|
153
|
+
optional_fields = set(["display_name", "status"])
|
|
154
|
+
serialized = handler(self)
|
|
155
|
+
m = {}
|
|
156
|
+
|
|
157
|
+
for n, f in type(self).model_fields.items():
|
|
158
|
+
k = f.alias or n
|
|
159
|
+
val = serialized.get(k)
|
|
160
|
+
|
|
161
|
+
if val != UNSET_SENTINEL:
|
|
162
|
+
if val is not None or k not in optional_fields:
|
|
163
|
+
m[k] = val
|
|
164
|
+
|
|
165
|
+
return m
|
|
166
|
+
|
|
135
167
|
|
|
136
168
|
CreateToolRequestBodyToolsStatus = Literal[
|
|
137
169
|
"live",
|
|
@@ -155,6 +187,22 @@ class RequestBodyHeaders(BaseModel):
|
|
|
155
187
|
|
|
156
188
|
encrypted: Optional[bool] = False
|
|
157
189
|
|
|
190
|
+
@model_serializer(mode="wrap")
|
|
191
|
+
def serialize_model(self, handler):
|
|
192
|
+
optional_fields = set(["encrypted"])
|
|
193
|
+
serialized = handler(self)
|
|
194
|
+
m = {}
|
|
195
|
+
|
|
196
|
+
for n, f in type(self).model_fields.items():
|
|
197
|
+
k = f.alias or n
|
|
198
|
+
val = serialized.get(k)
|
|
199
|
+
|
|
200
|
+
if val != UNSET_SENTINEL:
|
|
201
|
+
if val is not None or k not in optional_fields:
|
|
202
|
+
m[k] = val
|
|
203
|
+
|
|
204
|
+
return m
|
|
205
|
+
|
|
158
206
|
|
|
159
207
|
RequestBodyConnectionType = Literal[
|
|
160
208
|
"http",
|
|
@@ -182,6 +230,22 @@ class RequestBodyMcp(BaseModel):
|
|
|
182
230
|
headers: Optional[Dict[str, RequestBodyHeaders]] = None
|
|
183
231
|
r"""HTTP headers for MCP server requests with encryption support"""
|
|
184
232
|
|
|
233
|
+
@model_serializer(mode="wrap")
|
|
234
|
+
def serialize_model(self, handler):
|
|
235
|
+
optional_fields = set(["headers"])
|
|
236
|
+
serialized = handler(self)
|
|
237
|
+
m = {}
|
|
238
|
+
|
|
239
|
+
for n, f in type(self).model_fields.items():
|
|
240
|
+
k = f.alias or n
|
|
241
|
+
val = serialized.get(k)
|
|
242
|
+
|
|
243
|
+
if val != UNSET_SENTINEL:
|
|
244
|
+
if val is not None or k not in optional_fields:
|
|
245
|
+
m[k] = val
|
|
246
|
+
|
|
247
|
+
return m
|
|
248
|
+
|
|
185
249
|
|
|
186
250
|
class RequestBodyMCPToolTypedDict(TypedDict):
|
|
187
251
|
r"""A tool from a Model Context Protocol (MCP) server that provides standardized access to external capabilities."""
|
|
@@ -232,6 +296,22 @@ class RequestBodyMCPTool(BaseModel):
|
|
|
232
296
|
status: Optional[CreateToolRequestBodyToolsStatus] = "live"
|
|
233
297
|
r"""The status of the tool. `Live` is the latest version of the tool. `Draft` is a version that is not yet published. `Pending` is a version that is pending approval. `Published` is a version that was live and has been replaced by a new version."""
|
|
234
298
|
|
|
299
|
+
@model_serializer(mode="wrap")
|
|
300
|
+
def serialize_model(self, handler):
|
|
301
|
+
optional_fields = set(["display_name", "status"])
|
|
302
|
+
serialized = handler(self)
|
|
303
|
+
m = {}
|
|
304
|
+
|
|
305
|
+
for n, f in type(self).model_fields.items():
|
|
306
|
+
k = f.alias or n
|
|
307
|
+
val = serialized.get(k)
|
|
308
|
+
|
|
309
|
+
if val != UNSET_SENTINEL:
|
|
310
|
+
if val is not None or k not in optional_fields:
|
|
311
|
+
m[k] = val
|
|
312
|
+
|
|
313
|
+
return m
|
|
314
|
+
|
|
235
315
|
|
|
236
316
|
CreateToolRequestBodyStatus = Literal[
|
|
237
317
|
"live",
|
|
@@ -264,6 +344,22 @@ class CreateToolHeaders2(BaseModel):
|
|
|
264
344
|
|
|
265
345
|
encrypted: Optional[bool] = False
|
|
266
346
|
|
|
347
|
+
@model_serializer(mode="wrap")
|
|
348
|
+
def serialize_model(self, handler):
|
|
349
|
+
optional_fields = set(["encrypted"])
|
|
350
|
+
serialized = handler(self)
|
|
351
|
+
m = {}
|
|
352
|
+
|
|
353
|
+
for n, f in type(self).model_fields.items():
|
|
354
|
+
k = f.alias or n
|
|
355
|
+
val = serialized.get(k)
|
|
356
|
+
|
|
357
|
+
if val != UNSET_SENTINEL:
|
|
358
|
+
if val is not None or k not in optional_fields:
|
|
359
|
+
m[k] = val
|
|
360
|
+
|
|
361
|
+
return m
|
|
362
|
+
|
|
267
363
|
|
|
268
364
|
CreateToolRequestBodyHeadersTypedDict = TypeAliasType(
|
|
269
365
|
"CreateToolRequestBodyHeadersTypedDict", Union[CreateToolHeaders2TypedDict, str]
|
|
@@ -303,6 +399,22 @@ class RequestBodyBlueprint(BaseModel):
|
|
|
303
399
|
body: Optional[Dict[str, Any]] = None
|
|
304
400
|
r"""The body to send with the request."""
|
|
305
401
|
|
|
402
|
+
@model_serializer(mode="wrap")
|
|
403
|
+
def serialize_model(self, handler):
|
|
404
|
+
optional_fields = set(["headers", "body"])
|
|
405
|
+
serialized = handler(self)
|
|
406
|
+
m = {}
|
|
407
|
+
|
|
408
|
+
for n, f in type(self).model_fields.items():
|
|
409
|
+
k = f.alias or n
|
|
410
|
+
val = serialized.get(k)
|
|
411
|
+
|
|
412
|
+
if val != UNSET_SENTINEL:
|
|
413
|
+
if val is not None or k not in optional_fields:
|
|
414
|
+
m[k] = val
|
|
415
|
+
|
|
416
|
+
return m
|
|
417
|
+
|
|
306
418
|
|
|
307
419
|
CreateToolRequestBodyToolsRequest3Type = Literal[
|
|
308
420
|
"string",
|
|
@@ -348,6 +460,22 @@ class RequestBodyArguments(BaseModel):
|
|
|
348
460
|
default_value: Optional[RequestBodyDefaultValue] = None
|
|
349
461
|
r"""The default value of the argument."""
|
|
350
462
|
|
|
463
|
+
@model_serializer(mode="wrap")
|
|
464
|
+
def serialize_model(self, handler):
|
|
465
|
+
optional_fields = set(["send_to_model", "default_value"])
|
|
466
|
+
serialized = handler(self)
|
|
467
|
+
m = {}
|
|
468
|
+
|
|
469
|
+
for n, f in type(self).model_fields.items():
|
|
470
|
+
k = f.alias or n
|
|
471
|
+
val = serialized.get(k)
|
|
472
|
+
|
|
473
|
+
if val != UNSET_SENTINEL:
|
|
474
|
+
if val is not None or k not in optional_fields:
|
|
475
|
+
m[k] = val
|
|
476
|
+
|
|
477
|
+
return m
|
|
478
|
+
|
|
351
479
|
|
|
352
480
|
class CreateToolRequestBodyHTTPTypedDict(TypedDict):
|
|
353
481
|
blueprint: RequestBodyBlueprintTypedDict
|
|
@@ -363,6 +491,22 @@ class CreateToolRequestBodyHTTP(BaseModel):
|
|
|
363
491
|
arguments: Optional[Dict[str, RequestBodyArguments]] = None
|
|
364
492
|
r"""The arguments to send with the request. The keys will be used to replace the placeholders in the `blueprint` field."""
|
|
365
493
|
|
|
494
|
+
@model_serializer(mode="wrap")
|
|
495
|
+
def serialize_model(self, handler):
|
|
496
|
+
optional_fields = set(["arguments"])
|
|
497
|
+
serialized = handler(self)
|
|
498
|
+
m = {}
|
|
499
|
+
|
|
500
|
+
for n, f in type(self).model_fields.items():
|
|
501
|
+
k = f.alias or n
|
|
502
|
+
val = serialized.get(k)
|
|
503
|
+
|
|
504
|
+
if val != UNSET_SENTINEL:
|
|
505
|
+
if val is not None or k not in optional_fields:
|
|
506
|
+
m[k] = val
|
|
507
|
+
|
|
508
|
+
return m
|
|
509
|
+
|
|
366
510
|
|
|
367
511
|
class RequestBodyHTTPToolTypedDict(TypedDict):
|
|
368
512
|
r"""Executes HTTP requests to interact with external APIs and web services using customizable blueprints."""
|
|
@@ -413,6 +557,22 @@ class RequestBodyHTTPTool(BaseModel):
|
|
|
413
557
|
status: Optional[CreateToolRequestBodyStatus] = "live"
|
|
414
558
|
r"""The status of the tool. `Live` is the latest version of the tool. `Draft` is a version that is not yet published. `Pending` is a version that is pending approval. `Published` is a version that was live and has been replaced by a new version."""
|
|
415
559
|
|
|
560
|
+
@model_serializer(mode="wrap")
|
|
561
|
+
def serialize_model(self, handler):
|
|
562
|
+
optional_fields = set(["display_name", "status"])
|
|
563
|
+
serialized = handler(self)
|
|
564
|
+
m = {}
|
|
565
|
+
|
|
566
|
+
for n, f in type(self).model_fields.items():
|
|
567
|
+
k = f.alias or n
|
|
568
|
+
val = serialized.get(k)
|
|
569
|
+
|
|
570
|
+
if val != UNSET_SENTINEL:
|
|
571
|
+
if val is not None or k not in optional_fields:
|
|
572
|
+
m[k] = val
|
|
573
|
+
|
|
574
|
+
return m
|
|
575
|
+
|
|
416
576
|
|
|
417
577
|
RequestBodyStatus = Literal[
|
|
418
578
|
"live",
|
|
@@ -487,8 +647,24 @@ class RequestBodyJSONSchema(BaseModel):
|
|
|
487
647
|
strict: Optional[bool] = None
|
|
488
648
|
r"""Whether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the `schema` field. Only a subset of JSON Schema is supported when `strict` is `true`. Only compatible with `OpenAI` models."""
|
|
489
649
|
|
|
650
|
+
@model_serializer(mode="wrap")
|
|
651
|
+
def serialize_model(self, handler):
|
|
652
|
+
optional_fields = set(["strict"])
|
|
653
|
+
serialized = handler(self)
|
|
654
|
+
m = {}
|
|
655
|
+
|
|
656
|
+
for n, f in type(self).model_fields.items():
|
|
657
|
+
k = f.alias or n
|
|
658
|
+
val = serialized.get(k)
|
|
659
|
+
|
|
660
|
+
if val != UNSET_SENTINEL:
|
|
661
|
+
if val is not None or k not in optional_fields:
|
|
662
|
+
m[k] = val
|
|
490
663
|
|
|
491
|
-
|
|
664
|
+
return m
|
|
665
|
+
|
|
666
|
+
|
|
667
|
+
class RequestBodyJSONSchemaToolTypedDict(TypedDict):
|
|
492
668
|
r"""A tool that enforces structured output format using JSON Schema for consistent response formatting."""
|
|
493
669
|
|
|
494
670
|
path: str
|
|
@@ -510,7 +686,7 @@ class JSONSchemaToolTypedDict(TypedDict):
|
|
|
510
686
|
r"""The status of the tool. `Live` is the latest version of the tool. `Draft` is a version that is not yet published. `Pending` is a version that is pending approval. `Published` is a version that was live and has been replaced by a new version."""
|
|
511
687
|
|
|
512
688
|
|
|
513
|
-
class
|
|
689
|
+
class RequestBodyJSONSchemaTool(BaseModel):
|
|
514
690
|
r"""A tool that enforces structured output format using JSON Schema for consistent response formatting."""
|
|
515
691
|
|
|
516
692
|
path: str
|
|
@@ -537,6 +713,22 @@ class JSONSchemaTool(BaseModel):
|
|
|
537
713
|
status: Optional[RequestBodyStatus] = "live"
|
|
538
714
|
r"""The status of the tool. `Live` is the latest version of the tool. `Draft` is a version that is not yet published. `Pending` is a version that is pending approval. `Published` is a version that was live and has been replaced by a new version."""
|
|
539
715
|
|
|
716
|
+
@model_serializer(mode="wrap")
|
|
717
|
+
def serialize_model(self, handler):
|
|
718
|
+
optional_fields = set(["display_name", "status"])
|
|
719
|
+
serialized = handler(self)
|
|
720
|
+
m = {}
|
|
721
|
+
|
|
722
|
+
for n, f in type(self).model_fields.items():
|
|
723
|
+
k = f.alias or n
|
|
724
|
+
val = serialized.get(k)
|
|
725
|
+
|
|
726
|
+
if val != UNSET_SENTINEL:
|
|
727
|
+
if val is not None or k not in optional_fields:
|
|
728
|
+
m[k] = val
|
|
729
|
+
|
|
730
|
+
return m
|
|
731
|
+
|
|
540
732
|
|
|
541
733
|
CreateToolRequestBodyToolsRequest1Status = Literal[
|
|
542
734
|
"live",
|
|
@@ -615,6 +807,22 @@ class RequestBodyFunction(BaseModel):
|
|
|
615
807
|
parameters: Optional[RequestBodyParameters] = None
|
|
616
808
|
r"""The parameters the functions accepts, described as a JSON Schema object. See the `OpenAI` [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format."""
|
|
617
809
|
|
|
810
|
+
@model_serializer(mode="wrap")
|
|
811
|
+
def serialize_model(self, handler):
|
|
812
|
+
optional_fields = set(["description", "strict", "parameters"])
|
|
813
|
+
serialized = handler(self)
|
|
814
|
+
m = {}
|
|
815
|
+
|
|
816
|
+
for n, f in type(self).model_fields.items():
|
|
817
|
+
k = f.alias or n
|
|
818
|
+
val = serialized.get(k)
|
|
819
|
+
|
|
820
|
+
if val != UNSET_SENTINEL:
|
|
821
|
+
if val is not None or k not in optional_fields:
|
|
822
|
+
m[k] = val
|
|
823
|
+
|
|
824
|
+
return m
|
|
825
|
+
|
|
618
826
|
|
|
619
827
|
class RequestBodyFunctionToolTypedDict(TypedDict):
|
|
620
828
|
r"""A custom function tool that allows the model to call predefined functions with structured parameters."""
|
|
@@ -665,12 +873,28 @@ class RequestBodyFunctionTool(BaseModel):
|
|
|
665
873
|
status: Optional[CreateToolRequestBodyToolsRequest1Status] = "live"
|
|
666
874
|
r"""The status of the tool. `Live` is the latest version of the tool. `Draft` is a version that is not yet published. `Pending` is a version that is pending approval. `Published` is a version that was live and has been replaced by a new version."""
|
|
667
875
|
|
|
876
|
+
@model_serializer(mode="wrap")
|
|
877
|
+
def serialize_model(self, handler):
|
|
878
|
+
optional_fields = set(["display_name", "status"])
|
|
879
|
+
serialized = handler(self)
|
|
880
|
+
m = {}
|
|
881
|
+
|
|
882
|
+
for n, f in type(self).model_fields.items():
|
|
883
|
+
k = f.alias or n
|
|
884
|
+
val = serialized.get(k)
|
|
885
|
+
|
|
886
|
+
if val != UNSET_SENTINEL:
|
|
887
|
+
if val is not None or k not in optional_fields:
|
|
888
|
+
m[k] = val
|
|
889
|
+
|
|
890
|
+
return m
|
|
891
|
+
|
|
668
892
|
|
|
669
893
|
CreateToolRequestBodyTypedDict = TypeAliasType(
|
|
670
894
|
"CreateToolRequestBodyTypedDict",
|
|
671
895
|
Union[
|
|
672
896
|
RequestBodyFunctionToolTypedDict,
|
|
673
|
-
|
|
897
|
+
RequestBodyJSONSchemaToolTypedDict,
|
|
674
898
|
RequestBodyHTTPToolTypedDict,
|
|
675
899
|
RequestBodyMCPToolTypedDict,
|
|
676
900
|
RequestBodyCodeExecutionToolTypedDict,
|
|
@@ -682,7 +906,7 @@ r"""The tool to create"""
|
|
|
682
906
|
CreateToolRequestBody = Annotated[
|
|
683
907
|
Union[
|
|
684
908
|
Annotated[RequestBodyFunctionTool, Tag("function")],
|
|
685
|
-
Annotated[
|
|
909
|
+
Annotated[RequestBodyJSONSchemaTool, Tag("json_schema")],
|
|
686
910
|
Annotated[RequestBodyHTTPTool, Tag("http")],
|
|
687
911
|
Annotated[RequestBodyMCPTool, Tag("mcp")],
|
|
688
912
|
Annotated[RequestBodyCodeExecutionTool, Tag("code")],
|
|
@@ -765,6 +989,22 @@ class ResponseBodyCodeTool(BaseModel):
|
|
|
765
989
|
parameters: Optional[CreateToolResponseBodyParameters] = None
|
|
766
990
|
r"""The parameters the functions accepts, described as a JSON Schema object. See the `OpenAI` [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format."""
|
|
767
991
|
|
|
992
|
+
@model_serializer(mode="wrap")
|
|
993
|
+
def serialize_model(self, handler):
|
|
994
|
+
optional_fields = set(["parameters"])
|
|
995
|
+
serialized = handler(self)
|
|
996
|
+
m = {}
|
|
997
|
+
|
|
998
|
+
for n, f in type(self).model_fields.items():
|
|
999
|
+
k = f.alias or n
|
|
1000
|
+
val = serialized.get(k)
|
|
1001
|
+
|
|
1002
|
+
if val != UNSET_SENTINEL:
|
|
1003
|
+
if val is not None or k not in optional_fields:
|
|
1004
|
+
m[k] = val
|
|
1005
|
+
|
|
1006
|
+
return m
|
|
1007
|
+
|
|
768
1008
|
|
|
769
1009
|
class ResponseBodyCodeExecutionToolTypedDict(TypedDict):
|
|
770
1010
|
r"""Executes code snippets in a sandboxed environment, currently supporting Python."""
|
|
@@ -828,7 +1068,7 @@ class ResponseBodyCodeExecutionTool(BaseModel):
|
|
|
828
1068
|
code_tool: ResponseBodyCodeTool
|
|
829
1069
|
|
|
830
1070
|
id: Annotated[Optional[str], pydantic.Field(alias="_id")] = (
|
|
831
|
-
"
|
|
1071
|
+
"tool_01KFTTTRD1W6BB4SPS6EWWKR6R"
|
|
832
1072
|
)
|
|
833
1073
|
|
|
834
1074
|
display_name: Optional[str] = None
|
|
@@ -845,6 +1085,31 @@ class ResponseBodyCodeExecutionTool(BaseModel):
|
|
|
845
1085
|
|
|
846
1086
|
version_hash: Optional[str] = None
|
|
847
1087
|
|
|
1088
|
+
@model_serializer(mode="wrap")
|
|
1089
|
+
def serialize_model(self, handler):
|
|
1090
|
+
optional_fields = set(
|
|
1091
|
+
[
|
|
1092
|
+
"_id",
|
|
1093
|
+
"display_name",
|
|
1094
|
+
"created_by_id",
|
|
1095
|
+
"updated_by_id",
|
|
1096
|
+
"status",
|
|
1097
|
+
"version_hash",
|
|
1098
|
+
]
|
|
1099
|
+
)
|
|
1100
|
+
serialized = handler(self)
|
|
1101
|
+
m = {}
|
|
1102
|
+
|
|
1103
|
+
for n, f in type(self).model_fields.items():
|
|
1104
|
+
k = f.alias or n
|
|
1105
|
+
val = serialized.get(k)
|
|
1106
|
+
|
|
1107
|
+
if val != UNSET_SENTINEL:
|
|
1108
|
+
if val is not None or k not in optional_fields:
|
|
1109
|
+
m[k] = val
|
|
1110
|
+
|
|
1111
|
+
return m
|
|
1112
|
+
|
|
848
1113
|
|
|
849
1114
|
CreateToolResponseBodyToolsResponseStatus = Literal[
|
|
850
1115
|
"live",
|
|
@@ -868,6 +1133,22 @@ class ResponseBodyHeaders(BaseModel):
|
|
|
868
1133
|
|
|
869
1134
|
encrypted: Optional[bool] = False
|
|
870
1135
|
|
|
1136
|
+
@model_serializer(mode="wrap")
|
|
1137
|
+
def serialize_model(self, handler):
|
|
1138
|
+
optional_fields = set(["encrypted"])
|
|
1139
|
+
serialized = handler(self)
|
|
1140
|
+
m = {}
|
|
1141
|
+
|
|
1142
|
+
for n, f in type(self).model_fields.items():
|
|
1143
|
+
k = f.alias or n
|
|
1144
|
+
val = serialized.get(k)
|
|
1145
|
+
|
|
1146
|
+
if val != UNSET_SENTINEL:
|
|
1147
|
+
if val is not None or k not in optional_fields:
|
|
1148
|
+
m[k] = val
|
|
1149
|
+
|
|
1150
|
+
return m
|
|
1151
|
+
|
|
871
1152
|
|
|
872
1153
|
CreateToolResponseBodyToolsResponse200ApplicationJSON4Type = Literal["object",]
|
|
873
1154
|
|
|
@@ -885,6 +1166,22 @@ class CreateToolResponseBodySchema(BaseModel):
|
|
|
885
1166
|
|
|
886
1167
|
required: Optional[List[str]] = None
|
|
887
1168
|
|
|
1169
|
+
@model_serializer(mode="wrap")
|
|
1170
|
+
def serialize_model(self, handler):
|
|
1171
|
+
optional_fields = set(["properties", "required"])
|
|
1172
|
+
serialized = handler(self)
|
|
1173
|
+
m = {}
|
|
1174
|
+
|
|
1175
|
+
for n, f in type(self).model_fields.items():
|
|
1176
|
+
k = f.alias or n
|
|
1177
|
+
val = serialized.get(k)
|
|
1178
|
+
|
|
1179
|
+
if val != UNSET_SENTINEL:
|
|
1180
|
+
if val is not None or k not in optional_fields:
|
|
1181
|
+
m[k] = val
|
|
1182
|
+
|
|
1183
|
+
return m
|
|
1184
|
+
|
|
888
1185
|
|
|
889
1186
|
class ResponseBodyToolsTypedDict(TypedDict):
|
|
890
1187
|
name: str
|
|
@@ -898,10 +1195,26 @@ class ResponseBodyTools(BaseModel):
|
|
|
898
1195
|
|
|
899
1196
|
schema_: Annotated[CreateToolResponseBodySchema, pydantic.Field(alias="schema")]
|
|
900
1197
|
|
|
901
|
-
id: Optional[str] = "
|
|
1198
|
+
id: Optional[str] = "01KFTTTRCZEJ91WBZJX13P0BAK"
|
|
902
1199
|
|
|
903
1200
|
description: Optional[str] = None
|
|
904
1201
|
|
|
1202
|
+
@model_serializer(mode="wrap")
|
|
1203
|
+
def serialize_model(self, handler):
|
|
1204
|
+
optional_fields = set(["id", "description"])
|
|
1205
|
+
serialized = handler(self)
|
|
1206
|
+
m = {}
|
|
1207
|
+
|
|
1208
|
+
for n, f in type(self).model_fields.items():
|
|
1209
|
+
k = f.alias or n
|
|
1210
|
+
val = serialized.get(k)
|
|
1211
|
+
|
|
1212
|
+
if val != UNSET_SENTINEL:
|
|
1213
|
+
if val is not None or k not in optional_fields:
|
|
1214
|
+
m[k] = val
|
|
1215
|
+
|
|
1216
|
+
return m
|
|
1217
|
+
|
|
905
1218
|
|
|
906
1219
|
ResponseBodyConnectionType = Literal[
|
|
907
1220
|
"http",
|
|
@@ -934,6 +1247,22 @@ class ResponseBodyMcp(BaseModel):
|
|
|
934
1247
|
headers: Optional[Dict[str, ResponseBodyHeaders]] = None
|
|
935
1248
|
r"""HTTP headers for MCP server requests with encryption support"""
|
|
936
1249
|
|
|
1250
|
+
@model_serializer(mode="wrap")
|
|
1251
|
+
def serialize_model(self, handler):
|
|
1252
|
+
optional_fields = set(["headers"])
|
|
1253
|
+
serialized = handler(self)
|
|
1254
|
+
m = {}
|
|
1255
|
+
|
|
1256
|
+
for n, f in type(self).model_fields.items():
|
|
1257
|
+
k = f.alias or n
|
|
1258
|
+
val = serialized.get(k)
|
|
1259
|
+
|
|
1260
|
+
if val != UNSET_SENTINEL:
|
|
1261
|
+
if val is not None or k not in optional_fields:
|
|
1262
|
+
m[k] = val
|
|
1263
|
+
|
|
1264
|
+
return m
|
|
1265
|
+
|
|
937
1266
|
|
|
938
1267
|
class ResponseBodyMCPToolTypedDict(TypedDict):
|
|
939
1268
|
r"""A tool from a Model Context Protocol (MCP) server that provides standardized access to external capabilities."""
|
|
@@ -997,7 +1326,7 @@ class ResponseBodyMCPTool(BaseModel):
|
|
|
997
1326
|
mcp: ResponseBodyMcp
|
|
998
1327
|
|
|
999
1328
|
id: Annotated[Optional[str], pydantic.Field(alias="_id")] = (
|
|
1000
|
-
"
|
|
1329
|
+
"tool_01KFTTTRCY0G655TFQ3ZHVH3Y1"
|
|
1001
1330
|
)
|
|
1002
1331
|
|
|
1003
1332
|
display_name: Optional[str] = None
|
|
@@ -1014,6 +1343,31 @@ class ResponseBodyMCPTool(BaseModel):
|
|
|
1014
1343
|
|
|
1015
1344
|
version_hash: Optional[str] = None
|
|
1016
1345
|
|
|
1346
|
+
@model_serializer(mode="wrap")
|
|
1347
|
+
def serialize_model(self, handler):
|
|
1348
|
+
optional_fields = set(
|
|
1349
|
+
[
|
|
1350
|
+
"_id",
|
|
1351
|
+
"display_name",
|
|
1352
|
+
"created_by_id",
|
|
1353
|
+
"updated_by_id",
|
|
1354
|
+
"status",
|
|
1355
|
+
"version_hash",
|
|
1356
|
+
]
|
|
1357
|
+
)
|
|
1358
|
+
serialized = handler(self)
|
|
1359
|
+
m = {}
|
|
1360
|
+
|
|
1361
|
+
for n, f in type(self).model_fields.items():
|
|
1362
|
+
k = f.alias or n
|
|
1363
|
+
val = serialized.get(k)
|
|
1364
|
+
|
|
1365
|
+
if val != UNSET_SENTINEL:
|
|
1366
|
+
if val is not None or k not in optional_fields:
|
|
1367
|
+
m[k] = val
|
|
1368
|
+
|
|
1369
|
+
return m
|
|
1370
|
+
|
|
1017
1371
|
|
|
1018
1372
|
CreateToolResponseBodyToolsStatus = Literal[
|
|
1019
1373
|
"live",
|
|
@@ -1046,6 +1400,22 @@ class CreateToolHeadersTools2(BaseModel):
|
|
|
1046
1400
|
|
|
1047
1401
|
encrypted: Optional[bool] = False
|
|
1048
1402
|
|
|
1403
|
+
@model_serializer(mode="wrap")
|
|
1404
|
+
def serialize_model(self, handler):
|
|
1405
|
+
optional_fields = set(["encrypted"])
|
|
1406
|
+
serialized = handler(self)
|
|
1407
|
+
m = {}
|
|
1408
|
+
|
|
1409
|
+
for n, f in type(self).model_fields.items():
|
|
1410
|
+
k = f.alias or n
|
|
1411
|
+
val = serialized.get(k)
|
|
1412
|
+
|
|
1413
|
+
if val != UNSET_SENTINEL:
|
|
1414
|
+
if val is not None or k not in optional_fields:
|
|
1415
|
+
m[k] = val
|
|
1416
|
+
|
|
1417
|
+
return m
|
|
1418
|
+
|
|
1049
1419
|
|
|
1050
1420
|
CreateToolResponseBodyHeadersTypedDict = TypeAliasType(
|
|
1051
1421
|
"CreateToolResponseBodyHeadersTypedDict",
|
|
@@ -1086,6 +1456,22 @@ class ResponseBodyBlueprint(BaseModel):
|
|
|
1086
1456
|
body: Optional[Dict[str, Any]] = None
|
|
1087
1457
|
r"""The body to send with the request."""
|
|
1088
1458
|
|
|
1459
|
+
@model_serializer(mode="wrap")
|
|
1460
|
+
def serialize_model(self, handler):
|
|
1461
|
+
optional_fields = set(["headers", "body"])
|
|
1462
|
+
serialized = handler(self)
|
|
1463
|
+
m = {}
|
|
1464
|
+
|
|
1465
|
+
for n, f in type(self).model_fields.items():
|
|
1466
|
+
k = f.alias or n
|
|
1467
|
+
val = serialized.get(k)
|
|
1468
|
+
|
|
1469
|
+
if val != UNSET_SENTINEL:
|
|
1470
|
+
if val is not None or k not in optional_fields:
|
|
1471
|
+
m[k] = val
|
|
1472
|
+
|
|
1473
|
+
return m
|
|
1474
|
+
|
|
1089
1475
|
|
|
1090
1476
|
CreateToolResponseBodyToolsResponse200ApplicationJSON3Type = Literal[
|
|
1091
1477
|
"string",
|
|
@@ -1131,6 +1517,22 @@ class ResponseBodyArguments(BaseModel):
|
|
|
1131
1517
|
default_value: Optional[ResponseBodyDefaultValue] = None
|
|
1132
1518
|
r"""The default value of the argument."""
|
|
1133
1519
|
|
|
1520
|
+
@model_serializer(mode="wrap")
|
|
1521
|
+
def serialize_model(self, handler):
|
|
1522
|
+
optional_fields = set(["send_to_model", "default_value"])
|
|
1523
|
+
serialized = handler(self)
|
|
1524
|
+
m = {}
|
|
1525
|
+
|
|
1526
|
+
for n, f in type(self).model_fields.items():
|
|
1527
|
+
k = f.alias or n
|
|
1528
|
+
val = serialized.get(k)
|
|
1529
|
+
|
|
1530
|
+
if val != UNSET_SENTINEL:
|
|
1531
|
+
if val is not None or k not in optional_fields:
|
|
1532
|
+
m[k] = val
|
|
1533
|
+
|
|
1534
|
+
return m
|
|
1535
|
+
|
|
1134
1536
|
|
|
1135
1537
|
class CreateToolResponseBodyHTTPTypedDict(TypedDict):
|
|
1136
1538
|
blueprint: ResponseBodyBlueprintTypedDict
|
|
@@ -1146,6 +1548,22 @@ class CreateToolResponseBodyHTTP(BaseModel):
|
|
|
1146
1548
|
arguments: Optional[Dict[str, ResponseBodyArguments]] = None
|
|
1147
1549
|
r"""The arguments to send with the request. The keys will be used to replace the placeholders in the `blueprint` field."""
|
|
1148
1550
|
|
|
1551
|
+
@model_serializer(mode="wrap")
|
|
1552
|
+
def serialize_model(self, handler):
|
|
1553
|
+
optional_fields = set(["arguments"])
|
|
1554
|
+
serialized = handler(self)
|
|
1555
|
+
m = {}
|
|
1556
|
+
|
|
1557
|
+
for n, f in type(self).model_fields.items():
|
|
1558
|
+
k = f.alias or n
|
|
1559
|
+
val = serialized.get(k)
|
|
1560
|
+
|
|
1561
|
+
if val != UNSET_SENTINEL:
|
|
1562
|
+
if val is not None or k not in optional_fields:
|
|
1563
|
+
m[k] = val
|
|
1564
|
+
|
|
1565
|
+
return m
|
|
1566
|
+
|
|
1149
1567
|
|
|
1150
1568
|
class ResponseBodyHTTPToolTypedDict(TypedDict):
|
|
1151
1569
|
r"""Executes HTTP requests to interact with external APIs and web services using customizable blueprints."""
|
|
@@ -1209,7 +1627,7 @@ class ResponseBodyHTTPTool(BaseModel):
|
|
|
1209
1627
|
http: CreateToolResponseBodyHTTP
|
|
1210
1628
|
|
|
1211
1629
|
id: Annotated[Optional[str], pydantic.Field(alias="_id")] = (
|
|
1212
|
-
"
|
|
1630
|
+
"tool_01KFTTTRCQK73SR9S9M5WG7YXR"
|
|
1213
1631
|
)
|
|
1214
1632
|
|
|
1215
1633
|
display_name: Optional[str] = None
|
|
@@ -1226,6 +1644,31 @@ class ResponseBodyHTTPTool(BaseModel):
|
|
|
1226
1644
|
|
|
1227
1645
|
version_hash: Optional[str] = None
|
|
1228
1646
|
|
|
1647
|
+
@model_serializer(mode="wrap")
|
|
1648
|
+
def serialize_model(self, handler):
|
|
1649
|
+
optional_fields = set(
|
|
1650
|
+
[
|
|
1651
|
+
"_id",
|
|
1652
|
+
"display_name",
|
|
1653
|
+
"created_by_id",
|
|
1654
|
+
"updated_by_id",
|
|
1655
|
+
"status",
|
|
1656
|
+
"version_hash",
|
|
1657
|
+
]
|
|
1658
|
+
)
|
|
1659
|
+
serialized = handler(self)
|
|
1660
|
+
m = {}
|
|
1661
|
+
|
|
1662
|
+
for n, f in type(self).model_fields.items():
|
|
1663
|
+
k = f.alias or n
|
|
1664
|
+
val = serialized.get(k)
|
|
1665
|
+
|
|
1666
|
+
if val != UNSET_SENTINEL:
|
|
1667
|
+
if val is not None or k not in optional_fields:
|
|
1668
|
+
m[k] = val
|
|
1669
|
+
|
|
1670
|
+
return m
|
|
1671
|
+
|
|
1229
1672
|
|
|
1230
1673
|
CreateToolResponseBodyStatus = Literal[
|
|
1231
1674
|
"live",
|
|
@@ -1300,6 +1743,22 @@ class ResponseBodyJSONSchema(BaseModel):
|
|
|
1300
1743
|
strict: Optional[bool] = None
|
|
1301
1744
|
r"""Whether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the `schema` field. Only a subset of JSON Schema is supported when `strict` is `true`. Only compatible with `OpenAI` models."""
|
|
1302
1745
|
|
|
1746
|
+
@model_serializer(mode="wrap")
|
|
1747
|
+
def serialize_model(self, handler):
|
|
1748
|
+
optional_fields = set(["strict"])
|
|
1749
|
+
serialized = handler(self)
|
|
1750
|
+
m = {}
|
|
1751
|
+
|
|
1752
|
+
for n, f in type(self).model_fields.items():
|
|
1753
|
+
k = f.alias or n
|
|
1754
|
+
val = serialized.get(k)
|
|
1755
|
+
|
|
1756
|
+
if val != UNSET_SENTINEL:
|
|
1757
|
+
if val is not None or k not in optional_fields:
|
|
1758
|
+
m[k] = val
|
|
1759
|
+
|
|
1760
|
+
return m
|
|
1761
|
+
|
|
1303
1762
|
|
|
1304
1763
|
class ResponseBodyJSONSchemaToolTypedDict(TypedDict):
|
|
1305
1764
|
r"""A tool that enforces structured output format using JSON Schema for consistent response formatting."""
|
|
@@ -1363,7 +1822,7 @@ class ResponseBodyJSONSchemaTool(BaseModel):
|
|
|
1363
1822
|
json_schema: ResponseBodyJSONSchema
|
|
1364
1823
|
|
|
1365
1824
|
id: Annotated[Optional[str], pydantic.Field(alias="_id")] = (
|
|
1366
|
-
"
|
|
1825
|
+
"tool_01KFTTTRCJ0DW52XWZJHVAY9QP"
|
|
1367
1826
|
)
|
|
1368
1827
|
|
|
1369
1828
|
display_name: Optional[str] = None
|
|
@@ -1380,6 +1839,31 @@ class ResponseBodyJSONSchemaTool(BaseModel):
|
|
|
1380
1839
|
|
|
1381
1840
|
version_hash: Optional[str] = None
|
|
1382
1841
|
|
|
1842
|
+
@model_serializer(mode="wrap")
|
|
1843
|
+
def serialize_model(self, handler):
|
|
1844
|
+
optional_fields = set(
|
|
1845
|
+
[
|
|
1846
|
+
"_id",
|
|
1847
|
+
"display_name",
|
|
1848
|
+
"created_by_id",
|
|
1849
|
+
"updated_by_id",
|
|
1850
|
+
"status",
|
|
1851
|
+
"version_hash",
|
|
1852
|
+
]
|
|
1853
|
+
)
|
|
1854
|
+
serialized = handler(self)
|
|
1855
|
+
m = {}
|
|
1856
|
+
|
|
1857
|
+
for n, f in type(self).model_fields.items():
|
|
1858
|
+
k = f.alias or n
|
|
1859
|
+
val = serialized.get(k)
|
|
1860
|
+
|
|
1861
|
+
if val != UNSET_SENTINEL:
|
|
1862
|
+
if val is not None or k not in optional_fields:
|
|
1863
|
+
m[k] = val
|
|
1864
|
+
|
|
1865
|
+
return m
|
|
1866
|
+
|
|
1383
1867
|
|
|
1384
1868
|
ResponseBodyStatus = Literal[
|
|
1385
1869
|
"live",
|
|
@@ -1458,6 +1942,22 @@ class CreateToolResponseBodyFunction(BaseModel):
|
|
|
1458
1942
|
parameters: Optional[ResponseBodyParameters] = None
|
|
1459
1943
|
r"""The parameters the functions accepts, described as a JSON Schema object. See the `OpenAI` [guide](https://platform.openai.com/docs/guides/function-calling) for examples, and the [JSON Schema reference](https://json-schema.org/understanding-json-schema/) for documentation about the format."""
|
|
1460
1944
|
|
|
1945
|
+
@model_serializer(mode="wrap")
|
|
1946
|
+
def serialize_model(self, handler):
|
|
1947
|
+
optional_fields = set(["description", "strict", "parameters"])
|
|
1948
|
+
serialized = handler(self)
|
|
1949
|
+
m = {}
|
|
1950
|
+
|
|
1951
|
+
for n, f in type(self).model_fields.items():
|
|
1952
|
+
k = f.alias or n
|
|
1953
|
+
val = serialized.get(k)
|
|
1954
|
+
|
|
1955
|
+
if val != UNSET_SENTINEL:
|
|
1956
|
+
if val is not None or k not in optional_fields:
|
|
1957
|
+
m[k] = val
|
|
1958
|
+
|
|
1959
|
+
return m
|
|
1960
|
+
|
|
1461
1961
|
|
|
1462
1962
|
class ResponseBodyFunctionToolTypedDict(TypedDict):
|
|
1463
1963
|
r"""A custom function tool that allows the model to call predefined functions with structured parameters."""
|
|
@@ -1521,7 +2021,7 @@ class ResponseBodyFunctionTool(BaseModel):
|
|
|
1521
2021
|
function: CreateToolResponseBodyFunction
|
|
1522
2022
|
|
|
1523
2023
|
id: Annotated[Optional[str], pydantic.Field(alias="_id")] = (
|
|
1524
|
-
"
|
|
2024
|
+
"tool_01KFTTTRCHK4DKBGZYG35ZGNP8"
|
|
1525
2025
|
)
|
|
1526
2026
|
|
|
1527
2027
|
display_name: Optional[str] = None
|
|
@@ -1538,6 +2038,31 @@ class ResponseBodyFunctionTool(BaseModel):
|
|
|
1538
2038
|
|
|
1539
2039
|
version_hash: Optional[str] = None
|
|
1540
2040
|
|
|
2041
|
+
@model_serializer(mode="wrap")
|
|
2042
|
+
def serialize_model(self, handler):
|
|
2043
|
+
optional_fields = set(
|
|
2044
|
+
[
|
|
2045
|
+
"_id",
|
|
2046
|
+
"display_name",
|
|
2047
|
+
"created_by_id",
|
|
2048
|
+
"updated_by_id",
|
|
2049
|
+
"status",
|
|
2050
|
+
"version_hash",
|
|
2051
|
+
]
|
|
2052
|
+
)
|
|
2053
|
+
serialized = handler(self)
|
|
2054
|
+
m = {}
|
|
2055
|
+
|
|
2056
|
+
for n, f in type(self).model_fields.items():
|
|
2057
|
+
k = f.alias or n
|
|
2058
|
+
val = serialized.get(k)
|
|
2059
|
+
|
|
2060
|
+
if val != UNSET_SENTINEL:
|
|
2061
|
+
if val is not None or k not in optional_fields:
|
|
2062
|
+
m[k] = val
|
|
2063
|
+
|
|
2064
|
+
return m
|
|
2065
|
+
|
|
1541
2066
|
|
|
1542
2067
|
CreateToolResponseBodyTypedDict = TypeAliasType(
|
|
1543
2068
|
"CreateToolResponseBodyTypedDict",
|