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,13 +1,17 @@
|
|
|
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
|
+
from pydantic import model_serializer
|
|
5
6
|
from typing import Any, Dict, List, Optional
|
|
6
|
-
from typing_extensions import NotRequired, TypedDict
|
|
7
|
+
from typing_extensions import NotRequired, TypedDict, deprecated
|
|
7
8
|
|
|
8
9
|
|
|
10
|
+
@deprecated(
|
|
11
|
+
"warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
12
|
+
)
|
|
9
13
|
class PublicContactTypedDict(TypedDict):
|
|
10
|
-
r"""Information about the
|
|
14
|
+
r"""@deprecated Use identity instead. Information about the contact making the request."""
|
|
11
15
|
|
|
12
16
|
id: str
|
|
13
17
|
r"""Unique identifier for the contact"""
|
|
@@ -23,8 +27,11 @@ class PublicContactTypedDict(TypedDict):
|
|
|
23
27
|
r"""A list of tags associated with the contact"""
|
|
24
28
|
|
|
25
29
|
|
|
30
|
+
@deprecated(
|
|
31
|
+
"warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
|
|
32
|
+
)
|
|
26
33
|
class PublicContact(BaseModel):
|
|
27
|
-
r"""Information about the
|
|
34
|
+
r"""@deprecated Use identity instead. Information about the contact making the request."""
|
|
28
35
|
|
|
29
36
|
id: str
|
|
30
37
|
r"""Unique identifier for the contact"""
|
|
@@ -43,3 +50,19 @@ class PublicContact(BaseModel):
|
|
|
43
50
|
|
|
44
51
|
tags: Optional[List[str]] = None
|
|
45
52
|
r"""A list of tags associated with the contact"""
|
|
53
|
+
|
|
54
|
+
@model_serializer(mode="wrap")
|
|
55
|
+
def serialize_model(self, handler):
|
|
56
|
+
optional_fields = set(["display_name", "email", "metadata", "logo_url", "tags"])
|
|
57
|
+
serialized = handler(self)
|
|
58
|
+
m = {}
|
|
59
|
+
|
|
60
|
+
for n, f in type(self).model_fields.items():
|
|
61
|
+
k = f.alias or n
|
|
62
|
+
val = serialized.get(k)
|
|
63
|
+
|
|
64
|
+
if val != UNSET_SENTINEL:
|
|
65
|
+
if val is not None or k not in optional_fields:
|
|
66
|
+
m[k] = val
|
|
67
|
+
|
|
68
|
+
return m
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from orq_ai_sdk.types import BaseModel, UNSET_SENTINEL
|
|
5
|
+
from pydantic import model_serializer
|
|
6
|
+
from typing import Any, Dict, List, Optional
|
|
7
|
+
from typing_extensions import NotRequired, TypedDict
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class PublicIdentityTypedDict(TypedDict):
|
|
11
|
+
r"""Information about the identity making the request. If the identity does not exist, it will be created automatically."""
|
|
12
|
+
|
|
13
|
+
id: str
|
|
14
|
+
r"""Unique identifier for the contact"""
|
|
15
|
+
display_name: NotRequired[str]
|
|
16
|
+
r"""Display name of the contact"""
|
|
17
|
+
email: NotRequired[str]
|
|
18
|
+
r"""Email address of the contact"""
|
|
19
|
+
metadata: NotRequired[List[Dict[str, Any]]]
|
|
20
|
+
r"""A hash of key/value pairs containing any other data about the contact"""
|
|
21
|
+
logo_url: NotRequired[str]
|
|
22
|
+
r"""URL to the contact's avatar or logo"""
|
|
23
|
+
tags: NotRequired[List[str]]
|
|
24
|
+
r"""A list of tags associated with the contact"""
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class PublicIdentity(BaseModel):
|
|
28
|
+
r"""Information about the identity making the request. If the identity does not exist, it will be created automatically."""
|
|
29
|
+
|
|
30
|
+
id: str
|
|
31
|
+
r"""Unique identifier for the contact"""
|
|
32
|
+
|
|
33
|
+
display_name: Optional[str] = None
|
|
34
|
+
r"""Display name of the contact"""
|
|
35
|
+
|
|
36
|
+
email: Optional[str] = None
|
|
37
|
+
r"""Email address of the contact"""
|
|
38
|
+
|
|
39
|
+
metadata: Optional[List[Dict[str, Any]]] = None
|
|
40
|
+
r"""A hash of key/value pairs containing any other data about the contact"""
|
|
41
|
+
|
|
42
|
+
logo_url: Optional[str] = None
|
|
43
|
+
r"""URL to the contact's avatar or logo"""
|
|
44
|
+
|
|
45
|
+
tags: Optional[List[str]] = None
|
|
46
|
+
r"""A list of tags associated with the contact"""
|
|
47
|
+
|
|
48
|
+
@model_serializer(mode="wrap")
|
|
49
|
+
def serialize_model(self, handler):
|
|
50
|
+
optional_fields = set(["display_name", "email", "metadata", "logo_url", "tags"])
|
|
51
|
+
serialized = handler(self)
|
|
52
|
+
m = {}
|
|
53
|
+
|
|
54
|
+
for n, f in type(self).model_fields.items():
|
|
55
|
+
k = f.alias or n
|
|
56
|
+
val = serialized.get(k)
|
|
57
|
+
|
|
58
|
+
if val != UNSET_SENTINEL:
|
|
59
|
+
if val is not None or k not in optional_fields:
|
|
60
|
+
m[k] = val
|
|
61
|
+
|
|
62
|
+
return m
|
|
@@ -1,8 +1,9 @@
|
|
|
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
|
import pydantic
|
|
6
|
+
from pydantic import model_serializer
|
|
6
7
|
from typing import Any, Dict, Literal, Optional
|
|
7
8
|
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
8
9
|
|
|
@@ -36,7 +37,7 @@ class ReasoningPart(BaseModel):
|
|
|
36
37
|
r"""The reasoning or thought process behind the response. Used for chain-of-thought or extended thinking."""
|
|
37
38
|
|
|
38
39
|
id: Annotated[Optional[str], pydantic.Field(alias="_id")] = (
|
|
39
|
-
"
|
|
40
|
+
"reasoning_01kftttqrsjfpz1fk19h5qh6zm"
|
|
40
41
|
)
|
|
41
42
|
r"""Unique identifier for the part. Format: reasoning_{ulid} (e.g., reasoning_01hxyz...)"""
|
|
42
43
|
|
|
@@ -45,3 +46,19 @@ class ReasoningPart(BaseModel):
|
|
|
45
46
|
|
|
46
47
|
signature: Optional[str] = None
|
|
47
48
|
r"""Optional cryptographic signature to verify the authenticity and integrity of the reasoning content"""
|
|
49
|
+
|
|
50
|
+
@model_serializer(mode="wrap")
|
|
51
|
+
def serialize_model(self, handler):
|
|
52
|
+
optional_fields = set(["_id", "metadata", "signature"])
|
|
53
|
+
serialized = handler(self)
|
|
54
|
+
m = {}
|
|
55
|
+
|
|
56
|
+
for n, f in type(self).model_fields.items():
|
|
57
|
+
k = f.alias or n
|
|
58
|
+
val = serialized.get(k)
|
|
59
|
+
|
|
60
|
+
if val != UNSET_SENTINEL:
|
|
61
|
+
if val is not None or k not in optional_fields:
|
|
62
|
+
m[k] = val
|
|
63
|
+
|
|
64
|
+
return m
|
|
@@ -1,7 +1,8 @@
|
|
|
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
|
+
from pydantic import model_serializer
|
|
5
6
|
from typing import Literal, Optional
|
|
6
7
|
from typing_extensions import NotRequired, TypedDict
|
|
7
8
|
|
|
@@ -27,3 +28,19 @@ class RefusalPartSchema(BaseModel):
|
|
|
27
28
|
|
|
28
29
|
refusal: Optional[str] = None
|
|
29
30
|
r"""The refusal message generated by the model."""
|
|
31
|
+
|
|
32
|
+
@model_serializer(mode="wrap")
|
|
33
|
+
def serialize_model(self, handler):
|
|
34
|
+
optional_fields = set(["refusal"])
|
|
35
|
+
serialized = handler(self)
|
|
36
|
+
m = {}
|
|
37
|
+
|
|
38
|
+
for n, f in type(self).model_fields.items():
|
|
39
|
+
k = f.alias or n
|
|
40
|
+
val = serialized.get(k)
|
|
41
|
+
|
|
42
|
+
if val != UNSET_SENTINEL:
|
|
43
|
+
if val is not None or k not in optional_fields:
|
|
44
|
+
m[k] = val
|
|
45
|
+
|
|
46
|
+
return m
|
|
@@ -1,7 +1,8 @@
|
|
|
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
|
+
from pydantic import model_serializer
|
|
5
6
|
from typing import Any, Dict, Literal, Optional
|
|
6
7
|
from typing_extensions import NotRequired, TypedDict
|
|
7
8
|
|
|
@@ -25,6 +26,22 @@ class RemoteConfigsGetConfigRequestBody(BaseModel):
|
|
|
25
26
|
metadata: Optional[Dict[str, Any]] = None
|
|
26
27
|
r"""Key-value pairs to attach to the log generated by this request."""
|
|
27
28
|
|
|
29
|
+
@model_serializer(mode="wrap")
|
|
30
|
+
def serialize_model(self, handler):
|
|
31
|
+
optional_fields = set(["context", "metadata"])
|
|
32
|
+
serialized = handler(self)
|
|
33
|
+
m = {}
|
|
34
|
+
|
|
35
|
+
for n, f in type(self).model_fields.items():
|
|
36
|
+
k = f.alias or n
|
|
37
|
+
val = serialized.get(k)
|
|
38
|
+
|
|
39
|
+
if val != UNSET_SENTINEL:
|
|
40
|
+
if val is not None or k not in optional_fields:
|
|
41
|
+
m[k] = val
|
|
42
|
+
|
|
43
|
+
return m
|
|
44
|
+
|
|
28
45
|
|
|
29
46
|
RemoteConfigsGetConfigType = Literal[
|
|
30
47
|
"boolean",
|
|
@@ -53,3 +70,19 @@ class RemoteConfigsGetConfigResponseBody(BaseModel):
|
|
|
53
70
|
r"""The return type of the rule"""
|
|
54
71
|
|
|
55
72
|
value: Optional[Any] = None
|
|
73
|
+
|
|
74
|
+
@model_serializer(mode="wrap")
|
|
75
|
+
def serialize_model(self, handler):
|
|
76
|
+
optional_fields = set(["value"])
|
|
77
|
+
serialized = handler(self)
|
|
78
|
+
m = {}
|
|
79
|
+
|
|
80
|
+
for n, f in type(self).model_fields.items():
|
|
81
|
+
k = f.alias or n
|
|
82
|
+
val = serialized.get(k)
|
|
83
|
+
|
|
84
|
+
if val != UNSET_SENTINEL:
|
|
85
|
+
if val is not None or k not in optional_fields:
|
|
86
|
+
m[k] = val
|
|
87
|
+
|
|
88
|
+
return m
|
|
@@ -17,7 +17,7 @@ from typing_extensions import Annotated, NotRequired, TypedDict
|
|
|
17
17
|
ResponseDoneEventType = Literal["response.done",]
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
ResponseDoneEventFinishReason = Literal[
|
|
21
21
|
"stop",
|
|
22
22
|
"length",
|
|
23
23
|
"tool_calls",
|
|
@@ -46,31 +46,30 @@ class ResponseDoneEventPromptTokensDetails(BaseModel):
|
|
|
46
46
|
|
|
47
47
|
@model_serializer(mode="wrap")
|
|
48
48
|
def serialize_model(self, handler):
|
|
49
|
-
optional_fields =
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
optional_fields = set(
|
|
50
|
+
["cached_tokens", "cache_creation_tokens", "audio_tokens"]
|
|
51
|
+
)
|
|
52
|
+
nullable_fields = set(
|
|
53
|
+
["cached_tokens", "cache_creation_tokens", "audio_tokens"]
|
|
54
|
+
)
|
|
53
55
|
serialized = handler(self)
|
|
54
|
-
|
|
55
56
|
m = {}
|
|
56
57
|
|
|
57
58
|
for n, f in type(self).model_fields.items():
|
|
58
59
|
k = f.alias or n
|
|
59
60
|
val = serialized.get(k)
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
):
|
|
73
|
-
m[k] = val
|
|
61
|
+
is_nullable_and_explicitly_set = (
|
|
62
|
+
k in nullable_fields
|
|
63
|
+
and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
if val != UNSET_SENTINEL:
|
|
67
|
+
if (
|
|
68
|
+
val is not None
|
|
69
|
+
or k not in optional_fields
|
|
70
|
+
or is_nullable_and_explicitly_set
|
|
71
|
+
):
|
|
72
|
+
m[k] = val
|
|
74
73
|
|
|
75
74
|
return m
|
|
76
75
|
|
|
@@ -95,41 +94,40 @@ class ResponseDoneEventCompletionTokensDetails(BaseModel):
|
|
|
95
94
|
|
|
96
95
|
@model_serializer(mode="wrap")
|
|
97
96
|
def serialize_model(self, handler):
|
|
98
|
-
optional_fields =
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
97
|
+
optional_fields = set(
|
|
98
|
+
[
|
|
99
|
+
"reasoning_tokens",
|
|
100
|
+
"accepted_prediction_tokens",
|
|
101
|
+
"rejected_prediction_tokens",
|
|
102
|
+
"audio_tokens",
|
|
103
|
+
]
|
|
104
|
+
)
|
|
105
|
+
nullable_fields = set(
|
|
106
|
+
[
|
|
107
|
+
"reasoning_tokens",
|
|
108
|
+
"accepted_prediction_tokens",
|
|
109
|
+
"rejected_prediction_tokens",
|
|
110
|
+
"audio_tokens",
|
|
111
|
+
]
|
|
112
|
+
)
|
|
112
113
|
serialized = handler(self)
|
|
113
|
-
|
|
114
114
|
m = {}
|
|
115
115
|
|
|
116
116
|
for n, f in type(self).model_fields.items():
|
|
117
117
|
k = f.alias or n
|
|
118
118
|
val = serialized.get(k)
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
):
|
|
132
|
-
m[k] = val
|
|
119
|
+
is_nullable_and_explicitly_set = (
|
|
120
|
+
k in nullable_fields
|
|
121
|
+
and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member
|
|
122
|
+
)
|
|
123
|
+
|
|
124
|
+
if val != UNSET_SENTINEL:
|
|
125
|
+
if (
|
|
126
|
+
val is not None
|
|
127
|
+
or k not in optional_fields
|
|
128
|
+
or is_nullable_and_explicitly_set
|
|
129
|
+
):
|
|
130
|
+
m[k] = val
|
|
133
131
|
|
|
134
132
|
return m
|
|
135
133
|
|
|
@@ -173,37 +171,34 @@ class ResponseDoneEventUsage(BaseModel):
|
|
|
173
171
|
|
|
174
172
|
@model_serializer(mode="wrap")
|
|
175
173
|
def serialize_model(self, handler):
|
|
176
|
-
optional_fields =
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
174
|
+
optional_fields = set(
|
|
175
|
+
[
|
|
176
|
+
"completion_tokens",
|
|
177
|
+
"prompt_tokens",
|
|
178
|
+
"total_tokens",
|
|
179
|
+
"prompt_tokens_details",
|
|
180
|
+
"completion_tokens_details",
|
|
181
|
+
]
|
|
182
|
+
)
|
|
183
|
+
nullable_fields = set(["prompt_tokens_details", "completion_tokens_details"])
|
|
186
184
|
serialized = handler(self)
|
|
187
|
-
|
|
188
185
|
m = {}
|
|
189
186
|
|
|
190
187
|
for n, f in type(self).model_fields.items():
|
|
191
188
|
k = f.alias or n
|
|
192
189
|
val = serialized.get(k)
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
):
|
|
206
|
-
m[k] = val
|
|
190
|
+
is_nullable_and_explicitly_set = (
|
|
191
|
+
k in nullable_fields
|
|
192
|
+
and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member
|
|
193
|
+
)
|
|
194
|
+
|
|
195
|
+
if val != UNSET_SENTINEL:
|
|
196
|
+
if (
|
|
197
|
+
val is not None
|
|
198
|
+
or k not in optional_fields
|
|
199
|
+
or is_nullable_and_explicitly_set
|
|
200
|
+
):
|
|
201
|
+
m[k] = val
|
|
207
202
|
|
|
208
203
|
return m
|
|
209
204
|
|
|
@@ -211,58 +206,93 @@ class ResponseDoneEventUsage(BaseModel):
|
|
|
211
206
|
ResponseDoneEventDataType = Literal["function",]
|
|
212
207
|
|
|
213
208
|
|
|
214
|
-
class
|
|
209
|
+
class ResponseDoneEventFunctionTypedDict(TypedDict):
|
|
215
210
|
name: NotRequired[str]
|
|
216
211
|
r"""The name of the function to call"""
|
|
217
212
|
arguments: NotRequired[str]
|
|
218
213
|
r"""The arguments to pass to the function as JSON string"""
|
|
219
214
|
|
|
220
215
|
|
|
221
|
-
class
|
|
216
|
+
class ResponseDoneEventFunction(BaseModel):
|
|
222
217
|
name: Optional[str] = None
|
|
223
218
|
r"""The name of the function to call"""
|
|
224
219
|
|
|
225
220
|
arguments: Optional[str] = None
|
|
226
221
|
r"""The arguments to pass to the function as JSON string"""
|
|
227
222
|
|
|
223
|
+
@model_serializer(mode="wrap")
|
|
224
|
+
def serialize_model(self, handler):
|
|
225
|
+
optional_fields = set(["name", "arguments"])
|
|
226
|
+
serialized = handler(self)
|
|
227
|
+
m = {}
|
|
228
228
|
|
|
229
|
-
|
|
229
|
+
for n, f in type(self).model_fields.items():
|
|
230
|
+
k = f.alias or n
|
|
231
|
+
val = serialized.get(k)
|
|
232
|
+
|
|
233
|
+
if val != UNSET_SENTINEL:
|
|
234
|
+
if val is not None or k not in optional_fields:
|
|
235
|
+
m[k] = val
|
|
236
|
+
|
|
237
|
+
return m
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
class ResponseDoneEventPendingToolCallsTypedDict(TypedDict):
|
|
230
241
|
id: str
|
|
231
242
|
r"""Unique identifier for the tool call"""
|
|
232
243
|
type: ResponseDoneEventDataType
|
|
233
|
-
function:
|
|
244
|
+
function: ResponseDoneEventFunctionTypedDict
|
|
234
245
|
|
|
235
246
|
|
|
236
|
-
class
|
|
247
|
+
class ResponseDoneEventPendingToolCalls(BaseModel):
|
|
237
248
|
id: str
|
|
238
249
|
r"""Unique identifier for the tool call"""
|
|
239
250
|
|
|
240
251
|
type: ResponseDoneEventDataType
|
|
241
252
|
|
|
242
|
-
function:
|
|
253
|
+
function: ResponseDoneEventFunction
|
|
243
254
|
|
|
244
255
|
|
|
245
256
|
class ResponseDoneEventDataTypedDict(TypedDict):
|
|
246
|
-
finish_reason:
|
|
257
|
+
finish_reason: ResponseDoneEventFinishReason
|
|
247
258
|
r"""The reason why the agent stopped generating"""
|
|
248
259
|
usage: NotRequired[ResponseDoneEventUsageTypedDict]
|
|
249
260
|
r"""Token usage statistics for the complete response"""
|
|
250
|
-
pending_tool_calls: NotRequired[List[
|
|
261
|
+
pending_tool_calls: NotRequired[List[ResponseDoneEventPendingToolCallsTypedDict]]
|
|
251
262
|
r"""Tool calls awaiting user response (when finishReason is function_call)"""
|
|
252
263
|
|
|
253
264
|
|
|
254
265
|
class ResponseDoneEventData(BaseModel):
|
|
255
|
-
finish_reason: Annotated[
|
|
266
|
+
finish_reason: Annotated[
|
|
267
|
+
ResponseDoneEventFinishReason, pydantic.Field(alias="finishReason")
|
|
268
|
+
]
|
|
256
269
|
r"""The reason why the agent stopped generating"""
|
|
257
270
|
|
|
258
271
|
usage: Optional[ResponseDoneEventUsage] = None
|
|
259
272
|
r"""Token usage statistics for the complete response"""
|
|
260
273
|
|
|
261
274
|
pending_tool_calls: Annotated[
|
|
262
|
-
Optional[List[
|
|
275
|
+
Optional[List[ResponseDoneEventPendingToolCalls]],
|
|
276
|
+
pydantic.Field(alias="pendingToolCalls"),
|
|
263
277
|
] = None
|
|
264
278
|
r"""Tool calls awaiting user response (when finishReason is function_call)"""
|
|
265
279
|
|
|
280
|
+
@model_serializer(mode="wrap")
|
|
281
|
+
def serialize_model(self, handler):
|
|
282
|
+
optional_fields = set(["usage", "pendingToolCalls"])
|
|
283
|
+
serialized = handler(self)
|
|
284
|
+
m = {}
|
|
285
|
+
|
|
286
|
+
for n, f in type(self).model_fields.items():
|
|
287
|
+
k = f.alias or n
|
|
288
|
+
val = serialized.get(k)
|
|
289
|
+
|
|
290
|
+
if val != UNSET_SENTINEL:
|
|
291
|
+
if val is not None or k not in optional_fields:
|
|
292
|
+
m[k] = val
|
|
293
|
+
|
|
294
|
+
return m
|
|
295
|
+
|
|
266
296
|
|
|
267
297
|
class ResponseDoneEventTypedDict(TypedDict):
|
|
268
298
|
r"""Emitted when the agent completes processing. Contains the finish reason and usage statistics."""
|
|
@@ -1,8 +1,9 @@
|
|
|
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
|
import pydantic
|
|
6
|
+
from pydantic import model_serializer
|
|
6
7
|
from typing import Literal, Optional
|
|
7
8
|
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
8
9
|
|
|
@@ -54,6 +55,22 @@ class Data(BaseModel):
|
|
|
54
55
|
] = None
|
|
55
56
|
r"""Server-generated ID for the assistant message. Use this ID for frontend state consistency."""
|
|
56
57
|
|
|
58
|
+
@model_serializer(mode="wrap")
|
|
59
|
+
def serialize_model(self, handler):
|
|
60
|
+
optional_fields = set(["userMessageId", "assistantMessageId"])
|
|
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
|
+
|
|
57
74
|
|
|
58
75
|
class ResponseStartedEventTypedDict(TypedDict):
|
|
59
76
|
r"""Emitted when the agent begins processing. Contains identifiers for tracking the response."""
|