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.
Files changed (167) hide show
  1. orq_ai_sdk/_hooks/globalhook.py +0 -1
  2. orq_ai_sdk/_version.py +3 -3
  3. orq_ai_sdk/audio.py +30 -0
  4. orq_ai_sdk/basesdk.py +20 -6
  5. orq_ai_sdk/chat.py +22 -0
  6. orq_ai_sdk/completions.py +332 -0
  7. orq_ai_sdk/contacts.py +43 -855
  8. orq_ai_sdk/deployments.py +61 -0
  9. orq_ai_sdk/edits.py +258 -0
  10. orq_ai_sdk/embeddings.py +238 -0
  11. orq_ai_sdk/generations.py +272 -0
  12. orq_ai_sdk/identities.py +1037 -0
  13. orq_ai_sdk/images.py +28 -0
  14. orq_ai_sdk/models/__init__.py +5341 -737
  15. orq_ai_sdk/models/actionreviewedstreamingevent.py +18 -1
  16. orq_ai_sdk/models/actionreviewrequestedstreamingevent.py +44 -1
  17. orq_ai_sdk/models/agenterroredstreamingevent.py +18 -1
  18. orq_ai_sdk/models/agentinactivestreamingevent.py +168 -70
  19. orq_ai_sdk/models/agentmessagecreatedstreamingevent.py +18 -2
  20. orq_ai_sdk/models/agentresponsemessage.py +18 -2
  21. orq_ai_sdk/models/agentstartedstreamingevent.py +127 -2
  22. orq_ai_sdk/models/agentthoughtstreamingevent.py +178 -211
  23. orq_ai_sdk/models/conversationresponse.py +31 -20
  24. orq_ai_sdk/models/conversationwithmessagesresponse.py +31 -20
  25. orq_ai_sdk/models/createagentrequestop.py +1922 -384
  26. orq_ai_sdk/models/createagentresponse.py +147 -91
  27. orq_ai_sdk/models/createagentresponserequestop.py +111 -2
  28. orq_ai_sdk/models/createchatcompletionop.py +1375 -861
  29. orq_ai_sdk/models/createchunkop.py +46 -19
  30. orq_ai_sdk/models/createcompletionop.py +1890 -0
  31. orq_ai_sdk/models/createcontactop.py +45 -56
  32. orq_ai_sdk/models/createconversationop.py +61 -39
  33. orq_ai_sdk/models/createconversationresponseop.py +68 -4
  34. orq_ai_sdk/models/createdatasetitemop.py +424 -80
  35. orq_ai_sdk/models/createdatasetop.py +19 -2
  36. orq_ai_sdk/models/createdatasourceop.py +92 -26
  37. orq_ai_sdk/models/createembeddingop.py +384 -0
  38. orq_ai_sdk/models/createevalop.py +552 -24
  39. orq_ai_sdk/models/createidentityop.py +176 -0
  40. orq_ai_sdk/models/createimageeditop.py +504 -0
  41. orq_ai_sdk/models/createimageop.py +208 -117
  42. orq_ai_sdk/models/createimagevariationop.py +486 -0
  43. orq_ai_sdk/models/createknowledgeop.py +186 -121
  44. orq_ai_sdk/models/creatememorydocumentop.py +50 -1
  45. orq_ai_sdk/models/creatememoryop.py +34 -21
  46. orq_ai_sdk/models/creatememorystoreop.py +34 -1
  47. orq_ai_sdk/models/createmoderationop.py +521 -0
  48. orq_ai_sdk/models/createpromptop.py +2748 -1252
  49. orq_ai_sdk/models/creatererankop.py +416 -0
  50. orq_ai_sdk/models/createresponseop.py +2567 -0
  51. orq_ai_sdk/models/createspeechop.py +316 -0
  52. orq_ai_sdk/models/createtoolop.py +537 -12
  53. orq_ai_sdk/models/createtranscriptionop.py +562 -0
  54. orq_ai_sdk/models/createtranslationop.py +540 -0
  55. orq_ai_sdk/models/datapart.py +18 -1
  56. orq_ai_sdk/models/deletechunksop.py +34 -1
  57. orq_ai_sdk/models/{deletecontactop.py → deleteidentityop.py} +9 -9
  58. orq_ai_sdk/models/deletepromptop.py +26 -0
  59. orq_ai_sdk/models/deploymentcreatemetricop.py +362 -76
  60. orq_ai_sdk/models/deploymentgetconfigop.py +635 -194
  61. orq_ai_sdk/models/deploymentinvokeop.py +168 -173
  62. orq_ai_sdk/models/deploymentsop.py +195 -58
  63. orq_ai_sdk/models/deploymentstreamop.py +652 -304
  64. orq_ai_sdk/models/errorpart.py +18 -1
  65. orq_ai_sdk/models/filecontentpartschema.py +18 -1
  66. orq_ai_sdk/models/filegetop.py +19 -2
  67. orq_ai_sdk/models/filelistop.py +35 -2
  68. orq_ai_sdk/models/filepart.py +50 -1
  69. orq_ai_sdk/models/fileuploadop.py +51 -2
  70. orq_ai_sdk/models/generateconversationnameop.py +31 -20
  71. orq_ai_sdk/models/get_v2_evaluators_id_versionsop.py +34 -1
  72. orq_ai_sdk/models/get_v2_tools_tool_id_versions_version_id_op.py +18 -1
  73. orq_ai_sdk/models/get_v2_tools_tool_id_versionsop.py +34 -1
  74. orq_ai_sdk/models/getallmemoriesop.py +34 -21
  75. orq_ai_sdk/models/getallmemorydocumentsop.py +42 -1
  76. orq_ai_sdk/models/getallmemorystoresop.py +34 -1
  77. orq_ai_sdk/models/getallpromptsop.py +1690 -230
  78. orq_ai_sdk/models/getalltoolsop.py +325 -8
  79. orq_ai_sdk/models/getchunkscountop.py +34 -1
  80. orq_ai_sdk/models/getevalsop.py +395 -43
  81. orq_ai_sdk/models/getonechunkop.py +14 -19
  82. orq_ai_sdk/models/getoneknowledgeop.py +116 -96
  83. orq_ai_sdk/models/getonepromptop.py +1673 -230
  84. orq_ai_sdk/models/getpromptversionop.py +1670 -216
  85. orq_ai_sdk/models/imagecontentpartschema.py +50 -1
  86. orq_ai_sdk/models/internal/globals.py +18 -1
  87. orq_ai_sdk/models/invokeagentop.py +140 -2
  88. orq_ai_sdk/models/invokedeploymentrequest.py +418 -80
  89. orq_ai_sdk/models/invokeevalop.py +160 -131
  90. orq_ai_sdk/models/listagentsop.py +793 -166
  91. orq_ai_sdk/models/listchunksop.py +32 -19
  92. orq_ai_sdk/models/listchunkspaginatedop.py +46 -19
  93. orq_ai_sdk/models/listconversationsop.py +18 -1
  94. orq_ai_sdk/models/listdatasetdatapointsop.py +252 -42
  95. orq_ai_sdk/models/listdatasetsop.py +35 -2
  96. orq_ai_sdk/models/listdatasourcesop.py +35 -26
  97. orq_ai_sdk/models/{listcontactsop.py → listidentitiesop.py} +89 -79
  98. orq_ai_sdk/models/listknowledgebasesop.py +132 -96
  99. orq_ai_sdk/models/listmodelsop.py +1 -0
  100. orq_ai_sdk/models/listpromptversionsop.py +1684 -216
  101. orq_ai_sdk/models/parseop.py +161 -17
  102. orq_ai_sdk/models/partdoneevent.py +19 -2
  103. orq_ai_sdk/models/post_v2_router_ocrop.py +408 -0
  104. orq_ai_sdk/models/publiccontact.py +27 -4
  105. orq_ai_sdk/models/publicidentity.py +62 -0
  106. orq_ai_sdk/models/reasoningpart.py +19 -2
  107. orq_ai_sdk/models/refusalpartschema.py +18 -1
  108. orq_ai_sdk/models/remoteconfigsgetconfigop.py +34 -1
  109. orq_ai_sdk/models/responsedoneevent.py +114 -84
  110. orq_ai_sdk/models/responsestartedevent.py +18 -1
  111. orq_ai_sdk/models/retrieveagentrequestop.py +787 -166
  112. orq_ai_sdk/models/retrievedatapointop.py +236 -42
  113. orq_ai_sdk/models/retrievedatasetop.py +19 -2
  114. orq_ai_sdk/models/retrievedatasourceop.py +17 -26
  115. orq_ai_sdk/models/{retrievecontactop.py → retrieveidentityop.py} +38 -41
  116. orq_ai_sdk/models/retrievememorydocumentop.py +18 -1
  117. orq_ai_sdk/models/retrievememoryop.py +18 -21
  118. orq_ai_sdk/models/retrievememorystoreop.py +18 -1
  119. orq_ai_sdk/models/retrievetoolop.py +309 -8
  120. orq_ai_sdk/models/runagentop.py +1451 -197
  121. orq_ai_sdk/models/searchknowledgeop.py +108 -1
  122. orq_ai_sdk/models/security.py +18 -1
  123. orq_ai_sdk/models/streamagentop.py +93 -2
  124. orq_ai_sdk/models/streamrunagentop.py +1428 -195
  125. orq_ai_sdk/models/textcontentpartschema.py +34 -1
  126. orq_ai_sdk/models/thinkingconfigenabledschema.py +18 -1
  127. orq_ai_sdk/models/toolcallpart.py +18 -1
  128. orq_ai_sdk/models/tooldoneevent.py +18 -1
  129. orq_ai_sdk/models/toolexecutionfailedstreamingevent.py +50 -1
  130. orq_ai_sdk/models/toolexecutionfinishedstreamingevent.py +34 -1
  131. orq_ai_sdk/models/toolexecutionstartedstreamingevent.py +34 -1
  132. orq_ai_sdk/models/toolresultpart.py +18 -1
  133. orq_ai_sdk/models/toolreviewrequestedevent.py +18 -1
  134. orq_ai_sdk/models/toolstartedevent.py +18 -1
  135. orq_ai_sdk/models/updateagentop.py +1951 -404
  136. orq_ai_sdk/models/updatechunkop.py +46 -19
  137. orq_ai_sdk/models/updateconversationop.py +61 -39
  138. orq_ai_sdk/models/updatedatapointop.py +424 -80
  139. orq_ai_sdk/models/updatedatasetop.py +51 -2
  140. orq_ai_sdk/models/updatedatasourceop.py +17 -26
  141. orq_ai_sdk/models/updateevalop.py +577 -16
  142. orq_ai_sdk/models/{updatecontactop.py → updateidentityop.py} +78 -68
  143. orq_ai_sdk/models/updateknowledgeop.py +234 -190
  144. orq_ai_sdk/models/updatememorydocumentop.py +50 -1
  145. orq_ai_sdk/models/updatememoryop.py +50 -21
  146. orq_ai_sdk/models/updatememorystoreop.py +66 -1
  147. orq_ai_sdk/models/updatepromptop.py +2844 -1450
  148. orq_ai_sdk/models/updatetoolop.py +592 -9
  149. orq_ai_sdk/models/usermessagerequest.py +18 -2
  150. orq_ai_sdk/moderations.py +218 -0
  151. orq_ai_sdk/orq_completions.py +660 -0
  152. orq_ai_sdk/orq_responses.py +398 -0
  153. orq_ai_sdk/prompts.py +28 -36
  154. orq_ai_sdk/rerank.py +232 -0
  155. orq_ai_sdk/router.py +89 -641
  156. orq_ai_sdk/sdk.py +3 -0
  157. orq_ai_sdk/speech.py +251 -0
  158. orq_ai_sdk/transcriptions.py +326 -0
  159. orq_ai_sdk/translations.py +298 -0
  160. orq_ai_sdk/utils/__init__.py +13 -1
  161. orq_ai_sdk/variations.py +254 -0
  162. orq_ai_sdk-4.2.6.dist-info/METADATA +888 -0
  163. orq_ai_sdk-4.2.6.dist-info/RECORD +263 -0
  164. {orq_ai_sdk-4.2.0rc28.dist-info → orq_ai_sdk-4.2.6.dist-info}/WHEEL +2 -1
  165. orq_ai_sdk-4.2.6.dist-info/top_level.txt +1 -0
  166. orq_ai_sdk-4.2.0rc28.dist-info/METADATA +0 -867
  167. orq_ai_sdk-4.2.0rc28.dist-info/RECORD +0 -233
@@ -0,0 +1,176 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from datetime import datetime
5
+ from orq_ai_sdk.types import (
6
+ BaseModel,
7
+ Nullable,
8
+ OptionalNullable,
9
+ UNSET,
10
+ UNSET_SENTINEL,
11
+ )
12
+ from orq_ai_sdk.utils import parse_datetime
13
+ import pydantic
14
+ from pydantic import model_serializer
15
+ from typing import Any, Dict, List, Optional
16
+ from typing_extensions import Annotated, NotRequired, TypedDict
17
+
18
+
19
+ class CreateIdentityRequestBodyTypedDict(TypedDict):
20
+ r"""Identity profile information"""
21
+
22
+ external_id: str
23
+ r"""Unique string value to identify the contact user in the customer's system. This should be the same ID you use in your system to reference this user."""
24
+ display_name: NotRequired[Nullable[str]]
25
+ r"""Display name or nickname of the contact user. This is typically shown in user interfaces."""
26
+ email: NotRequired[Nullable[str]]
27
+ r"""Email address of the contact user"""
28
+ avatar_url: NotRequired[Nullable[str]]
29
+ r"""URL linking to the contact user's avatar image"""
30
+ tags: NotRequired[List[str]]
31
+ r"""Array of tags associated with the contact. Useful for organizing and filtering contacts by categories, departments, or custom classifications."""
32
+ metadata: NotRequired[Dict[str, Any]]
33
+ r"""Additional custom metadata associated with the contact as key-value pairs. Use this to store any extra information specific to your application."""
34
+
35
+
36
+ class CreateIdentityRequestBody(BaseModel):
37
+ r"""Identity profile information"""
38
+
39
+ external_id: str
40
+ r"""Unique string value to identify the contact user in the customer's system. This should be the same ID you use in your system to reference this user."""
41
+
42
+ display_name: OptionalNullable[str] = UNSET
43
+ r"""Display name or nickname of the contact user. This is typically shown in user interfaces."""
44
+
45
+ email: OptionalNullable[str] = UNSET
46
+ r"""Email address of the contact user"""
47
+
48
+ avatar_url: OptionalNullable[str] = UNSET
49
+ r"""URL linking to the contact user's avatar image"""
50
+
51
+ tags: Optional[List[str]] = None
52
+ r"""Array of tags associated with the contact. Useful for organizing and filtering contacts by categories, departments, or custom classifications."""
53
+
54
+ metadata: Optional[Dict[str, Any]] = None
55
+ r"""Additional custom metadata associated with the contact as key-value pairs. Use this to store any extra information specific to your application."""
56
+
57
+ @model_serializer(mode="wrap")
58
+ def serialize_model(self, handler):
59
+ optional_fields = set(
60
+ ["display_name", "email", "avatar_url", "tags", "metadata"]
61
+ )
62
+ nullable_fields = set(["display_name", "email", "avatar_url"])
63
+ serialized = handler(self)
64
+ m = {}
65
+
66
+ for n, f in type(self).model_fields.items():
67
+ k = f.alias or n
68
+ val = serialized.get(k)
69
+ is_nullable_and_explicitly_set = (
70
+ k in nullable_fields
71
+ and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member
72
+ )
73
+
74
+ if val != UNSET_SENTINEL:
75
+ if (
76
+ val is not None
77
+ or k not in optional_fields
78
+ or is_nullable_and_explicitly_set
79
+ ):
80
+ m[k] = val
81
+
82
+ return m
83
+
84
+
85
+ class CreateIdentityResponseBodyTypedDict(TypedDict):
86
+ r"""Created Identity"""
87
+
88
+ id: str
89
+ r"""Unique ULID (Universally Unique Lexicographically Sortable Identifier) for the contact"""
90
+ external_id: str
91
+ r"""Unique string value to identify the contact user in the customer's system. This should be the same ID you use in your system to reference this user."""
92
+ workspace_id: str
93
+ r"""Unique identifier for the workspace to which the contact belongs"""
94
+ display_name: NotRequired[Nullable[str]]
95
+ r"""Display name or nickname of the contact user. This is typically shown in user interfaces."""
96
+ email: NotRequired[Nullable[str]]
97
+ r"""Email address of the contact user"""
98
+ avatar_url: NotRequired[Nullable[str]]
99
+ r"""URL linking to the contact user's avatar image"""
100
+ tags: NotRequired[List[str]]
101
+ r"""Array of tags associated with the contact. Useful for organizing and filtering contacts by categories, departments, or custom classifications."""
102
+ metadata: NotRequired[Dict[str, Any]]
103
+ r"""Additional custom metadata associated with the contact as key-value pairs. Use this to store any extra information specific to your application."""
104
+ created: NotRequired[datetime]
105
+ r"""The date and time the resource was created"""
106
+ updated: NotRequired[datetime]
107
+ r"""The date and time the resource was last updated"""
108
+
109
+
110
+ class CreateIdentityResponseBody(BaseModel):
111
+ r"""Created Identity"""
112
+
113
+ id: Annotated[str, pydantic.Field(alias="_id")]
114
+ r"""Unique ULID (Universally Unique Lexicographically Sortable Identifier) for the contact"""
115
+
116
+ external_id: str
117
+ r"""Unique string value to identify the contact user in the customer's system. This should be the same ID you use in your system to reference this user."""
118
+
119
+ workspace_id: str
120
+ r"""Unique identifier for the workspace to which the contact belongs"""
121
+
122
+ display_name: OptionalNullable[str] = UNSET
123
+ r"""Display name or nickname of the contact user. This is typically shown in user interfaces."""
124
+
125
+ email: OptionalNullable[str] = UNSET
126
+ r"""Email address of the contact user"""
127
+
128
+ avatar_url: OptionalNullable[str] = UNSET
129
+ r"""URL linking to the contact user's avatar image"""
130
+
131
+ tags: Optional[List[str]] = None
132
+ r"""Array of tags associated with the contact. Useful for organizing and filtering contacts by categories, departments, or custom classifications."""
133
+
134
+ metadata: Optional[Dict[str, Any]] = None
135
+ r"""Additional custom metadata associated with the contact as key-value pairs. Use this to store any extra information specific to your application."""
136
+
137
+ created: Optional[datetime] = None
138
+ r"""The date and time the resource was created"""
139
+
140
+ updated: Optional[datetime] = parse_datetime("2026-01-25T15:02:07.185Z")
141
+ r"""The date and time the resource was last updated"""
142
+
143
+ @model_serializer(mode="wrap")
144
+ def serialize_model(self, handler):
145
+ optional_fields = set(
146
+ [
147
+ "display_name",
148
+ "email",
149
+ "avatar_url",
150
+ "tags",
151
+ "metadata",
152
+ "created",
153
+ "updated",
154
+ ]
155
+ )
156
+ nullable_fields = set(["display_name", "email", "avatar_url"])
157
+ serialized = handler(self)
158
+ m = {}
159
+
160
+ for n, f in type(self).model_fields.items():
161
+ k = f.alias or n
162
+ val = serialized.get(k)
163
+ is_nullable_and_explicitly_set = (
164
+ k in nullable_fields
165
+ and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member
166
+ )
167
+
168
+ if val != UNSET_SENTINEL:
169
+ if (
170
+ val is not None
171
+ or k not in optional_fields
172
+ or is_nullable_and_explicitly_set
173
+ ):
174
+ m[k] = val
175
+
176
+ return m
@@ -0,0 +1,504 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from .publiccontact import PublicContact, PublicContactTypedDict
5
+ from .publicidentity import PublicIdentity, PublicIdentityTypedDict
6
+ from orq_ai_sdk.types import (
7
+ BaseModel,
8
+ Nullable,
9
+ OptionalNullable,
10
+ UNSET,
11
+ UNSET_SENTINEL,
12
+ )
13
+ from orq_ai_sdk.utils import FieldMetadata, MultipartFormMetadata
14
+ import pydantic
15
+ from pydantic import model_serializer
16
+ from typing import Any, List, Literal, Optional
17
+ from typing_extensions import Annotated, NotRequired, TypedDict
18
+
19
+
20
+ CreateImageEditQuality = Literal[
21
+ "auto",
22
+ "high",
23
+ "medium",
24
+ "low",
25
+ "standard",
26
+ ]
27
+ r"""The quality of the image that will be generated. Auto will automatically select the best quality for the given model."""
28
+
29
+
30
+ CreateImageEditResponseFormat = Literal[
31
+ "url",
32
+ "b64_json",
33
+ ]
34
+ r"""The format in which the generated images are returned. Some of the models only return the image in base64 format."""
35
+
36
+
37
+ class CreateImageEditRetryTypedDict(TypedDict):
38
+ r"""Retry configuration for the request"""
39
+
40
+ count: NotRequired[float]
41
+ r"""Number of retry attempts (1-5)"""
42
+ on_codes: NotRequired[List[float]]
43
+ r"""HTTP status codes that trigger retry logic"""
44
+
45
+
46
+ class CreateImageEditRetry(BaseModel):
47
+ r"""Retry configuration for the request"""
48
+
49
+ count: Optional[float] = 3
50
+ r"""Number of retry attempts (1-5)"""
51
+
52
+ on_codes: Optional[List[float]] = None
53
+ r"""HTTP status codes that trigger retry logic"""
54
+
55
+ @model_serializer(mode="wrap")
56
+ def serialize_model(self, handler):
57
+ optional_fields = set(["count", "on_codes"])
58
+ serialized = handler(self)
59
+ m = {}
60
+
61
+ for n, f in type(self).model_fields.items():
62
+ k = f.alias or n
63
+ val = serialized.get(k)
64
+
65
+ if val != UNSET_SENTINEL:
66
+ if val is not None or k not in optional_fields:
67
+ m[k] = val
68
+
69
+ return m
70
+
71
+
72
+ class CreateImageEditFallbacksTypedDict(TypedDict):
73
+ model: str
74
+ r"""Fallback model identifier"""
75
+
76
+
77
+ class CreateImageEditFallbacks(BaseModel):
78
+ model: str
79
+ r"""Fallback model identifier"""
80
+
81
+
82
+ CreateImageEditVersion = Literal["latest",]
83
+ r"""Version of the prompt to use (currently only \"latest\" supported)"""
84
+
85
+
86
+ class CreateImageEditPromptTypedDict(TypedDict):
87
+ r"""Prompt configuration for the request"""
88
+
89
+ id: str
90
+ r"""Unique identifier of the prompt to use"""
91
+ version: CreateImageEditVersion
92
+ r"""Version of the prompt to use (currently only \"latest\" supported)"""
93
+
94
+
95
+ class CreateImageEditPrompt(BaseModel):
96
+ r"""Prompt configuration for the request"""
97
+
98
+ id: str
99
+ r"""Unique identifier of the prompt to use"""
100
+
101
+ version: CreateImageEditVersion
102
+ r"""Version of the prompt to use (currently only \"latest\" supported)"""
103
+
104
+
105
+ CreateImageEditType = Literal["exact_match",]
106
+
107
+
108
+ class CreateImageEditCacheTypedDict(TypedDict):
109
+ r"""Cache configuration for the request."""
110
+
111
+ type: CreateImageEditType
112
+ ttl: NotRequired[float]
113
+ r"""Time to live for cached responses in seconds. Maximum 259200 seconds (3 days)."""
114
+
115
+
116
+ class CreateImageEditCache(BaseModel):
117
+ r"""Cache configuration for the request."""
118
+
119
+ type: CreateImageEditType
120
+
121
+ ttl: Optional[float] = 1800
122
+ r"""Time to live for cached responses in seconds. Maximum 259200 seconds (3 days)."""
123
+
124
+ @model_serializer(mode="wrap")
125
+ def serialize_model(self, handler):
126
+ optional_fields = set(["ttl"])
127
+ serialized = handler(self)
128
+ m = {}
129
+
130
+ for n, f in type(self).model_fields.items():
131
+ k = f.alias or n
132
+ val = serialized.get(k)
133
+
134
+ if val != UNSET_SENTINEL:
135
+ if val is not None or k not in optional_fields:
136
+ m[k] = val
137
+
138
+ return m
139
+
140
+
141
+ CreateImageEditLoadBalancerType = Literal["weight_based",]
142
+
143
+
144
+ class CreateImageEditLoadBalancerModelsTypedDict(TypedDict):
145
+ model: str
146
+ r"""Model identifier for load balancing"""
147
+ weight: NotRequired[float]
148
+ r"""Weight assigned to this model for load balancing"""
149
+
150
+
151
+ class CreateImageEditLoadBalancerModels(BaseModel):
152
+ model: str
153
+ r"""Model identifier for load balancing"""
154
+
155
+ weight: Optional[float] = 0.5
156
+ r"""Weight assigned to this model for load balancing"""
157
+
158
+ @model_serializer(mode="wrap")
159
+ def serialize_model(self, handler):
160
+ optional_fields = set(["weight"])
161
+ serialized = handler(self)
162
+ m = {}
163
+
164
+ for n, f in type(self).model_fields.items():
165
+ k = f.alias or n
166
+ val = serialized.get(k)
167
+
168
+ if val != UNSET_SENTINEL:
169
+ if val is not None or k not in optional_fields:
170
+ m[k] = val
171
+
172
+ return m
173
+
174
+
175
+ class CreateImageEditLoadBalancer1TypedDict(TypedDict):
176
+ type: CreateImageEditLoadBalancerType
177
+ models: List[CreateImageEditLoadBalancerModelsTypedDict]
178
+
179
+
180
+ class CreateImageEditLoadBalancer1(BaseModel):
181
+ type: CreateImageEditLoadBalancerType
182
+
183
+ models: List[CreateImageEditLoadBalancerModels]
184
+
185
+
186
+ CreateImageEditLoadBalancerTypedDict = CreateImageEditLoadBalancer1TypedDict
187
+ r"""Array of models with weights for load balancing requests"""
188
+
189
+
190
+ CreateImageEditLoadBalancer = CreateImageEditLoadBalancer1
191
+ r"""Array of models with weights for load balancing requests"""
192
+
193
+
194
+ class CreateImageEditTimeoutTypedDict(TypedDict):
195
+ 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."""
196
+
197
+ call_timeout: float
198
+ r"""Timeout value in milliseconds"""
199
+
200
+
201
+ class CreateImageEditTimeout(BaseModel):
202
+ 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."""
203
+
204
+ call_timeout: float
205
+ r"""Timeout value in milliseconds"""
206
+
207
+
208
+ class CreateImageEditOrqTypedDict(TypedDict):
209
+ name: NotRequired[str]
210
+ r"""The name to display on the trace. If not specified, the default system name will be used."""
211
+ retry: NotRequired[CreateImageEditRetryTypedDict]
212
+ r"""Retry configuration for the request"""
213
+ fallbacks: NotRequired[List[CreateImageEditFallbacksTypedDict]]
214
+ r"""Array of fallback models to use if primary model fails"""
215
+ prompt: NotRequired[CreateImageEditPromptTypedDict]
216
+ r"""Prompt configuration for the request"""
217
+ identity: NotRequired[PublicIdentityTypedDict]
218
+ r"""Information about the identity making the request. If the identity does not exist, it will be created automatically."""
219
+ contact: NotRequired[PublicContactTypedDict]
220
+ r"""@deprecated Use identity instead. Information about the contact making the request."""
221
+ cache: NotRequired[CreateImageEditCacheTypedDict]
222
+ r"""Cache configuration for the request."""
223
+ load_balancer: NotRequired[CreateImageEditLoadBalancerTypedDict]
224
+ r"""Array of models with weights for load balancing requests"""
225
+ timeout: NotRequired[CreateImageEditTimeoutTypedDict]
226
+ 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."""
227
+
228
+
229
+ class CreateImageEditOrq(BaseModel):
230
+ name: Optional[str] = None
231
+ r"""The name to display on the trace. If not specified, the default system name will be used."""
232
+
233
+ retry: Optional[CreateImageEditRetry] = None
234
+ r"""Retry configuration for the request"""
235
+
236
+ fallbacks: Optional[List[CreateImageEditFallbacks]] = None
237
+ r"""Array of fallback models to use if primary model fails"""
238
+
239
+ prompt: Optional[CreateImageEditPrompt] = None
240
+ r"""Prompt configuration for the request"""
241
+
242
+ identity: Optional[PublicIdentity] = None
243
+ r"""Information about the identity making the request. If the identity does not exist, it will be created automatically."""
244
+
245
+ contact: Annotated[
246
+ Optional[PublicContact],
247
+ pydantic.Field(
248
+ deprecated="warning: ** DEPRECATED ** - This will be removed in a future release, please migrate away from it as soon as possible."
249
+ ),
250
+ ] = None
251
+ r"""@deprecated Use identity instead. Information about the contact making the request."""
252
+
253
+ cache: Optional[CreateImageEditCache] = None
254
+ r"""Cache configuration for the request."""
255
+
256
+ load_balancer: Optional[CreateImageEditLoadBalancer] = None
257
+ r"""Array of models with weights for load balancing requests"""
258
+
259
+ timeout: Optional[CreateImageEditTimeout] = None
260
+ 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."""
261
+
262
+ @model_serializer(mode="wrap")
263
+ def serialize_model(self, handler):
264
+ optional_fields = set(
265
+ [
266
+ "name",
267
+ "retry",
268
+ "fallbacks",
269
+ "prompt",
270
+ "identity",
271
+ "contact",
272
+ "cache",
273
+ "load_balancer",
274
+ "timeout",
275
+ ]
276
+ )
277
+ serialized = handler(self)
278
+ m = {}
279
+
280
+ for n, f in type(self).model_fields.items():
281
+ k = f.alias or n
282
+ val = serialized.get(k)
283
+
284
+ if val != UNSET_SENTINEL:
285
+ if val is not None or k not in optional_fields:
286
+ m[k] = val
287
+
288
+ return m
289
+
290
+
291
+ class CreateImageEditRequestBodyTypedDict(TypedDict):
292
+ model: str
293
+ r"""The model to use for image edit. [Check models](https://docs.orq.ai/docs/ai-gateway-supported-models#image-models)"""
294
+ prompt: str
295
+ r"""A text description of the desired image(s)."""
296
+ image: NotRequired[Any]
297
+ r"""The image(s) to edit. Must be a supported image file or an array of images. Each image should be a png, webp, or jpg file less than 50MB. You can provide up to 16 images."""
298
+ n: NotRequired[Nullable[int]]
299
+ r"""The number of images to generate. Must be between 1 and 10."""
300
+ size: NotRequired[Nullable[str]]
301
+ r"""The size of the generated images"""
302
+ quality: NotRequired[Nullable[CreateImageEditQuality]]
303
+ r"""The quality of the image that will be generated. Auto will automatically select the best quality for the given model."""
304
+ response_format: NotRequired[CreateImageEditResponseFormat]
305
+ r"""The format in which the generated images are returned. Some of the models only return the image in base64 format."""
306
+ user: NotRequired[str]
307
+ r"""A unique identifier representing your end-user, which can help to monitor and detect abuse."""
308
+ orq: NotRequired[CreateImageEditOrqTypedDict]
309
+
310
+
311
+ class CreateImageEditRequestBody(BaseModel):
312
+ model: Annotated[str, FieldMetadata(multipart=True)]
313
+ r"""The model to use for image edit. [Check models](https://docs.orq.ai/docs/ai-gateway-supported-models#image-models)"""
314
+
315
+ prompt: Annotated[str, FieldMetadata(multipart=True)]
316
+ r"""A text description of the desired image(s)."""
317
+
318
+ image: Annotated[Optional[Any], FieldMetadata(multipart=True)] = None
319
+ r"""The image(s) to edit. Must be a supported image file or an array of images. Each image should be a png, webp, or jpg file less than 50MB. You can provide up to 16 images."""
320
+
321
+ n: Annotated[OptionalNullable[int], FieldMetadata(multipart=True)] = 1
322
+ r"""The number of images to generate. Must be between 1 and 10."""
323
+
324
+ size: Annotated[OptionalNullable[str], FieldMetadata(multipart=True)] = UNSET
325
+ r"""The size of the generated images"""
326
+
327
+ quality: Annotated[
328
+ OptionalNullable[CreateImageEditQuality], FieldMetadata(multipart=True)
329
+ ] = UNSET
330
+ r"""The quality of the image that will be generated. Auto will automatically select the best quality for the given model."""
331
+
332
+ response_format: Annotated[
333
+ Optional[CreateImageEditResponseFormat], FieldMetadata(multipart=True)
334
+ ] = None
335
+ r"""The format in which the generated images are returned. Some of the models only return the image in base64 format."""
336
+
337
+ user: Annotated[Optional[str], FieldMetadata(multipart=True)] = None
338
+ r"""A unique identifier representing your end-user, which can help to monitor and detect abuse."""
339
+
340
+ orq: Annotated[
341
+ Optional[CreateImageEditOrq],
342
+ FieldMetadata(multipart=MultipartFormMetadata(json=True)),
343
+ ] = None
344
+
345
+ @model_serializer(mode="wrap")
346
+ def serialize_model(self, handler):
347
+ optional_fields = set(
348
+ ["image", "n", "size", "quality", "response_format", "user", "orq"]
349
+ )
350
+ nullable_fields = set(["n", "size", "quality"])
351
+ serialized = handler(self)
352
+ m = {}
353
+
354
+ for n, f in type(self).model_fields.items():
355
+ k = f.alias or n
356
+ val = serialized.get(k)
357
+ is_nullable_and_explicitly_set = (
358
+ k in nullable_fields
359
+ and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member
360
+ )
361
+
362
+ if val != UNSET_SENTINEL:
363
+ if (
364
+ val is not None
365
+ or k not in optional_fields
366
+ or is_nullable_and_explicitly_set
367
+ ):
368
+ m[k] = val
369
+
370
+ return m
371
+
372
+
373
+ class CreateImageEditDataTypedDict(TypedDict):
374
+ b64_json: NotRequired[str]
375
+ r"""The base64-encoded JSON of the generated image, if response_format is b64_json"""
376
+ url: NotRequired[str]
377
+ r"""The URL of the generated image, if response_format is url (default)"""
378
+
379
+
380
+ class CreateImageEditData(BaseModel):
381
+ b64_json: Optional[str] = None
382
+ r"""The base64-encoded JSON of the generated image, if response_format is b64_json"""
383
+
384
+ url: Optional[str] = None
385
+ r"""The URL of the generated image, if response_format is url (default)"""
386
+
387
+ @model_serializer(mode="wrap")
388
+ def serialize_model(self, handler):
389
+ optional_fields = set(["b64_json", "url"])
390
+ serialized = handler(self)
391
+ m = {}
392
+
393
+ for n, f in type(self).model_fields.items():
394
+ k = f.alias or n
395
+ val = serialized.get(k)
396
+
397
+ if val != UNSET_SENTINEL:
398
+ if val is not None or k not in optional_fields:
399
+ m[k] = val
400
+
401
+ return m
402
+
403
+
404
+ class CreateImageEditInputTokensDetailsTypedDict(TypedDict):
405
+ r"""The input tokens detailed information for the image generation."""
406
+
407
+ text_tokens: float
408
+ r"""The number of text tokens in the input prompt."""
409
+ image_tokens: float
410
+ r"""The number of image tokens in the input prompt."""
411
+
412
+
413
+ class CreateImageEditInputTokensDetails(BaseModel):
414
+ r"""The input tokens detailed information for the image generation."""
415
+
416
+ text_tokens: float
417
+ r"""The number of text tokens in the input prompt."""
418
+
419
+ image_tokens: float
420
+ r"""The number of image tokens in the input prompt."""
421
+
422
+
423
+ class CreateImageEditUsageTypedDict(TypedDict):
424
+ r"""The token usage information for the image generation."""
425
+
426
+ total_tokens: float
427
+ r"""The total number of tokens (images and text) used for the image generation."""
428
+ input_tokens: float
429
+ r"""The number of tokens (images and text) in the input prompt."""
430
+ output_tokens: float
431
+ r"""The number of output tokens generated by the model."""
432
+ input_tokens_details: CreateImageEditInputTokensDetailsTypedDict
433
+ r"""The input tokens detailed information for the image generation."""
434
+
435
+
436
+ class CreateImageEditUsage(BaseModel):
437
+ r"""The token usage information for the image generation."""
438
+
439
+ total_tokens: float
440
+ r"""The total number of tokens (images and text) used for the image generation."""
441
+
442
+ input_tokens: float
443
+ r"""The number of tokens (images and text) in the input prompt."""
444
+
445
+ output_tokens: float
446
+ r"""The number of output tokens generated by the model."""
447
+
448
+ input_tokens_details: CreateImageEditInputTokensDetails
449
+ r"""The input tokens detailed information for the image generation."""
450
+
451
+
452
+ class CreateImageEditResponseBodyTypedDict(TypedDict):
453
+ r"""Represents an image edit response from the API."""
454
+
455
+ created: float
456
+ r"""The Unix timestamp (in seconds) of when the image was created."""
457
+ data: List[CreateImageEditDataTypedDict]
458
+ r"""The list of generated images."""
459
+ output_format: NotRequired[str]
460
+ r"""The output format of the image generation"""
461
+ size: NotRequired[str]
462
+ r"""The size of the image generated"""
463
+ quality: NotRequired[str]
464
+ r"""The quality of the image generated"""
465
+ usage: NotRequired[CreateImageEditUsageTypedDict]
466
+ r"""The token usage information for the image generation."""
467
+
468
+
469
+ class CreateImageEditResponseBody(BaseModel):
470
+ r"""Represents an image edit response from the API."""
471
+
472
+ created: float
473
+ r"""The Unix timestamp (in seconds) of when the image was created."""
474
+
475
+ data: List[CreateImageEditData]
476
+ r"""The list of generated images."""
477
+
478
+ output_format: Optional[str] = None
479
+ r"""The output format of the image generation"""
480
+
481
+ size: Optional[str] = None
482
+ r"""The size of the image generated"""
483
+
484
+ quality: Optional[str] = None
485
+ r"""The quality of the image generated"""
486
+
487
+ usage: Optional[CreateImageEditUsage] = None
488
+ r"""The token usage information for the image generation."""
489
+
490
+ @model_serializer(mode="wrap")
491
+ def serialize_model(self, handler):
492
+ optional_fields = set(["output_format", "size", "quality", "usage"])
493
+ serialized = handler(self)
494
+ m = {}
495
+
496
+ for n, f in type(self).model_fields.items():
497
+ k = f.alias or n
498
+ val = serialized.get(k)
499
+
500
+ if val != UNSET_SENTINEL:
501
+ if val is not None or k not in optional_fields:
502
+ m[k] = val
503
+
504
+ return m