@orq-ai/node 3.0.1 → 3.1.0-rc.7

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 (300) hide show
  1. package/README.md +11 -9
  2. package/docs/sdks/deployments/README.md +195 -5
  3. package/docs/sdks/files/README.md +8 -4
  4. package/funcs/contactsCreate.d.ts.map +1 -1
  5. package/funcs/contactsCreate.js +1 -1
  6. package/funcs/contactsCreate.js.map +1 -1
  7. package/funcs/deploymentsGetConfig.d.ts.map +1 -1
  8. package/funcs/deploymentsGetConfig.js +1 -1
  9. package/funcs/deploymentsGetConfig.js.map +1 -1
  10. package/funcs/deploymentsGetLogs.d.ts +15 -0
  11. package/funcs/deploymentsGetLogs.d.ts.map +1 -0
  12. package/funcs/deploymentsGetLogs.js +113 -0
  13. package/funcs/deploymentsGetLogs.js.map +1 -0
  14. package/funcs/deploymentsInvalidate.d.ts +15 -0
  15. package/funcs/deploymentsInvalidate.d.ts.map +1 -0
  16. package/funcs/deploymentsInvalidate.js +113 -0
  17. package/funcs/deploymentsInvalidate.js.map +1 -0
  18. package/funcs/deploymentsInvoke.d.ts.map +1 -1
  19. package/funcs/deploymentsInvoke.js +1 -1
  20. package/funcs/deploymentsInvoke.js.map +1 -1
  21. package/funcs/{deploymentsAll.d.ts → deploymentsList.d.ts} +2 -2
  22. package/funcs/deploymentsList.d.ts.map +1 -0
  23. package/funcs/{deploymentsAll.js → deploymentsList.js} +6 -5
  24. package/funcs/deploymentsList.js.map +1 -0
  25. package/funcs/deploymentsMetricsCreate.d.ts.map +1 -1
  26. package/funcs/deploymentsMetricsCreate.js +1 -1
  27. package/funcs/deploymentsMetricsCreate.js.map +1 -1
  28. package/funcs/feedbackCreate.d.ts.map +1 -1
  29. package/funcs/feedbackCreate.js +1 -1
  30. package/funcs/feedbackCreate.js.map +1 -1
  31. package/funcs/filesBulkUpload.d.ts.map +1 -1
  32. package/funcs/filesBulkUpload.js +1 -1
  33. package/funcs/filesBulkUpload.js.map +1 -1
  34. package/funcs/filesDelete.d.ts.map +1 -1
  35. package/funcs/filesDelete.js +1 -1
  36. package/funcs/filesDelete.js.map +1 -1
  37. package/funcs/filesGet.d.ts.map +1 -1
  38. package/funcs/filesGet.js +1 -1
  39. package/funcs/filesGet.js.map +1 -1
  40. package/funcs/filesList.d.ts.map +1 -1
  41. package/funcs/filesList.js +1 -1
  42. package/funcs/filesList.js.map +1 -1
  43. package/funcs/filesUpdate.d.ts.map +1 -1
  44. package/funcs/filesUpdate.js +1 -1
  45. package/funcs/filesUpdate.js.map +1 -1
  46. package/funcs/filesUpload.d.ts.map +1 -1
  47. package/funcs/filesUpload.js +1 -1
  48. package/funcs/filesUpload.js.map +1 -1
  49. package/funcs/promptSnippetsFindOne.d.ts.map +1 -1
  50. package/funcs/promptSnippetsFindOne.js +1 -1
  51. package/funcs/promptSnippetsFindOne.js.map +1 -1
  52. package/funcs/promptTemplatesGetAll.d.ts.map +1 -1
  53. package/funcs/promptTemplatesGetAll.js +1 -1
  54. package/funcs/promptTemplatesGetAll.js.map +1 -1
  55. package/funcs/promptsCreate.d.ts.map +1 -1
  56. package/funcs/promptsCreate.js +1 -1
  57. package/funcs/promptsCreate.js.map +1 -1
  58. package/funcs/promptsCreateVersion.d.ts.map +1 -1
  59. package/funcs/promptsCreateVersion.js +1 -1
  60. package/funcs/promptsCreateVersion.js.map +1 -1
  61. package/funcs/promptsDelete.d.ts.map +1 -1
  62. package/funcs/promptsDelete.js +1 -1
  63. package/funcs/promptsDelete.js.map +1 -1
  64. package/funcs/promptsDuplicate.d.ts.map +1 -1
  65. package/funcs/promptsDuplicate.js +1 -1
  66. package/funcs/promptsDuplicate.js.map +1 -1
  67. package/funcs/promptsGetAll.d.ts.map +1 -1
  68. package/funcs/promptsGetAll.js +1 -1
  69. package/funcs/promptsGetAll.js.map +1 -1
  70. package/funcs/promptsGetOne.d.ts.map +1 -1
  71. package/funcs/promptsGetOne.js +1 -1
  72. package/funcs/promptsGetOne.js.map +1 -1
  73. package/funcs/promptsUpdate.d.ts.map +1 -1
  74. package/funcs/promptsUpdate.js +1 -1
  75. package/funcs/promptsUpdate.js.map +1 -1
  76. package/funcs/remoteconfigGetConfig.d.ts.map +1 -1
  77. package/funcs/remoteconfigGetConfig.js +1 -1
  78. package/funcs/remoteconfigGetConfig.js.map +1 -1
  79. package/jsr.json +28 -0
  80. package/lib/config.d.ts +3 -3
  81. package/lib/config.js +3 -3
  82. package/lib/config.js.map +1 -1
  83. package/lib/schemas.d.ts +1 -1
  84. package/lib/schemas.d.ts.map +1 -1
  85. package/lib/schemas.js +4 -1
  86. package/lib/schemas.js.map +1 -1
  87. package/models/operations/bulkfileupload.js +2 -2
  88. package/models/operations/createcontact.js +2 -2
  89. package/models/operations/createprompt.d.ts +12 -0
  90. package/models/operations/createprompt.d.ts.map +1 -1
  91. package/models/operations/createprompt.js +4 -0
  92. package/models/operations/createprompt.js.map +1 -1
  93. package/models/operations/createpromptversion.d.ts +12 -0
  94. package/models/operations/createpromptversion.d.ts.map +1 -1
  95. package/models/operations/createpromptversion.js +4 -0
  96. package/models/operations/createpromptversion.js.map +1 -1
  97. package/models/operations/deploymentgetlogs.d.ts +52406 -0
  98. package/models/operations/deploymentgetlogs.d.ts.map +1 -0
  99. package/models/operations/deploymentgetlogs.js +53803 -0
  100. package/models/operations/deploymentgetlogs.js.map +1 -0
  101. package/models/operations/deploymentinvoke.d.ts +6 -0
  102. package/models/operations/deploymentinvoke.d.ts.map +1 -1
  103. package/models/operations/deploymentinvoke.js +2 -0
  104. package/models/operations/deploymentinvoke.js.map +1 -1
  105. package/models/operations/deployments.d.ts +15 -8
  106. package/models/operations/deployments.d.ts.map +1 -1
  107. package/models/operations/deployments.js +16 -10
  108. package/models/operations/deployments.js.map +1 -1
  109. package/models/operations/fileget.js +2 -2
  110. package/models/operations/filelist.d.ts +1 -5
  111. package/models/operations/filelist.d.ts.map +1 -1
  112. package/models/operations/filelist.js +4 -12
  113. package/models/operations/filelist.js.map +1 -1
  114. package/models/operations/fileupdate.js +2 -2
  115. package/models/operations/fileupload.js +2 -2
  116. package/models/operations/findonepromptsnippet.d.ts +36 -0
  117. package/models/operations/findonepromptsnippet.d.ts.map +1 -1
  118. package/models/operations/findonepromptsnippet.js +18 -6
  119. package/models/operations/findonepromptsnippet.js.map +1 -1
  120. package/models/operations/getallprompts.d.ts +944 -912
  121. package/models/operations/getallprompts.d.ts.map +1 -1
  122. package/models/operations/getallprompts.js +1372 -1362
  123. package/models/operations/getallprompts.js.map +1 -1
  124. package/models/operations/getallprompttemplates.d.ts +151 -115
  125. package/models/operations/getallprompttemplates.d.ts.map +1 -1
  126. package/models/operations/getallprompttemplates.js +182 -173
  127. package/models/operations/getallprompttemplates.js.map +1 -1
  128. package/models/operations/index.d.ts +2 -0
  129. package/models/operations/index.d.ts.map +1 -1
  130. package/models/operations/index.js +2 -0
  131. package/models/operations/index.js.map +1 -1
  132. package/models/operations/invaliddeployment.d.ts +29 -0
  133. package/models/operations/invaliddeployment.d.ts.map +1 -0
  134. package/models/operations/invaliddeployment.js +78 -0
  135. package/models/operations/invaliddeployment.js.map +1 -0
  136. package/models/operations/updateprompt.d.ts +42 -0
  137. package/models/operations/updateprompt.d.ts.map +1 -1
  138. package/models/operations/updateprompt.js +20 -6
  139. package/models/operations/updateprompt.js.map +1 -1
  140. package/package.json +3 -2
  141. package/sdk/deployments.d.ts +15 -1
  142. package/sdk/deployments.d.ts.map +1 -1
  143. package/sdk/deployments.js +23 -3
  144. package/sdk/deployments.js.map +1 -1
  145. package/src/funcs/contactsCreate.ts +2 -1
  146. package/src/funcs/deploymentsGetConfig.ts +2 -1
  147. package/{packages/orq-rc/src/funcs/deploymentsMetricsCreate.ts → src/funcs/deploymentsGetLogs.ts} +17 -16
  148. package/{packages/orq-rc/src/funcs/promptsDelete.ts → src/funcs/deploymentsInvalidate.ts} +18 -11
  149. package/src/funcs/deploymentsInvoke.ts +2 -1
  150. package/src/funcs/{deploymentsAll.ts → deploymentsList.ts} +5 -3
  151. package/src/funcs/deploymentsMetricsCreate.ts +2 -1
  152. package/src/funcs/feedbackCreate.ts +2 -1
  153. package/src/funcs/filesBulkUpload.ts +2 -1
  154. package/src/funcs/filesDelete.ts +2 -1
  155. package/src/funcs/filesGet.ts +2 -1
  156. package/src/funcs/filesList.ts +2 -1
  157. package/src/funcs/filesUpdate.ts +2 -1
  158. package/src/funcs/filesUpload.ts +2 -1
  159. package/src/funcs/promptSnippetsFindOne.ts +2 -1
  160. package/src/funcs/promptTemplatesGetAll.ts +2 -1
  161. package/src/funcs/promptsCreate.ts +2 -1
  162. package/src/funcs/promptsCreateVersion.ts +2 -1
  163. package/src/funcs/promptsDelete.ts +2 -1
  164. package/src/funcs/promptsDuplicate.ts +2 -1
  165. package/src/funcs/promptsGetAll.ts +2 -1
  166. package/src/funcs/promptsGetOne.ts +2 -1
  167. package/src/funcs/promptsUpdate.ts +2 -1
  168. package/src/funcs/remoteconfigGetConfig.ts +2 -1
  169. package/src/lib/config.ts +3 -3
  170. package/src/lib/schemas.ts +5 -0
  171. package/src/models/operations/bulkfileupload.ts +2 -2
  172. package/src/models/operations/createcontact.ts +2 -2
  173. package/src/models/operations/createprompt.ts +4 -0
  174. package/src/models/operations/createpromptversion.ts +4 -0
  175. package/src/models/operations/deploymentgetlogs.ts +119430 -0
  176. package/src/models/operations/deploymentinvoke.ts +2 -0
  177. package/src/models/operations/deployments.ts +25 -18
  178. package/src/models/operations/fileget.ts +2 -2
  179. package/src/models/operations/filelist.ts +5 -17
  180. package/src/models/operations/fileupdate.ts +2 -2
  181. package/src/models/operations/fileupload.ts +2 -2
  182. package/src/models/operations/findonepromptsnippet.ts +18 -6
  183. package/src/models/operations/getallprompts.ts +2464 -2159
  184. package/src/models/operations/getallprompttemplates.ts +321 -232
  185. package/src/models/operations/index.ts +2 -0
  186. package/src/models/operations/invaliddeployment.ts +75 -0
  187. package/src/models/operations/updateprompt.ts +20 -6
  188. package/src/sdk/deployments.ts +39 -3
  189. package/tsconfig.json +41 -0
  190. package/funcs/deploymentsAll.d.ts.map +0 -1
  191. package/funcs/deploymentsAll.js.map +0 -1
  192. package/packages/orq-rc/FUNCTIONS.md +0 -106
  193. package/packages/orq-rc/README.md +0 -564
  194. package/packages/orq-rc/RUNTIMES.md +0 -22
  195. package/packages/orq-rc/docs/sdks/contacts/README.md +0 -84
  196. package/packages/orq-rc/docs/sdks/deployments/README.md +0 -239
  197. package/packages/orq-rc/docs/sdks/feedback/README.md +0 -92
  198. package/packages/orq-rc/docs/sdks/files/README.md +0 -473
  199. package/packages/orq-rc/docs/sdks/metrics/README.md +0 -86
  200. package/packages/orq-rc/docs/sdks/orq/README.md +0 -10
  201. package/packages/orq-rc/docs/sdks/prompt/README.md +0 -6
  202. package/packages/orq-rc/docs/sdks/prompts/README.md +0 -533
  203. package/packages/orq-rc/docs/sdks/remoteconfig/README.md +0 -80
  204. package/packages/orq-rc/docs/sdks/snippets/README.md +0 -84
  205. package/packages/orq-rc/docs/sdks/templates/README.md +0 -80
  206. package/packages/orq-rc/src/core.ts +0 -13
  207. package/packages/orq-rc/src/funcs/contactsCreate.ts +0 -124
  208. package/packages/orq-rc/src/funcs/deploymentsAll.ts +0 -138
  209. package/packages/orq-rc/src/funcs/deploymentsGetConfig.ts +0 -132
  210. package/packages/orq-rc/src/funcs/deploymentsInvoke.ts +0 -135
  211. package/packages/orq-rc/src/funcs/feedbackCreate.ts +0 -124
  212. package/packages/orq-rc/src/funcs/filesBulkUpload.ts +0 -126
  213. package/packages/orq-rc/src/funcs/filesDelete.ts +0 -128
  214. package/packages/orq-rc/src/funcs/filesGet.ts +0 -127
  215. package/packages/orq-rc/src/funcs/filesList.ts +0 -129
  216. package/packages/orq-rc/src/funcs/filesUpdate.ts +0 -128
  217. package/packages/orq-rc/src/funcs/filesUpload.ts +0 -145
  218. package/packages/orq-rc/src/funcs/promptSnippetsFindOne.ts +0 -128
  219. package/packages/orq-rc/src/funcs/promptTemplatesGetAll.ts +0 -130
  220. package/packages/orq-rc/src/funcs/promptsCreate.ts +0 -124
  221. package/packages/orq-rc/src/funcs/promptsCreateVersion.ts +0 -129
  222. package/packages/orq-rc/src/funcs/promptsDuplicate.ts +0 -128
  223. package/packages/orq-rc/src/funcs/promptsGetAll.ts +0 -126
  224. package/packages/orq-rc/src/funcs/promptsGetOne.ts +0 -128
  225. package/packages/orq-rc/src/funcs/promptsUpdate.ts +0 -136
  226. package/packages/orq-rc/src/funcs/remoteconfigGetConfig.ts +0 -125
  227. package/packages/orq-rc/src/hooks/hooks.ts +0 -132
  228. package/packages/orq-rc/src/hooks/index.ts +0 -6
  229. package/packages/orq-rc/src/hooks/registration.ts +0 -14
  230. package/packages/orq-rc/src/hooks/types.ts +0 -109
  231. package/packages/orq-rc/src/index.ts +0 -7
  232. package/packages/orq-rc/src/lib/base64.ts +0 -37
  233. package/packages/orq-rc/src/lib/config.ts +0 -60
  234. package/packages/orq-rc/src/lib/dlv.ts +0 -53
  235. package/packages/orq-rc/src/lib/encodings.ts +0 -449
  236. package/packages/orq-rc/src/lib/env.ts +0 -41
  237. package/packages/orq-rc/src/lib/event-streams.ts +0 -264
  238. package/packages/orq-rc/src/lib/files.ts +0 -40
  239. package/packages/orq-rc/src/lib/http.ts +0 -323
  240. package/packages/orq-rc/src/lib/is-plain-object.ts +0 -43
  241. package/packages/orq-rc/src/lib/logger.ts +0 -9
  242. package/packages/orq-rc/src/lib/matchers.ts +0 -325
  243. package/packages/orq-rc/src/lib/primitives.ts +0 -122
  244. package/packages/orq-rc/src/lib/retries.ts +0 -219
  245. package/packages/orq-rc/src/lib/schemas.ts +0 -86
  246. package/packages/orq-rc/src/lib/sdks.ts +0 -397
  247. package/packages/orq-rc/src/lib/security.ts +0 -254
  248. package/packages/orq-rc/src/lib/url.ts +0 -33
  249. package/packages/orq-rc/src/models/components/deployments.ts +0 -1673
  250. package/packages/orq-rc/src/models/components/index.ts +0 -6
  251. package/packages/orq-rc/src/models/components/security.ts +0 -71
  252. package/packages/orq-rc/src/models/errors/apierror.ts +0 -27
  253. package/packages/orq-rc/src/models/errors/honoapierror.ts +0 -82
  254. package/packages/orq-rc/src/models/errors/httpclienterrors.ts +0 -62
  255. package/packages/orq-rc/src/models/errors/index.ts +0 -9
  256. package/packages/orq-rc/src/models/errors/sdkvalidationerror.ts +0 -97
  257. package/packages/orq-rc/src/models/errors/updateprompt.ts +0 -71
  258. package/packages/orq-rc/src/models/operations/bulkfileupload.ts +0 -315
  259. package/packages/orq-rc/src/models/operations/createcontact.ts +0 -256
  260. package/packages/orq-rc/src/models/operations/createfeedback.ts +0 -286
  261. package/packages/orq-rc/src/models/operations/createprompt.ts +0 -3461
  262. package/packages/orq-rc/src/models/operations/createpromptversion.ts +0 -3703
  263. package/packages/orq-rc/src/models/operations/deleteprompt.ts +0 -69
  264. package/packages/orq-rc/src/models/operations/deploymentcreatemetric.ts +0 -1790
  265. package/packages/orq-rc/src/models/operations/deploymentgetconfig.ts +0 -3483
  266. package/packages/orq-rc/src/models/operations/deploymentinvoke.ts +0 -2385
  267. package/packages/orq-rc/src/models/operations/deployments.ts +0 -2098
  268. package/packages/orq-rc/src/models/operations/duplicateprompt.ts +0 -69
  269. package/packages/orq-rc/src/models/operations/filedelete.ts +0 -78
  270. package/packages/orq-rc/src/models/operations/fileget.ts +0 -222
  271. package/packages/orq-rc/src/models/operations/filelist.ts +0 -333
  272. package/packages/orq-rc/src/models/operations/fileupdate.ts +0 -298
  273. package/packages/orq-rc/src/models/operations/fileupload.ts +0 -322
  274. package/packages/orq-rc/src/models/operations/findonepromptsnippet.ts +0 -13629
  275. package/packages/orq-rc/src/models/operations/getallprompts.ts +0 -18640
  276. package/packages/orq-rc/src/models/operations/getallprompttemplates.ts +0 -13690
  277. package/packages/orq-rc/src/models/operations/getoneprompt.ts +0 -69
  278. package/packages/orq-rc/src/models/operations/index.ts +0 -26
  279. package/packages/orq-rc/src/models/operations/remoteconfigsgetconfig.ts +0 -190
  280. package/packages/orq-rc/src/models/operations/updateprompt.ts +0 -14407
  281. package/packages/orq-rc/src/sdk/contacts.ts +0 -27
  282. package/packages/orq-rc/src/sdk/deployments.ts +0 -75
  283. package/packages/orq-rc/src/sdk/feedback.ts +0 -27
  284. package/packages/orq-rc/src/sdk/files.ts +0 -105
  285. package/packages/orq-rc/src/sdk/index.ts +0 -5
  286. package/packages/orq-rc/src/sdk/metrics.ts +0 -27
  287. package/packages/orq-rc/src/sdk/prompt.ts +0 -19
  288. package/packages/orq-rc/src/sdk/prompts.ts +0 -114
  289. package/packages/orq-rc/src/sdk/remoteconfig.ts +0 -24
  290. package/packages/orq-rc/src/sdk/sdk.ts +0 -49
  291. package/packages/orq-rc/src/sdk/snippets.ts +0 -24
  292. package/packages/orq-rc/src/sdk/templates.ts +0 -24
  293. package/packages/orq-rc/src/types/blobs.ts +0 -31
  294. package/packages/orq-rc/src/types/constdatetime.ts +0 -15
  295. package/packages/orq-rc/src/types/enums.ts +0 -16
  296. package/packages/orq-rc/src/types/fp.ts +0 -50
  297. package/packages/orq-rc/src/types/index.ts +0 -11
  298. package/packages/orq-rc/src/types/operations.ts +0 -105
  299. package/packages/orq-rc/src/types/rfcdate.ts +0 -54
  300. package/packages/orq-rc/src/types/streams.ts +0 -21
@@ -1,1673 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod";
6
- import { remap as remap$ } from "../../lib/primitives.js";
7
- import { safeParse } from "../../lib/schemas.js";
8
- import { ClosedEnum } from "../../types/enums.js";
9
- import { Result as SafeParseResult } from "../../types/fp.js";
10
- import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
-
12
- export type Inputs = string | number | boolean;
13
-
14
- /**
15
- * The role of the prompt message
16
- */
17
- export const Role = {
18
- System: "system",
19
- Assistant: "assistant",
20
- User: "user",
21
- Exception: "exception",
22
- Tool: "tool",
23
- Prompt: "prompt",
24
- Correction: "correction",
25
- ExpectedOutput: "expected_output",
26
- } as const;
27
- /**
28
- * The role of the prompt message
29
- */
30
- export type Role = ClosedEnum<typeof Role>;
31
-
32
- export const TwoType = {
33
- ImageUrl: "image_url",
34
- } as const;
35
- export type TwoType = ClosedEnum<typeof TwoType>;
36
-
37
- export type ImageUrl = {
38
- /**
39
- * Either a URL of the image or the base64 encoded data URI.
40
- */
41
- url: string;
42
- /**
43
- * Specifies the detail level of the image. Currently only supported with OpenAI models
44
- */
45
- detail?: string | undefined;
46
- };
47
-
48
- /**
49
- * The image part of the prompt message. Only supported with vision models.
50
- */
51
- export type Two2 = {
52
- type: TwoType;
53
- imageUrl: ImageUrl;
54
- };
55
-
56
- export const Deployments2Type = {
57
- Text: "text",
58
- } as const;
59
- export type Deployments2Type = ClosedEnum<typeof Deployments2Type>;
60
-
61
- /**
62
- * Text content part of a prompt message
63
- */
64
- export type One = {
65
- type: Deployments2Type;
66
- text: string;
67
- };
68
-
69
- export type Two = One | Two2;
70
-
71
- /**
72
- * The contents of the user message. Either the text content of the message or an array of content parts with a defined type, each can be of type `text` or `image_url` when passing in images. You can pass multiple images by adding multiple `image_url` content parts.
73
- */
74
- export type Content = string | Array<One | Two2>;
75
-
76
- export const Type = {
77
- Function: "function",
78
- } as const;
79
- export type Type = ClosedEnum<typeof Type>;
80
-
81
- export type FunctionT = {
82
- name: string;
83
- /**
84
- * JSON string arguments for the functions
85
- */
86
- arguments: string;
87
- };
88
-
89
- export type ToolCalls = {
90
- id?: string | undefined;
91
- index?: number | undefined;
92
- type: Type;
93
- function: FunctionT;
94
- };
95
-
96
- export type PrefixMessages = {
97
- /**
98
- * The role of the prompt message
99
- */
100
- role: Role;
101
- /**
102
- * The contents of the user message. Either the text content of the message or an array of content parts with a defined type, each can be of type `text` or `image_url` when passing in images. You can pass multiple images by adding multiple `image_url` content parts.
103
- */
104
- content: string | Array<One | Two2>;
105
- toolCalls?: Array<ToolCalls> | undefined;
106
- };
107
-
108
- /**
109
- * The role of the prompt message
110
- */
111
- export const DeploymentsRole = {
112
- System: "system",
113
- Assistant: "assistant",
114
- User: "user",
115
- Exception: "exception",
116
- Tool: "tool",
117
- Prompt: "prompt",
118
- Correction: "correction",
119
- ExpectedOutput: "expected_output",
120
- } as const;
121
- /**
122
- * The role of the prompt message
123
- */
124
- export type DeploymentsRole = ClosedEnum<typeof DeploymentsRole>;
125
-
126
- export const Deployments2MessagesContentType = {
127
- ImageUrl: "image_url",
128
- } as const;
129
- export type Deployments2MessagesContentType = ClosedEnum<
130
- typeof Deployments2MessagesContentType
131
- >;
132
-
133
- export type TwoImageUrl = {
134
- /**
135
- * Either a URL of the image or the base64 encoded data URI.
136
- */
137
- url: string;
138
- /**
139
- * Specifies the detail level of the image. Currently only supported with OpenAI models
140
- */
141
- detail?: string | undefined;
142
- };
143
-
144
- /**
145
- * The image part of the prompt message. Only supported with vision models.
146
- */
147
- export type Deployments22 = {
148
- type: Deployments2MessagesContentType;
149
- imageUrl: TwoImageUrl;
150
- };
151
-
152
- export const Deployments2MessagesType = {
153
- Text: "text",
154
- } as const;
155
- export type Deployments2MessagesType = ClosedEnum<
156
- typeof Deployments2MessagesType
157
- >;
158
-
159
- /**
160
- * Text content part of a prompt message
161
- */
162
- export type Two1 = {
163
- type: Deployments2MessagesType;
164
- text: string;
165
- };
166
-
167
- export type Content2 = Two1 | Deployments22;
168
-
169
- /**
170
- * The contents of the user message. Either the text content of the message or an array of content parts with a defined type, each can be of type `text` or `image_url` when passing in images. You can pass multiple images by adding multiple `image_url` content parts.
171
- */
172
- export type DeploymentsContent = string | Array<Two1 | Deployments22>;
173
-
174
- export const DeploymentsType = {
175
- Function: "function",
176
- } as const;
177
- export type DeploymentsType = ClosedEnum<typeof DeploymentsType>;
178
-
179
- export type DeploymentsFunction = {
180
- name: string;
181
- /**
182
- * JSON string arguments for the functions
183
- */
184
- arguments: string;
185
- };
186
-
187
- export type DeploymentsToolCalls = {
188
- id?: string | undefined;
189
- index?: number | undefined;
190
- type: DeploymentsType;
191
- function: DeploymentsFunction;
192
- };
193
-
194
- export type Messages = {
195
- /**
196
- * The role of the prompt message
197
- */
198
- role: DeploymentsRole;
199
- /**
200
- * The contents of the user message. Either the text content of the message or an array of content parts with a defined type, each can be of type `text` or `image_url` when passing in images. You can pass multiple images by adding multiple `image_url` content parts.
201
- */
202
- content: string | Array<Two1 | Deployments22>;
203
- toolCalls?: Array<DeploymentsToolCalls> | undefined;
204
- };
205
-
206
- /**
207
- * Metadata about the document
208
- */
209
- export type Metadata = {
210
- /**
211
- * Name of the file the text is from.
212
- */
213
- fileName?: string | undefined;
214
- /**
215
- * Content type of the file the text is from.
216
- */
217
- fileType?: string | undefined;
218
- /**
219
- * The page number the text is from.
220
- */
221
- pageNumber?: number | undefined;
222
- };
223
-
224
- export type Documents = {
225
- /**
226
- * The text content of the document
227
- */
228
- text: string;
229
- /**
230
- * Metadata about the document
231
- */
232
- metadata?: Metadata | undefined;
233
- };
234
-
235
- export type InvokeOptions = {
236
- /**
237
- * Whether to include the retrieved knowledge chunks in the response.
238
- */
239
- includeRetrievals?: boolean | undefined;
240
- };
241
-
242
- /**
243
- * The deployment request payload
244
- */
245
- export type Deployments = {
246
- /**
247
- * The deployment key to invoke
248
- */
249
- key: string;
250
- /**
251
- * If set, partial message content will be sent. Tokens will be sent as data-only `server-sent events` as they become available, with the stream terminated by a `data: [DONE]` message.
252
- */
253
- stream?: boolean | undefined;
254
- /**
255
- * Key-value pairs variables to replace in your prompts. If a variable is not provided that is defined in the prompt, the default variables are used.
256
- */
257
- inputs?: { [k: string]: string | number | boolean } | undefined;
258
- /**
259
- * Key-value pairs that match your data model and fields declared in your configuration matrix. If you send multiple prompt keys, the context will be applied to the evaluation of each key.
260
- */
261
- context?: { [k: string]: any } | undefined;
262
- /**
263
- * A list of messages to include after the `System` message, but before the `User` and `Assistant` pairs configured in your deployment.
264
- */
265
- prefixMessages?: Array<PrefixMessages> | undefined;
266
- /**
267
- * A list of messages to send to the deployment.
268
- */
269
- messages?: Array<Messages> | undefined;
270
- /**
271
- * A list of file IDs that are associated with the deployment request.
272
- */
273
- fileIds?: Array<string> | undefined;
274
- /**
275
- * Key-value pairs that you want to attach to the log generated by this request.
276
- */
277
- metadata?: { [k: string]: any } | undefined;
278
- /**
279
- * Utilized for passing additional parameters to the model provider. Exercise caution when using this feature, as the included parameters will overwrite any parameters specified in the deployment prompt configuration.
280
- */
281
- extraParams?: { [k: string]: any } | undefined;
282
- /**
283
- * A list of relevant documents that evaluators and guardrails can cite to evaluate the user input or the model response based on your deployment settings.
284
- */
285
- documents?: Array<Documents> | undefined;
286
- invokeOptions?: InvokeOptions | undefined;
287
- };
288
-
289
- /** @internal */
290
- export const Inputs$inboundSchema: z.ZodType<Inputs, z.ZodTypeDef, unknown> = z
291
- .union([z.string(), z.number(), z.boolean()]);
292
-
293
- /** @internal */
294
- export type Inputs$Outbound = string | number | boolean;
295
-
296
- /** @internal */
297
- export const Inputs$outboundSchema: z.ZodType<
298
- Inputs$Outbound,
299
- z.ZodTypeDef,
300
- Inputs
301
- > = z.union([z.string(), z.number(), z.boolean()]);
302
-
303
- /**
304
- * @internal
305
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
306
- */
307
- export namespace Inputs$ {
308
- /** @deprecated use `Inputs$inboundSchema` instead. */
309
- export const inboundSchema = Inputs$inboundSchema;
310
- /** @deprecated use `Inputs$outboundSchema` instead. */
311
- export const outboundSchema = Inputs$outboundSchema;
312
- /** @deprecated use `Inputs$Outbound` instead. */
313
- export type Outbound = Inputs$Outbound;
314
- }
315
-
316
- export function inputsToJSON(inputs: Inputs): string {
317
- return JSON.stringify(Inputs$outboundSchema.parse(inputs));
318
- }
319
-
320
- export function inputsFromJSON(
321
- jsonString: string,
322
- ): SafeParseResult<Inputs, SDKValidationError> {
323
- return safeParse(
324
- jsonString,
325
- (x) => Inputs$inboundSchema.parse(JSON.parse(x)),
326
- `Failed to parse 'Inputs' from JSON`,
327
- );
328
- }
329
-
330
- /** @internal */
331
- export const Role$inboundSchema: z.ZodNativeEnum<typeof Role> = z.nativeEnum(
332
- Role,
333
- );
334
-
335
- /** @internal */
336
- export const Role$outboundSchema: z.ZodNativeEnum<typeof Role> =
337
- Role$inboundSchema;
338
-
339
- /**
340
- * @internal
341
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
342
- */
343
- export namespace Role$ {
344
- /** @deprecated use `Role$inboundSchema` instead. */
345
- export const inboundSchema = Role$inboundSchema;
346
- /** @deprecated use `Role$outboundSchema` instead. */
347
- export const outboundSchema = Role$outboundSchema;
348
- }
349
-
350
- /** @internal */
351
- export const TwoType$inboundSchema: z.ZodNativeEnum<typeof TwoType> = z
352
- .nativeEnum(TwoType);
353
-
354
- /** @internal */
355
- export const TwoType$outboundSchema: z.ZodNativeEnum<typeof TwoType> =
356
- TwoType$inboundSchema;
357
-
358
- /**
359
- * @internal
360
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
361
- */
362
- export namespace TwoType$ {
363
- /** @deprecated use `TwoType$inboundSchema` instead. */
364
- export const inboundSchema = TwoType$inboundSchema;
365
- /** @deprecated use `TwoType$outboundSchema` instead. */
366
- export const outboundSchema = TwoType$outboundSchema;
367
- }
368
-
369
- /** @internal */
370
- export const ImageUrl$inboundSchema: z.ZodType<
371
- ImageUrl,
372
- z.ZodTypeDef,
373
- unknown
374
- > = z.object({
375
- url: z.string(),
376
- detail: z.string().optional(),
377
- });
378
-
379
- /** @internal */
380
- export type ImageUrl$Outbound = {
381
- url: string;
382
- detail?: string | undefined;
383
- };
384
-
385
- /** @internal */
386
- export const ImageUrl$outboundSchema: z.ZodType<
387
- ImageUrl$Outbound,
388
- z.ZodTypeDef,
389
- ImageUrl
390
- > = z.object({
391
- url: z.string(),
392
- detail: z.string().optional(),
393
- });
394
-
395
- /**
396
- * @internal
397
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
398
- */
399
- export namespace ImageUrl$ {
400
- /** @deprecated use `ImageUrl$inboundSchema` instead. */
401
- export const inboundSchema = ImageUrl$inboundSchema;
402
- /** @deprecated use `ImageUrl$outboundSchema` instead. */
403
- export const outboundSchema = ImageUrl$outboundSchema;
404
- /** @deprecated use `ImageUrl$Outbound` instead. */
405
- export type Outbound = ImageUrl$Outbound;
406
- }
407
-
408
- export function imageUrlToJSON(imageUrl: ImageUrl): string {
409
- return JSON.stringify(ImageUrl$outboundSchema.parse(imageUrl));
410
- }
411
-
412
- export function imageUrlFromJSON(
413
- jsonString: string,
414
- ): SafeParseResult<ImageUrl, SDKValidationError> {
415
- return safeParse(
416
- jsonString,
417
- (x) => ImageUrl$inboundSchema.parse(JSON.parse(x)),
418
- `Failed to parse 'ImageUrl' from JSON`,
419
- );
420
- }
421
-
422
- /** @internal */
423
- export const Two2$inboundSchema: z.ZodType<Two2, z.ZodTypeDef, unknown> = z
424
- .object({
425
- type: TwoType$inboundSchema,
426
- image_url: z.lazy(() => ImageUrl$inboundSchema),
427
- }).transform((v) => {
428
- return remap$(v, {
429
- "image_url": "imageUrl",
430
- });
431
- });
432
-
433
- /** @internal */
434
- export type Two2$Outbound = {
435
- type: string;
436
- image_url: ImageUrl$Outbound;
437
- };
438
-
439
- /** @internal */
440
- export const Two2$outboundSchema: z.ZodType<Two2$Outbound, z.ZodTypeDef, Two2> =
441
- z.object({
442
- type: TwoType$outboundSchema,
443
- imageUrl: z.lazy(() => ImageUrl$outboundSchema),
444
- }).transform((v) => {
445
- return remap$(v, {
446
- imageUrl: "image_url",
447
- });
448
- });
449
-
450
- /**
451
- * @internal
452
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
453
- */
454
- export namespace Two2$ {
455
- /** @deprecated use `Two2$inboundSchema` instead. */
456
- export const inboundSchema = Two2$inboundSchema;
457
- /** @deprecated use `Two2$outboundSchema` instead. */
458
- export const outboundSchema = Two2$outboundSchema;
459
- /** @deprecated use `Two2$Outbound` instead. */
460
- export type Outbound = Two2$Outbound;
461
- }
462
-
463
- export function two2ToJSON(two2: Two2): string {
464
- return JSON.stringify(Two2$outboundSchema.parse(two2));
465
- }
466
-
467
- export function two2FromJSON(
468
- jsonString: string,
469
- ): SafeParseResult<Two2, SDKValidationError> {
470
- return safeParse(
471
- jsonString,
472
- (x) => Two2$inboundSchema.parse(JSON.parse(x)),
473
- `Failed to parse 'Two2' from JSON`,
474
- );
475
- }
476
-
477
- /** @internal */
478
- export const Deployments2Type$inboundSchema: z.ZodNativeEnum<
479
- typeof Deployments2Type
480
- > = z.nativeEnum(Deployments2Type);
481
-
482
- /** @internal */
483
- export const Deployments2Type$outboundSchema: z.ZodNativeEnum<
484
- typeof Deployments2Type
485
- > = Deployments2Type$inboundSchema;
486
-
487
- /**
488
- * @internal
489
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
490
- */
491
- export namespace Deployments2Type$ {
492
- /** @deprecated use `Deployments2Type$inboundSchema` instead. */
493
- export const inboundSchema = Deployments2Type$inboundSchema;
494
- /** @deprecated use `Deployments2Type$outboundSchema` instead. */
495
- export const outboundSchema = Deployments2Type$outboundSchema;
496
- }
497
-
498
- /** @internal */
499
- export const One$inboundSchema: z.ZodType<One, z.ZodTypeDef, unknown> = z
500
- .object({
501
- type: Deployments2Type$inboundSchema,
502
- text: z.string(),
503
- });
504
-
505
- /** @internal */
506
- export type One$Outbound = {
507
- type: string;
508
- text: string;
509
- };
510
-
511
- /** @internal */
512
- export const One$outboundSchema: z.ZodType<One$Outbound, z.ZodTypeDef, One> = z
513
- .object({
514
- type: Deployments2Type$outboundSchema,
515
- text: z.string(),
516
- });
517
-
518
- /**
519
- * @internal
520
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
521
- */
522
- export namespace One$ {
523
- /** @deprecated use `One$inboundSchema` instead. */
524
- export const inboundSchema = One$inboundSchema;
525
- /** @deprecated use `One$outboundSchema` instead. */
526
- export const outboundSchema = One$outboundSchema;
527
- /** @deprecated use `One$Outbound` instead. */
528
- export type Outbound = One$Outbound;
529
- }
530
-
531
- export function oneToJSON(one: One): string {
532
- return JSON.stringify(One$outboundSchema.parse(one));
533
- }
534
-
535
- export function oneFromJSON(
536
- jsonString: string,
537
- ): SafeParseResult<One, SDKValidationError> {
538
- return safeParse(
539
- jsonString,
540
- (x) => One$inboundSchema.parse(JSON.parse(x)),
541
- `Failed to parse 'One' from JSON`,
542
- );
543
- }
544
-
545
- /** @internal */
546
- export const Two$inboundSchema: z.ZodType<Two, z.ZodTypeDef, unknown> = z.union(
547
- [z.lazy(() => One$inboundSchema), z.lazy(() => Two2$inboundSchema)],
548
- );
549
-
550
- /** @internal */
551
- export type Two$Outbound = One$Outbound | Two2$Outbound;
552
-
553
- /** @internal */
554
- export const Two$outboundSchema: z.ZodType<Two$Outbound, z.ZodTypeDef, Two> = z
555
- .union([z.lazy(() => One$outboundSchema), z.lazy(() => Two2$outboundSchema)]);
556
-
557
- /**
558
- * @internal
559
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
560
- */
561
- export namespace Two$ {
562
- /** @deprecated use `Two$inboundSchema` instead. */
563
- export const inboundSchema = Two$inboundSchema;
564
- /** @deprecated use `Two$outboundSchema` instead. */
565
- export const outboundSchema = Two$outboundSchema;
566
- /** @deprecated use `Two$Outbound` instead. */
567
- export type Outbound = Two$Outbound;
568
- }
569
-
570
- export function twoToJSON(two: Two): string {
571
- return JSON.stringify(Two$outboundSchema.parse(two));
572
- }
573
-
574
- export function twoFromJSON(
575
- jsonString: string,
576
- ): SafeParseResult<Two, SDKValidationError> {
577
- return safeParse(
578
- jsonString,
579
- (x) => Two$inboundSchema.parse(JSON.parse(x)),
580
- `Failed to parse 'Two' from JSON`,
581
- );
582
- }
583
-
584
- /** @internal */
585
- export const Content$inboundSchema: z.ZodType<Content, z.ZodTypeDef, unknown> =
586
- z.union([
587
- z.string(),
588
- z.array(z.union([
589
- z.lazy(() => One$inboundSchema),
590
- z.lazy(() => Two2$inboundSchema),
591
- ])),
592
- ]);
593
-
594
- /** @internal */
595
- export type Content$Outbound = string | Array<One$Outbound | Two2$Outbound>;
596
-
597
- /** @internal */
598
- export const Content$outboundSchema: z.ZodType<
599
- Content$Outbound,
600
- z.ZodTypeDef,
601
- Content
602
- > = z.union([
603
- z.string(),
604
- z.array(z.union([
605
- z.lazy(() => One$outboundSchema),
606
- z.lazy(() => Two2$outboundSchema),
607
- ])),
608
- ]);
609
-
610
- /**
611
- * @internal
612
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
613
- */
614
- export namespace Content$ {
615
- /** @deprecated use `Content$inboundSchema` instead. */
616
- export const inboundSchema = Content$inboundSchema;
617
- /** @deprecated use `Content$outboundSchema` instead. */
618
- export const outboundSchema = Content$outboundSchema;
619
- /** @deprecated use `Content$Outbound` instead. */
620
- export type Outbound = Content$Outbound;
621
- }
622
-
623
- export function contentToJSON(content: Content): string {
624
- return JSON.stringify(Content$outboundSchema.parse(content));
625
- }
626
-
627
- export function contentFromJSON(
628
- jsonString: string,
629
- ): SafeParseResult<Content, SDKValidationError> {
630
- return safeParse(
631
- jsonString,
632
- (x) => Content$inboundSchema.parse(JSON.parse(x)),
633
- `Failed to parse 'Content' from JSON`,
634
- );
635
- }
636
-
637
- /** @internal */
638
- export const Type$inboundSchema: z.ZodNativeEnum<typeof Type> = z.nativeEnum(
639
- Type,
640
- );
641
-
642
- /** @internal */
643
- export const Type$outboundSchema: z.ZodNativeEnum<typeof Type> =
644
- Type$inboundSchema;
645
-
646
- /**
647
- * @internal
648
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
649
- */
650
- export namespace Type$ {
651
- /** @deprecated use `Type$inboundSchema` instead. */
652
- export const inboundSchema = Type$inboundSchema;
653
- /** @deprecated use `Type$outboundSchema` instead. */
654
- export const outboundSchema = Type$outboundSchema;
655
- }
656
-
657
- /** @internal */
658
- export const FunctionT$inboundSchema: z.ZodType<
659
- FunctionT,
660
- z.ZodTypeDef,
661
- unknown
662
- > = z.object({
663
- name: z.string(),
664
- arguments: z.string(),
665
- });
666
-
667
- /** @internal */
668
- export type FunctionT$Outbound = {
669
- name: string;
670
- arguments: string;
671
- };
672
-
673
- /** @internal */
674
- export const FunctionT$outboundSchema: z.ZodType<
675
- FunctionT$Outbound,
676
- z.ZodTypeDef,
677
- FunctionT
678
- > = z.object({
679
- name: z.string(),
680
- arguments: z.string(),
681
- });
682
-
683
- /**
684
- * @internal
685
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
686
- */
687
- export namespace FunctionT$ {
688
- /** @deprecated use `FunctionT$inboundSchema` instead. */
689
- export const inboundSchema = FunctionT$inboundSchema;
690
- /** @deprecated use `FunctionT$outboundSchema` instead. */
691
- export const outboundSchema = FunctionT$outboundSchema;
692
- /** @deprecated use `FunctionT$Outbound` instead. */
693
- export type Outbound = FunctionT$Outbound;
694
- }
695
-
696
- export function functionToJSON(functionT: FunctionT): string {
697
- return JSON.stringify(FunctionT$outboundSchema.parse(functionT));
698
- }
699
-
700
- export function functionFromJSON(
701
- jsonString: string,
702
- ): SafeParseResult<FunctionT, SDKValidationError> {
703
- return safeParse(
704
- jsonString,
705
- (x) => FunctionT$inboundSchema.parse(JSON.parse(x)),
706
- `Failed to parse 'FunctionT' from JSON`,
707
- );
708
- }
709
-
710
- /** @internal */
711
- export const ToolCalls$inboundSchema: z.ZodType<
712
- ToolCalls,
713
- z.ZodTypeDef,
714
- unknown
715
- > = z.object({
716
- id: z.string().optional(),
717
- index: z.number().optional(),
718
- type: Type$inboundSchema,
719
- function: z.lazy(() => FunctionT$inboundSchema),
720
- });
721
-
722
- /** @internal */
723
- export type ToolCalls$Outbound = {
724
- id?: string | undefined;
725
- index?: number | undefined;
726
- type: string;
727
- function: FunctionT$Outbound;
728
- };
729
-
730
- /** @internal */
731
- export const ToolCalls$outboundSchema: z.ZodType<
732
- ToolCalls$Outbound,
733
- z.ZodTypeDef,
734
- ToolCalls
735
- > = z.object({
736
- id: z.string().optional(),
737
- index: z.number().optional(),
738
- type: Type$outboundSchema,
739
- function: z.lazy(() => FunctionT$outboundSchema),
740
- });
741
-
742
- /**
743
- * @internal
744
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
745
- */
746
- export namespace ToolCalls$ {
747
- /** @deprecated use `ToolCalls$inboundSchema` instead. */
748
- export const inboundSchema = ToolCalls$inboundSchema;
749
- /** @deprecated use `ToolCalls$outboundSchema` instead. */
750
- export const outboundSchema = ToolCalls$outboundSchema;
751
- /** @deprecated use `ToolCalls$Outbound` instead. */
752
- export type Outbound = ToolCalls$Outbound;
753
- }
754
-
755
- export function toolCallsToJSON(toolCalls: ToolCalls): string {
756
- return JSON.stringify(ToolCalls$outboundSchema.parse(toolCalls));
757
- }
758
-
759
- export function toolCallsFromJSON(
760
- jsonString: string,
761
- ): SafeParseResult<ToolCalls, SDKValidationError> {
762
- return safeParse(
763
- jsonString,
764
- (x) => ToolCalls$inboundSchema.parse(JSON.parse(x)),
765
- `Failed to parse 'ToolCalls' from JSON`,
766
- );
767
- }
768
-
769
- /** @internal */
770
- export const PrefixMessages$inboundSchema: z.ZodType<
771
- PrefixMessages,
772
- z.ZodTypeDef,
773
- unknown
774
- > = z.object({
775
- role: Role$inboundSchema,
776
- content: z.union([
777
- z.string(),
778
- z.array(z.union([
779
- z.lazy(() => One$inboundSchema),
780
- z.lazy(() => Two2$inboundSchema),
781
- ])),
782
- ]),
783
- tool_calls: z.array(z.lazy(() => ToolCalls$inboundSchema)).optional(),
784
- }).transform((v) => {
785
- return remap$(v, {
786
- "tool_calls": "toolCalls",
787
- });
788
- });
789
-
790
- /** @internal */
791
- export type PrefixMessages$Outbound = {
792
- role: string;
793
- content: string | Array<One$Outbound | Two2$Outbound>;
794
- tool_calls?: Array<ToolCalls$Outbound> | undefined;
795
- };
796
-
797
- /** @internal */
798
- export const PrefixMessages$outboundSchema: z.ZodType<
799
- PrefixMessages$Outbound,
800
- z.ZodTypeDef,
801
- PrefixMessages
802
- > = z.object({
803
- role: Role$outboundSchema,
804
- content: z.union([
805
- z.string(),
806
- z.array(z.union([
807
- z.lazy(() => One$outboundSchema),
808
- z.lazy(() => Two2$outboundSchema),
809
- ])),
810
- ]),
811
- toolCalls: z.array(z.lazy(() => ToolCalls$outboundSchema)).optional(),
812
- }).transform((v) => {
813
- return remap$(v, {
814
- toolCalls: "tool_calls",
815
- });
816
- });
817
-
818
- /**
819
- * @internal
820
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
821
- */
822
- export namespace PrefixMessages$ {
823
- /** @deprecated use `PrefixMessages$inboundSchema` instead. */
824
- export const inboundSchema = PrefixMessages$inboundSchema;
825
- /** @deprecated use `PrefixMessages$outboundSchema` instead. */
826
- export const outboundSchema = PrefixMessages$outboundSchema;
827
- /** @deprecated use `PrefixMessages$Outbound` instead. */
828
- export type Outbound = PrefixMessages$Outbound;
829
- }
830
-
831
- export function prefixMessagesToJSON(prefixMessages: PrefixMessages): string {
832
- return JSON.stringify(PrefixMessages$outboundSchema.parse(prefixMessages));
833
- }
834
-
835
- export function prefixMessagesFromJSON(
836
- jsonString: string,
837
- ): SafeParseResult<PrefixMessages, SDKValidationError> {
838
- return safeParse(
839
- jsonString,
840
- (x) => PrefixMessages$inboundSchema.parse(JSON.parse(x)),
841
- `Failed to parse 'PrefixMessages' from JSON`,
842
- );
843
- }
844
-
845
- /** @internal */
846
- export const DeploymentsRole$inboundSchema: z.ZodNativeEnum<
847
- typeof DeploymentsRole
848
- > = z.nativeEnum(DeploymentsRole);
849
-
850
- /** @internal */
851
- export const DeploymentsRole$outboundSchema: z.ZodNativeEnum<
852
- typeof DeploymentsRole
853
- > = DeploymentsRole$inboundSchema;
854
-
855
- /**
856
- * @internal
857
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
858
- */
859
- export namespace DeploymentsRole$ {
860
- /** @deprecated use `DeploymentsRole$inboundSchema` instead. */
861
- export const inboundSchema = DeploymentsRole$inboundSchema;
862
- /** @deprecated use `DeploymentsRole$outboundSchema` instead. */
863
- export const outboundSchema = DeploymentsRole$outboundSchema;
864
- }
865
-
866
- /** @internal */
867
- export const Deployments2MessagesContentType$inboundSchema: z.ZodNativeEnum<
868
- typeof Deployments2MessagesContentType
869
- > = z.nativeEnum(Deployments2MessagesContentType);
870
-
871
- /** @internal */
872
- export const Deployments2MessagesContentType$outboundSchema: z.ZodNativeEnum<
873
- typeof Deployments2MessagesContentType
874
- > = Deployments2MessagesContentType$inboundSchema;
875
-
876
- /**
877
- * @internal
878
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
879
- */
880
- export namespace Deployments2MessagesContentType$ {
881
- /** @deprecated use `Deployments2MessagesContentType$inboundSchema` instead. */
882
- export const inboundSchema = Deployments2MessagesContentType$inboundSchema;
883
- /** @deprecated use `Deployments2MessagesContentType$outboundSchema` instead. */
884
- export const outboundSchema = Deployments2MessagesContentType$outboundSchema;
885
- }
886
-
887
- /** @internal */
888
- export const TwoImageUrl$inboundSchema: z.ZodType<
889
- TwoImageUrl,
890
- z.ZodTypeDef,
891
- unknown
892
- > = z.object({
893
- url: z.string(),
894
- detail: z.string().optional(),
895
- });
896
-
897
- /** @internal */
898
- export type TwoImageUrl$Outbound = {
899
- url: string;
900
- detail?: string | undefined;
901
- };
902
-
903
- /** @internal */
904
- export const TwoImageUrl$outboundSchema: z.ZodType<
905
- TwoImageUrl$Outbound,
906
- z.ZodTypeDef,
907
- TwoImageUrl
908
- > = z.object({
909
- url: z.string(),
910
- detail: z.string().optional(),
911
- });
912
-
913
- /**
914
- * @internal
915
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
916
- */
917
- export namespace TwoImageUrl$ {
918
- /** @deprecated use `TwoImageUrl$inboundSchema` instead. */
919
- export const inboundSchema = TwoImageUrl$inboundSchema;
920
- /** @deprecated use `TwoImageUrl$outboundSchema` instead. */
921
- export const outboundSchema = TwoImageUrl$outboundSchema;
922
- /** @deprecated use `TwoImageUrl$Outbound` instead. */
923
- export type Outbound = TwoImageUrl$Outbound;
924
- }
925
-
926
- export function twoImageUrlToJSON(twoImageUrl: TwoImageUrl): string {
927
- return JSON.stringify(TwoImageUrl$outboundSchema.parse(twoImageUrl));
928
- }
929
-
930
- export function twoImageUrlFromJSON(
931
- jsonString: string,
932
- ): SafeParseResult<TwoImageUrl, SDKValidationError> {
933
- return safeParse(
934
- jsonString,
935
- (x) => TwoImageUrl$inboundSchema.parse(JSON.parse(x)),
936
- `Failed to parse 'TwoImageUrl' from JSON`,
937
- );
938
- }
939
-
940
- /** @internal */
941
- export const Deployments22$inboundSchema: z.ZodType<
942
- Deployments22,
943
- z.ZodTypeDef,
944
- unknown
945
- > = z.object({
946
- type: Deployments2MessagesContentType$inboundSchema,
947
- image_url: z.lazy(() => TwoImageUrl$inboundSchema),
948
- }).transform((v) => {
949
- return remap$(v, {
950
- "image_url": "imageUrl",
951
- });
952
- });
953
-
954
- /** @internal */
955
- export type Deployments22$Outbound = {
956
- type: string;
957
- image_url: TwoImageUrl$Outbound;
958
- };
959
-
960
- /** @internal */
961
- export const Deployments22$outboundSchema: z.ZodType<
962
- Deployments22$Outbound,
963
- z.ZodTypeDef,
964
- Deployments22
965
- > = z.object({
966
- type: Deployments2MessagesContentType$outboundSchema,
967
- imageUrl: z.lazy(() => TwoImageUrl$outboundSchema),
968
- }).transform((v) => {
969
- return remap$(v, {
970
- imageUrl: "image_url",
971
- });
972
- });
973
-
974
- /**
975
- * @internal
976
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
977
- */
978
- export namespace Deployments22$ {
979
- /** @deprecated use `Deployments22$inboundSchema` instead. */
980
- export const inboundSchema = Deployments22$inboundSchema;
981
- /** @deprecated use `Deployments22$outboundSchema` instead. */
982
- export const outboundSchema = Deployments22$outboundSchema;
983
- /** @deprecated use `Deployments22$Outbound` instead. */
984
- export type Outbound = Deployments22$Outbound;
985
- }
986
-
987
- export function deployments22ToJSON(deployments22: Deployments22): string {
988
- return JSON.stringify(Deployments22$outboundSchema.parse(deployments22));
989
- }
990
-
991
- export function deployments22FromJSON(
992
- jsonString: string,
993
- ): SafeParseResult<Deployments22, SDKValidationError> {
994
- return safeParse(
995
- jsonString,
996
- (x) => Deployments22$inboundSchema.parse(JSON.parse(x)),
997
- `Failed to parse 'Deployments22' from JSON`,
998
- );
999
- }
1000
-
1001
- /** @internal */
1002
- export const Deployments2MessagesType$inboundSchema: z.ZodNativeEnum<
1003
- typeof Deployments2MessagesType
1004
- > = z.nativeEnum(Deployments2MessagesType);
1005
-
1006
- /** @internal */
1007
- export const Deployments2MessagesType$outboundSchema: z.ZodNativeEnum<
1008
- typeof Deployments2MessagesType
1009
- > = Deployments2MessagesType$inboundSchema;
1010
-
1011
- /**
1012
- * @internal
1013
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1014
- */
1015
- export namespace Deployments2MessagesType$ {
1016
- /** @deprecated use `Deployments2MessagesType$inboundSchema` instead. */
1017
- export const inboundSchema = Deployments2MessagesType$inboundSchema;
1018
- /** @deprecated use `Deployments2MessagesType$outboundSchema` instead. */
1019
- export const outboundSchema = Deployments2MessagesType$outboundSchema;
1020
- }
1021
-
1022
- /** @internal */
1023
- export const Two1$inboundSchema: z.ZodType<Two1, z.ZodTypeDef, unknown> = z
1024
- .object({
1025
- type: Deployments2MessagesType$inboundSchema,
1026
- text: z.string(),
1027
- });
1028
-
1029
- /** @internal */
1030
- export type Two1$Outbound = {
1031
- type: string;
1032
- text: string;
1033
- };
1034
-
1035
- /** @internal */
1036
- export const Two1$outboundSchema: z.ZodType<Two1$Outbound, z.ZodTypeDef, Two1> =
1037
- z.object({
1038
- type: Deployments2MessagesType$outboundSchema,
1039
- text: z.string(),
1040
- });
1041
-
1042
- /**
1043
- * @internal
1044
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1045
- */
1046
- export namespace Two1$ {
1047
- /** @deprecated use `Two1$inboundSchema` instead. */
1048
- export const inboundSchema = Two1$inboundSchema;
1049
- /** @deprecated use `Two1$outboundSchema` instead. */
1050
- export const outboundSchema = Two1$outboundSchema;
1051
- /** @deprecated use `Two1$Outbound` instead. */
1052
- export type Outbound = Two1$Outbound;
1053
- }
1054
-
1055
- export function two1ToJSON(two1: Two1): string {
1056
- return JSON.stringify(Two1$outboundSchema.parse(two1));
1057
- }
1058
-
1059
- export function two1FromJSON(
1060
- jsonString: string,
1061
- ): SafeParseResult<Two1, SDKValidationError> {
1062
- return safeParse(
1063
- jsonString,
1064
- (x) => Two1$inboundSchema.parse(JSON.parse(x)),
1065
- `Failed to parse 'Two1' from JSON`,
1066
- );
1067
- }
1068
-
1069
- /** @internal */
1070
- export const Content2$inboundSchema: z.ZodType<
1071
- Content2,
1072
- z.ZodTypeDef,
1073
- unknown
1074
- > = z.union([
1075
- z.lazy(() => Two1$inboundSchema),
1076
- z.lazy(() => Deployments22$inboundSchema),
1077
- ]);
1078
-
1079
- /** @internal */
1080
- export type Content2$Outbound = Two1$Outbound | Deployments22$Outbound;
1081
-
1082
- /** @internal */
1083
- export const Content2$outboundSchema: z.ZodType<
1084
- Content2$Outbound,
1085
- z.ZodTypeDef,
1086
- Content2
1087
- > = z.union([
1088
- z.lazy(() => Two1$outboundSchema),
1089
- z.lazy(() => Deployments22$outboundSchema),
1090
- ]);
1091
-
1092
- /**
1093
- * @internal
1094
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1095
- */
1096
- export namespace Content2$ {
1097
- /** @deprecated use `Content2$inboundSchema` instead. */
1098
- export const inboundSchema = Content2$inboundSchema;
1099
- /** @deprecated use `Content2$outboundSchema` instead. */
1100
- export const outboundSchema = Content2$outboundSchema;
1101
- /** @deprecated use `Content2$Outbound` instead. */
1102
- export type Outbound = Content2$Outbound;
1103
- }
1104
-
1105
- export function content2ToJSON(content2: Content2): string {
1106
- return JSON.stringify(Content2$outboundSchema.parse(content2));
1107
- }
1108
-
1109
- export function content2FromJSON(
1110
- jsonString: string,
1111
- ): SafeParseResult<Content2, SDKValidationError> {
1112
- return safeParse(
1113
- jsonString,
1114
- (x) => Content2$inboundSchema.parse(JSON.parse(x)),
1115
- `Failed to parse 'Content2' from JSON`,
1116
- );
1117
- }
1118
-
1119
- /** @internal */
1120
- export const DeploymentsContent$inboundSchema: z.ZodType<
1121
- DeploymentsContent,
1122
- z.ZodTypeDef,
1123
- unknown
1124
- > = z.union([
1125
- z.string(),
1126
- z.array(z.union([
1127
- z.lazy(() => Two1$inboundSchema),
1128
- z.lazy(() => Deployments22$inboundSchema),
1129
- ])),
1130
- ]);
1131
-
1132
- /** @internal */
1133
- export type DeploymentsContent$Outbound =
1134
- | string
1135
- | Array<Two1$Outbound | Deployments22$Outbound>;
1136
-
1137
- /** @internal */
1138
- export const DeploymentsContent$outboundSchema: z.ZodType<
1139
- DeploymentsContent$Outbound,
1140
- z.ZodTypeDef,
1141
- DeploymentsContent
1142
- > = z.union([
1143
- z.string(),
1144
- z.array(z.union([
1145
- z.lazy(() => Two1$outboundSchema),
1146
- z.lazy(() => Deployments22$outboundSchema),
1147
- ])),
1148
- ]);
1149
-
1150
- /**
1151
- * @internal
1152
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1153
- */
1154
- export namespace DeploymentsContent$ {
1155
- /** @deprecated use `DeploymentsContent$inboundSchema` instead. */
1156
- export const inboundSchema = DeploymentsContent$inboundSchema;
1157
- /** @deprecated use `DeploymentsContent$outboundSchema` instead. */
1158
- export const outboundSchema = DeploymentsContent$outboundSchema;
1159
- /** @deprecated use `DeploymentsContent$Outbound` instead. */
1160
- export type Outbound = DeploymentsContent$Outbound;
1161
- }
1162
-
1163
- export function deploymentsContentToJSON(
1164
- deploymentsContent: DeploymentsContent,
1165
- ): string {
1166
- return JSON.stringify(
1167
- DeploymentsContent$outboundSchema.parse(deploymentsContent),
1168
- );
1169
- }
1170
-
1171
- export function deploymentsContentFromJSON(
1172
- jsonString: string,
1173
- ): SafeParseResult<DeploymentsContent, SDKValidationError> {
1174
- return safeParse(
1175
- jsonString,
1176
- (x) => DeploymentsContent$inboundSchema.parse(JSON.parse(x)),
1177
- `Failed to parse 'DeploymentsContent' from JSON`,
1178
- );
1179
- }
1180
-
1181
- /** @internal */
1182
- export const DeploymentsType$inboundSchema: z.ZodNativeEnum<
1183
- typeof DeploymentsType
1184
- > = z.nativeEnum(DeploymentsType);
1185
-
1186
- /** @internal */
1187
- export const DeploymentsType$outboundSchema: z.ZodNativeEnum<
1188
- typeof DeploymentsType
1189
- > = DeploymentsType$inboundSchema;
1190
-
1191
- /**
1192
- * @internal
1193
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1194
- */
1195
- export namespace DeploymentsType$ {
1196
- /** @deprecated use `DeploymentsType$inboundSchema` instead. */
1197
- export const inboundSchema = DeploymentsType$inboundSchema;
1198
- /** @deprecated use `DeploymentsType$outboundSchema` instead. */
1199
- export const outboundSchema = DeploymentsType$outboundSchema;
1200
- }
1201
-
1202
- /** @internal */
1203
- export const DeploymentsFunction$inboundSchema: z.ZodType<
1204
- DeploymentsFunction,
1205
- z.ZodTypeDef,
1206
- unknown
1207
- > = z.object({
1208
- name: z.string(),
1209
- arguments: z.string(),
1210
- });
1211
-
1212
- /** @internal */
1213
- export type DeploymentsFunction$Outbound = {
1214
- name: string;
1215
- arguments: string;
1216
- };
1217
-
1218
- /** @internal */
1219
- export const DeploymentsFunction$outboundSchema: z.ZodType<
1220
- DeploymentsFunction$Outbound,
1221
- z.ZodTypeDef,
1222
- DeploymentsFunction
1223
- > = z.object({
1224
- name: z.string(),
1225
- arguments: z.string(),
1226
- });
1227
-
1228
- /**
1229
- * @internal
1230
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1231
- */
1232
- export namespace DeploymentsFunction$ {
1233
- /** @deprecated use `DeploymentsFunction$inboundSchema` instead. */
1234
- export const inboundSchema = DeploymentsFunction$inboundSchema;
1235
- /** @deprecated use `DeploymentsFunction$outboundSchema` instead. */
1236
- export const outboundSchema = DeploymentsFunction$outboundSchema;
1237
- /** @deprecated use `DeploymentsFunction$Outbound` instead. */
1238
- export type Outbound = DeploymentsFunction$Outbound;
1239
- }
1240
-
1241
- export function deploymentsFunctionToJSON(
1242
- deploymentsFunction: DeploymentsFunction,
1243
- ): string {
1244
- return JSON.stringify(
1245
- DeploymentsFunction$outboundSchema.parse(deploymentsFunction),
1246
- );
1247
- }
1248
-
1249
- export function deploymentsFunctionFromJSON(
1250
- jsonString: string,
1251
- ): SafeParseResult<DeploymentsFunction, SDKValidationError> {
1252
- return safeParse(
1253
- jsonString,
1254
- (x) => DeploymentsFunction$inboundSchema.parse(JSON.parse(x)),
1255
- `Failed to parse 'DeploymentsFunction' from JSON`,
1256
- );
1257
- }
1258
-
1259
- /** @internal */
1260
- export const DeploymentsToolCalls$inboundSchema: z.ZodType<
1261
- DeploymentsToolCalls,
1262
- z.ZodTypeDef,
1263
- unknown
1264
- > = z.object({
1265
- id: z.string().optional(),
1266
- index: z.number().optional(),
1267
- type: DeploymentsType$inboundSchema,
1268
- function: z.lazy(() => DeploymentsFunction$inboundSchema),
1269
- });
1270
-
1271
- /** @internal */
1272
- export type DeploymentsToolCalls$Outbound = {
1273
- id?: string | undefined;
1274
- index?: number | undefined;
1275
- type: string;
1276
- function: DeploymentsFunction$Outbound;
1277
- };
1278
-
1279
- /** @internal */
1280
- export const DeploymentsToolCalls$outboundSchema: z.ZodType<
1281
- DeploymentsToolCalls$Outbound,
1282
- z.ZodTypeDef,
1283
- DeploymentsToolCalls
1284
- > = z.object({
1285
- id: z.string().optional(),
1286
- index: z.number().optional(),
1287
- type: DeploymentsType$outboundSchema,
1288
- function: z.lazy(() => DeploymentsFunction$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 DeploymentsToolCalls$ {
1296
- /** @deprecated use `DeploymentsToolCalls$inboundSchema` instead. */
1297
- export const inboundSchema = DeploymentsToolCalls$inboundSchema;
1298
- /** @deprecated use `DeploymentsToolCalls$outboundSchema` instead. */
1299
- export const outboundSchema = DeploymentsToolCalls$outboundSchema;
1300
- /** @deprecated use `DeploymentsToolCalls$Outbound` instead. */
1301
- export type Outbound = DeploymentsToolCalls$Outbound;
1302
- }
1303
-
1304
- export function deploymentsToolCallsToJSON(
1305
- deploymentsToolCalls: DeploymentsToolCalls,
1306
- ): string {
1307
- return JSON.stringify(
1308
- DeploymentsToolCalls$outboundSchema.parse(deploymentsToolCalls),
1309
- );
1310
- }
1311
-
1312
- export function deploymentsToolCallsFromJSON(
1313
- jsonString: string,
1314
- ): SafeParseResult<DeploymentsToolCalls, SDKValidationError> {
1315
- return safeParse(
1316
- jsonString,
1317
- (x) => DeploymentsToolCalls$inboundSchema.parse(JSON.parse(x)),
1318
- `Failed to parse 'DeploymentsToolCalls' from JSON`,
1319
- );
1320
- }
1321
-
1322
- /** @internal */
1323
- export const Messages$inboundSchema: z.ZodType<
1324
- Messages,
1325
- z.ZodTypeDef,
1326
- unknown
1327
- > = z.object({
1328
- role: DeploymentsRole$inboundSchema,
1329
- content: z.union([
1330
- z.string(),
1331
- z.array(z.union([
1332
- z.lazy(() => Two1$inboundSchema),
1333
- z.lazy(() => Deployments22$inboundSchema),
1334
- ])),
1335
- ]),
1336
- tool_calls: z.array(z.lazy(() => DeploymentsToolCalls$inboundSchema))
1337
- .optional(),
1338
- }).transform((v) => {
1339
- return remap$(v, {
1340
- "tool_calls": "toolCalls",
1341
- });
1342
- });
1343
-
1344
- /** @internal */
1345
- export type Messages$Outbound = {
1346
- role: string;
1347
- content: string | Array<Two1$Outbound | Deployments22$Outbound>;
1348
- tool_calls?: Array<DeploymentsToolCalls$Outbound> | undefined;
1349
- };
1350
-
1351
- /** @internal */
1352
- export const Messages$outboundSchema: z.ZodType<
1353
- Messages$Outbound,
1354
- z.ZodTypeDef,
1355
- Messages
1356
- > = z.object({
1357
- role: DeploymentsRole$outboundSchema,
1358
- content: z.union([
1359
- z.string(),
1360
- z.array(z.union([
1361
- z.lazy(() => Two1$outboundSchema),
1362
- z.lazy(() => Deployments22$outboundSchema),
1363
- ])),
1364
- ]),
1365
- toolCalls: z.array(z.lazy(() => DeploymentsToolCalls$outboundSchema))
1366
- .optional(),
1367
- }).transform((v) => {
1368
- return remap$(v, {
1369
- toolCalls: "tool_calls",
1370
- });
1371
- });
1372
-
1373
- /**
1374
- * @internal
1375
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1376
- */
1377
- export namespace Messages$ {
1378
- /** @deprecated use `Messages$inboundSchema` instead. */
1379
- export const inboundSchema = Messages$inboundSchema;
1380
- /** @deprecated use `Messages$outboundSchema` instead. */
1381
- export const outboundSchema = Messages$outboundSchema;
1382
- /** @deprecated use `Messages$Outbound` instead. */
1383
- export type Outbound = Messages$Outbound;
1384
- }
1385
-
1386
- export function messagesToJSON(messages: Messages): string {
1387
- return JSON.stringify(Messages$outboundSchema.parse(messages));
1388
- }
1389
-
1390
- export function messagesFromJSON(
1391
- jsonString: string,
1392
- ): SafeParseResult<Messages, SDKValidationError> {
1393
- return safeParse(
1394
- jsonString,
1395
- (x) => Messages$inboundSchema.parse(JSON.parse(x)),
1396
- `Failed to parse 'Messages' from JSON`,
1397
- );
1398
- }
1399
-
1400
- /** @internal */
1401
- export const Metadata$inboundSchema: z.ZodType<
1402
- Metadata,
1403
- z.ZodTypeDef,
1404
- unknown
1405
- > = z.object({
1406
- file_name: z.string().optional(),
1407
- file_type: z.string().optional(),
1408
- page_number: z.number().optional(),
1409
- }).transform((v) => {
1410
- return remap$(v, {
1411
- "file_name": "fileName",
1412
- "file_type": "fileType",
1413
- "page_number": "pageNumber",
1414
- });
1415
- });
1416
-
1417
- /** @internal */
1418
- export type Metadata$Outbound = {
1419
- file_name?: string | undefined;
1420
- file_type?: string | undefined;
1421
- page_number?: number | undefined;
1422
- };
1423
-
1424
- /** @internal */
1425
- export const Metadata$outboundSchema: z.ZodType<
1426
- Metadata$Outbound,
1427
- z.ZodTypeDef,
1428
- Metadata
1429
- > = z.object({
1430
- fileName: z.string().optional(),
1431
- fileType: z.string().optional(),
1432
- pageNumber: z.number().optional(),
1433
- }).transform((v) => {
1434
- return remap$(v, {
1435
- fileName: "file_name",
1436
- fileType: "file_type",
1437
- pageNumber: "page_number",
1438
- });
1439
- });
1440
-
1441
- /**
1442
- * @internal
1443
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1444
- */
1445
- export namespace Metadata$ {
1446
- /** @deprecated use `Metadata$inboundSchema` instead. */
1447
- export const inboundSchema = Metadata$inboundSchema;
1448
- /** @deprecated use `Metadata$outboundSchema` instead. */
1449
- export const outboundSchema = Metadata$outboundSchema;
1450
- /** @deprecated use `Metadata$Outbound` instead. */
1451
- export type Outbound = Metadata$Outbound;
1452
- }
1453
-
1454
- export function metadataToJSON(metadata: Metadata): string {
1455
- return JSON.stringify(Metadata$outboundSchema.parse(metadata));
1456
- }
1457
-
1458
- export function metadataFromJSON(
1459
- jsonString: string,
1460
- ): SafeParseResult<Metadata, SDKValidationError> {
1461
- return safeParse(
1462
- jsonString,
1463
- (x) => Metadata$inboundSchema.parse(JSON.parse(x)),
1464
- `Failed to parse 'Metadata' from JSON`,
1465
- );
1466
- }
1467
-
1468
- /** @internal */
1469
- export const Documents$inboundSchema: z.ZodType<
1470
- Documents,
1471
- z.ZodTypeDef,
1472
- unknown
1473
- > = z.object({
1474
- text: z.string(),
1475
- metadata: z.lazy(() => Metadata$inboundSchema).optional(),
1476
- });
1477
-
1478
- /** @internal */
1479
- export type Documents$Outbound = {
1480
- text: string;
1481
- metadata?: Metadata$Outbound | undefined;
1482
- };
1483
-
1484
- /** @internal */
1485
- export const Documents$outboundSchema: z.ZodType<
1486
- Documents$Outbound,
1487
- z.ZodTypeDef,
1488
- Documents
1489
- > = z.object({
1490
- text: z.string(),
1491
- metadata: z.lazy(() => Metadata$outboundSchema).optional(),
1492
- });
1493
-
1494
- /**
1495
- * @internal
1496
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1497
- */
1498
- export namespace Documents$ {
1499
- /** @deprecated use `Documents$inboundSchema` instead. */
1500
- export const inboundSchema = Documents$inboundSchema;
1501
- /** @deprecated use `Documents$outboundSchema` instead. */
1502
- export const outboundSchema = Documents$outboundSchema;
1503
- /** @deprecated use `Documents$Outbound` instead. */
1504
- export type Outbound = Documents$Outbound;
1505
- }
1506
-
1507
- export function documentsToJSON(documents: Documents): string {
1508
- return JSON.stringify(Documents$outboundSchema.parse(documents));
1509
- }
1510
-
1511
- export function documentsFromJSON(
1512
- jsonString: string,
1513
- ): SafeParseResult<Documents, SDKValidationError> {
1514
- return safeParse(
1515
- jsonString,
1516
- (x) => Documents$inboundSchema.parse(JSON.parse(x)),
1517
- `Failed to parse 'Documents' from JSON`,
1518
- );
1519
- }
1520
-
1521
- /** @internal */
1522
- export const InvokeOptions$inboundSchema: z.ZodType<
1523
- InvokeOptions,
1524
- z.ZodTypeDef,
1525
- unknown
1526
- > = z.object({
1527
- include_retrievals: z.boolean().default(false),
1528
- }).transform((v) => {
1529
- return remap$(v, {
1530
- "include_retrievals": "includeRetrievals",
1531
- });
1532
- });
1533
-
1534
- /** @internal */
1535
- export type InvokeOptions$Outbound = {
1536
- include_retrievals: boolean;
1537
- };
1538
-
1539
- /** @internal */
1540
- export const InvokeOptions$outboundSchema: z.ZodType<
1541
- InvokeOptions$Outbound,
1542
- z.ZodTypeDef,
1543
- InvokeOptions
1544
- > = z.object({
1545
- includeRetrievals: z.boolean().default(false),
1546
- }).transform((v) => {
1547
- return remap$(v, {
1548
- includeRetrievals: "include_retrievals",
1549
- });
1550
- });
1551
-
1552
- /**
1553
- * @internal
1554
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1555
- */
1556
- export namespace InvokeOptions$ {
1557
- /** @deprecated use `InvokeOptions$inboundSchema` instead. */
1558
- export const inboundSchema = InvokeOptions$inboundSchema;
1559
- /** @deprecated use `InvokeOptions$outboundSchema` instead. */
1560
- export const outboundSchema = InvokeOptions$outboundSchema;
1561
- /** @deprecated use `InvokeOptions$Outbound` instead. */
1562
- export type Outbound = InvokeOptions$Outbound;
1563
- }
1564
-
1565
- export function invokeOptionsToJSON(invokeOptions: InvokeOptions): string {
1566
- return JSON.stringify(InvokeOptions$outboundSchema.parse(invokeOptions));
1567
- }
1568
-
1569
- export function invokeOptionsFromJSON(
1570
- jsonString: string,
1571
- ): SafeParseResult<InvokeOptions, SDKValidationError> {
1572
- return safeParse(
1573
- jsonString,
1574
- (x) => InvokeOptions$inboundSchema.parse(JSON.parse(x)),
1575
- `Failed to parse 'InvokeOptions' from JSON`,
1576
- );
1577
- }
1578
-
1579
- /** @internal */
1580
- export const Deployments$inboundSchema: z.ZodType<
1581
- Deployments,
1582
- z.ZodTypeDef,
1583
- unknown
1584
- > = z.object({
1585
- key: z.string(),
1586
- stream: z.boolean().default(false),
1587
- inputs: z.record(z.union([z.string(), z.number(), z.boolean()])).optional(),
1588
- context: z.record(z.any()).optional(),
1589
- prefix_messages: z.array(z.lazy(() => PrefixMessages$inboundSchema))
1590
- .optional(),
1591
- messages: z.array(z.lazy(() => Messages$inboundSchema)).optional(),
1592
- file_ids: z.array(z.string()).optional(),
1593
- metadata: z.record(z.any()).optional(),
1594
- extra_params: z.record(z.any()).optional(),
1595
- documents: z.array(z.lazy(() => Documents$inboundSchema)).optional(),
1596
- invoke_options: z.lazy(() => InvokeOptions$inboundSchema).optional(),
1597
- }).transform((v) => {
1598
- return remap$(v, {
1599
- "prefix_messages": "prefixMessages",
1600
- "file_ids": "fileIds",
1601
- "extra_params": "extraParams",
1602
- "invoke_options": "invokeOptions",
1603
- });
1604
- });
1605
-
1606
- /** @internal */
1607
- export type Deployments$Outbound = {
1608
- key: string;
1609
- stream: boolean;
1610
- inputs?: { [k: string]: string | number | boolean } | undefined;
1611
- context?: { [k: string]: any } | undefined;
1612
- prefix_messages?: Array<PrefixMessages$Outbound> | undefined;
1613
- messages?: Array<Messages$Outbound> | undefined;
1614
- file_ids?: Array<string> | undefined;
1615
- metadata?: { [k: string]: any } | undefined;
1616
- extra_params?: { [k: string]: any } | undefined;
1617
- documents?: Array<Documents$Outbound> | undefined;
1618
- invoke_options?: InvokeOptions$Outbound | undefined;
1619
- };
1620
-
1621
- /** @internal */
1622
- export const Deployments$outboundSchema: z.ZodType<
1623
- Deployments$Outbound,
1624
- z.ZodTypeDef,
1625
- Deployments
1626
- > = z.object({
1627
- key: z.string(),
1628
- stream: z.boolean().default(false),
1629
- inputs: z.record(z.union([z.string(), z.number(), z.boolean()])).optional(),
1630
- context: z.record(z.any()).optional(),
1631
- prefixMessages: z.array(z.lazy(() => PrefixMessages$outboundSchema))
1632
- .optional(),
1633
- messages: z.array(z.lazy(() => Messages$outboundSchema)).optional(),
1634
- fileIds: z.array(z.string()).optional(),
1635
- metadata: z.record(z.any()).optional(),
1636
- extraParams: z.record(z.any()).optional(),
1637
- documents: z.array(z.lazy(() => Documents$outboundSchema)).optional(),
1638
- invokeOptions: z.lazy(() => InvokeOptions$outboundSchema).optional(),
1639
- }).transform((v) => {
1640
- return remap$(v, {
1641
- prefixMessages: "prefix_messages",
1642
- fileIds: "file_ids",
1643
- extraParams: "extra_params",
1644
- invokeOptions: "invoke_options",
1645
- });
1646
- });
1647
-
1648
- /**
1649
- * @internal
1650
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1651
- */
1652
- export namespace Deployments$ {
1653
- /** @deprecated use `Deployments$inboundSchema` instead. */
1654
- export const inboundSchema = Deployments$inboundSchema;
1655
- /** @deprecated use `Deployments$outboundSchema` instead. */
1656
- export const outboundSchema = Deployments$outboundSchema;
1657
- /** @deprecated use `Deployments$Outbound` instead. */
1658
- export type Outbound = Deployments$Outbound;
1659
- }
1660
-
1661
- export function deploymentsToJSON(deployments: Deployments): string {
1662
- return JSON.stringify(Deployments$outboundSchema.parse(deployments));
1663
- }
1664
-
1665
- export function deploymentsFromJSON(
1666
- jsonString: string,
1667
- ): SafeParseResult<Deployments, SDKValidationError> {
1668
- return safeParse(
1669
- jsonString,
1670
- (x) => Deployments$inboundSchema.parse(JSON.parse(x)),
1671
- `Failed to parse 'Deployments' from JSON`,
1672
- );
1673
- }