@orq-ai/node 3.0.0-rc.19 → 3.0.1

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 (244) hide show
  1. package/README.md +1 -1
  2. package/RUNTIMES.md +27 -1
  3. package/funcs/contactsCreate.d.ts.map +1 -1
  4. package/funcs/contactsCreate.js +7 -6
  5. package/funcs/contactsCreate.js.map +1 -1
  6. package/funcs/deploymentsAll.d.ts.map +1 -1
  7. package/funcs/deploymentsAll.js +9 -8
  8. package/funcs/deploymentsAll.js.map +1 -1
  9. package/funcs/deploymentsGetConfig.d.ts.map +1 -1
  10. package/funcs/deploymentsGetConfig.js +7 -6
  11. package/funcs/deploymentsGetConfig.js.map +1 -1
  12. package/funcs/deploymentsInvoke.d.ts.map +1 -1
  13. package/funcs/deploymentsInvoke.js +8 -7
  14. package/funcs/deploymentsInvoke.js.map +1 -1
  15. package/funcs/deploymentsMetricsCreate.d.ts.map +1 -1
  16. package/funcs/deploymentsMetricsCreate.js +7 -6
  17. package/funcs/deploymentsMetricsCreate.js.map +1 -1
  18. package/funcs/feedbackCreate.d.ts.map +1 -1
  19. package/funcs/feedbackCreate.js +7 -6
  20. package/funcs/feedbackCreate.js.map +1 -1
  21. package/funcs/filesBulkUpload.d.ts.map +1 -1
  22. package/funcs/filesBulkUpload.js +10 -8
  23. package/funcs/filesBulkUpload.js.map +1 -1
  24. package/funcs/filesDelete.d.ts.map +1 -1
  25. package/funcs/filesDelete.js +7 -6
  26. package/funcs/filesDelete.js.map +1 -1
  27. package/funcs/filesGet.d.ts.map +1 -1
  28. package/funcs/filesGet.js +7 -6
  29. package/funcs/filesGet.js.map +1 -1
  30. package/funcs/filesList.d.ts.map +1 -1
  31. package/funcs/filesList.js +11 -10
  32. package/funcs/filesList.js.map +1 -1
  33. package/funcs/filesUpdate.d.ts.map +1 -1
  34. package/funcs/filesUpdate.js +7 -6
  35. package/funcs/filesUpdate.js.map +1 -1
  36. package/funcs/filesUpload.d.ts.map +1 -1
  37. package/funcs/filesUpload.js +17 -15
  38. package/funcs/filesUpload.js.map +1 -1
  39. package/funcs/promptSnippetsFindOne.d.ts.map +1 -1
  40. package/funcs/promptSnippetsFindOne.js +7 -6
  41. package/funcs/promptSnippetsFindOne.js.map +1 -1
  42. package/funcs/promptTemplatesGetAll.d.ts.map +1 -1
  43. package/funcs/promptTemplatesGetAll.js +10 -9
  44. package/funcs/promptTemplatesGetAll.js.map +1 -1
  45. package/funcs/promptsCreate.d.ts.map +1 -1
  46. package/funcs/promptsCreate.js +7 -6
  47. package/funcs/promptsCreate.js.map +1 -1
  48. package/funcs/promptsCreateVersion.d.ts.map +1 -1
  49. package/funcs/promptsCreateVersion.js +7 -6
  50. package/funcs/promptsCreateVersion.js.map +1 -1
  51. package/funcs/promptsDelete.d.ts.map +1 -1
  52. package/funcs/promptsDelete.js +7 -6
  53. package/funcs/promptsDelete.js.map +1 -1
  54. package/funcs/promptsDuplicate.d.ts.map +1 -1
  55. package/funcs/promptsDuplicate.js +7 -6
  56. package/funcs/promptsDuplicate.js.map +1 -1
  57. package/funcs/promptsGetAll.d.ts.map +1 -1
  58. package/funcs/promptsGetAll.js +7 -6
  59. package/funcs/promptsGetAll.js.map +1 -1
  60. package/funcs/promptsGetOne.d.ts.map +1 -1
  61. package/funcs/promptsGetOne.js +7 -6
  62. package/funcs/promptsGetOne.js.map +1 -1
  63. package/funcs/promptsUpdate.d.ts.map +1 -1
  64. package/funcs/promptsUpdate.js +7 -6
  65. package/funcs/promptsUpdate.js.map +1 -1
  66. package/funcs/remoteconfigGetConfig.d.ts.map +1 -1
  67. package/funcs/remoteconfigGetConfig.js +7 -6
  68. package/funcs/remoteconfigGetConfig.js.map +1 -1
  69. package/lib/config.d.ts +4 -4
  70. package/lib/config.d.ts.map +1 -1
  71. package/lib/config.js +5 -6
  72. package/lib/config.js.map +1 -1
  73. package/lib/encodings.d.ts +10 -9
  74. package/lib/encodings.d.ts.map +1 -1
  75. package/lib/encodings.js +91 -66
  76. package/lib/encodings.js.map +1 -1
  77. package/lib/env.js +1 -2
  78. package/lib/env.js.map +1 -1
  79. package/lib/event-streams.js +2 -3
  80. package/lib/event-streams.js.map +1 -1
  81. package/lib/http.js +1 -2
  82. package/lib/http.js.map +1 -1
  83. package/lib/matchers.js +5 -6
  84. package/lib/matchers.js.map +1 -1
  85. package/lib/primitives.d.ts +1 -0
  86. package/lib/primitives.d.ts.map +1 -1
  87. package/lib/primitives.js +11 -1
  88. package/lib/primitives.js.map +1 -1
  89. package/lib/retries.js +3 -4
  90. package/lib/retries.js.map +1 -1
  91. package/lib/sdks.d.ts.map +1 -1
  92. package/lib/sdks.js +19 -17
  93. package/lib/sdks.js.map +1 -1
  94. package/lib/security.js +2 -3
  95. package/lib/security.js.map +1 -1
  96. package/lib/url.js +1 -1
  97. package/lib/url.js.map +1 -1
  98. package/models/errors/httpclienterrors.js +2 -2
  99. package/models/errors/httpclienterrors.js.map +1 -1
  100. package/package.json +2 -3
  101. package/packages/orq-rc/FUNCTIONS.md +106 -0
  102. package/packages/orq-rc/README.md +564 -0
  103. package/packages/orq-rc/RUNTIMES.md +22 -0
  104. package/packages/orq-rc/docs/sdks/contacts/README.md +84 -0
  105. package/packages/orq-rc/docs/sdks/deployments/README.md +239 -0
  106. package/packages/orq-rc/docs/sdks/feedback/README.md +92 -0
  107. package/packages/orq-rc/docs/sdks/files/README.md +473 -0
  108. package/packages/orq-rc/docs/sdks/metrics/README.md +86 -0
  109. package/packages/orq-rc/docs/sdks/orq/README.md +10 -0
  110. package/packages/orq-rc/docs/sdks/prompt/README.md +6 -0
  111. package/packages/orq-rc/docs/sdks/prompts/README.md +533 -0
  112. package/packages/orq-rc/docs/sdks/remoteconfig/README.md +80 -0
  113. package/packages/orq-rc/docs/sdks/snippets/README.md +84 -0
  114. package/packages/orq-rc/docs/sdks/templates/README.md +80 -0
  115. package/packages/orq-rc/src/core.ts +13 -0
  116. package/packages/orq-rc/src/funcs/contactsCreate.ts +124 -0
  117. package/packages/orq-rc/src/funcs/deploymentsAll.ts +138 -0
  118. package/packages/orq-rc/src/funcs/deploymentsGetConfig.ts +132 -0
  119. package/packages/orq-rc/src/funcs/deploymentsInvoke.ts +135 -0
  120. package/packages/orq-rc/src/funcs/deploymentsMetricsCreate.ts +132 -0
  121. package/packages/orq-rc/src/funcs/feedbackCreate.ts +124 -0
  122. package/packages/orq-rc/src/funcs/filesBulkUpload.ts +126 -0
  123. package/packages/orq-rc/src/funcs/filesDelete.ts +128 -0
  124. package/packages/orq-rc/src/funcs/filesGet.ts +127 -0
  125. package/packages/orq-rc/src/funcs/filesList.ts +129 -0
  126. package/packages/orq-rc/src/funcs/filesUpdate.ts +128 -0
  127. package/packages/orq-rc/src/funcs/filesUpload.ts +145 -0
  128. package/packages/orq-rc/src/funcs/promptSnippetsFindOne.ts +128 -0
  129. package/packages/orq-rc/src/funcs/promptTemplatesGetAll.ts +130 -0
  130. package/packages/orq-rc/src/funcs/promptsCreate.ts +124 -0
  131. package/packages/orq-rc/src/funcs/promptsCreateVersion.ts +129 -0
  132. package/packages/orq-rc/src/funcs/promptsDelete.ts +128 -0
  133. package/packages/orq-rc/src/funcs/promptsDuplicate.ts +128 -0
  134. package/packages/orq-rc/src/funcs/promptsGetAll.ts +126 -0
  135. package/packages/orq-rc/src/funcs/promptsGetOne.ts +128 -0
  136. package/packages/orq-rc/src/funcs/promptsUpdate.ts +136 -0
  137. package/packages/orq-rc/src/funcs/remoteconfigGetConfig.ts +125 -0
  138. package/packages/orq-rc/src/hooks/hooks.ts +132 -0
  139. package/packages/orq-rc/src/hooks/index.ts +6 -0
  140. package/packages/orq-rc/src/hooks/registration.ts +14 -0
  141. package/packages/orq-rc/src/hooks/types.ts +109 -0
  142. package/packages/orq-rc/src/index.ts +7 -0
  143. package/packages/orq-rc/src/lib/base64.ts +37 -0
  144. package/packages/orq-rc/src/lib/config.ts +60 -0
  145. package/packages/orq-rc/src/lib/dlv.ts +53 -0
  146. package/packages/orq-rc/src/lib/encodings.ts +449 -0
  147. package/packages/orq-rc/src/lib/env.ts +41 -0
  148. package/packages/orq-rc/src/lib/event-streams.ts +264 -0
  149. package/packages/orq-rc/src/lib/files.ts +40 -0
  150. package/packages/orq-rc/src/lib/http.ts +323 -0
  151. package/packages/orq-rc/src/lib/is-plain-object.ts +43 -0
  152. package/packages/orq-rc/src/lib/logger.ts +9 -0
  153. package/packages/orq-rc/src/lib/matchers.ts +325 -0
  154. package/packages/orq-rc/src/lib/primitives.ts +122 -0
  155. package/packages/orq-rc/src/lib/retries.ts +219 -0
  156. package/packages/orq-rc/src/lib/schemas.ts +86 -0
  157. package/packages/orq-rc/src/lib/sdks.ts +397 -0
  158. package/packages/orq-rc/src/lib/security.ts +254 -0
  159. package/packages/orq-rc/src/lib/url.ts +33 -0
  160. package/packages/orq-rc/src/models/components/deployments.ts +1673 -0
  161. package/packages/orq-rc/src/models/components/index.ts +6 -0
  162. package/packages/orq-rc/src/models/components/security.ts +71 -0
  163. package/packages/orq-rc/src/models/errors/apierror.ts +27 -0
  164. package/packages/orq-rc/src/models/errors/honoapierror.ts +82 -0
  165. package/packages/orq-rc/src/models/errors/httpclienterrors.ts +62 -0
  166. package/packages/orq-rc/src/models/errors/index.ts +9 -0
  167. package/packages/orq-rc/src/models/errors/sdkvalidationerror.ts +97 -0
  168. package/packages/orq-rc/src/models/errors/updateprompt.ts +71 -0
  169. package/packages/orq-rc/src/models/operations/bulkfileupload.ts +315 -0
  170. package/packages/orq-rc/src/models/operations/createcontact.ts +256 -0
  171. package/packages/orq-rc/src/models/operations/createfeedback.ts +286 -0
  172. package/packages/orq-rc/src/models/operations/createprompt.ts +3461 -0
  173. package/packages/orq-rc/src/models/operations/createpromptversion.ts +3703 -0
  174. package/packages/orq-rc/src/models/operations/deleteprompt.ts +69 -0
  175. package/packages/orq-rc/src/models/operations/deploymentcreatemetric.ts +1790 -0
  176. package/packages/orq-rc/src/models/operations/deploymentgetconfig.ts +3483 -0
  177. package/packages/orq-rc/src/models/operations/deploymentinvoke.ts +2385 -0
  178. package/packages/orq-rc/src/models/operations/deployments.ts +2098 -0
  179. package/packages/orq-rc/src/models/operations/duplicateprompt.ts +69 -0
  180. package/packages/orq-rc/src/models/operations/filedelete.ts +78 -0
  181. package/packages/orq-rc/src/models/operations/fileget.ts +222 -0
  182. package/packages/orq-rc/src/models/operations/filelist.ts +333 -0
  183. package/packages/orq-rc/src/models/operations/fileupdate.ts +298 -0
  184. package/packages/orq-rc/src/models/operations/fileupload.ts +322 -0
  185. package/packages/orq-rc/src/models/operations/findonepromptsnippet.ts +13629 -0
  186. package/packages/orq-rc/src/models/operations/getallprompts.ts +18640 -0
  187. package/packages/orq-rc/src/models/operations/getallprompttemplates.ts +13690 -0
  188. package/packages/orq-rc/src/models/operations/getoneprompt.ts +69 -0
  189. package/packages/orq-rc/src/models/operations/index.ts +26 -0
  190. package/packages/orq-rc/src/models/operations/remoteconfigsgetconfig.ts +190 -0
  191. package/packages/orq-rc/src/models/operations/updateprompt.ts +14407 -0
  192. package/packages/orq-rc/src/sdk/contacts.ts +27 -0
  193. package/packages/orq-rc/src/sdk/deployments.ts +75 -0
  194. package/packages/orq-rc/src/sdk/feedback.ts +27 -0
  195. package/packages/orq-rc/src/sdk/files.ts +105 -0
  196. package/packages/orq-rc/src/sdk/index.ts +5 -0
  197. package/packages/orq-rc/src/sdk/metrics.ts +27 -0
  198. package/packages/orq-rc/src/sdk/prompt.ts +19 -0
  199. package/packages/orq-rc/src/sdk/prompts.ts +114 -0
  200. package/packages/orq-rc/src/sdk/remoteconfig.ts +24 -0
  201. package/packages/orq-rc/src/sdk/sdk.ts +49 -0
  202. package/packages/orq-rc/src/sdk/snippets.ts +24 -0
  203. package/packages/orq-rc/src/sdk/templates.ts +24 -0
  204. package/packages/orq-rc/src/types/blobs.ts +31 -0
  205. package/packages/orq-rc/src/types/constdatetime.ts +15 -0
  206. package/packages/orq-rc/src/types/enums.ts +16 -0
  207. package/packages/orq-rc/src/types/fp.ts +50 -0
  208. package/packages/orq-rc/src/types/index.ts +11 -0
  209. package/packages/orq-rc/src/types/operations.ts +105 -0
  210. package/packages/orq-rc/src/types/rfcdate.ts +54 -0
  211. package/packages/orq-rc/src/types/streams.ts +21 -0
  212. package/sdk/deployments.js +1 -2
  213. package/sdk/deployments.js.map +1 -1
  214. package/sdk/prompt.js +2 -4
  215. package/sdk/prompt.js.map +1 -1
  216. package/sdk/sdk.js +7 -14
  217. package/sdk/sdk.js.map +1 -1
  218. package/src/funcs/contactsCreate.ts +3 -2
  219. package/src/funcs/deploymentsAll.ts +3 -2
  220. package/src/funcs/deploymentsGetConfig.ts +3 -2
  221. package/src/funcs/deploymentsInvoke.ts +3 -2
  222. package/src/funcs/deploymentsMetricsCreate.ts +3 -2
  223. package/src/funcs/feedbackCreate.ts +3 -2
  224. package/src/funcs/filesBulkUpload.ts +6 -4
  225. package/src/funcs/filesDelete.ts +3 -2
  226. package/src/funcs/filesGet.ts +3 -2
  227. package/src/funcs/filesList.ts +3 -2
  228. package/src/funcs/filesUpdate.ts +3 -2
  229. package/src/funcs/filesUpload.ts +9 -6
  230. package/src/funcs/promptSnippetsFindOne.ts +3 -2
  231. package/src/funcs/promptTemplatesGetAll.ts +3 -2
  232. package/src/funcs/promptsCreate.ts +3 -2
  233. package/src/funcs/promptsCreateVersion.ts +3 -2
  234. package/src/funcs/promptsDelete.ts +3 -2
  235. package/src/funcs/promptsDuplicate.ts +3 -2
  236. package/src/funcs/promptsGetAll.ts +3 -2
  237. package/src/funcs/promptsGetOne.ts +3 -2
  238. package/src/funcs/promptsUpdate.ts +3 -2
  239. package/src/funcs/remoteconfigGetConfig.ts +3 -2
  240. package/src/lib/config.ts +4 -4
  241. package/src/lib/encodings.ts +95 -61
  242. package/src/lib/primitives.ts +14 -0
  243. package/src/lib/sdks.ts +4 -1
  244. package/src/lib/security.ts +1 -1
@@ -0,0 +1,2385 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { EventStream } from "../../lib/event-streams.js";
7
+ import { remap as remap$ } from "../../lib/primitives.js";
8
+ import { safeParse } from "../../lib/schemas.js";
9
+ import { ClosedEnum } from "../../types/enums.js";
10
+ import { Result as SafeParseResult } from "../../types/fp.js";
11
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
12
+
13
+ /**
14
+ * Indicates the type of model used to generate the response
15
+ */
16
+ export const DeploymentInvokeDeploymentsObject = {
17
+ Chat: "chat",
18
+ Completion: "completion",
19
+ Image: "image",
20
+ } as const;
21
+ /**
22
+ * Indicates the type of model used to generate the response
23
+ */
24
+ export type DeploymentInvokeDeploymentsObject = ClosedEnum<
25
+ typeof DeploymentInvokeDeploymentsObject
26
+ >;
27
+
28
+ /**
29
+ * The provider used to generate the response
30
+ */
31
+ export const DeploymentInvokeDeploymentsProvider = {
32
+ Cohere: "cohere",
33
+ Openai: "openai",
34
+ Anthropic: "anthropic",
35
+ Huggingface: "huggingface",
36
+ Replicate: "replicate",
37
+ Google: "google",
38
+ GoogleAi: "google-ai",
39
+ Azure: "azure",
40
+ Aws: "aws",
41
+ Anyscale: "anyscale",
42
+ Perplexity: "perplexity",
43
+ Groq: "groq",
44
+ Fal: "fal",
45
+ Leonardoai: "leonardoai",
46
+ Nvidia: "nvidia",
47
+ } as const;
48
+ /**
49
+ * The provider used to generate the response
50
+ */
51
+ export type DeploymentInvokeDeploymentsProvider = ClosedEnum<
52
+ typeof DeploymentInvokeDeploymentsProvider
53
+ >;
54
+
55
+ /**
56
+ * The role of the prompt message
57
+ */
58
+ export const DeploymentInvokeMessageDeploymentsResponse200TextEventStreamRole =
59
+ {
60
+ System: "system",
61
+ Assistant: "assistant",
62
+ User: "user",
63
+ Exception: "exception",
64
+ Tool: "tool",
65
+ Prompt: "prompt",
66
+ Correction: "correction",
67
+ ExpectedOutput: "expected_output",
68
+ } as const;
69
+ /**
70
+ * The role of the prompt message
71
+ */
72
+ export type DeploymentInvokeMessageDeploymentsResponse200TextEventStreamRole =
73
+ ClosedEnum<
74
+ typeof DeploymentInvokeMessageDeploymentsResponse200TextEventStreamRole
75
+ >;
76
+
77
+ export type DeploymentInvokeMessage3 = {
78
+ /**
79
+ * The role of the prompt message
80
+ */
81
+ role: DeploymentInvokeMessageDeploymentsResponse200TextEventStreamRole;
82
+ url: string;
83
+ };
84
+
85
+ /**
86
+ * The role of the prompt message
87
+ */
88
+ export const DeploymentInvokeMessageDeploymentsResponse200Role = {
89
+ System: "system",
90
+ Assistant: "assistant",
91
+ User: "user",
92
+ Exception: "exception",
93
+ Tool: "tool",
94
+ Prompt: "prompt",
95
+ Correction: "correction",
96
+ ExpectedOutput: "expected_output",
97
+ } as const;
98
+ /**
99
+ * The role of the prompt message
100
+ */
101
+ export type DeploymentInvokeMessageDeploymentsResponse200Role = ClosedEnum<
102
+ typeof DeploymentInvokeMessageDeploymentsResponse200Role
103
+ >;
104
+
105
+ export type DeploymentInvokeMessageDeployments2 = {
106
+ /**
107
+ * The role of the prompt message
108
+ */
109
+ role: DeploymentInvokeMessageDeploymentsResponse200Role;
110
+ content: string | null;
111
+ };
112
+
113
+ /**
114
+ * The role of the prompt message
115
+ */
116
+ export const DeploymentInvokeMessageDeploymentsResponse200TextEventStreamResponseBodyRole =
117
+ {
118
+ System: "system",
119
+ Assistant: "assistant",
120
+ User: "user",
121
+ Exception: "exception",
122
+ Tool: "tool",
123
+ Prompt: "prompt",
124
+ Correction: "correction",
125
+ ExpectedOutput: "expected_output",
126
+ } as const;
127
+ /**
128
+ * The role of the prompt message
129
+ */
130
+ export type DeploymentInvokeMessageDeploymentsResponse200TextEventStreamResponseBodyRole =
131
+ ClosedEnum<
132
+ typeof DeploymentInvokeMessageDeploymentsResponse200TextEventStreamResponseBodyRole
133
+ >;
134
+
135
+ export const DeploymentInvokeMessageDeploymentsType = {
136
+ Function: "function",
137
+ } as const;
138
+ export type DeploymentInvokeMessageDeploymentsType = ClosedEnum<
139
+ typeof DeploymentInvokeMessageDeploymentsType
140
+ >;
141
+
142
+ export type DeploymentInvokeMessageDeploymentsFunction = {
143
+ name: string;
144
+ /**
145
+ * JSON string arguments for the functions
146
+ */
147
+ arguments: string;
148
+ };
149
+
150
+ export type DeploymentInvokeMessageDeploymentsToolCalls = {
151
+ id?: string | undefined;
152
+ index?: number | undefined;
153
+ type: DeploymentInvokeMessageDeploymentsType;
154
+ function: DeploymentInvokeMessageDeploymentsFunction;
155
+ };
156
+
157
+ export type DeploymentInvokeMessageDeployments1 = {
158
+ /**
159
+ * The role of the prompt message
160
+ */
161
+ role:
162
+ DeploymentInvokeMessageDeploymentsResponse200TextEventStreamResponseBodyRole;
163
+ content?: string | null | undefined;
164
+ toolCalls: Array<DeploymentInvokeMessageDeploymentsToolCalls>;
165
+ };
166
+
167
+ export type DeploymentInvokeDeploymentsMessage =
168
+ | DeploymentInvokeMessageDeployments2
169
+ | DeploymentInvokeMessage3
170
+ | DeploymentInvokeMessageDeployments1;
171
+
172
+ export type DeploymentInvokeDeploymentsChoices = {
173
+ index: number;
174
+ message?:
175
+ | DeploymentInvokeMessageDeployments2
176
+ | DeploymentInvokeMessage3
177
+ | DeploymentInvokeMessageDeployments1
178
+ | undefined;
179
+ finishReason?: string | null | undefined;
180
+ };
181
+
182
+ /**
183
+ * Metadata of the retrieved chunk from the knowledge base
184
+ */
185
+ export type DeploymentInvokeDeploymentsMetadata = {
186
+ /**
187
+ * Name of the file
188
+ */
189
+ fileName: string;
190
+ /**
191
+ * Page number of the chunk
192
+ */
193
+ pageNumber: number | null;
194
+ /**
195
+ * Type of the file
196
+ */
197
+ fileType: string;
198
+ /**
199
+ * Rerank scores are normalized to be in the range [0, 1]. Scores close to 1 indicate a high relevance to the query, and scores closer to 0 indicate low relevance. It is not accurate to assume a score of 0.9 means the document is 2x more relevant than a document with a score of 0.45
200
+ */
201
+ rerankScore?: number | undefined;
202
+ /**
203
+ * Search scores are normalized to be in the range [0, 1]. Search score is calculated based on `[Cosine Similarity](https://en.wikipedia.org/wiki/Cosine_similarity)` algorithm. Scores close to 1 indicate the document is closer to the query, and scores closer to 0 indicate the document is farther from the query.
204
+ */
205
+ searchScore: number;
206
+ };
207
+
208
+ export type DeploymentInvokeRetrievals = {
209
+ /**
210
+ * Content of the retrieved chunk from the knowledge base
211
+ */
212
+ document: string;
213
+ /**
214
+ * Metadata of the retrieved chunk from the knowledge base
215
+ */
216
+ metadata: DeploymentInvokeDeploymentsMetadata;
217
+ };
218
+
219
+ export type DeploymentInvokeData = {
220
+ /**
221
+ * A unique identifier for the response. Can be used to add metrics to the transaction.
222
+ */
223
+ id?: string | undefined;
224
+ /**
225
+ * A timestamp indicating when the object was created. Usually in a standardized format like ISO 8601
226
+ */
227
+ created?: Date | undefined;
228
+ /**
229
+ * Indicates the type of model used to generate the response
230
+ */
231
+ object?: DeploymentInvokeDeploymentsObject | undefined;
232
+ /**
233
+ * The model used to generate the response
234
+ */
235
+ model?: string | undefined;
236
+ /**
237
+ * The provider used to generate the response
238
+ */
239
+ provider?: DeploymentInvokeDeploymentsProvider | undefined;
240
+ /**
241
+ * Indicates if the response is the final response
242
+ */
243
+ isFinal?: boolean | undefined;
244
+ /**
245
+ * Indicates integration id used to generate the response
246
+ */
247
+ integrationId?: string | undefined;
248
+ /**
249
+ * A timestamp indicating when the object was finalized. Usually in a standardized format like ISO 8601
250
+ */
251
+ finalized?: Date | undefined;
252
+ /**
253
+ * Provider backed system fingerprint.
254
+ */
255
+ systemFingerprint?: string | null | undefined;
256
+ /**
257
+ * A list of choices generated by the model
258
+ */
259
+ choices?: Array<DeploymentInvokeDeploymentsChoices> | undefined;
260
+ /**
261
+ * List of documents retrieved from the knowledge base. This property is only available when the `include_retrievals` flag is set to `true` in the invoke settings. When stream is set to true, the `retrievals` property will be returned in the last streamed chunk where the property `is_final` is set to `true`.
262
+ */
263
+ retrievals?: Array<DeploymentInvokeRetrievals> | undefined;
264
+ /**
265
+ * Response returned by the model provider. This functionality is only supported when streaming is not used. If streaming is used, the `provider_response` property will be set to `null`.
266
+ */
267
+ providerResponse?: any | undefined;
268
+ };
269
+
270
+ /**
271
+ * Response from the gateway
272
+ */
273
+ export type DeploymentInvokeDeploymentsResponseBody = {
274
+ data?: DeploymentInvokeData | undefined;
275
+ };
276
+
277
+ /**
278
+ * Indicates the type of model used to generate the response
279
+ */
280
+ export const DeploymentInvokeObject = {
281
+ Chat: "chat",
282
+ Completion: "completion",
283
+ Image: "image",
284
+ Vision: "vision",
285
+ } as const;
286
+ /**
287
+ * Indicates the type of model used to generate the response
288
+ */
289
+ export type DeploymentInvokeObject = ClosedEnum<typeof DeploymentInvokeObject>;
290
+
291
+ /**
292
+ * The provider used to generate the response
293
+ */
294
+ export const DeploymentInvokeProvider = {
295
+ Cohere: "cohere",
296
+ Openai: "openai",
297
+ Anthropic: "anthropic",
298
+ Huggingface: "huggingface",
299
+ Replicate: "replicate",
300
+ Google: "google",
301
+ GoogleAi: "google-ai",
302
+ Azure: "azure",
303
+ Aws: "aws",
304
+ Anyscale: "anyscale",
305
+ Perplexity: "perplexity",
306
+ Groq: "groq",
307
+ Fal: "fal",
308
+ Leonardoai: "leonardoai",
309
+ Nvidia: "nvidia",
310
+ Jina: "jina",
311
+ } as const;
312
+ /**
313
+ * The provider used to generate the response
314
+ */
315
+ export type DeploymentInvokeProvider = ClosedEnum<
316
+ typeof DeploymentInvokeProvider
317
+ >;
318
+
319
+ /**
320
+ * The role of the prompt message
321
+ */
322
+ export const DeploymentInvokeMessageDeploymentsRole = {
323
+ System: "system",
324
+ Assistant: "assistant",
325
+ User: "user",
326
+ Exception: "exception",
327
+ Tool: "tool",
328
+ Prompt: "prompt",
329
+ Correction: "correction",
330
+ ExpectedOutput: "expected_output",
331
+ } as const;
332
+ /**
333
+ * The role of the prompt message
334
+ */
335
+ export type DeploymentInvokeMessageDeploymentsRole = ClosedEnum<
336
+ typeof DeploymentInvokeMessageDeploymentsRole
337
+ >;
338
+
339
+ export type Message3 = {
340
+ /**
341
+ * The role of the prompt message
342
+ */
343
+ role: DeploymentInvokeMessageDeploymentsRole;
344
+ url: string;
345
+ };
346
+
347
+ /**
348
+ * The role of the prompt message
349
+ */
350
+ export const DeploymentInvokeMessageRole = {
351
+ System: "system",
352
+ Assistant: "assistant",
353
+ User: "user",
354
+ Exception: "exception",
355
+ Tool: "tool",
356
+ Prompt: "prompt",
357
+ Correction: "correction",
358
+ ExpectedOutput: "expected_output",
359
+ } as const;
360
+ /**
361
+ * The role of the prompt message
362
+ */
363
+ export type DeploymentInvokeMessageRole = ClosedEnum<
364
+ typeof DeploymentInvokeMessageRole
365
+ >;
366
+
367
+ export type DeploymentInvokeMessage2 = {
368
+ /**
369
+ * The role of the prompt message
370
+ */
371
+ role: DeploymentInvokeMessageRole;
372
+ content: string | null;
373
+ };
374
+
375
+ /**
376
+ * The role of the prompt message
377
+ */
378
+ export const DeploymentInvokeMessageDeploymentsResponseRole = {
379
+ System: "system",
380
+ Assistant: "assistant",
381
+ User: "user",
382
+ Exception: "exception",
383
+ Tool: "tool",
384
+ Prompt: "prompt",
385
+ Correction: "correction",
386
+ ExpectedOutput: "expected_output",
387
+ } as const;
388
+ /**
389
+ * The role of the prompt message
390
+ */
391
+ export type DeploymentInvokeMessageDeploymentsResponseRole = ClosedEnum<
392
+ typeof DeploymentInvokeMessageDeploymentsResponseRole
393
+ >;
394
+
395
+ export const DeploymentInvokeMessageType = {
396
+ Function: "function",
397
+ } as const;
398
+ export type DeploymentInvokeMessageType = ClosedEnum<
399
+ typeof DeploymentInvokeMessageType
400
+ >;
401
+
402
+ export type DeploymentInvokeMessageFunction = {
403
+ name: string;
404
+ /**
405
+ * JSON string arguments for the functions
406
+ */
407
+ arguments: string;
408
+ };
409
+
410
+ export type DeploymentInvokeMessageToolCalls = {
411
+ id?: string | undefined;
412
+ index?: number | undefined;
413
+ type: DeploymentInvokeMessageType;
414
+ function: DeploymentInvokeMessageFunction;
415
+ };
416
+
417
+ export type DeploymentInvokeMessage1 = {
418
+ /**
419
+ * The role of the prompt message
420
+ */
421
+ role: DeploymentInvokeMessageDeploymentsResponseRole;
422
+ content?: string | null | undefined;
423
+ toolCalls: Array<DeploymentInvokeMessageToolCalls>;
424
+ };
425
+
426
+ export type DeploymentInvokeMessage =
427
+ | DeploymentInvokeMessage2
428
+ | Message3
429
+ | DeploymentInvokeMessage1;
430
+
431
+ export type DeploymentInvokeChoices = {
432
+ index: number;
433
+ message?:
434
+ | DeploymentInvokeMessage2
435
+ | Message3
436
+ | DeploymentInvokeMessage1
437
+ | undefined;
438
+ finishReason?: string | null | undefined;
439
+ };
440
+
441
+ /**
442
+ * Metadata of the retrieved chunk from the knowledge base
443
+ */
444
+ export type DeploymentInvokeMetadata = {
445
+ /**
446
+ * Name of the file
447
+ */
448
+ fileName: string;
449
+ /**
450
+ * Page number of the chunk
451
+ */
452
+ pageNumber: number | null;
453
+ /**
454
+ * Type of the file
455
+ */
456
+ fileType: string;
457
+ /**
458
+ * Rerank scores are normalized to be in the range [0, 1]. Scores close to 1 indicate a high relevance to the query, and scores closer to 0 indicate low relevance. It is not accurate to assume a score of 0.9 means the document is 2x more relevant than a document with a score of 0.45
459
+ */
460
+ rerankScore?: number | undefined;
461
+ /**
462
+ * Search scores are normalized to be in the range [0, 1]. Search score is calculated based on `[Cosine Similarity](https://en.wikipedia.org/wiki/Cosine_similarity)` algorithm. Scores close to 1 indicate the document is closer to the query, and scores closer to 0 indicate the document is farther from the query.
463
+ */
464
+ searchScore: number;
465
+ };
466
+
467
+ export type Retrievals = {
468
+ /**
469
+ * Content of the retrieved chunk from the knowledge base
470
+ */
471
+ document: string;
472
+ /**
473
+ * Metadata of the retrieved chunk from the knowledge base
474
+ */
475
+ metadata: DeploymentInvokeMetadata;
476
+ };
477
+
478
+ /**
479
+ * Response from the gateway
480
+ */
481
+ export type DeploymentInvokeResponseBody = {
482
+ /**
483
+ * A unique identifier for the response. Can be used to add metrics to the transaction.
484
+ */
485
+ id: string;
486
+ /**
487
+ * A timestamp indicating when the object was created. Usually in a standardized format like ISO 8601
488
+ */
489
+ created: Date;
490
+ /**
491
+ * Indicates the type of model used to generate the response
492
+ */
493
+ object: DeploymentInvokeObject;
494
+ /**
495
+ * The model used to generate the response
496
+ */
497
+ model: string;
498
+ /**
499
+ * The provider used to generate the response
500
+ */
501
+ provider: DeploymentInvokeProvider;
502
+ /**
503
+ * Indicates if the response is the final response
504
+ */
505
+ isFinal: boolean;
506
+ /**
507
+ * Indicates integration id used to generate the response
508
+ */
509
+ integrationId?: string | undefined;
510
+ /**
511
+ * A timestamp indicating when the object was finalized. Usually in a standardized format like ISO 8601
512
+ */
513
+ finalized?: Date | undefined;
514
+ /**
515
+ * Provider backed system fingerprint.
516
+ */
517
+ systemFingerprint?: string | null | undefined;
518
+ /**
519
+ * A list of choices generated by the model
520
+ */
521
+ choices: Array<DeploymentInvokeChoices>;
522
+ /**
523
+ * List of documents retrieved from the knowledge base. This property is only available when the `include_retrievals` flag is set to `true` in the invoke settings. When stream is set to true, the `retrievals` property will be returned in the last streamed chunk where the property `is_final` is set to `true`.
524
+ */
525
+ retrievals?: Array<Retrievals> | undefined;
526
+ /**
527
+ * Response returned by the model provider. This functionality is only supported when streaming is not used. If streaming is used, the `provider_response` property will be set to `null`.
528
+ */
529
+ providerResponse?: any | undefined;
530
+ };
531
+
532
+ export type DeploymentInvokeResponse =
533
+ | DeploymentInvokeResponseBody
534
+ | EventStream<DeploymentInvokeDeploymentsResponseBody>;
535
+
536
+ /** @internal */
537
+ export const DeploymentInvokeDeploymentsObject$inboundSchema: z.ZodNativeEnum<
538
+ typeof DeploymentInvokeDeploymentsObject
539
+ > = z.nativeEnum(DeploymentInvokeDeploymentsObject);
540
+
541
+ /** @internal */
542
+ export const DeploymentInvokeDeploymentsObject$outboundSchema: z.ZodNativeEnum<
543
+ typeof DeploymentInvokeDeploymentsObject
544
+ > = DeploymentInvokeDeploymentsObject$inboundSchema;
545
+
546
+ /**
547
+ * @internal
548
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
549
+ */
550
+ export namespace DeploymentInvokeDeploymentsObject$ {
551
+ /** @deprecated use `DeploymentInvokeDeploymentsObject$inboundSchema` instead. */
552
+ export const inboundSchema = DeploymentInvokeDeploymentsObject$inboundSchema;
553
+ /** @deprecated use `DeploymentInvokeDeploymentsObject$outboundSchema` instead. */
554
+ export const outboundSchema =
555
+ DeploymentInvokeDeploymentsObject$outboundSchema;
556
+ }
557
+
558
+ /** @internal */
559
+ export const DeploymentInvokeDeploymentsProvider$inboundSchema: z.ZodNativeEnum<
560
+ typeof DeploymentInvokeDeploymentsProvider
561
+ > = z.nativeEnum(DeploymentInvokeDeploymentsProvider);
562
+
563
+ /** @internal */
564
+ export const DeploymentInvokeDeploymentsProvider$outboundSchema:
565
+ z.ZodNativeEnum<typeof DeploymentInvokeDeploymentsProvider> =
566
+ DeploymentInvokeDeploymentsProvider$inboundSchema;
567
+
568
+ /**
569
+ * @internal
570
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
571
+ */
572
+ export namespace DeploymentInvokeDeploymentsProvider$ {
573
+ /** @deprecated use `DeploymentInvokeDeploymentsProvider$inboundSchema` instead. */
574
+ export const inboundSchema =
575
+ DeploymentInvokeDeploymentsProvider$inboundSchema;
576
+ /** @deprecated use `DeploymentInvokeDeploymentsProvider$outboundSchema` instead. */
577
+ export const outboundSchema =
578
+ DeploymentInvokeDeploymentsProvider$outboundSchema;
579
+ }
580
+
581
+ /** @internal */
582
+ export const DeploymentInvokeMessageDeploymentsResponse200TextEventStreamRole$inboundSchema:
583
+ z.ZodNativeEnum<
584
+ typeof DeploymentInvokeMessageDeploymentsResponse200TextEventStreamRole
585
+ > = z.nativeEnum(
586
+ DeploymentInvokeMessageDeploymentsResponse200TextEventStreamRole,
587
+ );
588
+
589
+ /** @internal */
590
+ export const DeploymentInvokeMessageDeploymentsResponse200TextEventStreamRole$outboundSchema:
591
+ z.ZodNativeEnum<
592
+ typeof DeploymentInvokeMessageDeploymentsResponse200TextEventStreamRole
593
+ > =
594
+ DeploymentInvokeMessageDeploymentsResponse200TextEventStreamRole$inboundSchema;
595
+
596
+ /**
597
+ * @internal
598
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
599
+ */
600
+ export namespace DeploymentInvokeMessageDeploymentsResponse200TextEventStreamRole$ {
601
+ /** @deprecated use `DeploymentInvokeMessageDeploymentsResponse200TextEventStreamRole$inboundSchema` instead. */
602
+ export const inboundSchema =
603
+ DeploymentInvokeMessageDeploymentsResponse200TextEventStreamRole$inboundSchema;
604
+ /** @deprecated use `DeploymentInvokeMessageDeploymentsResponse200TextEventStreamRole$outboundSchema` instead. */
605
+ export const outboundSchema =
606
+ DeploymentInvokeMessageDeploymentsResponse200TextEventStreamRole$outboundSchema;
607
+ }
608
+
609
+ /** @internal */
610
+ export const DeploymentInvokeMessage3$inboundSchema: z.ZodType<
611
+ DeploymentInvokeMessage3,
612
+ z.ZodTypeDef,
613
+ unknown
614
+ > = z.object({
615
+ role:
616
+ DeploymentInvokeMessageDeploymentsResponse200TextEventStreamRole$inboundSchema,
617
+ url: z.string(),
618
+ });
619
+
620
+ /** @internal */
621
+ export type DeploymentInvokeMessage3$Outbound = {
622
+ role: string;
623
+ url: string;
624
+ };
625
+
626
+ /** @internal */
627
+ export const DeploymentInvokeMessage3$outboundSchema: z.ZodType<
628
+ DeploymentInvokeMessage3$Outbound,
629
+ z.ZodTypeDef,
630
+ DeploymentInvokeMessage3
631
+ > = z.object({
632
+ role:
633
+ DeploymentInvokeMessageDeploymentsResponse200TextEventStreamRole$outboundSchema,
634
+ url: z.string(),
635
+ });
636
+
637
+ /**
638
+ * @internal
639
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
640
+ */
641
+ export namespace DeploymentInvokeMessage3$ {
642
+ /** @deprecated use `DeploymentInvokeMessage3$inboundSchema` instead. */
643
+ export const inboundSchema = DeploymentInvokeMessage3$inboundSchema;
644
+ /** @deprecated use `DeploymentInvokeMessage3$outboundSchema` instead. */
645
+ export const outboundSchema = DeploymentInvokeMessage3$outboundSchema;
646
+ /** @deprecated use `DeploymentInvokeMessage3$Outbound` instead. */
647
+ export type Outbound = DeploymentInvokeMessage3$Outbound;
648
+ }
649
+
650
+ export function deploymentInvokeMessage3ToJSON(
651
+ deploymentInvokeMessage3: DeploymentInvokeMessage3,
652
+ ): string {
653
+ return JSON.stringify(
654
+ DeploymentInvokeMessage3$outboundSchema.parse(deploymentInvokeMessage3),
655
+ );
656
+ }
657
+
658
+ export function deploymentInvokeMessage3FromJSON(
659
+ jsonString: string,
660
+ ): SafeParseResult<DeploymentInvokeMessage3, SDKValidationError> {
661
+ return safeParse(
662
+ jsonString,
663
+ (x) => DeploymentInvokeMessage3$inboundSchema.parse(JSON.parse(x)),
664
+ `Failed to parse 'DeploymentInvokeMessage3' from JSON`,
665
+ );
666
+ }
667
+
668
+ /** @internal */
669
+ export const DeploymentInvokeMessageDeploymentsResponse200Role$inboundSchema:
670
+ z.ZodNativeEnum<typeof DeploymentInvokeMessageDeploymentsResponse200Role> = z
671
+ .nativeEnum(DeploymentInvokeMessageDeploymentsResponse200Role);
672
+
673
+ /** @internal */
674
+ export const DeploymentInvokeMessageDeploymentsResponse200Role$outboundSchema:
675
+ z.ZodNativeEnum<typeof DeploymentInvokeMessageDeploymentsResponse200Role> =
676
+ DeploymentInvokeMessageDeploymentsResponse200Role$inboundSchema;
677
+
678
+ /**
679
+ * @internal
680
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
681
+ */
682
+ export namespace DeploymentInvokeMessageDeploymentsResponse200Role$ {
683
+ /** @deprecated use `DeploymentInvokeMessageDeploymentsResponse200Role$inboundSchema` instead. */
684
+ export const inboundSchema =
685
+ DeploymentInvokeMessageDeploymentsResponse200Role$inboundSchema;
686
+ /** @deprecated use `DeploymentInvokeMessageDeploymentsResponse200Role$outboundSchema` instead. */
687
+ export const outboundSchema =
688
+ DeploymentInvokeMessageDeploymentsResponse200Role$outboundSchema;
689
+ }
690
+
691
+ /** @internal */
692
+ export const DeploymentInvokeMessageDeployments2$inboundSchema: z.ZodType<
693
+ DeploymentInvokeMessageDeployments2,
694
+ z.ZodTypeDef,
695
+ unknown
696
+ > = z.object({
697
+ role: DeploymentInvokeMessageDeploymentsResponse200Role$inboundSchema,
698
+ content: z.nullable(z.string()),
699
+ });
700
+
701
+ /** @internal */
702
+ export type DeploymentInvokeMessageDeployments2$Outbound = {
703
+ role: string;
704
+ content: string | null;
705
+ };
706
+
707
+ /** @internal */
708
+ export const DeploymentInvokeMessageDeployments2$outboundSchema: z.ZodType<
709
+ DeploymentInvokeMessageDeployments2$Outbound,
710
+ z.ZodTypeDef,
711
+ DeploymentInvokeMessageDeployments2
712
+ > = z.object({
713
+ role: DeploymentInvokeMessageDeploymentsResponse200Role$outboundSchema,
714
+ content: z.nullable(z.string()),
715
+ });
716
+
717
+ /**
718
+ * @internal
719
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
720
+ */
721
+ export namespace DeploymentInvokeMessageDeployments2$ {
722
+ /** @deprecated use `DeploymentInvokeMessageDeployments2$inboundSchema` instead. */
723
+ export const inboundSchema =
724
+ DeploymentInvokeMessageDeployments2$inboundSchema;
725
+ /** @deprecated use `DeploymentInvokeMessageDeployments2$outboundSchema` instead. */
726
+ export const outboundSchema =
727
+ DeploymentInvokeMessageDeployments2$outboundSchema;
728
+ /** @deprecated use `DeploymentInvokeMessageDeployments2$Outbound` instead. */
729
+ export type Outbound = DeploymentInvokeMessageDeployments2$Outbound;
730
+ }
731
+
732
+ export function deploymentInvokeMessageDeployments2ToJSON(
733
+ deploymentInvokeMessageDeployments2: DeploymentInvokeMessageDeployments2,
734
+ ): string {
735
+ return JSON.stringify(
736
+ DeploymentInvokeMessageDeployments2$outboundSchema.parse(
737
+ deploymentInvokeMessageDeployments2,
738
+ ),
739
+ );
740
+ }
741
+
742
+ export function deploymentInvokeMessageDeployments2FromJSON(
743
+ jsonString: string,
744
+ ): SafeParseResult<DeploymentInvokeMessageDeployments2, SDKValidationError> {
745
+ return safeParse(
746
+ jsonString,
747
+ (x) =>
748
+ DeploymentInvokeMessageDeployments2$inboundSchema.parse(JSON.parse(x)),
749
+ `Failed to parse 'DeploymentInvokeMessageDeployments2' from JSON`,
750
+ );
751
+ }
752
+
753
+ /** @internal */
754
+ export const DeploymentInvokeMessageDeploymentsResponse200TextEventStreamResponseBodyRole$inboundSchema:
755
+ z.ZodNativeEnum<
756
+ typeof DeploymentInvokeMessageDeploymentsResponse200TextEventStreamResponseBodyRole
757
+ > = z.nativeEnum(
758
+ DeploymentInvokeMessageDeploymentsResponse200TextEventStreamResponseBodyRole,
759
+ );
760
+
761
+ /** @internal */
762
+ export const DeploymentInvokeMessageDeploymentsResponse200TextEventStreamResponseBodyRole$outboundSchema:
763
+ z.ZodNativeEnum<
764
+ typeof DeploymentInvokeMessageDeploymentsResponse200TextEventStreamResponseBodyRole
765
+ > =
766
+ DeploymentInvokeMessageDeploymentsResponse200TextEventStreamResponseBodyRole$inboundSchema;
767
+
768
+ /**
769
+ * @internal
770
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
771
+ */
772
+ export namespace DeploymentInvokeMessageDeploymentsResponse200TextEventStreamResponseBodyRole$ {
773
+ /** @deprecated use `DeploymentInvokeMessageDeploymentsResponse200TextEventStreamResponseBodyRole$inboundSchema` instead. */
774
+ export const inboundSchema =
775
+ DeploymentInvokeMessageDeploymentsResponse200TextEventStreamResponseBodyRole$inboundSchema;
776
+ /** @deprecated use `DeploymentInvokeMessageDeploymentsResponse200TextEventStreamResponseBodyRole$outboundSchema` instead. */
777
+ export const outboundSchema =
778
+ DeploymentInvokeMessageDeploymentsResponse200TextEventStreamResponseBodyRole$outboundSchema;
779
+ }
780
+
781
+ /** @internal */
782
+ export const DeploymentInvokeMessageDeploymentsType$inboundSchema:
783
+ z.ZodNativeEnum<typeof DeploymentInvokeMessageDeploymentsType> = z.nativeEnum(
784
+ DeploymentInvokeMessageDeploymentsType,
785
+ );
786
+
787
+ /** @internal */
788
+ export const DeploymentInvokeMessageDeploymentsType$outboundSchema:
789
+ z.ZodNativeEnum<typeof DeploymentInvokeMessageDeploymentsType> =
790
+ DeploymentInvokeMessageDeploymentsType$inboundSchema;
791
+
792
+ /**
793
+ * @internal
794
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
795
+ */
796
+ export namespace DeploymentInvokeMessageDeploymentsType$ {
797
+ /** @deprecated use `DeploymentInvokeMessageDeploymentsType$inboundSchema` instead. */
798
+ export const inboundSchema =
799
+ DeploymentInvokeMessageDeploymentsType$inboundSchema;
800
+ /** @deprecated use `DeploymentInvokeMessageDeploymentsType$outboundSchema` instead. */
801
+ export const outboundSchema =
802
+ DeploymentInvokeMessageDeploymentsType$outboundSchema;
803
+ }
804
+
805
+ /** @internal */
806
+ export const DeploymentInvokeMessageDeploymentsFunction$inboundSchema:
807
+ z.ZodType<DeploymentInvokeMessageDeploymentsFunction, z.ZodTypeDef, unknown> =
808
+ z.object({
809
+ name: z.string(),
810
+ arguments: z.string(),
811
+ });
812
+
813
+ /** @internal */
814
+ export type DeploymentInvokeMessageDeploymentsFunction$Outbound = {
815
+ name: string;
816
+ arguments: string;
817
+ };
818
+
819
+ /** @internal */
820
+ export const DeploymentInvokeMessageDeploymentsFunction$outboundSchema:
821
+ z.ZodType<
822
+ DeploymentInvokeMessageDeploymentsFunction$Outbound,
823
+ z.ZodTypeDef,
824
+ DeploymentInvokeMessageDeploymentsFunction
825
+ > = z.object({
826
+ name: z.string(),
827
+ arguments: z.string(),
828
+ });
829
+
830
+ /**
831
+ * @internal
832
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
833
+ */
834
+ export namespace DeploymentInvokeMessageDeploymentsFunction$ {
835
+ /** @deprecated use `DeploymentInvokeMessageDeploymentsFunction$inboundSchema` instead. */
836
+ export const inboundSchema =
837
+ DeploymentInvokeMessageDeploymentsFunction$inboundSchema;
838
+ /** @deprecated use `DeploymentInvokeMessageDeploymentsFunction$outboundSchema` instead. */
839
+ export const outboundSchema =
840
+ DeploymentInvokeMessageDeploymentsFunction$outboundSchema;
841
+ /** @deprecated use `DeploymentInvokeMessageDeploymentsFunction$Outbound` instead. */
842
+ export type Outbound = DeploymentInvokeMessageDeploymentsFunction$Outbound;
843
+ }
844
+
845
+ export function deploymentInvokeMessageDeploymentsFunctionToJSON(
846
+ deploymentInvokeMessageDeploymentsFunction:
847
+ DeploymentInvokeMessageDeploymentsFunction,
848
+ ): string {
849
+ return JSON.stringify(
850
+ DeploymentInvokeMessageDeploymentsFunction$outboundSchema.parse(
851
+ deploymentInvokeMessageDeploymentsFunction,
852
+ ),
853
+ );
854
+ }
855
+
856
+ export function deploymentInvokeMessageDeploymentsFunctionFromJSON(
857
+ jsonString: string,
858
+ ): SafeParseResult<
859
+ DeploymentInvokeMessageDeploymentsFunction,
860
+ SDKValidationError
861
+ > {
862
+ return safeParse(
863
+ jsonString,
864
+ (x) =>
865
+ DeploymentInvokeMessageDeploymentsFunction$inboundSchema.parse(
866
+ JSON.parse(x),
867
+ ),
868
+ `Failed to parse 'DeploymentInvokeMessageDeploymentsFunction' from JSON`,
869
+ );
870
+ }
871
+
872
+ /** @internal */
873
+ export const DeploymentInvokeMessageDeploymentsToolCalls$inboundSchema:
874
+ z.ZodType<
875
+ DeploymentInvokeMessageDeploymentsToolCalls,
876
+ z.ZodTypeDef,
877
+ unknown
878
+ > = z.object({
879
+ id: z.string().optional(),
880
+ index: z.number().optional(),
881
+ type: DeploymentInvokeMessageDeploymentsType$inboundSchema,
882
+ function: z.lazy(() =>
883
+ DeploymentInvokeMessageDeploymentsFunction$inboundSchema
884
+ ),
885
+ });
886
+
887
+ /** @internal */
888
+ export type DeploymentInvokeMessageDeploymentsToolCalls$Outbound = {
889
+ id?: string | undefined;
890
+ index?: number | undefined;
891
+ type: string;
892
+ function: DeploymentInvokeMessageDeploymentsFunction$Outbound;
893
+ };
894
+
895
+ /** @internal */
896
+ export const DeploymentInvokeMessageDeploymentsToolCalls$outboundSchema:
897
+ z.ZodType<
898
+ DeploymentInvokeMessageDeploymentsToolCalls$Outbound,
899
+ z.ZodTypeDef,
900
+ DeploymentInvokeMessageDeploymentsToolCalls
901
+ > = z.object({
902
+ id: z.string().optional(),
903
+ index: z.number().optional(),
904
+ type: DeploymentInvokeMessageDeploymentsType$outboundSchema,
905
+ function: z.lazy(() =>
906
+ DeploymentInvokeMessageDeploymentsFunction$outboundSchema
907
+ ),
908
+ });
909
+
910
+ /**
911
+ * @internal
912
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
913
+ */
914
+ export namespace DeploymentInvokeMessageDeploymentsToolCalls$ {
915
+ /** @deprecated use `DeploymentInvokeMessageDeploymentsToolCalls$inboundSchema` instead. */
916
+ export const inboundSchema =
917
+ DeploymentInvokeMessageDeploymentsToolCalls$inboundSchema;
918
+ /** @deprecated use `DeploymentInvokeMessageDeploymentsToolCalls$outboundSchema` instead. */
919
+ export const outboundSchema =
920
+ DeploymentInvokeMessageDeploymentsToolCalls$outboundSchema;
921
+ /** @deprecated use `DeploymentInvokeMessageDeploymentsToolCalls$Outbound` instead. */
922
+ export type Outbound = DeploymentInvokeMessageDeploymentsToolCalls$Outbound;
923
+ }
924
+
925
+ export function deploymentInvokeMessageDeploymentsToolCallsToJSON(
926
+ deploymentInvokeMessageDeploymentsToolCalls:
927
+ DeploymentInvokeMessageDeploymentsToolCalls,
928
+ ): string {
929
+ return JSON.stringify(
930
+ DeploymentInvokeMessageDeploymentsToolCalls$outboundSchema.parse(
931
+ deploymentInvokeMessageDeploymentsToolCalls,
932
+ ),
933
+ );
934
+ }
935
+
936
+ export function deploymentInvokeMessageDeploymentsToolCallsFromJSON(
937
+ jsonString: string,
938
+ ): SafeParseResult<
939
+ DeploymentInvokeMessageDeploymentsToolCalls,
940
+ SDKValidationError
941
+ > {
942
+ return safeParse(
943
+ jsonString,
944
+ (x) =>
945
+ DeploymentInvokeMessageDeploymentsToolCalls$inboundSchema.parse(
946
+ JSON.parse(x),
947
+ ),
948
+ `Failed to parse 'DeploymentInvokeMessageDeploymentsToolCalls' from JSON`,
949
+ );
950
+ }
951
+
952
+ /** @internal */
953
+ export const DeploymentInvokeMessageDeployments1$inboundSchema: z.ZodType<
954
+ DeploymentInvokeMessageDeployments1,
955
+ z.ZodTypeDef,
956
+ unknown
957
+ > = z.object({
958
+ role:
959
+ DeploymentInvokeMessageDeploymentsResponse200TextEventStreamResponseBodyRole$inboundSchema,
960
+ content: z.nullable(z.string()).optional(),
961
+ tool_calls: z.array(
962
+ z.lazy(() => DeploymentInvokeMessageDeploymentsToolCalls$inboundSchema),
963
+ ),
964
+ }).transform((v) => {
965
+ return remap$(v, {
966
+ "tool_calls": "toolCalls",
967
+ });
968
+ });
969
+
970
+ /** @internal */
971
+ export type DeploymentInvokeMessageDeployments1$Outbound = {
972
+ role: string;
973
+ content?: string | null | undefined;
974
+ tool_calls: Array<DeploymentInvokeMessageDeploymentsToolCalls$Outbound>;
975
+ };
976
+
977
+ /** @internal */
978
+ export const DeploymentInvokeMessageDeployments1$outboundSchema: z.ZodType<
979
+ DeploymentInvokeMessageDeployments1$Outbound,
980
+ z.ZodTypeDef,
981
+ DeploymentInvokeMessageDeployments1
982
+ > = z.object({
983
+ role:
984
+ DeploymentInvokeMessageDeploymentsResponse200TextEventStreamResponseBodyRole$outboundSchema,
985
+ content: z.nullable(z.string()).optional(),
986
+ toolCalls: z.array(
987
+ z.lazy(() => DeploymentInvokeMessageDeploymentsToolCalls$outboundSchema),
988
+ ),
989
+ }).transform((v) => {
990
+ return remap$(v, {
991
+ toolCalls: "tool_calls",
992
+ });
993
+ });
994
+
995
+ /**
996
+ * @internal
997
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
998
+ */
999
+ export namespace DeploymentInvokeMessageDeployments1$ {
1000
+ /** @deprecated use `DeploymentInvokeMessageDeployments1$inboundSchema` instead. */
1001
+ export const inboundSchema =
1002
+ DeploymentInvokeMessageDeployments1$inboundSchema;
1003
+ /** @deprecated use `DeploymentInvokeMessageDeployments1$outboundSchema` instead. */
1004
+ export const outboundSchema =
1005
+ DeploymentInvokeMessageDeployments1$outboundSchema;
1006
+ /** @deprecated use `DeploymentInvokeMessageDeployments1$Outbound` instead. */
1007
+ export type Outbound = DeploymentInvokeMessageDeployments1$Outbound;
1008
+ }
1009
+
1010
+ export function deploymentInvokeMessageDeployments1ToJSON(
1011
+ deploymentInvokeMessageDeployments1: DeploymentInvokeMessageDeployments1,
1012
+ ): string {
1013
+ return JSON.stringify(
1014
+ DeploymentInvokeMessageDeployments1$outboundSchema.parse(
1015
+ deploymentInvokeMessageDeployments1,
1016
+ ),
1017
+ );
1018
+ }
1019
+
1020
+ export function deploymentInvokeMessageDeployments1FromJSON(
1021
+ jsonString: string,
1022
+ ): SafeParseResult<DeploymentInvokeMessageDeployments1, SDKValidationError> {
1023
+ return safeParse(
1024
+ jsonString,
1025
+ (x) =>
1026
+ DeploymentInvokeMessageDeployments1$inboundSchema.parse(JSON.parse(x)),
1027
+ `Failed to parse 'DeploymentInvokeMessageDeployments1' from JSON`,
1028
+ );
1029
+ }
1030
+
1031
+ /** @internal */
1032
+ export const DeploymentInvokeDeploymentsMessage$inboundSchema: z.ZodType<
1033
+ DeploymentInvokeDeploymentsMessage,
1034
+ z.ZodTypeDef,
1035
+ unknown
1036
+ > = z.union([
1037
+ z.lazy(() => DeploymentInvokeMessageDeployments2$inboundSchema),
1038
+ z.lazy(() => DeploymentInvokeMessage3$inboundSchema),
1039
+ z.lazy(() => DeploymentInvokeMessageDeployments1$inboundSchema),
1040
+ ]);
1041
+
1042
+ /** @internal */
1043
+ export type DeploymentInvokeDeploymentsMessage$Outbound =
1044
+ | DeploymentInvokeMessageDeployments2$Outbound
1045
+ | DeploymentInvokeMessage3$Outbound
1046
+ | DeploymentInvokeMessageDeployments1$Outbound;
1047
+
1048
+ /** @internal */
1049
+ export const DeploymentInvokeDeploymentsMessage$outboundSchema: z.ZodType<
1050
+ DeploymentInvokeDeploymentsMessage$Outbound,
1051
+ z.ZodTypeDef,
1052
+ DeploymentInvokeDeploymentsMessage
1053
+ > = z.union([
1054
+ z.lazy(() => DeploymentInvokeMessageDeployments2$outboundSchema),
1055
+ z.lazy(() => DeploymentInvokeMessage3$outboundSchema),
1056
+ z.lazy(() => DeploymentInvokeMessageDeployments1$outboundSchema),
1057
+ ]);
1058
+
1059
+ /**
1060
+ * @internal
1061
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1062
+ */
1063
+ export namespace DeploymentInvokeDeploymentsMessage$ {
1064
+ /** @deprecated use `DeploymentInvokeDeploymentsMessage$inboundSchema` instead. */
1065
+ export const inboundSchema = DeploymentInvokeDeploymentsMessage$inboundSchema;
1066
+ /** @deprecated use `DeploymentInvokeDeploymentsMessage$outboundSchema` instead. */
1067
+ export const outboundSchema =
1068
+ DeploymentInvokeDeploymentsMessage$outboundSchema;
1069
+ /** @deprecated use `DeploymentInvokeDeploymentsMessage$Outbound` instead. */
1070
+ export type Outbound = DeploymentInvokeDeploymentsMessage$Outbound;
1071
+ }
1072
+
1073
+ export function deploymentInvokeDeploymentsMessageToJSON(
1074
+ deploymentInvokeDeploymentsMessage: DeploymentInvokeDeploymentsMessage,
1075
+ ): string {
1076
+ return JSON.stringify(
1077
+ DeploymentInvokeDeploymentsMessage$outboundSchema.parse(
1078
+ deploymentInvokeDeploymentsMessage,
1079
+ ),
1080
+ );
1081
+ }
1082
+
1083
+ export function deploymentInvokeDeploymentsMessageFromJSON(
1084
+ jsonString: string,
1085
+ ): SafeParseResult<DeploymentInvokeDeploymentsMessage, SDKValidationError> {
1086
+ return safeParse(
1087
+ jsonString,
1088
+ (x) =>
1089
+ DeploymentInvokeDeploymentsMessage$inboundSchema.parse(JSON.parse(x)),
1090
+ `Failed to parse 'DeploymentInvokeDeploymentsMessage' from JSON`,
1091
+ );
1092
+ }
1093
+
1094
+ /** @internal */
1095
+ export const DeploymentInvokeDeploymentsChoices$inboundSchema: z.ZodType<
1096
+ DeploymentInvokeDeploymentsChoices,
1097
+ z.ZodTypeDef,
1098
+ unknown
1099
+ > = z.object({
1100
+ index: z.number(),
1101
+ message: z.union([
1102
+ z.lazy(() => DeploymentInvokeMessageDeployments2$inboundSchema),
1103
+ z.lazy(() => DeploymentInvokeMessage3$inboundSchema),
1104
+ z.lazy(() => DeploymentInvokeMessageDeployments1$inboundSchema),
1105
+ ]).optional(),
1106
+ finish_reason: z.nullable(z.string()).optional(),
1107
+ }).transform((v) => {
1108
+ return remap$(v, {
1109
+ "finish_reason": "finishReason",
1110
+ });
1111
+ });
1112
+
1113
+ /** @internal */
1114
+ export type DeploymentInvokeDeploymentsChoices$Outbound = {
1115
+ index: number;
1116
+ message?:
1117
+ | DeploymentInvokeMessageDeployments2$Outbound
1118
+ | DeploymentInvokeMessage3$Outbound
1119
+ | DeploymentInvokeMessageDeployments1$Outbound
1120
+ | undefined;
1121
+ finish_reason?: string | null | undefined;
1122
+ };
1123
+
1124
+ /** @internal */
1125
+ export const DeploymentInvokeDeploymentsChoices$outboundSchema: z.ZodType<
1126
+ DeploymentInvokeDeploymentsChoices$Outbound,
1127
+ z.ZodTypeDef,
1128
+ DeploymentInvokeDeploymentsChoices
1129
+ > = z.object({
1130
+ index: z.number(),
1131
+ message: z.union([
1132
+ z.lazy(() => DeploymentInvokeMessageDeployments2$outboundSchema),
1133
+ z.lazy(() => DeploymentInvokeMessage3$outboundSchema),
1134
+ z.lazy(() => DeploymentInvokeMessageDeployments1$outboundSchema),
1135
+ ]).optional(),
1136
+ finishReason: z.nullable(z.string()).optional(),
1137
+ }).transform((v) => {
1138
+ return remap$(v, {
1139
+ finishReason: "finish_reason",
1140
+ });
1141
+ });
1142
+
1143
+ /**
1144
+ * @internal
1145
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1146
+ */
1147
+ export namespace DeploymentInvokeDeploymentsChoices$ {
1148
+ /** @deprecated use `DeploymentInvokeDeploymentsChoices$inboundSchema` instead. */
1149
+ export const inboundSchema = DeploymentInvokeDeploymentsChoices$inboundSchema;
1150
+ /** @deprecated use `DeploymentInvokeDeploymentsChoices$outboundSchema` instead. */
1151
+ export const outboundSchema =
1152
+ DeploymentInvokeDeploymentsChoices$outboundSchema;
1153
+ /** @deprecated use `DeploymentInvokeDeploymentsChoices$Outbound` instead. */
1154
+ export type Outbound = DeploymentInvokeDeploymentsChoices$Outbound;
1155
+ }
1156
+
1157
+ export function deploymentInvokeDeploymentsChoicesToJSON(
1158
+ deploymentInvokeDeploymentsChoices: DeploymentInvokeDeploymentsChoices,
1159
+ ): string {
1160
+ return JSON.stringify(
1161
+ DeploymentInvokeDeploymentsChoices$outboundSchema.parse(
1162
+ deploymentInvokeDeploymentsChoices,
1163
+ ),
1164
+ );
1165
+ }
1166
+
1167
+ export function deploymentInvokeDeploymentsChoicesFromJSON(
1168
+ jsonString: string,
1169
+ ): SafeParseResult<DeploymentInvokeDeploymentsChoices, SDKValidationError> {
1170
+ return safeParse(
1171
+ jsonString,
1172
+ (x) =>
1173
+ DeploymentInvokeDeploymentsChoices$inboundSchema.parse(JSON.parse(x)),
1174
+ `Failed to parse 'DeploymentInvokeDeploymentsChoices' from JSON`,
1175
+ );
1176
+ }
1177
+
1178
+ /** @internal */
1179
+ export const DeploymentInvokeDeploymentsMetadata$inboundSchema: z.ZodType<
1180
+ DeploymentInvokeDeploymentsMetadata,
1181
+ z.ZodTypeDef,
1182
+ unknown
1183
+ > = z.object({
1184
+ file_name: z.string(),
1185
+ page_number: z.nullable(z.number()),
1186
+ file_type: z.string(),
1187
+ rerank_score: z.number().optional(),
1188
+ search_score: z.number(),
1189
+ }).transform((v) => {
1190
+ return remap$(v, {
1191
+ "file_name": "fileName",
1192
+ "page_number": "pageNumber",
1193
+ "file_type": "fileType",
1194
+ "rerank_score": "rerankScore",
1195
+ "search_score": "searchScore",
1196
+ });
1197
+ });
1198
+
1199
+ /** @internal */
1200
+ export type DeploymentInvokeDeploymentsMetadata$Outbound = {
1201
+ file_name: string;
1202
+ page_number: number | null;
1203
+ file_type: string;
1204
+ rerank_score?: number | undefined;
1205
+ search_score: number;
1206
+ };
1207
+
1208
+ /** @internal */
1209
+ export const DeploymentInvokeDeploymentsMetadata$outboundSchema: z.ZodType<
1210
+ DeploymentInvokeDeploymentsMetadata$Outbound,
1211
+ z.ZodTypeDef,
1212
+ DeploymentInvokeDeploymentsMetadata
1213
+ > = z.object({
1214
+ fileName: z.string(),
1215
+ pageNumber: z.nullable(z.number()),
1216
+ fileType: z.string(),
1217
+ rerankScore: z.number().optional(),
1218
+ searchScore: z.number(),
1219
+ }).transform((v) => {
1220
+ return remap$(v, {
1221
+ fileName: "file_name",
1222
+ pageNumber: "page_number",
1223
+ fileType: "file_type",
1224
+ rerankScore: "rerank_score",
1225
+ searchScore: "search_score",
1226
+ });
1227
+ });
1228
+
1229
+ /**
1230
+ * @internal
1231
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1232
+ */
1233
+ export namespace DeploymentInvokeDeploymentsMetadata$ {
1234
+ /** @deprecated use `DeploymentInvokeDeploymentsMetadata$inboundSchema` instead. */
1235
+ export const inboundSchema =
1236
+ DeploymentInvokeDeploymentsMetadata$inboundSchema;
1237
+ /** @deprecated use `DeploymentInvokeDeploymentsMetadata$outboundSchema` instead. */
1238
+ export const outboundSchema =
1239
+ DeploymentInvokeDeploymentsMetadata$outboundSchema;
1240
+ /** @deprecated use `DeploymentInvokeDeploymentsMetadata$Outbound` instead. */
1241
+ export type Outbound = DeploymentInvokeDeploymentsMetadata$Outbound;
1242
+ }
1243
+
1244
+ export function deploymentInvokeDeploymentsMetadataToJSON(
1245
+ deploymentInvokeDeploymentsMetadata: DeploymentInvokeDeploymentsMetadata,
1246
+ ): string {
1247
+ return JSON.stringify(
1248
+ DeploymentInvokeDeploymentsMetadata$outboundSchema.parse(
1249
+ deploymentInvokeDeploymentsMetadata,
1250
+ ),
1251
+ );
1252
+ }
1253
+
1254
+ export function deploymentInvokeDeploymentsMetadataFromJSON(
1255
+ jsonString: string,
1256
+ ): SafeParseResult<DeploymentInvokeDeploymentsMetadata, SDKValidationError> {
1257
+ return safeParse(
1258
+ jsonString,
1259
+ (x) =>
1260
+ DeploymentInvokeDeploymentsMetadata$inboundSchema.parse(JSON.parse(x)),
1261
+ `Failed to parse 'DeploymentInvokeDeploymentsMetadata' from JSON`,
1262
+ );
1263
+ }
1264
+
1265
+ /** @internal */
1266
+ export const DeploymentInvokeRetrievals$inboundSchema: z.ZodType<
1267
+ DeploymentInvokeRetrievals,
1268
+ z.ZodTypeDef,
1269
+ unknown
1270
+ > = z.object({
1271
+ document: z.string(),
1272
+ metadata: z.lazy(() => DeploymentInvokeDeploymentsMetadata$inboundSchema),
1273
+ });
1274
+
1275
+ /** @internal */
1276
+ export type DeploymentInvokeRetrievals$Outbound = {
1277
+ document: string;
1278
+ metadata: DeploymentInvokeDeploymentsMetadata$Outbound;
1279
+ };
1280
+
1281
+ /** @internal */
1282
+ export const DeploymentInvokeRetrievals$outboundSchema: z.ZodType<
1283
+ DeploymentInvokeRetrievals$Outbound,
1284
+ z.ZodTypeDef,
1285
+ DeploymentInvokeRetrievals
1286
+ > = z.object({
1287
+ document: z.string(),
1288
+ metadata: z.lazy(() => DeploymentInvokeDeploymentsMetadata$outboundSchema),
1289
+ });
1290
+
1291
+ /**
1292
+ * @internal
1293
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1294
+ */
1295
+ export namespace DeploymentInvokeRetrievals$ {
1296
+ /** @deprecated use `DeploymentInvokeRetrievals$inboundSchema` instead. */
1297
+ export const inboundSchema = DeploymentInvokeRetrievals$inboundSchema;
1298
+ /** @deprecated use `DeploymentInvokeRetrievals$outboundSchema` instead. */
1299
+ export const outboundSchema = DeploymentInvokeRetrievals$outboundSchema;
1300
+ /** @deprecated use `DeploymentInvokeRetrievals$Outbound` instead. */
1301
+ export type Outbound = DeploymentInvokeRetrievals$Outbound;
1302
+ }
1303
+
1304
+ export function deploymentInvokeRetrievalsToJSON(
1305
+ deploymentInvokeRetrievals: DeploymentInvokeRetrievals,
1306
+ ): string {
1307
+ return JSON.stringify(
1308
+ DeploymentInvokeRetrievals$outboundSchema.parse(deploymentInvokeRetrievals),
1309
+ );
1310
+ }
1311
+
1312
+ export function deploymentInvokeRetrievalsFromJSON(
1313
+ jsonString: string,
1314
+ ): SafeParseResult<DeploymentInvokeRetrievals, SDKValidationError> {
1315
+ return safeParse(
1316
+ jsonString,
1317
+ (x) => DeploymentInvokeRetrievals$inboundSchema.parse(JSON.parse(x)),
1318
+ `Failed to parse 'DeploymentInvokeRetrievals' from JSON`,
1319
+ );
1320
+ }
1321
+
1322
+ /** @internal */
1323
+ export const DeploymentInvokeData$inboundSchema: z.ZodType<
1324
+ DeploymentInvokeData,
1325
+ z.ZodTypeDef,
1326
+ unknown
1327
+ > = z.object({
1328
+ id: z.string().optional(),
1329
+ created: z.string().datetime({ offset: true }).transform(v => new Date(v))
1330
+ .optional(),
1331
+ object: DeploymentInvokeDeploymentsObject$inboundSchema.optional(),
1332
+ model: z.string().optional(),
1333
+ provider: DeploymentInvokeDeploymentsProvider$inboundSchema.optional(),
1334
+ is_final: z.boolean().optional(),
1335
+ integration_id: z.string().optional(),
1336
+ finalized: z.string().datetime({ offset: true }).transform(v => new Date(v))
1337
+ .optional(),
1338
+ system_fingerprint: z.nullable(z.string()).optional(),
1339
+ choices: z.array(
1340
+ z.lazy(() => DeploymentInvokeDeploymentsChoices$inboundSchema),
1341
+ ).optional(),
1342
+ retrievals: z.array(z.lazy(() => DeploymentInvokeRetrievals$inboundSchema))
1343
+ .optional(),
1344
+ provider_response: z.any().optional(),
1345
+ }).transform((v) => {
1346
+ return remap$(v, {
1347
+ "is_final": "isFinal",
1348
+ "integration_id": "integrationId",
1349
+ "system_fingerprint": "systemFingerprint",
1350
+ "provider_response": "providerResponse",
1351
+ });
1352
+ });
1353
+
1354
+ /** @internal */
1355
+ export type DeploymentInvokeData$Outbound = {
1356
+ id?: string | undefined;
1357
+ created?: string | undefined;
1358
+ object?: string | undefined;
1359
+ model?: string | undefined;
1360
+ provider?: string | undefined;
1361
+ is_final?: boolean | undefined;
1362
+ integration_id?: string | undefined;
1363
+ finalized?: string | undefined;
1364
+ system_fingerprint?: string | null | undefined;
1365
+ choices?: Array<DeploymentInvokeDeploymentsChoices$Outbound> | undefined;
1366
+ retrievals?: Array<DeploymentInvokeRetrievals$Outbound> | undefined;
1367
+ provider_response?: any | undefined;
1368
+ };
1369
+
1370
+ /** @internal */
1371
+ export const DeploymentInvokeData$outboundSchema: z.ZodType<
1372
+ DeploymentInvokeData$Outbound,
1373
+ z.ZodTypeDef,
1374
+ DeploymentInvokeData
1375
+ > = z.object({
1376
+ id: z.string().optional(),
1377
+ created: z.date().transform(v => v.toISOString()).optional(),
1378
+ object: DeploymentInvokeDeploymentsObject$outboundSchema.optional(),
1379
+ model: z.string().optional(),
1380
+ provider: DeploymentInvokeDeploymentsProvider$outboundSchema.optional(),
1381
+ isFinal: z.boolean().optional(),
1382
+ integrationId: z.string().optional(),
1383
+ finalized: z.date().transform(v => v.toISOString()).optional(),
1384
+ systemFingerprint: z.nullable(z.string()).optional(),
1385
+ choices: z.array(
1386
+ z.lazy(() => DeploymentInvokeDeploymentsChoices$outboundSchema),
1387
+ ).optional(),
1388
+ retrievals: z.array(z.lazy(() => DeploymentInvokeRetrievals$outboundSchema))
1389
+ .optional(),
1390
+ providerResponse: z.any().optional(),
1391
+ }).transform((v) => {
1392
+ return remap$(v, {
1393
+ isFinal: "is_final",
1394
+ integrationId: "integration_id",
1395
+ systemFingerprint: "system_fingerprint",
1396
+ providerResponse: "provider_response",
1397
+ });
1398
+ });
1399
+
1400
+ /**
1401
+ * @internal
1402
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1403
+ */
1404
+ export namespace DeploymentInvokeData$ {
1405
+ /** @deprecated use `DeploymentInvokeData$inboundSchema` instead. */
1406
+ export const inboundSchema = DeploymentInvokeData$inboundSchema;
1407
+ /** @deprecated use `DeploymentInvokeData$outboundSchema` instead. */
1408
+ export const outboundSchema = DeploymentInvokeData$outboundSchema;
1409
+ /** @deprecated use `DeploymentInvokeData$Outbound` instead. */
1410
+ export type Outbound = DeploymentInvokeData$Outbound;
1411
+ }
1412
+
1413
+ export function deploymentInvokeDataToJSON(
1414
+ deploymentInvokeData: DeploymentInvokeData,
1415
+ ): string {
1416
+ return JSON.stringify(
1417
+ DeploymentInvokeData$outboundSchema.parse(deploymentInvokeData),
1418
+ );
1419
+ }
1420
+
1421
+ export function deploymentInvokeDataFromJSON(
1422
+ jsonString: string,
1423
+ ): SafeParseResult<DeploymentInvokeData, SDKValidationError> {
1424
+ return safeParse(
1425
+ jsonString,
1426
+ (x) => DeploymentInvokeData$inboundSchema.parse(JSON.parse(x)),
1427
+ `Failed to parse 'DeploymentInvokeData' from JSON`,
1428
+ );
1429
+ }
1430
+
1431
+ /** @internal */
1432
+ export const DeploymentInvokeDeploymentsResponseBody$inboundSchema: z.ZodType<
1433
+ DeploymentInvokeDeploymentsResponseBody,
1434
+ z.ZodTypeDef,
1435
+ unknown
1436
+ > = z.object({
1437
+ data: z.string().transform((v, ctx) => {
1438
+ try {
1439
+ return JSON.parse(v);
1440
+ } catch (err) {
1441
+ ctx.addIssue({
1442
+ code: z.ZodIssueCode.custom,
1443
+ message: `malformed json: ${err}`,
1444
+ });
1445
+ return z.NEVER;
1446
+ }
1447
+ }).pipe(z.lazy(() => DeploymentInvokeData$inboundSchema).optional()),
1448
+ });
1449
+
1450
+ /** @internal */
1451
+ export type DeploymentInvokeDeploymentsResponseBody$Outbound = {
1452
+ data?: DeploymentInvokeData$Outbound | undefined;
1453
+ };
1454
+
1455
+ /** @internal */
1456
+ export const DeploymentInvokeDeploymentsResponseBody$outboundSchema: z.ZodType<
1457
+ DeploymentInvokeDeploymentsResponseBody$Outbound,
1458
+ z.ZodTypeDef,
1459
+ DeploymentInvokeDeploymentsResponseBody
1460
+ > = z.object({
1461
+ data: z.lazy(() => DeploymentInvokeData$outboundSchema).optional(),
1462
+ });
1463
+
1464
+ /**
1465
+ * @internal
1466
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1467
+ */
1468
+ export namespace DeploymentInvokeDeploymentsResponseBody$ {
1469
+ /** @deprecated use `DeploymentInvokeDeploymentsResponseBody$inboundSchema` instead. */
1470
+ export const inboundSchema =
1471
+ DeploymentInvokeDeploymentsResponseBody$inboundSchema;
1472
+ /** @deprecated use `DeploymentInvokeDeploymentsResponseBody$outboundSchema` instead. */
1473
+ export const outboundSchema =
1474
+ DeploymentInvokeDeploymentsResponseBody$outboundSchema;
1475
+ /** @deprecated use `DeploymentInvokeDeploymentsResponseBody$Outbound` instead. */
1476
+ export type Outbound = DeploymentInvokeDeploymentsResponseBody$Outbound;
1477
+ }
1478
+
1479
+ export function deploymentInvokeDeploymentsResponseBodyToJSON(
1480
+ deploymentInvokeDeploymentsResponseBody:
1481
+ DeploymentInvokeDeploymentsResponseBody,
1482
+ ): string {
1483
+ return JSON.stringify(
1484
+ DeploymentInvokeDeploymentsResponseBody$outboundSchema.parse(
1485
+ deploymentInvokeDeploymentsResponseBody,
1486
+ ),
1487
+ );
1488
+ }
1489
+
1490
+ export function deploymentInvokeDeploymentsResponseBodyFromJSON(
1491
+ jsonString: string,
1492
+ ): SafeParseResult<
1493
+ DeploymentInvokeDeploymentsResponseBody,
1494
+ SDKValidationError
1495
+ > {
1496
+ return safeParse(
1497
+ jsonString,
1498
+ (x) =>
1499
+ DeploymentInvokeDeploymentsResponseBody$inboundSchema.parse(
1500
+ JSON.parse(x),
1501
+ ),
1502
+ `Failed to parse 'DeploymentInvokeDeploymentsResponseBody' from JSON`,
1503
+ );
1504
+ }
1505
+
1506
+ /** @internal */
1507
+ export const DeploymentInvokeObject$inboundSchema: z.ZodNativeEnum<
1508
+ typeof DeploymentInvokeObject
1509
+ > = z.nativeEnum(DeploymentInvokeObject);
1510
+
1511
+ /** @internal */
1512
+ export const DeploymentInvokeObject$outboundSchema: z.ZodNativeEnum<
1513
+ typeof DeploymentInvokeObject
1514
+ > = DeploymentInvokeObject$inboundSchema;
1515
+
1516
+ /**
1517
+ * @internal
1518
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1519
+ */
1520
+ export namespace DeploymentInvokeObject$ {
1521
+ /** @deprecated use `DeploymentInvokeObject$inboundSchema` instead. */
1522
+ export const inboundSchema = DeploymentInvokeObject$inboundSchema;
1523
+ /** @deprecated use `DeploymentInvokeObject$outboundSchema` instead. */
1524
+ export const outboundSchema = DeploymentInvokeObject$outboundSchema;
1525
+ }
1526
+
1527
+ /** @internal */
1528
+ export const DeploymentInvokeProvider$inboundSchema: z.ZodNativeEnum<
1529
+ typeof DeploymentInvokeProvider
1530
+ > = z.nativeEnum(DeploymentInvokeProvider);
1531
+
1532
+ /** @internal */
1533
+ export const DeploymentInvokeProvider$outboundSchema: z.ZodNativeEnum<
1534
+ typeof DeploymentInvokeProvider
1535
+ > = DeploymentInvokeProvider$inboundSchema;
1536
+
1537
+ /**
1538
+ * @internal
1539
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1540
+ */
1541
+ export namespace DeploymentInvokeProvider$ {
1542
+ /** @deprecated use `DeploymentInvokeProvider$inboundSchema` instead. */
1543
+ export const inboundSchema = DeploymentInvokeProvider$inboundSchema;
1544
+ /** @deprecated use `DeploymentInvokeProvider$outboundSchema` instead. */
1545
+ export const outboundSchema = DeploymentInvokeProvider$outboundSchema;
1546
+ }
1547
+
1548
+ /** @internal */
1549
+ export const DeploymentInvokeMessageDeploymentsRole$inboundSchema:
1550
+ z.ZodNativeEnum<typeof DeploymentInvokeMessageDeploymentsRole> = z.nativeEnum(
1551
+ DeploymentInvokeMessageDeploymentsRole,
1552
+ );
1553
+
1554
+ /** @internal */
1555
+ export const DeploymentInvokeMessageDeploymentsRole$outboundSchema:
1556
+ z.ZodNativeEnum<typeof DeploymentInvokeMessageDeploymentsRole> =
1557
+ DeploymentInvokeMessageDeploymentsRole$inboundSchema;
1558
+
1559
+ /**
1560
+ * @internal
1561
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1562
+ */
1563
+ export namespace DeploymentInvokeMessageDeploymentsRole$ {
1564
+ /** @deprecated use `DeploymentInvokeMessageDeploymentsRole$inboundSchema` instead. */
1565
+ export const inboundSchema =
1566
+ DeploymentInvokeMessageDeploymentsRole$inboundSchema;
1567
+ /** @deprecated use `DeploymentInvokeMessageDeploymentsRole$outboundSchema` instead. */
1568
+ export const outboundSchema =
1569
+ DeploymentInvokeMessageDeploymentsRole$outboundSchema;
1570
+ }
1571
+
1572
+ /** @internal */
1573
+ export const Message3$inboundSchema: z.ZodType<
1574
+ Message3,
1575
+ z.ZodTypeDef,
1576
+ unknown
1577
+ > = z.object({
1578
+ role: DeploymentInvokeMessageDeploymentsRole$inboundSchema,
1579
+ url: z.string(),
1580
+ });
1581
+
1582
+ /** @internal */
1583
+ export type Message3$Outbound = {
1584
+ role: string;
1585
+ url: string;
1586
+ };
1587
+
1588
+ /** @internal */
1589
+ export const Message3$outboundSchema: z.ZodType<
1590
+ Message3$Outbound,
1591
+ z.ZodTypeDef,
1592
+ Message3
1593
+ > = z.object({
1594
+ role: DeploymentInvokeMessageDeploymentsRole$outboundSchema,
1595
+ url: z.string(),
1596
+ });
1597
+
1598
+ /**
1599
+ * @internal
1600
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1601
+ */
1602
+ export namespace Message3$ {
1603
+ /** @deprecated use `Message3$inboundSchema` instead. */
1604
+ export const inboundSchema = Message3$inboundSchema;
1605
+ /** @deprecated use `Message3$outboundSchema` instead. */
1606
+ export const outboundSchema = Message3$outboundSchema;
1607
+ /** @deprecated use `Message3$Outbound` instead. */
1608
+ export type Outbound = Message3$Outbound;
1609
+ }
1610
+
1611
+ export function message3ToJSON(message3: Message3): string {
1612
+ return JSON.stringify(Message3$outboundSchema.parse(message3));
1613
+ }
1614
+
1615
+ export function message3FromJSON(
1616
+ jsonString: string,
1617
+ ): SafeParseResult<Message3, SDKValidationError> {
1618
+ return safeParse(
1619
+ jsonString,
1620
+ (x) => Message3$inboundSchema.parse(JSON.parse(x)),
1621
+ `Failed to parse 'Message3' from JSON`,
1622
+ );
1623
+ }
1624
+
1625
+ /** @internal */
1626
+ export const DeploymentInvokeMessageRole$inboundSchema: z.ZodNativeEnum<
1627
+ typeof DeploymentInvokeMessageRole
1628
+ > = z.nativeEnum(DeploymentInvokeMessageRole);
1629
+
1630
+ /** @internal */
1631
+ export const DeploymentInvokeMessageRole$outboundSchema: z.ZodNativeEnum<
1632
+ typeof DeploymentInvokeMessageRole
1633
+ > = DeploymentInvokeMessageRole$inboundSchema;
1634
+
1635
+ /**
1636
+ * @internal
1637
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1638
+ */
1639
+ export namespace DeploymentInvokeMessageRole$ {
1640
+ /** @deprecated use `DeploymentInvokeMessageRole$inboundSchema` instead. */
1641
+ export const inboundSchema = DeploymentInvokeMessageRole$inboundSchema;
1642
+ /** @deprecated use `DeploymentInvokeMessageRole$outboundSchema` instead. */
1643
+ export const outboundSchema = DeploymentInvokeMessageRole$outboundSchema;
1644
+ }
1645
+
1646
+ /** @internal */
1647
+ export const DeploymentInvokeMessage2$inboundSchema: z.ZodType<
1648
+ DeploymentInvokeMessage2,
1649
+ z.ZodTypeDef,
1650
+ unknown
1651
+ > = z.object({
1652
+ role: DeploymentInvokeMessageRole$inboundSchema,
1653
+ content: z.nullable(z.string()),
1654
+ });
1655
+
1656
+ /** @internal */
1657
+ export type DeploymentInvokeMessage2$Outbound = {
1658
+ role: string;
1659
+ content: string | null;
1660
+ };
1661
+
1662
+ /** @internal */
1663
+ export const DeploymentInvokeMessage2$outboundSchema: z.ZodType<
1664
+ DeploymentInvokeMessage2$Outbound,
1665
+ z.ZodTypeDef,
1666
+ DeploymentInvokeMessage2
1667
+ > = z.object({
1668
+ role: DeploymentInvokeMessageRole$outboundSchema,
1669
+ content: z.nullable(z.string()),
1670
+ });
1671
+
1672
+ /**
1673
+ * @internal
1674
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1675
+ */
1676
+ export namespace DeploymentInvokeMessage2$ {
1677
+ /** @deprecated use `DeploymentInvokeMessage2$inboundSchema` instead. */
1678
+ export const inboundSchema = DeploymentInvokeMessage2$inboundSchema;
1679
+ /** @deprecated use `DeploymentInvokeMessage2$outboundSchema` instead. */
1680
+ export const outboundSchema = DeploymentInvokeMessage2$outboundSchema;
1681
+ /** @deprecated use `DeploymentInvokeMessage2$Outbound` instead. */
1682
+ export type Outbound = DeploymentInvokeMessage2$Outbound;
1683
+ }
1684
+
1685
+ export function deploymentInvokeMessage2ToJSON(
1686
+ deploymentInvokeMessage2: DeploymentInvokeMessage2,
1687
+ ): string {
1688
+ return JSON.stringify(
1689
+ DeploymentInvokeMessage2$outboundSchema.parse(deploymentInvokeMessage2),
1690
+ );
1691
+ }
1692
+
1693
+ export function deploymentInvokeMessage2FromJSON(
1694
+ jsonString: string,
1695
+ ): SafeParseResult<DeploymentInvokeMessage2, SDKValidationError> {
1696
+ return safeParse(
1697
+ jsonString,
1698
+ (x) => DeploymentInvokeMessage2$inboundSchema.parse(JSON.parse(x)),
1699
+ `Failed to parse 'DeploymentInvokeMessage2' from JSON`,
1700
+ );
1701
+ }
1702
+
1703
+ /** @internal */
1704
+ export const DeploymentInvokeMessageDeploymentsResponseRole$inboundSchema:
1705
+ z.ZodNativeEnum<typeof DeploymentInvokeMessageDeploymentsResponseRole> = z
1706
+ .nativeEnum(DeploymentInvokeMessageDeploymentsResponseRole);
1707
+
1708
+ /** @internal */
1709
+ export const DeploymentInvokeMessageDeploymentsResponseRole$outboundSchema:
1710
+ z.ZodNativeEnum<typeof DeploymentInvokeMessageDeploymentsResponseRole> =
1711
+ DeploymentInvokeMessageDeploymentsResponseRole$inboundSchema;
1712
+
1713
+ /**
1714
+ * @internal
1715
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1716
+ */
1717
+ export namespace DeploymentInvokeMessageDeploymentsResponseRole$ {
1718
+ /** @deprecated use `DeploymentInvokeMessageDeploymentsResponseRole$inboundSchema` instead. */
1719
+ export const inboundSchema =
1720
+ DeploymentInvokeMessageDeploymentsResponseRole$inboundSchema;
1721
+ /** @deprecated use `DeploymentInvokeMessageDeploymentsResponseRole$outboundSchema` instead. */
1722
+ export const outboundSchema =
1723
+ DeploymentInvokeMessageDeploymentsResponseRole$outboundSchema;
1724
+ }
1725
+
1726
+ /** @internal */
1727
+ export const DeploymentInvokeMessageType$inboundSchema: z.ZodNativeEnum<
1728
+ typeof DeploymentInvokeMessageType
1729
+ > = z.nativeEnum(DeploymentInvokeMessageType);
1730
+
1731
+ /** @internal */
1732
+ export const DeploymentInvokeMessageType$outboundSchema: z.ZodNativeEnum<
1733
+ typeof DeploymentInvokeMessageType
1734
+ > = DeploymentInvokeMessageType$inboundSchema;
1735
+
1736
+ /**
1737
+ * @internal
1738
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1739
+ */
1740
+ export namespace DeploymentInvokeMessageType$ {
1741
+ /** @deprecated use `DeploymentInvokeMessageType$inboundSchema` instead. */
1742
+ export const inboundSchema = DeploymentInvokeMessageType$inboundSchema;
1743
+ /** @deprecated use `DeploymentInvokeMessageType$outboundSchema` instead. */
1744
+ export const outboundSchema = DeploymentInvokeMessageType$outboundSchema;
1745
+ }
1746
+
1747
+ /** @internal */
1748
+ export const DeploymentInvokeMessageFunction$inboundSchema: z.ZodType<
1749
+ DeploymentInvokeMessageFunction,
1750
+ z.ZodTypeDef,
1751
+ unknown
1752
+ > = z.object({
1753
+ name: z.string(),
1754
+ arguments: z.string(),
1755
+ });
1756
+
1757
+ /** @internal */
1758
+ export type DeploymentInvokeMessageFunction$Outbound = {
1759
+ name: string;
1760
+ arguments: string;
1761
+ };
1762
+
1763
+ /** @internal */
1764
+ export const DeploymentInvokeMessageFunction$outboundSchema: z.ZodType<
1765
+ DeploymentInvokeMessageFunction$Outbound,
1766
+ z.ZodTypeDef,
1767
+ DeploymentInvokeMessageFunction
1768
+ > = z.object({
1769
+ name: z.string(),
1770
+ arguments: z.string(),
1771
+ });
1772
+
1773
+ /**
1774
+ * @internal
1775
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1776
+ */
1777
+ export namespace DeploymentInvokeMessageFunction$ {
1778
+ /** @deprecated use `DeploymentInvokeMessageFunction$inboundSchema` instead. */
1779
+ export const inboundSchema = DeploymentInvokeMessageFunction$inboundSchema;
1780
+ /** @deprecated use `DeploymentInvokeMessageFunction$outboundSchema` instead. */
1781
+ export const outboundSchema = DeploymentInvokeMessageFunction$outboundSchema;
1782
+ /** @deprecated use `DeploymentInvokeMessageFunction$Outbound` instead. */
1783
+ export type Outbound = DeploymentInvokeMessageFunction$Outbound;
1784
+ }
1785
+
1786
+ export function deploymentInvokeMessageFunctionToJSON(
1787
+ deploymentInvokeMessageFunction: DeploymentInvokeMessageFunction,
1788
+ ): string {
1789
+ return JSON.stringify(
1790
+ DeploymentInvokeMessageFunction$outboundSchema.parse(
1791
+ deploymentInvokeMessageFunction,
1792
+ ),
1793
+ );
1794
+ }
1795
+
1796
+ export function deploymentInvokeMessageFunctionFromJSON(
1797
+ jsonString: string,
1798
+ ): SafeParseResult<DeploymentInvokeMessageFunction, SDKValidationError> {
1799
+ return safeParse(
1800
+ jsonString,
1801
+ (x) => DeploymentInvokeMessageFunction$inboundSchema.parse(JSON.parse(x)),
1802
+ `Failed to parse 'DeploymentInvokeMessageFunction' from JSON`,
1803
+ );
1804
+ }
1805
+
1806
+ /** @internal */
1807
+ export const DeploymentInvokeMessageToolCalls$inboundSchema: z.ZodType<
1808
+ DeploymentInvokeMessageToolCalls,
1809
+ z.ZodTypeDef,
1810
+ unknown
1811
+ > = z.object({
1812
+ id: z.string().optional(),
1813
+ index: z.number().optional(),
1814
+ type: DeploymentInvokeMessageType$inboundSchema,
1815
+ function: z.lazy(() => DeploymentInvokeMessageFunction$inboundSchema),
1816
+ });
1817
+
1818
+ /** @internal */
1819
+ export type DeploymentInvokeMessageToolCalls$Outbound = {
1820
+ id?: string | undefined;
1821
+ index?: number | undefined;
1822
+ type: string;
1823
+ function: DeploymentInvokeMessageFunction$Outbound;
1824
+ };
1825
+
1826
+ /** @internal */
1827
+ export const DeploymentInvokeMessageToolCalls$outboundSchema: z.ZodType<
1828
+ DeploymentInvokeMessageToolCalls$Outbound,
1829
+ z.ZodTypeDef,
1830
+ DeploymentInvokeMessageToolCalls
1831
+ > = z.object({
1832
+ id: z.string().optional(),
1833
+ index: z.number().optional(),
1834
+ type: DeploymentInvokeMessageType$outboundSchema,
1835
+ function: z.lazy(() => DeploymentInvokeMessageFunction$outboundSchema),
1836
+ });
1837
+
1838
+ /**
1839
+ * @internal
1840
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1841
+ */
1842
+ export namespace DeploymentInvokeMessageToolCalls$ {
1843
+ /** @deprecated use `DeploymentInvokeMessageToolCalls$inboundSchema` instead. */
1844
+ export const inboundSchema = DeploymentInvokeMessageToolCalls$inboundSchema;
1845
+ /** @deprecated use `DeploymentInvokeMessageToolCalls$outboundSchema` instead. */
1846
+ export const outboundSchema = DeploymentInvokeMessageToolCalls$outboundSchema;
1847
+ /** @deprecated use `DeploymentInvokeMessageToolCalls$Outbound` instead. */
1848
+ export type Outbound = DeploymentInvokeMessageToolCalls$Outbound;
1849
+ }
1850
+
1851
+ export function deploymentInvokeMessageToolCallsToJSON(
1852
+ deploymentInvokeMessageToolCalls: DeploymentInvokeMessageToolCalls,
1853
+ ): string {
1854
+ return JSON.stringify(
1855
+ DeploymentInvokeMessageToolCalls$outboundSchema.parse(
1856
+ deploymentInvokeMessageToolCalls,
1857
+ ),
1858
+ );
1859
+ }
1860
+
1861
+ export function deploymentInvokeMessageToolCallsFromJSON(
1862
+ jsonString: string,
1863
+ ): SafeParseResult<DeploymentInvokeMessageToolCalls, SDKValidationError> {
1864
+ return safeParse(
1865
+ jsonString,
1866
+ (x) => DeploymentInvokeMessageToolCalls$inboundSchema.parse(JSON.parse(x)),
1867
+ `Failed to parse 'DeploymentInvokeMessageToolCalls' from JSON`,
1868
+ );
1869
+ }
1870
+
1871
+ /** @internal */
1872
+ export const DeploymentInvokeMessage1$inboundSchema: z.ZodType<
1873
+ DeploymentInvokeMessage1,
1874
+ z.ZodTypeDef,
1875
+ unknown
1876
+ > = z.object({
1877
+ role: DeploymentInvokeMessageDeploymentsResponseRole$inboundSchema,
1878
+ content: z.nullable(z.string()).optional(),
1879
+ tool_calls: z.array(
1880
+ z.lazy(() => DeploymentInvokeMessageToolCalls$inboundSchema),
1881
+ ),
1882
+ }).transform((v) => {
1883
+ return remap$(v, {
1884
+ "tool_calls": "toolCalls",
1885
+ });
1886
+ });
1887
+
1888
+ /** @internal */
1889
+ export type DeploymentInvokeMessage1$Outbound = {
1890
+ role: string;
1891
+ content?: string | null | undefined;
1892
+ tool_calls: Array<DeploymentInvokeMessageToolCalls$Outbound>;
1893
+ };
1894
+
1895
+ /** @internal */
1896
+ export const DeploymentInvokeMessage1$outboundSchema: z.ZodType<
1897
+ DeploymentInvokeMessage1$Outbound,
1898
+ z.ZodTypeDef,
1899
+ DeploymentInvokeMessage1
1900
+ > = z.object({
1901
+ role: DeploymentInvokeMessageDeploymentsResponseRole$outboundSchema,
1902
+ content: z.nullable(z.string()).optional(),
1903
+ toolCalls: z.array(
1904
+ z.lazy(() => DeploymentInvokeMessageToolCalls$outboundSchema),
1905
+ ),
1906
+ }).transform((v) => {
1907
+ return remap$(v, {
1908
+ toolCalls: "tool_calls",
1909
+ });
1910
+ });
1911
+
1912
+ /**
1913
+ * @internal
1914
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1915
+ */
1916
+ export namespace DeploymentInvokeMessage1$ {
1917
+ /** @deprecated use `DeploymentInvokeMessage1$inboundSchema` instead. */
1918
+ export const inboundSchema = DeploymentInvokeMessage1$inboundSchema;
1919
+ /** @deprecated use `DeploymentInvokeMessage1$outboundSchema` instead. */
1920
+ export const outboundSchema = DeploymentInvokeMessage1$outboundSchema;
1921
+ /** @deprecated use `DeploymentInvokeMessage1$Outbound` instead. */
1922
+ export type Outbound = DeploymentInvokeMessage1$Outbound;
1923
+ }
1924
+
1925
+ export function deploymentInvokeMessage1ToJSON(
1926
+ deploymentInvokeMessage1: DeploymentInvokeMessage1,
1927
+ ): string {
1928
+ return JSON.stringify(
1929
+ DeploymentInvokeMessage1$outboundSchema.parse(deploymentInvokeMessage1),
1930
+ );
1931
+ }
1932
+
1933
+ export function deploymentInvokeMessage1FromJSON(
1934
+ jsonString: string,
1935
+ ): SafeParseResult<DeploymentInvokeMessage1, SDKValidationError> {
1936
+ return safeParse(
1937
+ jsonString,
1938
+ (x) => DeploymentInvokeMessage1$inboundSchema.parse(JSON.parse(x)),
1939
+ `Failed to parse 'DeploymentInvokeMessage1' from JSON`,
1940
+ );
1941
+ }
1942
+
1943
+ /** @internal */
1944
+ export const DeploymentInvokeMessage$inboundSchema: z.ZodType<
1945
+ DeploymentInvokeMessage,
1946
+ z.ZodTypeDef,
1947
+ unknown
1948
+ > = z.union([
1949
+ z.lazy(() => DeploymentInvokeMessage2$inboundSchema),
1950
+ z.lazy(() => Message3$inboundSchema),
1951
+ z.lazy(() => DeploymentInvokeMessage1$inboundSchema),
1952
+ ]);
1953
+
1954
+ /** @internal */
1955
+ export type DeploymentInvokeMessage$Outbound =
1956
+ | DeploymentInvokeMessage2$Outbound
1957
+ | Message3$Outbound
1958
+ | DeploymentInvokeMessage1$Outbound;
1959
+
1960
+ /** @internal */
1961
+ export const DeploymentInvokeMessage$outboundSchema: z.ZodType<
1962
+ DeploymentInvokeMessage$Outbound,
1963
+ z.ZodTypeDef,
1964
+ DeploymentInvokeMessage
1965
+ > = z.union([
1966
+ z.lazy(() => DeploymentInvokeMessage2$outboundSchema),
1967
+ z.lazy(() => Message3$outboundSchema),
1968
+ z.lazy(() => DeploymentInvokeMessage1$outboundSchema),
1969
+ ]);
1970
+
1971
+ /**
1972
+ * @internal
1973
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1974
+ */
1975
+ export namespace DeploymentInvokeMessage$ {
1976
+ /** @deprecated use `DeploymentInvokeMessage$inboundSchema` instead. */
1977
+ export const inboundSchema = DeploymentInvokeMessage$inboundSchema;
1978
+ /** @deprecated use `DeploymentInvokeMessage$outboundSchema` instead. */
1979
+ export const outboundSchema = DeploymentInvokeMessage$outboundSchema;
1980
+ /** @deprecated use `DeploymentInvokeMessage$Outbound` instead. */
1981
+ export type Outbound = DeploymentInvokeMessage$Outbound;
1982
+ }
1983
+
1984
+ export function deploymentInvokeMessageToJSON(
1985
+ deploymentInvokeMessage: DeploymentInvokeMessage,
1986
+ ): string {
1987
+ return JSON.stringify(
1988
+ DeploymentInvokeMessage$outboundSchema.parse(deploymentInvokeMessage),
1989
+ );
1990
+ }
1991
+
1992
+ export function deploymentInvokeMessageFromJSON(
1993
+ jsonString: string,
1994
+ ): SafeParseResult<DeploymentInvokeMessage, SDKValidationError> {
1995
+ return safeParse(
1996
+ jsonString,
1997
+ (x) => DeploymentInvokeMessage$inboundSchema.parse(JSON.parse(x)),
1998
+ `Failed to parse 'DeploymentInvokeMessage' from JSON`,
1999
+ );
2000
+ }
2001
+
2002
+ /** @internal */
2003
+ export const DeploymentInvokeChoices$inboundSchema: z.ZodType<
2004
+ DeploymentInvokeChoices,
2005
+ z.ZodTypeDef,
2006
+ unknown
2007
+ > = z.object({
2008
+ index: z.number(),
2009
+ message: z.union([
2010
+ z.lazy(() => DeploymentInvokeMessage2$inboundSchema),
2011
+ z.lazy(() => Message3$inboundSchema),
2012
+ z.lazy(() => DeploymentInvokeMessage1$inboundSchema),
2013
+ ]).optional(),
2014
+ finish_reason: z.nullable(z.string()).optional(),
2015
+ }).transform((v) => {
2016
+ return remap$(v, {
2017
+ "finish_reason": "finishReason",
2018
+ });
2019
+ });
2020
+
2021
+ /** @internal */
2022
+ export type DeploymentInvokeChoices$Outbound = {
2023
+ index: number;
2024
+ message?:
2025
+ | DeploymentInvokeMessage2$Outbound
2026
+ | Message3$Outbound
2027
+ | DeploymentInvokeMessage1$Outbound
2028
+ | undefined;
2029
+ finish_reason?: string | null | undefined;
2030
+ };
2031
+
2032
+ /** @internal */
2033
+ export const DeploymentInvokeChoices$outboundSchema: z.ZodType<
2034
+ DeploymentInvokeChoices$Outbound,
2035
+ z.ZodTypeDef,
2036
+ DeploymentInvokeChoices
2037
+ > = z.object({
2038
+ index: z.number(),
2039
+ message: z.union([
2040
+ z.lazy(() => DeploymentInvokeMessage2$outboundSchema),
2041
+ z.lazy(() => Message3$outboundSchema),
2042
+ z.lazy(() => DeploymentInvokeMessage1$outboundSchema),
2043
+ ]).optional(),
2044
+ finishReason: z.nullable(z.string()).optional(),
2045
+ }).transform((v) => {
2046
+ return remap$(v, {
2047
+ finishReason: "finish_reason",
2048
+ });
2049
+ });
2050
+
2051
+ /**
2052
+ * @internal
2053
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2054
+ */
2055
+ export namespace DeploymentInvokeChoices$ {
2056
+ /** @deprecated use `DeploymentInvokeChoices$inboundSchema` instead. */
2057
+ export const inboundSchema = DeploymentInvokeChoices$inboundSchema;
2058
+ /** @deprecated use `DeploymentInvokeChoices$outboundSchema` instead. */
2059
+ export const outboundSchema = DeploymentInvokeChoices$outboundSchema;
2060
+ /** @deprecated use `DeploymentInvokeChoices$Outbound` instead. */
2061
+ export type Outbound = DeploymentInvokeChoices$Outbound;
2062
+ }
2063
+
2064
+ export function deploymentInvokeChoicesToJSON(
2065
+ deploymentInvokeChoices: DeploymentInvokeChoices,
2066
+ ): string {
2067
+ return JSON.stringify(
2068
+ DeploymentInvokeChoices$outboundSchema.parse(deploymentInvokeChoices),
2069
+ );
2070
+ }
2071
+
2072
+ export function deploymentInvokeChoicesFromJSON(
2073
+ jsonString: string,
2074
+ ): SafeParseResult<DeploymentInvokeChoices, SDKValidationError> {
2075
+ return safeParse(
2076
+ jsonString,
2077
+ (x) => DeploymentInvokeChoices$inboundSchema.parse(JSON.parse(x)),
2078
+ `Failed to parse 'DeploymentInvokeChoices' from JSON`,
2079
+ );
2080
+ }
2081
+
2082
+ /** @internal */
2083
+ export const DeploymentInvokeMetadata$inboundSchema: z.ZodType<
2084
+ DeploymentInvokeMetadata,
2085
+ z.ZodTypeDef,
2086
+ unknown
2087
+ > = z.object({
2088
+ file_name: z.string(),
2089
+ page_number: z.nullable(z.number()),
2090
+ file_type: z.string(),
2091
+ rerank_score: z.number().optional(),
2092
+ search_score: z.number(),
2093
+ }).transform((v) => {
2094
+ return remap$(v, {
2095
+ "file_name": "fileName",
2096
+ "page_number": "pageNumber",
2097
+ "file_type": "fileType",
2098
+ "rerank_score": "rerankScore",
2099
+ "search_score": "searchScore",
2100
+ });
2101
+ });
2102
+
2103
+ /** @internal */
2104
+ export type DeploymentInvokeMetadata$Outbound = {
2105
+ file_name: string;
2106
+ page_number: number | null;
2107
+ file_type: string;
2108
+ rerank_score?: number | undefined;
2109
+ search_score: number;
2110
+ };
2111
+
2112
+ /** @internal */
2113
+ export const DeploymentInvokeMetadata$outboundSchema: z.ZodType<
2114
+ DeploymentInvokeMetadata$Outbound,
2115
+ z.ZodTypeDef,
2116
+ DeploymentInvokeMetadata
2117
+ > = z.object({
2118
+ fileName: z.string(),
2119
+ pageNumber: z.nullable(z.number()),
2120
+ fileType: z.string(),
2121
+ rerankScore: z.number().optional(),
2122
+ searchScore: z.number(),
2123
+ }).transform((v) => {
2124
+ return remap$(v, {
2125
+ fileName: "file_name",
2126
+ pageNumber: "page_number",
2127
+ fileType: "file_type",
2128
+ rerankScore: "rerank_score",
2129
+ searchScore: "search_score",
2130
+ });
2131
+ });
2132
+
2133
+ /**
2134
+ * @internal
2135
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2136
+ */
2137
+ export namespace DeploymentInvokeMetadata$ {
2138
+ /** @deprecated use `DeploymentInvokeMetadata$inboundSchema` instead. */
2139
+ export const inboundSchema = DeploymentInvokeMetadata$inboundSchema;
2140
+ /** @deprecated use `DeploymentInvokeMetadata$outboundSchema` instead. */
2141
+ export const outboundSchema = DeploymentInvokeMetadata$outboundSchema;
2142
+ /** @deprecated use `DeploymentInvokeMetadata$Outbound` instead. */
2143
+ export type Outbound = DeploymentInvokeMetadata$Outbound;
2144
+ }
2145
+
2146
+ export function deploymentInvokeMetadataToJSON(
2147
+ deploymentInvokeMetadata: DeploymentInvokeMetadata,
2148
+ ): string {
2149
+ return JSON.stringify(
2150
+ DeploymentInvokeMetadata$outboundSchema.parse(deploymentInvokeMetadata),
2151
+ );
2152
+ }
2153
+
2154
+ export function deploymentInvokeMetadataFromJSON(
2155
+ jsonString: string,
2156
+ ): SafeParseResult<DeploymentInvokeMetadata, SDKValidationError> {
2157
+ return safeParse(
2158
+ jsonString,
2159
+ (x) => DeploymentInvokeMetadata$inboundSchema.parse(JSON.parse(x)),
2160
+ `Failed to parse 'DeploymentInvokeMetadata' from JSON`,
2161
+ );
2162
+ }
2163
+
2164
+ /** @internal */
2165
+ export const Retrievals$inboundSchema: z.ZodType<
2166
+ Retrievals,
2167
+ z.ZodTypeDef,
2168
+ unknown
2169
+ > = z.object({
2170
+ document: z.string(),
2171
+ metadata: z.lazy(() => DeploymentInvokeMetadata$inboundSchema),
2172
+ });
2173
+
2174
+ /** @internal */
2175
+ export type Retrievals$Outbound = {
2176
+ document: string;
2177
+ metadata: DeploymentInvokeMetadata$Outbound;
2178
+ };
2179
+
2180
+ /** @internal */
2181
+ export const Retrievals$outboundSchema: z.ZodType<
2182
+ Retrievals$Outbound,
2183
+ z.ZodTypeDef,
2184
+ Retrievals
2185
+ > = z.object({
2186
+ document: z.string(),
2187
+ metadata: z.lazy(() => DeploymentInvokeMetadata$outboundSchema),
2188
+ });
2189
+
2190
+ /**
2191
+ * @internal
2192
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2193
+ */
2194
+ export namespace Retrievals$ {
2195
+ /** @deprecated use `Retrievals$inboundSchema` instead. */
2196
+ export const inboundSchema = Retrievals$inboundSchema;
2197
+ /** @deprecated use `Retrievals$outboundSchema` instead. */
2198
+ export const outboundSchema = Retrievals$outboundSchema;
2199
+ /** @deprecated use `Retrievals$Outbound` instead. */
2200
+ export type Outbound = Retrievals$Outbound;
2201
+ }
2202
+
2203
+ export function retrievalsToJSON(retrievals: Retrievals): string {
2204
+ return JSON.stringify(Retrievals$outboundSchema.parse(retrievals));
2205
+ }
2206
+
2207
+ export function retrievalsFromJSON(
2208
+ jsonString: string,
2209
+ ): SafeParseResult<Retrievals, SDKValidationError> {
2210
+ return safeParse(
2211
+ jsonString,
2212
+ (x) => Retrievals$inboundSchema.parse(JSON.parse(x)),
2213
+ `Failed to parse 'Retrievals' from JSON`,
2214
+ );
2215
+ }
2216
+
2217
+ /** @internal */
2218
+ export const DeploymentInvokeResponseBody$inboundSchema: z.ZodType<
2219
+ DeploymentInvokeResponseBody,
2220
+ z.ZodTypeDef,
2221
+ unknown
2222
+ > = z.object({
2223
+ id: z.string(),
2224
+ created: z.string().datetime({ offset: true }).transform(v => new Date(v)),
2225
+ object: DeploymentInvokeObject$inboundSchema,
2226
+ model: z.string(),
2227
+ provider: DeploymentInvokeProvider$inboundSchema,
2228
+ is_final: z.boolean(),
2229
+ integration_id: z.string().optional(),
2230
+ finalized: z.string().datetime({ offset: true }).transform(v => new Date(v))
2231
+ .optional(),
2232
+ system_fingerprint: z.nullable(z.string()).optional(),
2233
+ choices: z.array(z.lazy(() => DeploymentInvokeChoices$inboundSchema)),
2234
+ retrievals: z.array(z.lazy(() => Retrievals$inboundSchema)).optional(),
2235
+ provider_response: z.any().optional(),
2236
+ }).transform((v) => {
2237
+ return remap$(v, {
2238
+ "is_final": "isFinal",
2239
+ "integration_id": "integrationId",
2240
+ "system_fingerprint": "systemFingerprint",
2241
+ "provider_response": "providerResponse",
2242
+ });
2243
+ });
2244
+
2245
+ /** @internal */
2246
+ export type DeploymentInvokeResponseBody$Outbound = {
2247
+ id: string;
2248
+ created: string;
2249
+ object: string;
2250
+ model: string;
2251
+ provider: string;
2252
+ is_final: boolean;
2253
+ integration_id?: string | undefined;
2254
+ finalized?: string | undefined;
2255
+ system_fingerprint?: string | null | undefined;
2256
+ choices: Array<DeploymentInvokeChoices$Outbound>;
2257
+ retrievals?: Array<Retrievals$Outbound> | undefined;
2258
+ provider_response?: any | undefined;
2259
+ };
2260
+
2261
+ /** @internal */
2262
+ export const DeploymentInvokeResponseBody$outboundSchema: z.ZodType<
2263
+ DeploymentInvokeResponseBody$Outbound,
2264
+ z.ZodTypeDef,
2265
+ DeploymentInvokeResponseBody
2266
+ > = z.object({
2267
+ id: z.string(),
2268
+ created: z.date().transform(v => v.toISOString()),
2269
+ object: DeploymentInvokeObject$outboundSchema,
2270
+ model: z.string(),
2271
+ provider: DeploymentInvokeProvider$outboundSchema,
2272
+ isFinal: z.boolean(),
2273
+ integrationId: z.string().optional(),
2274
+ finalized: z.date().transform(v => v.toISOString()).optional(),
2275
+ systemFingerprint: z.nullable(z.string()).optional(),
2276
+ choices: z.array(z.lazy(() => DeploymentInvokeChoices$outboundSchema)),
2277
+ retrievals: z.array(z.lazy(() => Retrievals$outboundSchema)).optional(),
2278
+ providerResponse: z.any().optional(),
2279
+ }).transform((v) => {
2280
+ return remap$(v, {
2281
+ isFinal: "is_final",
2282
+ integrationId: "integration_id",
2283
+ systemFingerprint: "system_fingerprint",
2284
+ providerResponse: "provider_response",
2285
+ });
2286
+ });
2287
+
2288
+ /**
2289
+ * @internal
2290
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2291
+ */
2292
+ export namespace DeploymentInvokeResponseBody$ {
2293
+ /** @deprecated use `DeploymentInvokeResponseBody$inboundSchema` instead. */
2294
+ export const inboundSchema = DeploymentInvokeResponseBody$inboundSchema;
2295
+ /** @deprecated use `DeploymentInvokeResponseBody$outboundSchema` instead. */
2296
+ export const outboundSchema = DeploymentInvokeResponseBody$outboundSchema;
2297
+ /** @deprecated use `DeploymentInvokeResponseBody$Outbound` instead. */
2298
+ export type Outbound = DeploymentInvokeResponseBody$Outbound;
2299
+ }
2300
+
2301
+ export function deploymentInvokeResponseBodyToJSON(
2302
+ deploymentInvokeResponseBody: DeploymentInvokeResponseBody,
2303
+ ): string {
2304
+ return JSON.stringify(
2305
+ DeploymentInvokeResponseBody$outboundSchema.parse(
2306
+ deploymentInvokeResponseBody,
2307
+ ),
2308
+ );
2309
+ }
2310
+
2311
+ export function deploymentInvokeResponseBodyFromJSON(
2312
+ jsonString: string,
2313
+ ): SafeParseResult<DeploymentInvokeResponseBody, SDKValidationError> {
2314
+ return safeParse(
2315
+ jsonString,
2316
+ (x) => DeploymentInvokeResponseBody$inboundSchema.parse(JSON.parse(x)),
2317
+ `Failed to parse 'DeploymentInvokeResponseBody' from JSON`,
2318
+ );
2319
+ }
2320
+
2321
+ /** @internal */
2322
+ export const DeploymentInvokeResponse$inboundSchema: z.ZodType<
2323
+ DeploymentInvokeResponse,
2324
+ z.ZodTypeDef,
2325
+ unknown
2326
+ > = z.union([
2327
+ z.lazy(() => DeploymentInvokeResponseBody$inboundSchema),
2328
+ z.instanceof(ReadableStream<Uint8Array>).transform(stream => {
2329
+ return new EventStream({
2330
+ stream,
2331
+ decoder(rawEvent) {
2332
+ const schema = z.lazy(() =>
2333
+ DeploymentInvokeDeploymentsResponseBody$inboundSchema
2334
+ );
2335
+ return schema.parse(rawEvent);
2336
+ },
2337
+ });
2338
+ }),
2339
+ ]);
2340
+
2341
+ /** @internal */
2342
+ export type DeploymentInvokeResponse$Outbound =
2343
+ | DeploymentInvokeResponseBody$Outbound
2344
+ | never;
2345
+
2346
+ /** @internal */
2347
+ export const DeploymentInvokeResponse$outboundSchema: z.ZodType<
2348
+ DeploymentInvokeResponse$Outbound,
2349
+ z.ZodTypeDef,
2350
+ DeploymentInvokeResponse
2351
+ > = z.union([
2352
+ z.lazy(() => DeploymentInvokeResponseBody$outboundSchema),
2353
+ z.never(),
2354
+ ]);
2355
+
2356
+ /**
2357
+ * @internal
2358
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2359
+ */
2360
+ export namespace DeploymentInvokeResponse$ {
2361
+ /** @deprecated use `DeploymentInvokeResponse$inboundSchema` instead. */
2362
+ export const inboundSchema = DeploymentInvokeResponse$inboundSchema;
2363
+ /** @deprecated use `DeploymentInvokeResponse$outboundSchema` instead. */
2364
+ export const outboundSchema = DeploymentInvokeResponse$outboundSchema;
2365
+ /** @deprecated use `DeploymentInvokeResponse$Outbound` instead. */
2366
+ export type Outbound = DeploymentInvokeResponse$Outbound;
2367
+ }
2368
+
2369
+ export function deploymentInvokeResponseToJSON(
2370
+ deploymentInvokeResponse: DeploymentInvokeResponse,
2371
+ ): string {
2372
+ return JSON.stringify(
2373
+ DeploymentInvokeResponse$outboundSchema.parse(deploymentInvokeResponse),
2374
+ );
2375
+ }
2376
+
2377
+ export function deploymentInvokeResponseFromJSON(
2378
+ jsonString: string,
2379
+ ): SafeParseResult<DeploymentInvokeResponse, SDKValidationError> {
2380
+ return safeParse(
2381
+ jsonString,
2382
+ (x) => DeploymentInvokeResponse$inboundSchema.parse(JSON.parse(x)),
2383
+ `Failed to parse 'DeploymentInvokeResponse' from JSON`,
2384
+ );
2385
+ }