@orq-ai/node 3.3.2 → 3.4.0-rc.0

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 (239) hide show
  1. package/bin/mcp-server.js +6 -9
  2. package/bin/mcp-server.js.map +7 -7
  3. package/jsr.json +1 -1
  4. package/lib/config.d.ts +2 -2
  5. package/lib/config.js +2 -2
  6. package/lib/config.js.map +1 -1
  7. package/mcp-server/mcp-server.js +1 -1
  8. package/mcp-server/mcp-server.js.map +1 -1
  9. package/mcp-server/server.js +1 -1
  10. package/mcp-server/server.js.map +1 -1
  11. package/package.json +3 -2
  12. package/src/lib/config.ts +2 -2
  13. package/src/mcp-server/mcp-server.ts +1 -1
  14. package/src/mcp-server/server.ts +1 -1
  15. package/packages/orq-rc/FUNCTIONS.md +0 -106
  16. package/packages/orq-rc/README.md +0 -698
  17. package/packages/orq-rc/RUNTIMES.md +0 -48
  18. package/packages/orq-rc/docs/sdks/contacts/README.md +0 -84
  19. package/packages/orq-rc/docs/sdks/datasets/README.md +0 -940
  20. package/packages/orq-rc/docs/sdks/deployments/README.md +0 -316
  21. package/packages/orq-rc/docs/sdks/feedback/README.md +0 -92
  22. package/packages/orq-rc/docs/sdks/files/README.md +0 -311
  23. package/packages/orq-rc/docs/sdks/knowledge/README.md +0 -1279
  24. package/packages/orq-rc/docs/sdks/metrics/README.md +0 -86
  25. package/packages/orq-rc/docs/sdks/orq/README.md +0 -10
  26. package/packages/orq-rc/docs/sdks/prompts/README.md +0 -614
  27. package/packages/orq-rc/docs/sdks/remoteconfigs/README.md +0 -80
  28. package/packages/orq-rc/jsr.json +0 -28
  29. package/packages/orq-rc/package-lock.json +0 -3217
  30. package/packages/orq-rc/package.json +0 -45
  31. package/packages/orq-rc/src/core.ts +0 -13
  32. package/packages/orq-rc/src/funcs/contactsCreate.ts +0 -154
  33. package/packages/orq-rc/src/funcs/datasetsClear.ts +0 -161
  34. package/packages/orq-rc/src/funcs/datasetsCreate.ts +0 -159
  35. package/packages/orq-rc/src/funcs/datasetsCreateDatapoint.ts +0 -161
  36. package/packages/orq-rc/src/funcs/datasetsCreateDatapoints.ts +0 -165
  37. package/packages/orq-rc/src/funcs/datasetsDelete.ts +0 -161
  38. package/packages/orq-rc/src/funcs/datasetsDeleteDatapoint.ts +0 -176
  39. package/packages/orq-rc/src/funcs/datasetsList.ts +0 -161
  40. package/packages/orq-rc/src/funcs/datasetsListDatapoints.ts +0 -168
  41. package/packages/orq-rc/src/funcs/datasetsRetrieve.ts +0 -169
  42. package/packages/orq-rc/src/funcs/datasetsRetrieveDatapoint.ts +0 -175
  43. package/packages/orq-rc/src/funcs/datasetsUpdate.ts +0 -170
  44. package/packages/orq-rc/src/funcs/datasetsUpdateDatapoint.ts +0 -173
  45. package/packages/orq-rc/src/funcs/deploymentsGetConfig.ts +0 -162
  46. package/packages/orq-rc/src/funcs/deploymentsInvoke.ts +0 -170
  47. package/packages/orq-rc/src/funcs/deploymentsList.ts +0 -170
  48. package/packages/orq-rc/src/funcs/deploymentsMetricsCreate.ts +0 -162
  49. package/packages/orq-rc/src/funcs/deploymentsStream.ts +0 -178
  50. package/packages/orq-rc/src/funcs/feedbackCreate.ts +0 -154
  51. package/packages/orq-rc/src/funcs/filesCreate.ts +0 -174
  52. package/packages/orq-rc/src/funcs/filesDelete.ts +0 -158
  53. package/packages/orq-rc/src/funcs/filesGet.ts +0 -160
  54. package/packages/orq-rc/src/funcs/filesList.ts +0 -161
  55. package/packages/orq-rc/src/funcs/knowledgeCreate.ts +0 -152
  56. package/packages/orq-rc/src/funcs/knowledgeCreateChunks.ts +0 -165
  57. package/packages/orq-rc/src/funcs/knowledgeCreateDatasource.ts +0 -160
  58. package/packages/orq-rc/src/funcs/knowledgeDelete.ts +0 -161
  59. package/packages/orq-rc/src/funcs/knowledgeDeleteChunk.ts +0 -168
  60. package/packages/orq-rc/src/funcs/knowledgeDeleteDatasource.ts +0 -167
  61. package/packages/orq-rc/src/funcs/knowledgeList.ts +0 -163
  62. package/packages/orq-rc/src/funcs/knowledgeListChunks.ts +0 -172
  63. package/packages/orq-rc/src/funcs/knowledgeListDatasources.ts +0 -168
  64. package/packages/orq-rc/src/funcs/knowledgeRetrieve.ts +0 -160
  65. package/packages/orq-rc/src/funcs/knowledgeRetrieveChunk.ts +0 -167
  66. package/packages/orq-rc/src/funcs/knowledgeRetrieveDatasource.ts +0 -163
  67. package/packages/orq-rc/src/funcs/knowledgeSearch.ts +0 -158
  68. package/packages/orq-rc/src/funcs/knowledgeUpdate.ts +0 -158
  69. package/packages/orq-rc/src/funcs/knowledgeUpdateChunk.ts +0 -168
  70. package/packages/orq-rc/src/funcs/knowledgeUpdateDatasource.ts +0 -164
  71. package/packages/orq-rc/src/funcs/promptsCreate.ts +0 -154
  72. package/packages/orq-rc/src/funcs/promptsDelete.ts +0 -158
  73. package/packages/orq-rc/src/funcs/promptsGetVersion.ts +0 -175
  74. package/packages/orq-rc/src/funcs/promptsList.ts +0 -161
  75. package/packages/orq-rc/src/funcs/promptsListVersions.ts +0 -167
  76. package/packages/orq-rc/src/funcs/promptsRetrieve.ts +0 -160
  77. package/packages/orq-rc/src/funcs/promptsUpdate.ts +0 -167
  78. package/packages/orq-rc/src/funcs/remoteconfigsRetrieve.ts +0 -155
  79. package/packages/orq-rc/src/hooks/global.ts +0 -44
  80. package/packages/orq-rc/src/hooks/hooks.ts +0 -132
  81. package/packages/orq-rc/src/hooks/index.ts +0 -6
  82. package/packages/orq-rc/src/hooks/registration.ts +0 -15
  83. package/packages/orq-rc/src/hooks/types.ts +0 -110
  84. package/packages/orq-rc/src/index.ts +0 -7
  85. package/packages/orq-rc/src/lib/base64.ts +0 -37
  86. package/packages/orq-rc/src/lib/config.ts +0 -70
  87. package/packages/orq-rc/src/lib/dlv.ts +0 -53
  88. package/packages/orq-rc/src/lib/encodings.ts +0 -483
  89. package/packages/orq-rc/src/lib/env.ts +0 -73
  90. package/packages/orq-rc/src/lib/event-streams.ts +0 -264
  91. package/packages/orq-rc/src/lib/files.ts +0 -40
  92. package/packages/orq-rc/src/lib/http.ts +0 -323
  93. package/packages/orq-rc/src/lib/is-plain-object.ts +0 -43
  94. package/packages/orq-rc/src/lib/logger.ts +0 -9
  95. package/packages/orq-rc/src/lib/matchers.ts +0 -325
  96. package/packages/orq-rc/src/lib/primitives.ts +0 -150
  97. package/packages/orq-rc/src/lib/retries.ts +0 -218
  98. package/packages/orq-rc/src/lib/schemas.ts +0 -91
  99. package/packages/orq-rc/src/lib/sdks.ts +0 -395
  100. package/packages/orq-rc/src/lib/security.ts +0 -261
  101. package/packages/orq-rc/src/lib/url.ts +0 -33
  102. package/packages/orq-rc/src/mcp-server/cli/start/command.ts +0 -125
  103. package/packages/orq-rc/src/mcp-server/cli/start/impl.ts +0 -140
  104. package/packages/orq-rc/src/mcp-server/cli.ts +0 -13
  105. package/packages/orq-rc/src/mcp-server/console-logger.ts +0 -71
  106. package/packages/orq-rc/src/mcp-server/extensions.ts +0 -17
  107. package/packages/orq-rc/src/mcp-server/mcp-server.ts +0 -26
  108. package/packages/orq-rc/src/mcp-server/prompts.ts +0 -110
  109. package/packages/orq-rc/src/mcp-server/resources.ts +0 -158
  110. package/packages/orq-rc/src/mcp-server/scopes.ts +0 -7
  111. package/packages/orq-rc/src/mcp-server/server.ts +0 -157
  112. package/packages/orq-rc/src/mcp-server/shared.ts +0 -75
  113. package/packages/orq-rc/src/mcp-server/tools/contactsCreate.ts +0 -37
  114. package/packages/orq-rc/src/mcp-server/tools/datasetsClear.ts +0 -35
  115. package/packages/orq-rc/src/mcp-server/tools/datasetsCreate.ts +0 -37
  116. package/packages/orq-rc/src/mcp-server/tools/datasetsCreateDatapoint.ts +0 -37
  117. package/packages/orq-rc/src/mcp-server/tools/datasetsCreateDatapoints.ts +0 -37
  118. package/packages/orq-rc/src/mcp-server/tools/datasetsDelete.ts +0 -35
  119. package/packages/orq-rc/src/mcp-server/tools/datasetsDeleteDatapoint.ts +0 -35
  120. package/packages/orq-rc/src/mcp-server/tools/datasetsList.ts +0 -37
  121. package/packages/orq-rc/src/mcp-server/tools/datasetsListDatapoints.ts +0 -37
  122. package/packages/orq-rc/src/mcp-server/tools/datasetsRetrieve.ts +0 -37
  123. package/packages/orq-rc/src/mcp-server/tools/datasetsRetrieveDatapoint.ts +0 -37
  124. package/packages/orq-rc/src/mcp-server/tools/datasetsUpdate.ts +0 -37
  125. package/packages/orq-rc/src/mcp-server/tools/datasetsUpdateDatapoint.ts +0 -35
  126. package/packages/orq-rc/src/mcp-server/tools/deploymentsGetConfig.ts +0 -37
  127. package/packages/orq-rc/src/mcp-server/tools/deploymentsInvoke.ts +0 -37
  128. package/packages/orq-rc/src/mcp-server/tools/deploymentsList.ts +0 -37
  129. package/packages/orq-rc/src/mcp-server/tools/deploymentsMetricsCreate.ts +0 -37
  130. package/packages/orq-rc/src/mcp-server/tools/deploymentsStream.ts +0 -37
  131. package/packages/orq-rc/src/mcp-server/tools/feedbackCreate.ts +0 -37
  132. package/packages/orq-rc/src/mcp-server/tools/filesCreate.ts +0 -37
  133. package/packages/orq-rc/src/mcp-server/tools/filesDelete.ts +0 -33
  134. package/packages/orq-rc/src/mcp-server/tools/filesGet.ts +0 -37
  135. package/packages/orq-rc/src/mcp-server/tools/filesList.ts +0 -37
  136. package/packages/orq-rc/src/mcp-server/tools/knowledgeCreate.ts +0 -35
  137. package/packages/orq-rc/src/mcp-server/tools/knowledgeCreateChunks.ts +0 -35
  138. package/packages/orq-rc/src/mcp-server/tools/knowledgeCreateDatasource.ts +0 -35
  139. package/packages/orq-rc/src/mcp-server/tools/knowledgeDelete.ts +0 -35
  140. package/packages/orq-rc/src/mcp-server/tools/knowledgeDeleteChunk.ts +0 -33
  141. package/packages/orq-rc/src/mcp-server/tools/knowledgeDeleteDatasource.ts +0 -35
  142. package/packages/orq-rc/src/mcp-server/tools/knowledgeList.ts +0 -37
  143. package/packages/orq-rc/src/mcp-server/tools/knowledgeListChunks.ts +0 -35
  144. package/packages/orq-rc/src/mcp-server/tools/knowledgeListDatasources.ts +0 -35
  145. package/packages/orq-rc/src/mcp-server/tools/knowledgeRetrieve.ts +0 -37
  146. package/packages/orq-rc/src/mcp-server/tools/knowledgeRetrieveChunk.ts +0 -35
  147. package/packages/orq-rc/src/mcp-server/tools/knowledgeRetrieveDatasource.ts +0 -35
  148. package/packages/orq-rc/src/mcp-server/tools/knowledgeSearch.ts +0 -35
  149. package/packages/orq-rc/src/mcp-server/tools/knowledgeUpdate.ts +0 -35
  150. package/packages/orq-rc/src/mcp-server/tools/knowledgeUpdateChunk.ts +0 -35
  151. package/packages/orq-rc/src/mcp-server/tools/knowledgeUpdateDatasource.ts +0 -35
  152. package/packages/orq-rc/src/mcp-server/tools/promptsCreate.ts +0 -35
  153. package/packages/orq-rc/src/mcp-server/tools/promptsDelete.ts +0 -33
  154. package/packages/orq-rc/src/mcp-server/tools/promptsGetVersion.ts +0 -37
  155. package/packages/orq-rc/src/mcp-server/tools/promptsList.ts +0 -37
  156. package/packages/orq-rc/src/mcp-server/tools/promptsListVersions.ts +0 -37
  157. package/packages/orq-rc/src/mcp-server/tools/promptsRetrieve.ts +0 -37
  158. package/packages/orq-rc/src/mcp-server/tools/promptsUpdate.ts +0 -35
  159. package/packages/orq-rc/src/mcp-server/tools/remoteconfigsRetrieve.ts +0 -36
  160. package/packages/orq-rc/src/mcp-server/tools.ts +0 -126
  161. package/packages/orq-rc/src/models/components/deployments.ts +0 -4164
  162. package/packages/orq-rc/src/models/components/index.ts +0 -6
  163. package/packages/orq-rc/src/models/components/security.ts +0 -71
  164. package/packages/orq-rc/src/models/errors/apierror.ts +0 -27
  165. package/packages/orq-rc/src/models/errors/getpromptversion.ts +0 -71
  166. package/packages/orq-rc/src/models/errors/honoapierror.ts +0 -82
  167. package/packages/orq-rc/src/models/errors/httpclienterrors.ts +0 -62
  168. package/packages/orq-rc/src/models/errors/index.ts +0 -10
  169. package/packages/orq-rc/src/models/errors/sdkvalidationerror.ts +0 -97
  170. package/packages/orq-rc/src/models/errors/updateprompt.ts +0 -71
  171. package/packages/orq-rc/src/models/operations/bulkcreatedatapoints.ts +0 -1816
  172. package/packages/orq-rc/src/models/operations/cleardataset.ts +0 -75
  173. package/packages/orq-rc/src/models/operations/createchunk.ts +0 -680
  174. package/packages/orq-rc/src/models/operations/createcontact.ts +0 -256
  175. package/packages/orq-rc/src/models/operations/createdataset.ts +0 -296
  176. package/packages/orq-rc/src/models/operations/createdatasetitem.ts +0 -1740
  177. package/packages/orq-rc/src/models/operations/createdatasource.ts +0 -852
  178. package/packages/orq-rc/src/models/operations/createfeedback.ts +0 -286
  179. package/packages/orq-rc/src/models/operations/createknowledge.ts +0 -676
  180. package/packages/orq-rc/src/models/operations/createprompt.ts +0 -3743
  181. package/packages/orq-rc/src/models/operations/deletechunk.ts +0 -96
  182. package/packages/orq-rc/src/models/operations/deletedatapoint.ts +0 -81
  183. package/packages/orq-rc/src/models/operations/deletedataset.ts +0 -75
  184. package/packages/orq-rc/src/models/operations/deletedatasource.ts +0 -87
  185. package/packages/orq-rc/src/models/operations/deleteknowledge.ts +0 -78
  186. package/packages/orq-rc/src/models/operations/deleteprompt.ts +0 -69
  187. package/packages/orq-rc/src/models/operations/deploymentcreatemetric.ts +0 -4936
  188. package/packages/orq-rc/src/models/operations/deploymentgetconfig.ts +0 -6090
  189. package/packages/orq-rc/src/models/operations/deploymentinvoke.ts +0 -1199
  190. package/packages/orq-rc/src/models/operations/deployments.ts +0 -2155
  191. package/packages/orq-rc/src/models/operations/deploymentstream.ts +0 -5960
  192. package/packages/orq-rc/src/models/operations/filedelete.ts +0 -78
  193. package/packages/orq-rc/src/models/operations/fileget.ts +0 -223
  194. package/packages/orq-rc/src/models/operations/filelist.ts +0 -337
  195. package/packages/orq-rc/src/models/operations/fileupload.ts +0 -324
  196. package/packages/orq-rc/src/models/operations/getallprompts.ts +0 -2127
  197. package/packages/orq-rc/src/models/operations/getonechunk.ts +0 -265
  198. package/packages/orq-rc/src/models/operations/getoneknowledge.ts +0 -444
  199. package/packages/orq-rc/src/models/operations/getoneprompt.ts +0 -1993
  200. package/packages/orq-rc/src/models/operations/getpromptversion.ts +0 -1991
  201. package/packages/orq-rc/src/models/operations/index.ts +0 -51
  202. package/packages/orq-rc/src/models/operations/listchunks.ts +0 -444
  203. package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +0 -1071
  204. package/packages/orq-rc/src/models/operations/listdatasets.ts +0 -406
  205. package/packages/orq-rc/src/models/operations/listdatasources.ts +0 -447
  206. package/packages/orq-rc/src/models/operations/listknowledgebases.ts +0 -568
  207. package/packages/orq-rc/src/models/operations/listpromptversions.ts +0 -2125
  208. package/packages/orq-rc/src/models/operations/remoteconfigsgetconfig.ts +0 -190
  209. package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +0 -924
  210. package/packages/orq-rc/src/models/operations/retrievedataset.ts +0 -288
  211. package/packages/orq-rc/src/models/operations/retrievedatasource.ts +0 -273
  212. package/packages/orq-rc/src/models/operations/searchknowledge.ts +0 -1673
  213. package/packages/orq-rc/src/models/operations/updatechunk.ts +0 -418
  214. package/packages/orq-rc/src/models/operations/updatedatapoint.ts +0 -1729
  215. package/packages/orq-rc/src/models/operations/updatedataset.ts +0 -393
  216. package/packages/orq-rc/src/models/operations/updatedatasource.ts +0 -345
  217. package/packages/orq-rc/src/models/operations/updateknowledge.ts +0 -790
  218. package/packages/orq-rc/src/models/operations/updateprompt.ts +0 -3929
  219. package/packages/orq-rc/src/sdk/contacts.ts +0 -27
  220. package/packages/orq-rc/src/sdk/datasets.ts +0 -222
  221. package/packages/orq-rc/src/sdk/deployments.ts +0 -89
  222. package/packages/orq-rc/src/sdk/feedback.ts +0 -27
  223. package/packages/orq-rc/src/sdk/files.ts +0 -78
  224. package/packages/orq-rc/src/sdk/index.ts +0 -5
  225. package/packages/orq-rc/src/sdk/knowledge.ts +0 -261
  226. package/packages/orq-rc/src/sdk/metrics.ts +0 -27
  227. package/packages/orq-rc/src/sdk/prompts.ts +0 -126
  228. package/packages/orq-rc/src/sdk/remoteconfigs.ts +0 -24
  229. package/packages/orq-rc/src/sdk/sdk.ts +0 -55
  230. package/packages/orq-rc/src/types/async.ts +0 -68
  231. package/packages/orq-rc/src/types/blobs.ts +0 -31
  232. package/packages/orq-rc/src/types/constdatetime.ts +0 -15
  233. package/packages/orq-rc/src/types/enums.ts +0 -16
  234. package/packages/orq-rc/src/types/fp.ts +0 -50
  235. package/packages/orq-rc/src/types/index.ts +0 -11
  236. package/packages/orq-rc/src/types/operations.ts +0 -105
  237. package/packages/orq-rc/src/types/rfcdate.ts +0 -54
  238. package/packages/orq-rc/src/types/streams.ts +0 -21
  239. package/packages/orq-rc/tsconfig.json +0 -41
@@ -1,4164 +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 messages author, in this case tool.
16
- */
17
- export const DeploymentsPrefixMessages5Role = {
18
- Tool: "tool",
19
- } as const;
20
- /**
21
- * The role of the messages author, in this case tool.
22
- */
23
- export type DeploymentsPrefixMessages5Role = ClosedEnum<
24
- typeof DeploymentsPrefixMessages5Role
25
- >;
26
-
27
- /**
28
- * The contents of the tool message.
29
- */
30
- export type DeploymentsPrefixMessagesContent = string | Array<string>;
31
-
32
- export type ToolMessage = {
33
- /**
34
- * The role of the messages author, in this case tool.
35
- */
36
- role: DeploymentsPrefixMessages5Role;
37
- /**
38
- * The contents of the tool message.
39
- */
40
- content: string | Array<string>;
41
- /**
42
- * Tool call that this message is responding to.
43
- */
44
- toolCallId: string;
45
- };
46
-
47
- /**
48
- * The type of the content part.
49
- */
50
- export const Deployments2PrefixMessages4Type = {
51
- Refusal: "refusal",
52
- } as const;
53
- /**
54
- * The type of the content part.
55
- */
56
- export type Deployments2PrefixMessages4Type = ClosedEnum<
57
- typeof Deployments2PrefixMessages4Type
58
- >;
59
-
60
- export type RefusalContentPart = {
61
- /**
62
- * The type of the content part.
63
- */
64
- type: Deployments2PrefixMessages4Type;
65
- /**
66
- * The refusal message generated by the model.
67
- */
68
- refusal: string;
69
- };
70
-
71
- /**
72
- * The type of the content part.
73
- */
74
- export const Deployments2PrefixMessagesType = {
75
- Text: "text",
76
- } as const;
77
- /**
78
- * The type of the content part.
79
- */
80
- export type Deployments2PrefixMessagesType = ClosedEnum<
81
- typeof Deployments2PrefixMessagesType
82
- >;
83
-
84
- export type TextContentPart = {
85
- /**
86
- * The type of the content part.
87
- */
88
- type: Deployments2PrefixMessagesType;
89
- /**
90
- * The text content.
91
- */
92
- text: string;
93
- };
94
-
95
- export type Content2 = TextContentPart | RefusalContentPart;
96
-
97
- /**
98
- * The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified.
99
- */
100
- export type PrefixMessagesContent =
101
- | string
102
- | Array<TextContentPart | RefusalContentPart>;
103
-
104
- /**
105
- * The role of the messages author, in this case `assistant`.
106
- */
107
- export const DeploymentsPrefixMessages4Role = {
108
- Assistant: "assistant",
109
- } as const;
110
- /**
111
- * The role of the messages author, in this case `assistant`.
112
- */
113
- export type DeploymentsPrefixMessages4Role = ClosedEnum<
114
- typeof DeploymentsPrefixMessages4Role
115
- >;
116
-
117
- /**
118
- * Data about a previous audio response from the model.
119
- */
120
- export type Audio = {
121
- /**
122
- * Unique identifier for a previous audio response from the model.
123
- */
124
- id: string;
125
- };
126
-
127
- /**
128
- * The type of the tool. Currently, only `function` is supported.
129
- */
130
- export const Type = {
131
- Function: "function",
132
- } as const;
133
- /**
134
- * The type of the tool. Currently, only `function` is supported.
135
- */
136
- export type Type = ClosedEnum<typeof Type>;
137
-
138
- export type FunctionT = {
139
- /**
140
- * The name of the function to call.
141
- */
142
- name?: string | undefined;
143
- /**
144
- * The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.
145
- */
146
- arguments?: string | undefined;
147
- };
148
-
149
- export type ToolCalls = {
150
- /**
151
- * The ID of the tool call.
152
- */
153
- id: string;
154
- /**
155
- * The type of the tool. Currently, only `function` is supported.
156
- */
157
- type: Type;
158
- function: FunctionT;
159
- };
160
-
161
- export type AssistantMessage = {
162
- /**
163
- * The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified.
164
- */
165
- content?: string | Array<TextContentPart | RefusalContentPart> | undefined;
166
- /**
167
- * The refusal message by the assistant.
168
- */
169
- refusal?: string | null | undefined;
170
- /**
171
- * The role of the messages author, in this case `assistant`.
172
- */
173
- role: DeploymentsPrefixMessages4Role;
174
- /**
175
- * An optional name for the participant. Provides the model information to differentiate between participants of the same role.
176
- */
177
- name?: string | undefined;
178
- /**
179
- * Data about a previous audio response from the model.
180
- */
181
- audio?: Audio | null | undefined;
182
- /**
183
- * The tool calls generated by the model, such as function calls.
184
- */
185
- toolCalls?: Array<ToolCalls> | undefined;
186
- };
187
-
188
- /**
189
- * The role of the messages author, in this case `user`.
190
- */
191
- export const DeploymentsPrefixMessagesRole = {
192
- User: "user",
193
- } as const;
194
- /**
195
- * The role of the messages author, in this case `user`.
196
- */
197
- export type DeploymentsPrefixMessagesRole = ClosedEnum<
198
- typeof DeploymentsPrefixMessagesRole
199
- >;
200
-
201
- export const Deployments2Type = {
202
- InputAudio: "input_audio",
203
- } as const;
204
- export type Deployments2Type = ClosedEnum<typeof Deployments2Type>;
205
-
206
- /**
207
- * The format of the encoded audio data. Currently supports `wav` and `mp3`.
208
- */
209
- export const Format = {
210
- Mp3: "mp3",
211
- Wav: "wav",
212
- } as const;
213
- /**
214
- * The format of the encoded audio data. Currently supports `wav` and `mp3`.
215
- */
216
- export type Format = ClosedEnum<typeof Format>;
217
-
218
- export type InputAudio = {
219
- /**
220
- * Base64 encoded audio data.
221
- */
222
- data: string;
223
- /**
224
- * The format of the encoded audio data. Currently supports `wav` and `mp3`.
225
- */
226
- format: Format;
227
- };
228
-
229
- export type Three = {
230
- type: Deployments2Type;
231
- inputAudio: InputAudio;
232
- };
233
-
234
- export const TwoType = {
235
- ImageUrl: "image_url",
236
- } as const;
237
- export type TwoType = ClosedEnum<typeof TwoType>;
238
-
239
- /**
240
- * Specifies the detail level of the image.
241
- */
242
- export const Detail = {
243
- Low: "low",
244
- High: "high",
245
- Auto: "auto",
246
- } as const;
247
- /**
248
- * Specifies the detail level of the image.
249
- */
250
- export type Detail = ClosedEnum<typeof Detail>;
251
-
252
- export type ImageUrl = {
253
- /**
254
- * Either a URL of the image or the base64 encoded image data.
255
- */
256
- url: string;
257
- /**
258
- * Specifies the detail level of the image.
259
- */
260
- detail?: Detail | undefined;
261
- };
262
-
263
- export type Two2 = {
264
- type: TwoType;
265
- imageUrl: ImageUrl;
266
- };
267
-
268
- export const Deployments2PrefixMessages3Type = {
269
- Text: "text",
270
- } as const;
271
- export type Deployments2PrefixMessages3Type = ClosedEnum<
272
- typeof Deployments2PrefixMessages3Type
273
- >;
274
-
275
- export type One = {
276
- type: Deployments2PrefixMessages3Type;
277
- text: string;
278
- };
279
-
280
- export type Two = One | Two2 | Three;
281
-
282
- /**
283
- * The contents of the user message.
284
- */
285
- export type Content = string | Array<One | Two2 | Three>;
286
-
287
- export type UserMessage = {
288
- /**
289
- * The role of the messages author, in this case `user`.
290
- */
291
- role: DeploymentsPrefixMessagesRole;
292
- /**
293
- * An optional name for the participant. Provides the model information to differentiate between participants of the same role.
294
- */
295
- name?: string | undefined;
296
- /**
297
- * The contents of the user message.
298
- */
299
- content: string | Array<One | Two2 | Three>;
300
- };
301
-
302
- /**
303
- * The role of the messages author, in this case `system`.
304
- */
305
- export const PrefixMessagesRole = {
306
- System: "system",
307
- } as const;
308
- /**
309
- * The role of the messages author, in this case `system`.
310
- */
311
- export type PrefixMessagesRole = ClosedEnum<typeof PrefixMessagesRole>;
312
-
313
- export type SystemMessage = {
314
- /**
315
- * The role of the messages author, in this case `system`.
316
- */
317
- role: PrefixMessagesRole;
318
- /**
319
- * The contents of the system message.
320
- */
321
- content: string;
322
- /**
323
- * An optional name for the participant. Provides the model information to differentiate between participants of the same role.
324
- */
325
- name?: string | undefined;
326
- };
327
-
328
- /**
329
- * The role of the messages author, in this case `developer`.
330
- */
331
- export const Role = {
332
- Developer: "developer",
333
- } as const;
334
- /**
335
- * The role of the messages author, in this case `developer`.
336
- */
337
- export type Role = ClosedEnum<typeof Role>;
338
-
339
- export type DeveloperMessage = {
340
- /**
341
- * The role of the messages author, in this case `developer`.
342
- */
343
- role: Role;
344
- /**
345
- * The contents of the developer message.
346
- */
347
- content: string;
348
- /**
349
- * An optional name for the participant. Provides the model information to differentiate between participants of the same role.
350
- */
351
- name?: string | undefined;
352
- };
353
-
354
- export type PrefixMessages =
355
- | DeveloperMessage
356
- | SystemMessage
357
- | UserMessage
358
- | ToolMessage
359
- | AssistantMessage;
360
-
361
- /**
362
- * The role of the messages author, in this case tool.
363
- */
364
- export const DeploymentsMessages5Role = {
365
- Tool: "tool",
366
- } as const;
367
- /**
368
- * The role of the messages author, in this case tool.
369
- */
370
- export type DeploymentsMessages5Role = ClosedEnum<
371
- typeof DeploymentsMessages5Role
372
- >;
373
-
374
- /**
375
- * The contents of the tool message.
376
- */
377
- export type DeploymentsMessages5Content = string | Array<string>;
378
-
379
- export type MessagesToolMessage = {
380
- /**
381
- * The role of the messages author, in this case tool.
382
- */
383
- role: DeploymentsMessages5Role;
384
- /**
385
- * The contents of the tool message.
386
- */
387
- content: string | Array<string>;
388
- /**
389
- * Tool call that this message is responding to.
390
- */
391
- toolCallId: string;
392
- };
393
-
394
- /**
395
- * The type of the content part.
396
- */
397
- export const Deployments2Messages4ContentType = {
398
- Refusal: "refusal",
399
- } as const;
400
- /**
401
- * The type of the content part.
402
- */
403
- export type Deployments2Messages4ContentType = ClosedEnum<
404
- typeof Deployments2Messages4ContentType
405
- >;
406
-
407
- export type TwoRefusalContentPart = {
408
- /**
409
- * The type of the content part.
410
- */
411
- type: Deployments2Messages4ContentType;
412
- /**
413
- * The refusal message generated by the model.
414
- */
415
- refusal: string;
416
- };
417
-
418
- /**
419
- * The type of the content part.
420
- */
421
- export const Deployments2Messages4Type = {
422
- Text: "text",
423
- } as const;
424
- /**
425
- * The type of the content part.
426
- */
427
- export type Deployments2Messages4Type = ClosedEnum<
428
- typeof Deployments2Messages4Type
429
- >;
430
-
431
- export type TwoTextContentPart = {
432
- /**
433
- * The type of the content part.
434
- */
435
- type: Deployments2Messages4Type;
436
- /**
437
- * The text content.
438
- */
439
- text: string;
440
- };
441
-
442
- export type DeploymentsContentMessages2 =
443
- | TwoTextContentPart
444
- | TwoRefusalContentPart;
445
-
446
- /**
447
- * The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified.
448
- */
449
- export type DeploymentsMessagesContent =
450
- | string
451
- | Array<TwoTextContentPart | TwoRefusalContentPart>;
452
-
453
- /**
454
- * The role of the messages author, in this case `assistant`.
455
- */
456
- export const DeploymentsMessages4Role = {
457
- Assistant: "assistant",
458
- } as const;
459
- /**
460
- * The role of the messages author, in this case `assistant`.
461
- */
462
- export type DeploymentsMessages4Role = ClosedEnum<
463
- typeof DeploymentsMessages4Role
464
- >;
465
-
466
- /**
467
- * Data about a previous audio response from the model.
468
- */
469
- export type MessagesAudio = {
470
- /**
471
- * Unique identifier for a previous audio response from the model.
472
- */
473
- id: string;
474
- };
475
-
476
- /**
477
- * The type of the tool. Currently, only `function` is supported.
478
- */
479
- export const MessagesType = {
480
- Function: "function",
481
- } as const;
482
- /**
483
- * The type of the tool. Currently, only `function` is supported.
484
- */
485
- export type MessagesType = ClosedEnum<typeof MessagesType>;
486
-
487
- export type MessagesFunction = {
488
- /**
489
- * The name of the function to call.
490
- */
491
- name?: string | undefined;
492
- /**
493
- * The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.
494
- */
495
- arguments?: string | undefined;
496
- };
497
-
498
- export type MessagesToolCalls = {
499
- /**
500
- * The ID of the tool call.
501
- */
502
- id: string;
503
- /**
504
- * The type of the tool. Currently, only `function` is supported.
505
- */
506
- type: MessagesType;
507
- function: MessagesFunction;
508
- };
509
-
510
- export type MessagesAssistantMessage = {
511
- /**
512
- * The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified.
513
- */
514
- content?:
515
- | string
516
- | Array<TwoTextContentPart | TwoRefusalContentPart>
517
- | undefined;
518
- /**
519
- * The refusal message by the assistant.
520
- */
521
- refusal?: string | null | undefined;
522
- /**
523
- * The role of the messages author, in this case `assistant`.
524
- */
525
- role: DeploymentsMessages4Role;
526
- /**
527
- * An optional name for the participant. Provides the model information to differentiate between participants of the same role.
528
- */
529
- name?: string | undefined;
530
- /**
531
- * Data about a previous audio response from the model.
532
- */
533
- audio?: MessagesAudio | null | undefined;
534
- /**
535
- * The tool calls generated by the model, such as function calls.
536
- */
537
- toolCalls?: Array<MessagesToolCalls> | undefined;
538
- };
539
-
540
- /**
541
- * The role of the messages author, in this case `user`.
542
- */
543
- export const DeploymentsMessages3Role = {
544
- User: "user",
545
- } as const;
546
- /**
547
- * The role of the messages author, in this case `user`.
548
- */
549
- export type DeploymentsMessages3Role = ClosedEnum<
550
- typeof DeploymentsMessages3Role
551
- >;
552
-
553
- export const Deployments2Messages3ContentType = {
554
- InputAudio: "input_audio",
555
- } as const;
556
- export type Deployments2Messages3ContentType = ClosedEnum<
557
- typeof Deployments2Messages3ContentType
558
- >;
559
-
560
- /**
561
- * The format of the encoded audio data. Currently supports `wav` and `mp3`.
562
- */
563
- export const TwoFormat = {
564
- Mp3: "mp3",
565
- Wav: "wav",
566
- } as const;
567
- /**
568
- * The format of the encoded audio data. Currently supports `wav` and `mp3`.
569
- */
570
- export type TwoFormat = ClosedEnum<typeof TwoFormat>;
571
-
572
- export type TwoInputAudio = {
573
- /**
574
- * Base64 encoded audio data.
575
- */
576
- data: string;
577
- /**
578
- * The format of the encoded audio data. Currently supports `wav` and `mp3`.
579
- */
580
- format: TwoFormat;
581
- };
582
-
583
- export type Two3 = {
584
- type: Deployments2Messages3ContentType;
585
- inputAudio: TwoInputAudio;
586
- };
587
-
588
- export const Deployments2Messages3Type = {
589
- ImageUrl: "image_url",
590
- } as const;
591
- export type Deployments2Messages3Type = ClosedEnum<
592
- typeof Deployments2Messages3Type
593
- >;
594
-
595
- /**
596
- * Specifies the detail level of the image.
597
- */
598
- export const TwoDetail = {
599
- Low: "low",
600
- High: "high",
601
- Auto: "auto",
602
- } as const;
603
- /**
604
- * Specifies the detail level of the image.
605
- */
606
- export type TwoDetail = ClosedEnum<typeof TwoDetail>;
607
-
608
- export type TwoImageUrl = {
609
- /**
610
- * Either a URL of the image or the base64 encoded image data.
611
- */
612
- url: string;
613
- /**
614
- * Specifies the detail level of the image.
615
- */
616
- detail?: TwoDetail | undefined;
617
- };
618
-
619
- export type Deployments22 = {
620
- type: Deployments2Messages3Type;
621
- imageUrl: TwoImageUrl;
622
- };
623
-
624
- export const Deployments2MessagesType = {
625
- Text: "text",
626
- } as const;
627
- export type Deployments2MessagesType = ClosedEnum<
628
- typeof Deployments2MessagesType
629
- >;
630
-
631
- export type Two1 = {
632
- type: Deployments2MessagesType;
633
- text: string;
634
- };
635
-
636
- export type DeploymentsContent2 = Two1 | Deployments22 | Two3;
637
-
638
- /**
639
- * The contents of the user message.
640
- */
641
- export type MessagesContent = string | Array<Two1 | Deployments22 | Two3>;
642
-
643
- export type MessagesUserMessage = {
644
- /**
645
- * The role of the messages author, in this case `user`.
646
- */
647
- role: DeploymentsMessages3Role;
648
- /**
649
- * An optional name for the participant. Provides the model information to differentiate between participants of the same role.
650
- */
651
- name?: string | undefined;
652
- /**
653
- * The contents of the user message.
654
- */
655
- content: string | Array<Two1 | Deployments22 | Two3>;
656
- };
657
-
658
- /**
659
- * The role of the messages author, in this case `system`.
660
- */
661
- export const DeploymentsMessagesRole = {
662
- System: "system",
663
- } as const;
664
- /**
665
- * The role of the messages author, in this case `system`.
666
- */
667
- export type DeploymentsMessagesRole = ClosedEnum<
668
- typeof DeploymentsMessagesRole
669
- >;
670
-
671
- export type MessagesSystemMessage = {
672
- /**
673
- * The role of the messages author, in this case `system`.
674
- */
675
- role: DeploymentsMessagesRole;
676
- /**
677
- * The contents of the system message.
678
- */
679
- content: string;
680
- /**
681
- * An optional name for the participant. Provides the model information to differentiate between participants of the same role.
682
- */
683
- name?: string | undefined;
684
- };
685
-
686
- /**
687
- * The role of the messages author, in this case `developer`.
688
- */
689
- export const MessagesRole = {
690
- Developer: "developer",
691
- } as const;
692
- /**
693
- * The role of the messages author, in this case `developer`.
694
- */
695
- export type MessagesRole = ClosedEnum<typeof MessagesRole>;
696
-
697
- export type MessagesDeveloperMessage = {
698
- /**
699
- * The role of the messages author, in this case `developer`.
700
- */
701
- role: MessagesRole;
702
- /**
703
- * The contents of the developer message.
704
- */
705
- content: string;
706
- /**
707
- * An optional name for the participant. Provides the model information to differentiate between participants of the same role.
708
- */
709
- name?: string | undefined;
710
- };
711
-
712
- export type Messages =
713
- | MessagesDeveloperMessage
714
- | MessagesSystemMessage
715
- | MessagesUserMessage
716
- | MessagesToolMessage
717
- | MessagesAssistantMessage;
718
-
719
- /**
720
- * Metadata about the document
721
- */
722
- export type Metadata = {
723
- /**
724
- * Name of the file the text is from.
725
- */
726
- fileName?: string | undefined;
727
- /**
728
- * Content type of the file the text is from.
729
- */
730
- fileType?: string | undefined;
731
- /**
732
- * The page number the text is from.
733
- */
734
- pageNumber?: number | undefined;
735
- };
736
-
737
- export type Documents = {
738
- /**
739
- * The text content of the document
740
- */
741
- text: string;
742
- /**
743
- * Metadata about the document
744
- */
745
- metadata?: Metadata | undefined;
746
- };
747
-
748
- export type InvokeOptions = {
749
- /**
750
- * Whether to include the retrieved knowledge chunks in the response.
751
- */
752
- includeRetrievals?: boolean | undefined;
753
- };
754
-
755
- /**
756
- * The deployment request payload
757
- */
758
- export type Deployments = {
759
- /**
760
- * The deployment key to invoke
761
- */
762
- key: string;
763
- /**
764
- * 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.
765
- */
766
- inputs?: { [k: string]: string | number | boolean } | undefined;
767
- /**
768
- * 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.
769
- */
770
- context?: { [k: string]: any } | undefined;
771
- /**
772
- * A list of messages to include after the `System` message, but before the `User` and `Assistant` pairs configured in your deployment.
773
- */
774
- prefixMessages?:
775
- | Array<
776
- | DeveloperMessage
777
- | SystemMessage
778
- | UserMessage
779
- | ToolMessage
780
- | AssistantMessage
781
- >
782
- | undefined;
783
- /**
784
- * A list of messages to send to the deployment.
785
- */
786
- messages?:
787
- | Array<
788
- | MessagesDeveloperMessage
789
- | MessagesSystemMessage
790
- | MessagesUserMessage
791
- | MessagesToolMessage
792
- | MessagesAssistantMessage
793
- >
794
- | undefined;
795
- /**
796
- * A list of file IDs that are associated with the deployment request.
797
- */
798
- fileIds?: Array<string> | undefined;
799
- /**
800
- * Key-value pairs that you want to attach to the log generated by this request.
801
- */
802
- metadata?: { [k: string]: any } | undefined;
803
- /**
804
- * 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.
805
- */
806
- extraParams?: { [k: string]: any } | undefined;
807
- /**
808
- * 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.
809
- */
810
- documents?: Array<Documents> | undefined;
811
- invokeOptions?: InvokeOptions | undefined;
812
- };
813
-
814
- /** @internal */
815
- export const Inputs$inboundSchema: z.ZodType<Inputs, z.ZodTypeDef, unknown> = z
816
- .union([z.string(), z.number(), z.boolean()]);
817
-
818
- /** @internal */
819
- export type Inputs$Outbound = string | number | boolean;
820
-
821
- /** @internal */
822
- export const Inputs$outboundSchema: z.ZodType<
823
- Inputs$Outbound,
824
- z.ZodTypeDef,
825
- Inputs
826
- > = z.union([z.string(), z.number(), z.boolean()]);
827
-
828
- /**
829
- * @internal
830
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
831
- */
832
- export namespace Inputs$ {
833
- /** @deprecated use `Inputs$inboundSchema` instead. */
834
- export const inboundSchema = Inputs$inboundSchema;
835
- /** @deprecated use `Inputs$outboundSchema` instead. */
836
- export const outboundSchema = Inputs$outboundSchema;
837
- /** @deprecated use `Inputs$Outbound` instead. */
838
- export type Outbound = Inputs$Outbound;
839
- }
840
-
841
- export function inputsToJSON(inputs: Inputs): string {
842
- return JSON.stringify(Inputs$outboundSchema.parse(inputs));
843
- }
844
-
845
- export function inputsFromJSON(
846
- jsonString: string,
847
- ): SafeParseResult<Inputs, SDKValidationError> {
848
- return safeParse(
849
- jsonString,
850
- (x) => Inputs$inboundSchema.parse(JSON.parse(x)),
851
- `Failed to parse 'Inputs' from JSON`,
852
- );
853
- }
854
-
855
- /** @internal */
856
- export const DeploymentsPrefixMessages5Role$inboundSchema: z.ZodNativeEnum<
857
- typeof DeploymentsPrefixMessages5Role
858
- > = z.nativeEnum(DeploymentsPrefixMessages5Role);
859
-
860
- /** @internal */
861
- export const DeploymentsPrefixMessages5Role$outboundSchema: z.ZodNativeEnum<
862
- typeof DeploymentsPrefixMessages5Role
863
- > = DeploymentsPrefixMessages5Role$inboundSchema;
864
-
865
- /**
866
- * @internal
867
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
868
- */
869
- export namespace DeploymentsPrefixMessages5Role$ {
870
- /** @deprecated use `DeploymentsPrefixMessages5Role$inboundSchema` instead. */
871
- export const inboundSchema = DeploymentsPrefixMessages5Role$inboundSchema;
872
- /** @deprecated use `DeploymentsPrefixMessages5Role$outboundSchema` instead. */
873
- export const outboundSchema = DeploymentsPrefixMessages5Role$outboundSchema;
874
- }
875
-
876
- /** @internal */
877
- export const DeploymentsPrefixMessagesContent$inboundSchema: z.ZodType<
878
- DeploymentsPrefixMessagesContent,
879
- z.ZodTypeDef,
880
- unknown
881
- > = z.union([z.string(), z.array(z.string())]);
882
-
883
- /** @internal */
884
- export type DeploymentsPrefixMessagesContent$Outbound = string | Array<string>;
885
-
886
- /** @internal */
887
- export const DeploymentsPrefixMessagesContent$outboundSchema: z.ZodType<
888
- DeploymentsPrefixMessagesContent$Outbound,
889
- z.ZodTypeDef,
890
- DeploymentsPrefixMessagesContent
891
- > = z.union([z.string(), z.array(z.string())]);
892
-
893
- /**
894
- * @internal
895
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
896
- */
897
- export namespace DeploymentsPrefixMessagesContent$ {
898
- /** @deprecated use `DeploymentsPrefixMessagesContent$inboundSchema` instead. */
899
- export const inboundSchema = DeploymentsPrefixMessagesContent$inboundSchema;
900
- /** @deprecated use `DeploymentsPrefixMessagesContent$outboundSchema` instead. */
901
- export const outboundSchema = DeploymentsPrefixMessagesContent$outboundSchema;
902
- /** @deprecated use `DeploymentsPrefixMessagesContent$Outbound` instead. */
903
- export type Outbound = DeploymentsPrefixMessagesContent$Outbound;
904
- }
905
-
906
- export function deploymentsPrefixMessagesContentToJSON(
907
- deploymentsPrefixMessagesContent: DeploymentsPrefixMessagesContent,
908
- ): string {
909
- return JSON.stringify(
910
- DeploymentsPrefixMessagesContent$outboundSchema.parse(
911
- deploymentsPrefixMessagesContent,
912
- ),
913
- );
914
- }
915
-
916
- export function deploymentsPrefixMessagesContentFromJSON(
917
- jsonString: string,
918
- ): SafeParseResult<DeploymentsPrefixMessagesContent, SDKValidationError> {
919
- return safeParse(
920
- jsonString,
921
- (x) => DeploymentsPrefixMessagesContent$inboundSchema.parse(JSON.parse(x)),
922
- `Failed to parse 'DeploymentsPrefixMessagesContent' from JSON`,
923
- );
924
- }
925
-
926
- /** @internal */
927
- export const ToolMessage$inboundSchema: z.ZodType<
928
- ToolMessage,
929
- z.ZodTypeDef,
930
- unknown
931
- > = z.object({
932
- role: DeploymentsPrefixMessages5Role$inboundSchema,
933
- content: z.union([z.string(), z.array(z.string())]),
934
- tool_call_id: z.string(),
935
- }).transform((v) => {
936
- return remap$(v, {
937
- "tool_call_id": "toolCallId",
938
- });
939
- });
940
-
941
- /** @internal */
942
- export type ToolMessage$Outbound = {
943
- role: string;
944
- content: string | Array<string>;
945
- tool_call_id: string;
946
- };
947
-
948
- /** @internal */
949
- export const ToolMessage$outboundSchema: z.ZodType<
950
- ToolMessage$Outbound,
951
- z.ZodTypeDef,
952
- ToolMessage
953
- > = z.object({
954
- role: DeploymentsPrefixMessages5Role$outboundSchema,
955
- content: z.union([z.string(), z.array(z.string())]),
956
- toolCallId: z.string(),
957
- }).transform((v) => {
958
- return remap$(v, {
959
- toolCallId: "tool_call_id",
960
- });
961
- });
962
-
963
- /**
964
- * @internal
965
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
966
- */
967
- export namespace ToolMessage$ {
968
- /** @deprecated use `ToolMessage$inboundSchema` instead. */
969
- export const inboundSchema = ToolMessage$inboundSchema;
970
- /** @deprecated use `ToolMessage$outboundSchema` instead. */
971
- export const outboundSchema = ToolMessage$outboundSchema;
972
- /** @deprecated use `ToolMessage$Outbound` instead. */
973
- export type Outbound = ToolMessage$Outbound;
974
- }
975
-
976
- export function toolMessageToJSON(toolMessage: ToolMessage): string {
977
- return JSON.stringify(ToolMessage$outboundSchema.parse(toolMessage));
978
- }
979
-
980
- export function toolMessageFromJSON(
981
- jsonString: string,
982
- ): SafeParseResult<ToolMessage, SDKValidationError> {
983
- return safeParse(
984
- jsonString,
985
- (x) => ToolMessage$inboundSchema.parse(JSON.parse(x)),
986
- `Failed to parse 'ToolMessage' from JSON`,
987
- );
988
- }
989
-
990
- /** @internal */
991
- export const Deployments2PrefixMessages4Type$inboundSchema: z.ZodNativeEnum<
992
- typeof Deployments2PrefixMessages4Type
993
- > = z.nativeEnum(Deployments2PrefixMessages4Type);
994
-
995
- /** @internal */
996
- export const Deployments2PrefixMessages4Type$outboundSchema: z.ZodNativeEnum<
997
- typeof Deployments2PrefixMessages4Type
998
- > = Deployments2PrefixMessages4Type$inboundSchema;
999
-
1000
- /**
1001
- * @internal
1002
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1003
- */
1004
- export namespace Deployments2PrefixMessages4Type$ {
1005
- /** @deprecated use `Deployments2PrefixMessages4Type$inboundSchema` instead. */
1006
- export const inboundSchema = Deployments2PrefixMessages4Type$inboundSchema;
1007
- /** @deprecated use `Deployments2PrefixMessages4Type$outboundSchema` instead. */
1008
- export const outboundSchema = Deployments2PrefixMessages4Type$outboundSchema;
1009
- }
1010
-
1011
- /** @internal */
1012
- export const RefusalContentPart$inboundSchema: z.ZodType<
1013
- RefusalContentPart,
1014
- z.ZodTypeDef,
1015
- unknown
1016
- > = z.object({
1017
- type: Deployments2PrefixMessages4Type$inboundSchema,
1018
- refusal: z.string(),
1019
- });
1020
-
1021
- /** @internal */
1022
- export type RefusalContentPart$Outbound = {
1023
- type: string;
1024
- refusal: string;
1025
- };
1026
-
1027
- /** @internal */
1028
- export const RefusalContentPart$outboundSchema: z.ZodType<
1029
- RefusalContentPart$Outbound,
1030
- z.ZodTypeDef,
1031
- RefusalContentPart
1032
- > = z.object({
1033
- type: Deployments2PrefixMessages4Type$outboundSchema,
1034
- refusal: z.string(),
1035
- });
1036
-
1037
- /**
1038
- * @internal
1039
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1040
- */
1041
- export namespace RefusalContentPart$ {
1042
- /** @deprecated use `RefusalContentPart$inboundSchema` instead. */
1043
- export const inboundSchema = RefusalContentPart$inboundSchema;
1044
- /** @deprecated use `RefusalContentPart$outboundSchema` instead. */
1045
- export const outboundSchema = RefusalContentPart$outboundSchema;
1046
- /** @deprecated use `RefusalContentPart$Outbound` instead. */
1047
- export type Outbound = RefusalContentPart$Outbound;
1048
- }
1049
-
1050
- export function refusalContentPartToJSON(
1051
- refusalContentPart: RefusalContentPart,
1052
- ): string {
1053
- return JSON.stringify(
1054
- RefusalContentPart$outboundSchema.parse(refusalContentPart),
1055
- );
1056
- }
1057
-
1058
- export function refusalContentPartFromJSON(
1059
- jsonString: string,
1060
- ): SafeParseResult<RefusalContentPart, SDKValidationError> {
1061
- return safeParse(
1062
- jsonString,
1063
- (x) => RefusalContentPart$inboundSchema.parse(JSON.parse(x)),
1064
- `Failed to parse 'RefusalContentPart' from JSON`,
1065
- );
1066
- }
1067
-
1068
- /** @internal */
1069
- export const Deployments2PrefixMessagesType$inboundSchema: z.ZodNativeEnum<
1070
- typeof Deployments2PrefixMessagesType
1071
- > = z.nativeEnum(Deployments2PrefixMessagesType);
1072
-
1073
- /** @internal */
1074
- export const Deployments2PrefixMessagesType$outboundSchema: z.ZodNativeEnum<
1075
- typeof Deployments2PrefixMessagesType
1076
- > = Deployments2PrefixMessagesType$inboundSchema;
1077
-
1078
- /**
1079
- * @internal
1080
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1081
- */
1082
- export namespace Deployments2PrefixMessagesType$ {
1083
- /** @deprecated use `Deployments2PrefixMessagesType$inboundSchema` instead. */
1084
- export const inboundSchema = Deployments2PrefixMessagesType$inboundSchema;
1085
- /** @deprecated use `Deployments2PrefixMessagesType$outboundSchema` instead. */
1086
- export const outboundSchema = Deployments2PrefixMessagesType$outboundSchema;
1087
- }
1088
-
1089
- /** @internal */
1090
- export const TextContentPart$inboundSchema: z.ZodType<
1091
- TextContentPart,
1092
- z.ZodTypeDef,
1093
- unknown
1094
- > = z.object({
1095
- type: Deployments2PrefixMessagesType$inboundSchema,
1096
- text: z.string(),
1097
- });
1098
-
1099
- /** @internal */
1100
- export type TextContentPart$Outbound = {
1101
- type: string;
1102
- text: string;
1103
- };
1104
-
1105
- /** @internal */
1106
- export const TextContentPart$outboundSchema: z.ZodType<
1107
- TextContentPart$Outbound,
1108
- z.ZodTypeDef,
1109
- TextContentPart
1110
- > = z.object({
1111
- type: Deployments2PrefixMessagesType$outboundSchema,
1112
- text: z.string(),
1113
- });
1114
-
1115
- /**
1116
- * @internal
1117
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1118
- */
1119
- export namespace TextContentPart$ {
1120
- /** @deprecated use `TextContentPart$inboundSchema` instead. */
1121
- export const inboundSchema = TextContentPart$inboundSchema;
1122
- /** @deprecated use `TextContentPart$outboundSchema` instead. */
1123
- export const outboundSchema = TextContentPart$outboundSchema;
1124
- /** @deprecated use `TextContentPart$Outbound` instead. */
1125
- export type Outbound = TextContentPart$Outbound;
1126
- }
1127
-
1128
- export function textContentPartToJSON(
1129
- textContentPart: TextContentPart,
1130
- ): string {
1131
- return JSON.stringify(TextContentPart$outboundSchema.parse(textContentPart));
1132
- }
1133
-
1134
- export function textContentPartFromJSON(
1135
- jsonString: string,
1136
- ): SafeParseResult<TextContentPart, SDKValidationError> {
1137
- return safeParse(
1138
- jsonString,
1139
- (x) => TextContentPart$inboundSchema.parse(JSON.parse(x)),
1140
- `Failed to parse 'TextContentPart' from JSON`,
1141
- );
1142
- }
1143
-
1144
- /** @internal */
1145
- export const Content2$inboundSchema: z.ZodType<
1146
- Content2,
1147
- z.ZodTypeDef,
1148
- unknown
1149
- > = z.union([
1150
- z.lazy(() => TextContentPart$inboundSchema),
1151
- z.lazy(() => RefusalContentPart$inboundSchema),
1152
- ]);
1153
-
1154
- /** @internal */
1155
- export type Content2$Outbound =
1156
- | TextContentPart$Outbound
1157
- | RefusalContentPart$Outbound;
1158
-
1159
- /** @internal */
1160
- export const Content2$outboundSchema: z.ZodType<
1161
- Content2$Outbound,
1162
- z.ZodTypeDef,
1163
- Content2
1164
- > = z.union([
1165
- z.lazy(() => TextContentPart$outboundSchema),
1166
- z.lazy(() => RefusalContentPart$outboundSchema),
1167
- ]);
1168
-
1169
- /**
1170
- * @internal
1171
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1172
- */
1173
- export namespace Content2$ {
1174
- /** @deprecated use `Content2$inboundSchema` instead. */
1175
- export const inboundSchema = Content2$inboundSchema;
1176
- /** @deprecated use `Content2$outboundSchema` instead. */
1177
- export const outboundSchema = Content2$outboundSchema;
1178
- /** @deprecated use `Content2$Outbound` instead. */
1179
- export type Outbound = Content2$Outbound;
1180
- }
1181
-
1182
- export function content2ToJSON(content2: Content2): string {
1183
- return JSON.stringify(Content2$outboundSchema.parse(content2));
1184
- }
1185
-
1186
- export function content2FromJSON(
1187
- jsonString: string,
1188
- ): SafeParseResult<Content2, SDKValidationError> {
1189
- return safeParse(
1190
- jsonString,
1191
- (x) => Content2$inboundSchema.parse(JSON.parse(x)),
1192
- `Failed to parse 'Content2' from JSON`,
1193
- );
1194
- }
1195
-
1196
- /** @internal */
1197
- export const PrefixMessagesContent$inboundSchema: z.ZodType<
1198
- PrefixMessagesContent,
1199
- z.ZodTypeDef,
1200
- unknown
1201
- > = z.union([
1202
- z.string(),
1203
- z.array(z.union([
1204
- z.lazy(() => TextContentPart$inboundSchema),
1205
- z.lazy(() => RefusalContentPart$inboundSchema),
1206
- ])),
1207
- ]);
1208
-
1209
- /** @internal */
1210
- export type PrefixMessagesContent$Outbound =
1211
- | string
1212
- | Array<TextContentPart$Outbound | RefusalContentPart$Outbound>;
1213
-
1214
- /** @internal */
1215
- export const PrefixMessagesContent$outboundSchema: z.ZodType<
1216
- PrefixMessagesContent$Outbound,
1217
- z.ZodTypeDef,
1218
- PrefixMessagesContent
1219
- > = z.union([
1220
- z.string(),
1221
- z.array(z.union([
1222
- z.lazy(() => TextContentPart$outboundSchema),
1223
- z.lazy(() => RefusalContentPart$outboundSchema),
1224
- ])),
1225
- ]);
1226
-
1227
- /**
1228
- * @internal
1229
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1230
- */
1231
- export namespace PrefixMessagesContent$ {
1232
- /** @deprecated use `PrefixMessagesContent$inboundSchema` instead. */
1233
- export const inboundSchema = PrefixMessagesContent$inboundSchema;
1234
- /** @deprecated use `PrefixMessagesContent$outboundSchema` instead. */
1235
- export const outboundSchema = PrefixMessagesContent$outboundSchema;
1236
- /** @deprecated use `PrefixMessagesContent$Outbound` instead. */
1237
- export type Outbound = PrefixMessagesContent$Outbound;
1238
- }
1239
-
1240
- export function prefixMessagesContentToJSON(
1241
- prefixMessagesContent: PrefixMessagesContent,
1242
- ): string {
1243
- return JSON.stringify(
1244
- PrefixMessagesContent$outboundSchema.parse(prefixMessagesContent),
1245
- );
1246
- }
1247
-
1248
- export function prefixMessagesContentFromJSON(
1249
- jsonString: string,
1250
- ): SafeParseResult<PrefixMessagesContent, SDKValidationError> {
1251
- return safeParse(
1252
- jsonString,
1253
- (x) => PrefixMessagesContent$inboundSchema.parse(JSON.parse(x)),
1254
- `Failed to parse 'PrefixMessagesContent' from JSON`,
1255
- );
1256
- }
1257
-
1258
- /** @internal */
1259
- export const DeploymentsPrefixMessages4Role$inboundSchema: z.ZodNativeEnum<
1260
- typeof DeploymentsPrefixMessages4Role
1261
- > = z.nativeEnum(DeploymentsPrefixMessages4Role);
1262
-
1263
- /** @internal */
1264
- export const DeploymentsPrefixMessages4Role$outboundSchema: z.ZodNativeEnum<
1265
- typeof DeploymentsPrefixMessages4Role
1266
- > = DeploymentsPrefixMessages4Role$inboundSchema;
1267
-
1268
- /**
1269
- * @internal
1270
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1271
- */
1272
- export namespace DeploymentsPrefixMessages4Role$ {
1273
- /** @deprecated use `DeploymentsPrefixMessages4Role$inboundSchema` instead. */
1274
- export const inboundSchema = DeploymentsPrefixMessages4Role$inboundSchema;
1275
- /** @deprecated use `DeploymentsPrefixMessages4Role$outboundSchema` instead. */
1276
- export const outboundSchema = DeploymentsPrefixMessages4Role$outboundSchema;
1277
- }
1278
-
1279
- /** @internal */
1280
- export const Audio$inboundSchema: z.ZodType<Audio, z.ZodTypeDef, unknown> = z
1281
- .object({
1282
- id: z.string(),
1283
- });
1284
-
1285
- /** @internal */
1286
- export type Audio$Outbound = {
1287
- id: string;
1288
- };
1289
-
1290
- /** @internal */
1291
- export const Audio$outboundSchema: z.ZodType<
1292
- Audio$Outbound,
1293
- z.ZodTypeDef,
1294
- Audio
1295
- > = z.object({
1296
- id: z.string(),
1297
- });
1298
-
1299
- /**
1300
- * @internal
1301
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1302
- */
1303
- export namespace Audio$ {
1304
- /** @deprecated use `Audio$inboundSchema` instead. */
1305
- export const inboundSchema = Audio$inboundSchema;
1306
- /** @deprecated use `Audio$outboundSchema` instead. */
1307
- export const outboundSchema = Audio$outboundSchema;
1308
- /** @deprecated use `Audio$Outbound` instead. */
1309
- export type Outbound = Audio$Outbound;
1310
- }
1311
-
1312
- export function audioToJSON(audio: Audio): string {
1313
- return JSON.stringify(Audio$outboundSchema.parse(audio));
1314
- }
1315
-
1316
- export function audioFromJSON(
1317
- jsonString: string,
1318
- ): SafeParseResult<Audio, SDKValidationError> {
1319
- return safeParse(
1320
- jsonString,
1321
- (x) => Audio$inboundSchema.parse(JSON.parse(x)),
1322
- `Failed to parse 'Audio' from JSON`,
1323
- );
1324
- }
1325
-
1326
- /** @internal */
1327
- export const Type$inboundSchema: z.ZodNativeEnum<typeof Type> = z.nativeEnum(
1328
- Type,
1329
- );
1330
-
1331
- /** @internal */
1332
- export const Type$outboundSchema: z.ZodNativeEnum<typeof Type> =
1333
- Type$inboundSchema;
1334
-
1335
- /**
1336
- * @internal
1337
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1338
- */
1339
- export namespace Type$ {
1340
- /** @deprecated use `Type$inboundSchema` instead. */
1341
- export const inboundSchema = Type$inboundSchema;
1342
- /** @deprecated use `Type$outboundSchema` instead. */
1343
- export const outboundSchema = Type$outboundSchema;
1344
- }
1345
-
1346
- /** @internal */
1347
- export const FunctionT$inboundSchema: z.ZodType<
1348
- FunctionT,
1349
- z.ZodTypeDef,
1350
- unknown
1351
- > = z.object({
1352
- name: z.string().optional(),
1353
- arguments: z.string().optional(),
1354
- });
1355
-
1356
- /** @internal */
1357
- export type FunctionT$Outbound = {
1358
- name?: string | undefined;
1359
- arguments?: string | undefined;
1360
- };
1361
-
1362
- /** @internal */
1363
- export const FunctionT$outboundSchema: z.ZodType<
1364
- FunctionT$Outbound,
1365
- z.ZodTypeDef,
1366
- FunctionT
1367
- > = z.object({
1368
- name: z.string().optional(),
1369
- arguments: z.string().optional(),
1370
- });
1371
-
1372
- /**
1373
- * @internal
1374
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1375
- */
1376
- export namespace FunctionT$ {
1377
- /** @deprecated use `FunctionT$inboundSchema` instead. */
1378
- export const inboundSchema = FunctionT$inboundSchema;
1379
- /** @deprecated use `FunctionT$outboundSchema` instead. */
1380
- export const outboundSchema = FunctionT$outboundSchema;
1381
- /** @deprecated use `FunctionT$Outbound` instead. */
1382
- export type Outbound = FunctionT$Outbound;
1383
- }
1384
-
1385
- export function functionToJSON(functionT: FunctionT): string {
1386
- return JSON.stringify(FunctionT$outboundSchema.parse(functionT));
1387
- }
1388
-
1389
- export function functionFromJSON(
1390
- jsonString: string,
1391
- ): SafeParseResult<FunctionT, SDKValidationError> {
1392
- return safeParse(
1393
- jsonString,
1394
- (x) => FunctionT$inboundSchema.parse(JSON.parse(x)),
1395
- `Failed to parse 'FunctionT' from JSON`,
1396
- );
1397
- }
1398
-
1399
- /** @internal */
1400
- export const ToolCalls$inboundSchema: z.ZodType<
1401
- ToolCalls,
1402
- z.ZodTypeDef,
1403
- unknown
1404
- > = z.object({
1405
- id: z.string(),
1406
- type: Type$inboundSchema,
1407
- function: z.lazy(() => FunctionT$inboundSchema),
1408
- });
1409
-
1410
- /** @internal */
1411
- export type ToolCalls$Outbound = {
1412
- id: string;
1413
- type: string;
1414
- function: FunctionT$Outbound;
1415
- };
1416
-
1417
- /** @internal */
1418
- export const ToolCalls$outboundSchema: z.ZodType<
1419
- ToolCalls$Outbound,
1420
- z.ZodTypeDef,
1421
- ToolCalls
1422
- > = z.object({
1423
- id: z.string(),
1424
- type: Type$outboundSchema,
1425
- function: z.lazy(() => FunctionT$outboundSchema),
1426
- });
1427
-
1428
- /**
1429
- * @internal
1430
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1431
- */
1432
- export namespace ToolCalls$ {
1433
- /** @deprecated use `ToolCalls$inboundSchema` instead. */
1434
- export const inboundSchema = ToolCalls$inboundSchema;
1435
- /** @deprecated use `ToolCalls$outboundSchema` instead. */
1436
- export const outboundSchema = ToolCalls$outboundSchema;
1437
- /** @deprecated use `ToolCalls$Outbound` instead. */
1438
- export type Outbound = ToolCalls$Outbound;
1439
- }
1440
-
1441
- export function toolCallsToJSON(toolCalls: ToolCalls): string {
1442
- return JSON.stringify(ToolCalls$outboundSchema.parse(toolCalls));
1443
- }
1444
-
1445
- export function toolCallsFromJSON(
1446
- jsonString: string,
1447
- ): SafeParseResult<ToolCalls, SDKValidationError> {
1448
- return safeParse(
1449
- jsonString,
1450
- (x) => ToolCalls$inboundSchema.parse(JSON.parse(x)),
1451
- `Failed to parse 'ToolCalls' from JSON`,
1452
- );
1453
- }
1454
-
1455
- /** @internal */
1456
- export const AssistantMessage$inboundSchema: z.ZodType<
1457
- AssistantMessage,
1458
- z.ZodTypeDef,
1459
- unknown
1460
- > = z.object({
1461
- content: z.union([
1462
- z.string(),
1463
- z.array(z.union([
1464
- z.lazy(() => TextContentPart$inboundSchema),
1465
- z.lazy(() => RefusalContentPart$inboundSchema),
1466
- ])),
1467
- ]).optional(),
1468
- refusal: z.nullable(z.string()).optional(),
1469
- role: DeploymentsPrefixMessages4Role$inboundSchema,
1470
- name: z.string().optional(),
1471
- audio: z.nullable(z.lazy(() => Audio$inboundSchema)).optional(),
1472
- tool_calls: z.array(z.lazy(() => ToolCalls$inboundSchema)).optional(),
1473
- }).transform((v) => {
1474
- return remap$(v, {
1475
- "tool_calls": "toolCalls",
1476
- });
1477
- });
1478
-
1479
- /** @internal */
1480
- export type AssistantMessage$Outbound = {
1481
- content?:
1482
- | string
1483
- | Array<TextContentPart$Outbound | RefusalContentPart$Outbound>
1484
- | undefined;
1485
- refusal?: string | null | undefined;
1486
- role: string;
1487
- name?: string | undefined;
1488
- audio?: Audio$Outbound | null | undefined;
1489
- tool_calls?: Array<ToolCalls$Outbound> | undefined;
1490
- };
1491
-
1492
- /** @internal */
1493
- export const AssistantMessage$outboundSchema: z.ZodType<
1494
- AssistantMessage$Outbound,
1495
- z.ZodTypeDef,
1496
- AssistantMessage
1497
- > = z.object({
1498
- content: z.union([
1499
- z.string(),
1500
- z.array(z.union([
1501
- z.lazy(() => TextContentPart$outboundSchema),
1502
- z.lazy(() => RefusalContentPart$outboundSchema),
1503
- ])),
1504
- ]).optional(),
1505
- refusal: z.nullable(z.string()).optional(),
1506
- role: DeploymentsPrefixMessages4Role$outboundSchema,
1507
- name: z.string().optional(),
1508
- audio: z.nullable(z.lazy(() => Audio$outboundSchema)).optional(),
1509
- toolCalls: z.array(z.lazy(() => ToolCalls$outboundSchema)).optional(),
1510
- }).transform((v) => {
1511
- return remap$(v, {
1512
- toolCalls: "tool_calls",
1513
- });
1514
- });
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 AssistantMessage$ {
1521
- /** @deprecated use `AssistantMessage$inboundSchema` instead. */
1522
- export const inboundSchema = AssistantMessage$inboundSchema;
1523
- /** @deprecated use `AssistantMessage$outboundSchema` instead. */
1524
- export const outboundSchema = AssistantMessage$outboundSchema;
1525
- /** @deprecated use `AssistantMessage$Outbound` instead. */
1526
- export type Outbound = AssistantMessage$Outbound;
1527
- }
1528
-
1529
- export function assistantMessageToJSON(
1530
- assistantMessage: AssistantMessage,
1531
- ): string {
1532
- return JSON.stringify(
1533
- AssistantMessage$outboundSchema.parse(assistantMessage),
1534
- );
1535
- }
1536
-
1537
- export function assistantMessageFromJSON(
1538
- jsonString: string,
1539
- ): SafeParseResult<AssistantMessage, SDKValidationError> {
1540
- return safeParse(
1541
- jsonString,
1542
- (x) => AssistantMessage$inboundSchema.parse(JSON.parse(x)),
1543
- `Failed to parse 'AssistantMessage' from JSON`,
1544
- );
1545
- }
1546
-
1547
- /** @internal */
1548
- export const DeploymentsPrefixMessagesRole$inboundSchema: z.ZodNativeEnum<
1549
- typeof DeploymentsPrefixMessagesRole
1550
- > = z.nativeEnum(DeploymentsPrefixMessagesRole);
1551
-
1552
- /** @internal */
1553
- export const DeploymentsPrefixMessagesRole$outboundSchema: z.ZodNativeEnum<
1554
- typeof DeploymentsPrefixMessagesRole
1555
- > = DeploymentsPrefixMessagesRole$inboundSchema;
1556
-
1557
- /**
1558
- * @internal
1559
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1560
- */
1561
- export namespace DeploymentsPrefixMessagesRole$ {
1562
- /** @deprecated use `DeploymentsPrefixMessagesRole$inboundSchema` instead. */
1563
- export const inboundSchema = DeploymentsPrefixMessagesRole$inboundSchema;
1564
- /** @deprecated use `DeploymentsPrefixMessagesRole$outboundSchema` instead. */
1565
- export const outboundSchema = DeploymentsPrefixMessagesRole$outboundSchema;
1566
- }
1567
-
1568
- /** @internal */
1569
- export const Deployments2Type$inboundSchema: z.ZodNativeEnum<
1570
- typeof Deployments2Type
1571
- > = z.nativeEnum(Deployments2Type);
1572
-
1573
- /** @internal */
1574
- export const Deployments2Type$outboundSchema: z.ZodNativeEnum<
1575
- typeof Deployments2Type
1576
- > = Deployments2Type$inboundSchema;
1577
-
1578
- /**
1579
- * @internal
1580
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1581
- */
1582
- export namespace Deployments2Type$ {
1583
- /** @deprecated use `Deployments2Type$inboundSchema` instead. */
1584
- export const inboundSchema = Deployments2Type$inboundSchema;
1585
- /** @deprecated use `Deployments2Type$outboundSchema` instead. */
1586
- export const outboundSchema = Deployments2Type$outboundSchema;
1587
- }
1588
-
1589
- /** @internal */
1590
- export const Format$inboundSchema: z.ZodNativeEnum<typeof Format> = z
1591
- .nativeEnum(Format);
1592
-
1593
- /** @internal */
1594
- export const Format$outboundSchema: z.ZodNativeEnum<typeof Format> =
1595
- Format$inboundSchema;
1596
-
1597
- /**
1598
- * @internal
1599
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1600
- */
1601
- export namespace Format$ {
1602
- /** @deprecated use `Format$inboundSchema` instead. */
1603
- export const inboundSchema = Format$inboundSchema;
1604
- /** @deprecated use `Format$outboundSchema` instead. */
1605
- export const outboundSchema = Format$outboundSchema;
1606
- }
1607
-
1608
- /** @internal */
1609
- export const InputAudio$inboundSchema: z.ZodType<
1610
- InputAudio,
1611
- z.ZodTypeDef,
1612
- unknown
1613
- > = z.object({
1614
- data: z.string(),
1615
- format: Format$inboundSchema,
1616
- });
1617
-
1618
- /** @internal */
1619
- export type InputAudio$Outbound = {
1620
- data: string;
1621
- format: string;
1622
- };
1623
-
1624
- /** @internal */
1625
- export const InputAudio$outboundSchema: z.ZodType<
1626
- InputAudio$Outbound,
1627
- z.ZodTypeDef,
1628
- InputAudio
1629
- > = z.object({
1630
- data: z.string(),
1631
- format: Format$outboundSchema,
1632
- });
1633
-
1634
- /**
1635
- * @internal
1636
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1637
- */
1638
- export namespace InputAudio$ {
1639
- /** @deprecated use `InputAudio$inboundSchema` instead. */
1640
- export const inboundSchema = InputAudio$inboundSchema;
1641
- /** @deprecated use `InputAudio$outboundSchema` instead. */
1642
- export const outboundSchema = InputAudio$outboundSchema;
1643
- /** @deprecated use `InputAudio$Outbound` instead. */
1644
- export type Outbound = InputAudio$Outbound;
1645
- }
1646
-
1647
- export function inputAudioToJSON(inputAudio: InputAudio): string {
1648
- return JSON.stringify(InputAudio$outboundSchema.parse(inputAudio));
1649
- }
1650
-
1651
- export function inputAudioFromJSON(
1652
- jsonString: string,
1653
- ): SafeParseResult<InputAudio, SDKValidationError> {
1654
- return safeParse(
1655
- jsonString,
1656
- (x) => InputAudio$inboundSchema.parse(JSON.parse(x)),
1657
- `Failed to parse 'InputAudio' from JSON`,
1658
- );
1659
- }
1660
-
1661
- /** @internal */
1662
- export const Three$inboundSchema: z.ZodType<Three, z.ZodTypeDef, unknown> = z
1663
- .object({
1664
- type: Deployments2Type$inboundSchema,
1665
- input_audio: z.lazy(() => InputAudio$inboundSchema),
1666
- }).transform((v) => {
1667
- return remap$(v, {
1668
- "input_audio": "inputAudio",
1669
- });
1670
- });
1671
-
1672
- /** @internal */
1673
- export type Three$Outbound = {
1674
- type: string;
1675
- input_audio: InputAudio$Outbound;
1676
- };
1677
-
1678
- /** @internal */
1679
- export const Three$outboundSchema: z.ZodType<
1680
- Three$Outbound,
1681
- z.ZodTypeDef,
1682
- Three
1683
- > = z.object({
1684
- type: Deployments2Type$outboundSchema,
1685
- inputAudio: z.lazy(() => InputAudio$outboundSchema),
1686
- }).transform((v) => {
1687
- return remap$(v, {
1688
- inputAudio: "input_audio",
1689
- });
1690
- });
1691
-
1692
- /**
1693
- * @internal
1694
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1695
- */
1696
- export namespace Three$ {
1697
- /** @deprecated use `Three$inboundSchema` instead. */
1698
- export const inboundSchema = Three$inboundSchema;
1699
- /** @deprecated use `Three$outboundSchema` instead. */
1700
- export const outboundSchema = Three$outboundSchema;
1701
- /** @deprecated use `Three$Outbound` instead. */
1702
- export type Outbound = Three$Outbound;
1703
- }
1704
-
1705
- export function threeToJSON(three: Three): string {
1706
- return JSON.stringify(Three$outboundSchema.parse(three));
1707
- }
1708
-
1709
- export function threeFromJSON(
1710
- jsonString: string,
1711
- ): SafeParseResult<Three, SDKValidationError> {
1712
- return safeParse(
1713
- jsonString,
1714
- (x) => Three$inboundSchema.parse(JSON.parse(x)),
1715
- `Failed to parse 'Three' from JSON`,
1716
- );
1717
- }
1718
-
1719
- /** @internal */
1720
- export const TwoType$inboundSchema: z.ZodNativeEnum<typeof TwoType> = z
1721
- .nativeEnum(TwoType);
1722
-
1723
- /** @internal */
1724
- export const TwoType$outboundSchema: z.ZodNativeEnum<typeof TwoType> =
1725
- TwoType$inboundSchema;
1726
-
1727
- /**
1728
- * @internal
1729
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1730
- */
1731
- export namespace TwoType$ {
1732
- /** @deprecated use `TwoType$inboundSchema` instead. */
1733
- export const inboundSchema = TwoType$inboundSchema;
1734
- /** @deprecated use `TwoType$outboundSchema` instead. */
1735
- export const outboundSchema = TwoType$outboundSchema;
1736
- }
1737
-
1738
- /** @internal */
1739
- export const Detail$inboundSchema: z.ZodNativeEnum<typeof Detail> = z
1740
- .nativeEnum(Detail);
1741
-
1742
- /** @internal */
1743
- export const Detail$outboundSchema: z.ZodNativeEnum<typeof Detail> =
1744
- Detail$inboundSchema;
1745
-
1746
- /**
1747
- * @internal
1748
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1749
- */
1750
- export namespace Detail$ {
1751
- /** @deprecated use `Detail$inboundSchema` instead. */
1752
- export const inboundSchema = Detail$inboundSchema;
1753
- /** @deprecated use `Detail$outboundSchema` instead. */
1754
- export const outboundSchema = Detail$outboundSchema;
1755
- }
1756
-
1757
- /** @internal */
1758
- export const ImageUrl$inboundSchema: z.ZodType<
1759
- ImageUrl,
1760
- z.ZodTypeDef,
1761
- unknown
1762
- > = z.object({
1763
- url: z.string(),
1764
- detail: Detail$inboundSchema.optional(),
1765
- });
1766
-
1767
- /** @internal */
1768
- export type ImageUrl$Outbound = {
1769
- url: string;
1770
- detail?: string | undefined;
1771
- };
1772
-
1773
- /** @internal */
1774
- export const ImageUrl$outboundSchema: z.ZodType<
1775
- ImageUrl$Outbound,
1776
- z.ZodTypeDef,
1777
- ImageUrl
1778
- > = z.object({
1779
- url: z.string(),
1780
- detail: Detail$outboundSchema.optional(),
1781
- });
1782
-
1783
- /**
1784
- * @internal
1785
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1786
- */
1787
- export namespace ImageUrl$ {
1788
- /** @deprecated use `ImageUrl$inboundSchema` instead. */
1789
- export const inboundSchema = ImageUrl$inboundSchema;
1790
- /** @deprecated use `ImageUrl$outboundSchema` instead. */
1791
- export const outboundSchema = ImageUrl$outboundSchema;
1792
- /** @deprecated use `ImageUrl$Outbound` instead. */
1793
- export type Outbound = ImageUrl$Outbound;
1794
- }
1795
-
1796
- export function imageUrlToJSON(imageUrl: ImageUrl): string {
1797
- return JSON.stringify(ImageUrl$outboundSchema.parse(imageUrl));
1798
- }
1799
-
1800
- export function imageUrlFromJSON(
1801
- jsonString: string,
1802
- ): SafeParseResult<ImageUrl, SDKValidationError> {
1803
- return safeParse(
1804
- jsonString,
1805
- (x) => ImageUrl$inboundSchema.parse(JSON.parse(x)),
1806
- `Failed to parse 'ImageUrl' from JSON`,
1807
- );
1808
- }
1809
-
1810
- /** @internal */
1811
- export const Two2$inboundSchema: z.ZodType<Two2, z.ZodTypeDef, unknown> = z
1812
- .object({
1813
- type: TwoType$inboundSchema,
1814
- image_url: z.lazy(() => ImageUrl$inboundSchema),
1815
- }).transform((v) => {
1816
- return remap$(v, {
1817
- "image_url": "imageUrl",
1818
- });
1819
- });
1820
-
1821
- /** @internal */
1822
- export type Two2$Outbound = {
1823
- type: string;
1824
- image_url: ImageUrl$Outbound;
1825
- };
1826
-
1827
- /** @internal */
1828
- export const Two2$outboundSchema: z.ZodType<Two2$Outbound, z.ZodTypeDef, Two2> =
1829
- z.object({
1830
- type: TwoType$outboundSchema,
1831
- imageUrl: z.lazy(() => ImageUrl$outboundSchema),
1832
- }).transform((v) => {
1833
- return remap$(v, {
1834
- imageUrl: "image_url",
1835
- });
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 Two2$ {
1843
- /** @deprecated use `Two2$inboundSchema` instead. */
1844
- export const inboundSchema = Two2$inboundSchema;
1845
- /** @deprecated use `Two2$outboundSchema` instead. */
1846
- export const outboundSchema = Two2$outboundSchema;
1847
- /** @deprecated use `Two2$Outbound` instead. */
1848
- export type Outbound = Two2$Outbound;
1849
- }
1850
-
1851
- export function two2ToJSON(two2: Two2): string {
1852
- return JSON.stringify(Two2$outboundSchema.parse(two2));
1853
- }
1854
-
1855
- export function two2FromJSON(
1856
- jsonString: string,
1857
- ): SafeParseResult<Two2, SDKValidationError> {
1858
- return safeParse(
1859
- jsonString,
1860
- (x) => Two2$inboundSchema.parse(JSON.parse(x)),
1861
- `Failed to parse 'Two2' from JSON`,
1862
- );
1863
- }
1864
-
1865
- /** @internal */
1866
- export const Deployments2PrefixMessages3Type$inboundSchema: z.ZodNativeEnum<
1867
- typeof Deployments2PrefixMessages3Type
1868
- > = z.nativeEnum(Deployments2PrefixMessages3Type);
1869
-
1870
- /** @internal */
1871
- export const Deployments2PrefixMessages3Type$outboundSchema: z.ZodNativeEnum<
1872
- typeof Deployments2PrefixMessages3Type
1873
- > = Deployments2PrefixMessages3Type$inboundSchema;
1874
-
1875
- /**
1876
- * @internal
1877
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1878
- */
1879
- export namespace Deployments2PrefixMessages3Type$ {
1880
- /** @deprecated use `Deployments2PrefixMessages3Type$inboundSchema` instead. */
1881
- export const inboundSchema = Deployments2PrefixMessages3Type$inboundSchema;
1882
- /** @deprecated use `Deployments2PrefixMessages3Type$outboundSchema` instead. */
1883
- export const outboundSchema = Deployments2PrefixMessages3Type$outboundSchema;
1884
- }
1885
-
1886
- /** @internal */
1887
- export const One$inboundSchema: z.ZodType<One, z.ZodTypeDef, unknown> = z
1888
- .object({
1889
- type: Deployments2PrefixMessages3Type$inboundSchema,
1890
- text: z.string(),
1891
- });
1892
-
1893
- /** @internal */
1894
- export type One$Outbound = {
1895
- type: string;
1896
- text: string;
1897
- };
1898
-
1899
- /** @internal */
1900
- export const One$outboundSchema: z.ZodType<One$Outbound, z.ZodTypeDef, One> = z
1901
- .object({
1902
- type: Deployments2PrefixMessages3Type$outboundSchema,
1903
- text: z.string(),
1904
- });
1905
-
1906
- /**
1907
- * @internal
1908
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1909
- */
1910
- export namespace One$ {
1911
- /** @deprecated use `One$inboundSchema` instead. */
1912
- export const inboundSchema = One$inboundSchema;
1913
- /** @deprecated use `One$outboundSchema` instead. */
1914
- export const outboundSchema = One$outboundSchema;
1915
- /** @deprecated use `One$Outbound` instead. */
1916
- export type Outbound = One$Outbound;
1917
- }
1918
-
1919
- export function oneToJSON(one: One): string {
1920
- return JSON.stringify(One$outboundSchema.parse(one));
1921
- }
1922
-
1923
- export function oneFromJSON(
1924
- jsonString: string,
1925
- ): SafeParseResult<One, SDKValidationError> {
1926
- return safeParse(
1927
- jsonString,
1928
- (x) => One$inboundSchema.parse(JSON.parse(x)),
1929
- `Failed to parse 'One' from JSON`,
1930
- );
1931
- }
1932
-
1933
- /** @internal */
1934
- export const Two$inboundSchema: z.ZodType<Two, z.ZodTypeDef, unknown> = z.union(
1935
- [
1936
- z.lazy(() => One$inboundSchema),
1937
- z.lazy(() => Two2$inboundSchema),
1938
- z.lazy(() => Three$inboundSchema),
1939
- ],
1940
- );
1941
-
1942
- /** @internal */
1943
- export type Two$Outbound = One$Outbound | Two2$Outbound | Three$Outbound;
1944
-
1945
- /** @internal */
1946
- export const Two$outboundSchema: z.ZodType<Two$Outbound, z.ZodTypeDef, Two> = z
1947
- .union([
1948
- z.lazy(() => One$outboundSchema),
1949
- z.lazy(() => Two2$outboundSchema),
1950
- z.lazy(() => Three$outboundSchema),
1951
- ]);
1952
-
1953
- /**
1954
- * @internal
1955
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1956
- */
1957
- export namespace Two$ {
1958
- /** @deprecated use `Two$inboundSchema` instead. */
1959
- export const inboundSchema = Two$inboundSchema;
1960
- /** @deprecated use `Two$outboundSchema` instead. */
1961
- export const outboundSchema = Two$outboundSchema;
1962
- /** @deprecated use `Two$Outbound` instead. */
1963
- export type Outbound = Two$Outbound;
1964
- }
1965
-
1966
- export function twoToJSON(two: Two): string {
1967
- return JSON.stringify(Two$outboundSchema.parse(two));
1968
- }
1969
-
1970
- export function twoFromJSON(
1971
- jsonString: string,
1972
- ): SafeParseResult<Two, SDKValidationError> {
1973
- return safeParse(
1974
- jsonString,
1975
- (x) => Two$inboundSchema.parse(JSON.parse(x)),
1976
- `Failed to parse 'Two' from JSON`,
1977
- );
1978
- }
1979
-
1980
- /** @internal */
1981
- export const Content$inboundSchema: z.ZodType<Content, z.ZodTypeDef, unknown> =
1982
- z.union([
1983
- z.string(),
1984
- z.array(z.union([
1985
- z.lazy(() => One$inboundSchema),
1986
- z.lazy(() => Two2$inboundSchema),
1987
- z.lazy(() => Three$inboundSchema),
1988
- ])),
1989
- ]);
1990
-
1991
- /** @internal */
1992
- export type Content$Outbound =
1993
- | string
1994
- | Array<One$Outbound | Two2$Outbound | Three$Outbound>;
1995
-
1996
- /** @internal */
1997
- export const Content$outboundSchema: z.ZodType<
1998
- Content$Outbound,
1999
- z.ZodTypeDef,
2000
- Content
2001
- > = z.union([
2002
- z.string(),
2003
- z.array(z.union([
2004
- z.lazy(() => One$outboundSchema),
2005
- z.lazy(() => Two2$outboundSchema),
2006
- z.lazy(() => Three$outboundSchema),
2007
- ])),
2008
- ]);
2009
-
2010
- /**
2011
- * @internal
2012
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2013
- */
2014
- export namespace Content$ {
2015
- /** @deprecated use `Content$inboundSchema` instead. */
2016
- export const inboundSchema = Content$inboundSchema;
2017
- /** @deprecated use `Content$outboundSchema` instead. */
2018
- export const outboundSchema = Content$outboundSchema;
2019
- /** @deprecated use `Content$Outbound` instead. */
2020
- export type Outbound = Content$Outbound;
2021
- }
2022
-
2023
- export function contentToJSON(content: Content): string {
2024
- return JSON.stringify(Content$outboundSchema.parse(content));
2025
- }
2026
-
2027
- export function contentFromJSON(
2028
- jsonString: string,
2029
- ): SafeParseResult<Content, SDKValidationError> {
2030
- return safeParse(
2031
- jsonString,
2032
- (x) => Content$inboundSchema.parse(JSON.parse(x)),
2033
- `Failed to parse 'Content' from JSON`,
2034
- );
2035
- }
2036
-
2037
- /** @internal */
2038
- export const UserMessage$inboundSchema: z.ZodType<
2039
- UserMessage,
2040
- z.ZodTypeDef,
2041
- unknown
2042
- > = z.object({
2043
- role: DeploymentsPrefixMessagesRole$inboundSchema,
2044
- name: z.string().optional(),
2045
- content: z.union([
2046
- z.string(),
2047
- z.array(z.union([
2048
- z.lazy(() => One$inboundSchema),
2049
- z.lazy(() => Two2$inboundSchema),
2050
- z.lazy(() => Three$inboundSchema),
2051
- ])),
2052
- ]),
2053
- });
2054
-
2055
- /** @internal */
2056
- export type UserMessage$Outbound = {
2057
- role: string;
2058
- name?: string | undefined;
2059
- content: string | Array<One$Outbound | Two2$Outbound | Three$Outbound>;
2060
- };
2061
-
2062
- /** @internal */
2063
- export const UserMessage$outboundSchema: z.ZodType<
2064
- UserMessage$Outbound,
2065
- z.ZodTypeDef,
2066
- UserMessage
2067
- > = z.object({
2068
- role: DeploymentsPrefixMessagesRole$outboundSchema,
2069
- name: z.string().optional(),
2070
- content: z.union([
2071
- z.string(),
2072
- z.array(z.union([
2073
- z.lazy(() => One$outboundSchema),
2074
- z.lazy(() => Two2$outboundSchema),
2075
- z.lazy(() => Three$outboundSchema),
2076
- ])),
2077
- ]),
2078
- });
2079
-
2080
- /**
2081
- * @internal
2082
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2083
- */
2084
- export namespace UserMessage$ {
2085
- /** @deprecated use `UserMessage$inboundSchema` instead. */
2086
- export const inboundSchema = UserMessage$inboundSchema;
2087
- /** @deprecated use `UserMessage$outboundSchema` instead. */
2088
- export const outboundSchema = UserMessage$outboundSchema;
2089
- /** @deprecated use `UserMessage$Outbound` instead. */
2090
- export type Outbound = UserMessage$Outbound;
2091
- }
2092
-
2093
- export function userMessageToJSON(userMessage: UserMessage): string {
2094
- return JSON.stringify(UserMessage$outboundSchema.parse(userMessage));
2095
- }
2096
-
2097
- export function userMessageFromJSON(
2098
- jsonString: string,
2099
- ): SafeParseResult<UserMessage, SDKValidationError> {
2100
- return safeParse(
2101
- jsonString,
2102
- (x) => UserMessage$inboundSchema.parse(JSON.parse(x)),
2103
- `Failed to parse 'UserMessage' from JSON`,
2104
- );
2105
- }
2106
-
2107
- /** @internal */
2108
- export const PrefixMessagesRole$inboundSchema: z.ZodNativeEnum<
2109
- typeof PrefixMessagesRole
2110
- > = z.nativeEnum(PrefixMessagesRole);
2111
-
2112
- /** @internal */
2113
- export const PrefixMessagesRole$outboundSchema: z.ZodNativeEnum<
2114
- typeof PrefixMessagesRole
2115
- > = PrefixMessagesRole$inboundSchema;
2116
-
2117
- /**
2118
- * @internal
2119
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2120
- */
2121
- export namespace PrefixMessagesRole$ {
2122
- /** @deprecated use `PrefixMessagesRole$inboundSchema` instead. */
2123
- export const inboundSchema = PrefixMessagesRole$inboundSchema;
2124
- /** @deprecated use `PrefixMessagesRole$outboundSchema` instead. */
2125
- export const outboundSchema = PrefixMessagesRole$outboundSchema;
2126
- }
2127
-
2128
- /** @internal */
2129
- export const SystemMessage$inboundSchema: z.ZodType<
2130
- SystemMessage,
2131
- z.ZodTypeDef,
2132
- unknown
2133
- > = z.object({
2134
- role: PrefixMessagesRole$inboundSchema,
2135
- content: z.string(),
2136
- name: z.string().optional(),
2137
- });
2138
-
2139
- /** @internal */
2140
- export type SystemMessage$Outbound = {
2141
- role: string;
2142
- content: string;
2143
- name?: string | undefined;
2144
- };
2145
-
2146
- /** @internal */
2147
- export const SystemMessage$outboundSchema: z.ZodType<
2148
- SystemMessage$Outbound,
2149
- z.ZodTypeDef,
2150
- SystemMessage
2151
- > = z.object({
2152
- role: PrefixMessagesRole$outboundSchema,
2153
- content: z.string(),
2154
- name: z.string().optional(),
2155
- });
2156
-
2157
- /**
2158
- * @internal
2159
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2160
- */
2161
- export namespace SystemMessage$ {
2162
- /** @deprecated use `SystemMessage$inboundSchema` instead. */
2163
- export const inboundSchema = SystemMessage$inboundSchema;
2164
- /** @deprecated use `SystemMessage$outboundSchema` instead. */
2165
- export const outboundSchema = SystemMessage$outboundSchema;
2166
- /** @deprecated use `SystemMessage$Outbound` instead. */
2167
- export type Outbound = SystemMessage$Outbound;
2168
- }
2169
-
2170
- export function systemMessageToJSON(systemMessage: SystemMessage): string {
2171
- return JSON.stringify(SystemMessage$outboundSchema.parse(systemMessage));
2172
- }
2173
-
2174
- export function systemMessageFromJSON(
2175
- jsonString: string,
2176
- ): SafeParseResult<SystemMessage, SDKValidationError> {
2177
- return safeParse(
2178
- jsonString,
2179
- (x) => SystemMessage$inboundSchema.parse(JSON.parse(x)),
2180
- `Failed to parse 'SystemMessage' from JSON`,
2181
- );
2182
- }
2183
-
2184
- /** @internal */
2185
- export const Role$inboundSchema: z.ZodNativeEnum<typeof Role> = z.nativeEnum(
2186
- Role,
2187
- );
2188
-
2189
- /** @internal */
2190
- export const Role$outboundSchema: z.ZodNativeEnum<typeof Role> =
2191
- Role$inboundSchema;
2192
-
2193
- /**
2194
- * @internal
2195
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2196
- */
2197
- export namespace Role$ {
2198
- /** @deprecated use `Role$inboundSchema` instead. */
2199
- export const inboundSchema = Role$inboundSchema;
2200
- /** @deprecated use `Role$outboundSchema` instead. */
2201
- export const outboundSchema = Role$outboundSchema;
2202
- }
2203
-
2204
- /** @internal */
2205
- export const DeveloperMessage$inboundSchema: z.ZodType<
2206
- DeveloperMessage,
2207
- z.ZodTypeDef,
2208
- unknown
2209
- > = z.object({
2210
- role: Role$inboundSchema,
2211
- content: z.string(),
2212
- name: z.string().optional(),
2213
- });
2214
-
2215
- /** @internal */
2216
- export type DeveloperMessage$Outbound = {
2217
- role: string;
2218
- content: string;
2219
- name?: string | undefined;
2220
- };
2221
-
2222
- /** @internal */
2223
- export const DeveloperMessage$outboundSchema: z.ZodType<
2224
- DeveloperMessage$Outbound,
2225
- z.ZodTypeDef,
2226
- DeveloperMessage
2227
- > = z.object({
2228
- role: Role$outboundSchema,
2229
- content: z.string(),
2230
- name: z.string().optional(),
2231
- });
2232
-
2233
- /**
2234
- * @internal
2235
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2236
- */
2237
- export namespace DeveloperMessage$ {
2238
- /** @deprecated use `DeveloperMessage$inboundSchema` instead. */
2239
- export const inboundSchema = DeveloperMessage$inboundSchema;
2240
- /** @deprecated use `DeveloperMessage$outboundSchema` instead. */
2241
- export const outboundSchema = DeveloperMessage$outboundSchema;
2242
- /** @deprecated use `DeveloperMessage$Outbound` instead. */
2243
- export type Outbound = DeveloperMessage$Outbound;
2244
- }
2245
-
2246
- export function developerMessageToJSON(
2247
- developerMessage: DeveloperMessage,
2248
- ): string {
2249
- return JSON.stringify(
2250
- DeveloperMessage$outboundSchema.parse(developerMessage),
2251
- );
2252
- }
2253
-
2254
- export function developerMessageFromJSON(
2255
- jsonString: string,
2256
- ): SafeParseResult<DeveloperMessage, SDKValidationError> {
2257
- return safeParse(
2258
- jsonString,
2259
- (x) => DeveloperMessage$inboundSchema.parse(JSON.parse(x)),
2260
- `Failed to parse 'DeveloperMessage' from JSON`,
2261
- );
2262
- }
2263
-
2264
- /** @internal */
2265
- export const PrefixMessages$inboundSchema: z.ZodType<
2266
- PrefixMessages,
2267
- z.ZodTypeDef,
2268
- unknown
2269
- > = z.union([
2270
- z.lazy(() => DeveloperMessage$inboundSchema),
2271
- z.lazy(() => SystemMessage$inboundSchema),
2272
- z.lazy(() => UserMessage$inboundSchema),
2273
- z.lazy(() => ToolMessage$inboundSchema),
2274
- z.lazy(() => AssistantMessage$inboundSchema),
2275
- ]);
2276
-
2277
- /** @internal */
2278
- export type PrefixMessages$Outbound =
2279
- | DeveloperMessage$Outbound
2280
- | SystemMessage$Outbound
2281
- | UserMessage$Outbound
2282
- | ToolMessage$Outbound
2283
- | AssistantMessage$Outbound;
2284
-
2285
- /** @internal */
2286
- export const PrefixMessages$outboundSchema: z.ZodType<
2287
- PrefixMessages$Outbound,
2288
- z.ZodTypeDef,
2289
- PrefixMessages
2290
- > = z.union([
2291
- z.lazy(() => DeveloperMessage$outboundSchema),
2292
- z.lazy(() => SystemMessage$outboundSchema),
2293
- z.lazy(() => UserMessage$outboundSchema),
2294
- z.lazy(() => ToolMessage$outboundSchema),
2295
- z.lazy(() => AssistantMessage$outboundSchema),
2296
- ]);
2297
-
2298
- /**
2299
- * @internal
2300
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2301
- */
2302
- export namespace PrefixMessages$ {
2303
- /** @deprecated use `PrefixMessages$inboundSchema` instead. */
2304
- export const inboundSchema = PrefixMessages$inboundSchema;
2305
- /** @deprecated use `PrefixMessages$outboundSchema` instead. */
2306
- export const outboundSchema = PrefixMessages$outboundSchema;
2307
- /** @deprecated use `PrefixMessages$Outbound` instead. */
2308
- export type Outbound = PrefixMessages$Outbound;
2309
- }
2310
-
2311
- export function prefixMessagesToJSON(prefixMessages: PrefixMessages): string {
2312
- return JSON.stringify(PrefixMessages$outboundSchema.parse(prefixMessages));
2313
- }
2314
-
2315
- export function prefixMessagesFromJSON(
2316
- jsonString: string,
2317
- ): SafeParseResult<PrefixMessages, SDKValidationError> {
2318
- return safeParse(
2319
- jsonString,
2320
- (x) => PrefixMessages$inboundSchema.parse(JSON.parse(x)),
2321
- `Failed to parse 'PrefixMessages' from JSON`,
2322
- );
2323
- }
2324
-
2325
- /** @internal */
2326
- export const DeploymentsMessages5Role$inboundSchema: z.ZodNativeEnum<
2327
- typeof DeploymentsMessages5Role
2328
- > = z.nativeEnum(DeploymentsMessages5Role);
2329
-
2330
- /** @internal */
2331
- export const DeploymentsMessages5Role$outboundSchema: z.ZodNativeEnum<
2332
- typeof DeploymentsMessages5Role
2333
- > = DeploymentsMessages5Role$inboundSchema;
2334
-
2335
- /**
2336
- * @internal
2337
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2338
- */
2339
- export namespace DeploymentsMessages5Role$ {
2340
- /** @deprecated use `DeploymentsMessages5Role$inboundSchema` instead. */
2341
- export const inboundSchema = DeploymentsMessages5Role$inboundSchema;
2342
- /** @deprecated use `DeploymentsMessages5Role$outboundSchema` instead. */
2343
- export const outboundSchema = DeploymentsMessages5Role$outboundSchema;
2344
- }
2345
-
2346
- /** @internal */
2347
- export const DeploymentsMessages5Content$inboundSchema: z.ZodType<
2348
- DeploymentsMessages5Content,
2349
- z.ZodTypeDef,
2350
- unknown
2351
- > = z.union([z.string(), z.array(z.string())]);
2352
-
2353
- /** @internal */
2354
- export type DeploymentsMessages5Content$Outbound = string | Array<string>;
2355
-
2356
- /** @internal */
2357
- export const DeploymentsMessages5Content$outboundSchema: z.ZodType<
2358
- DeploymentsMessages5Content$Outbound,
2359
- z.ZodTypeDef,
2360
- DeploymentsMessages5Content
2361
- > = z.union([z.string(), z.array(z.string())]);
2362
-
2363
- /**
2364
- * @internal
2365
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2366
- */
2367
- export namespace DeploymentsMessages5Content$ {
2368
- /** @deprecated use `DeploymentsMessages5Content$inboundSchema` instead. */
2369
- export const inboundSchema = DeploymentsMessages5Content$inboundSchema;
2370
- /** @deprecated use `DeploymentsMessages5Content$outboundSchema` instead. */
2371
- export const outboundSchema = DeploymentsMessages5Content$outboundSchema;
2372
- /** @deprecated use `DeploymentsMessages5Content$Outbound` instead. */
2373
- export type Outbound = DeploymentsMessages5Content$Outbound;
2374
- }
2375
-
2376
- export function deploymentsMessages5ContentToJSON(
2377
- deploymentsMessages5Content: DeploymentsMessages5Content,
2378
- ): string {
2379
- return JSON.stringify(
2380
- DeploymentsMessages5Content$outboundSchema.parse(
2381
- deploymentsMessages5Content,
2382
- ),
2383
- );
2384
- }
2385
-
2386
- export function deploymentsMessages5ContentFromJSON(
2387
- jsonString: string,
2388
- ): SafeParseResult<DeploymentsMessages5Content, SDKValidationError> {
2389
- return safeParse(
2390
- jsonString,
2391
- (x) => DeploymentsMessages5Content$inboundSchema.parse(JSON.parse(x)),
2392
- `Failed to parse 'DeploymentsMessages5Content' from JSON`,
2393
- );
2394
- }
2395
-
2396
- /** @internal */
2397
- export const MessagesToolMessage$inboundSchema: z.ZodType<
2398
- MessagesToolMessage,
2399
- z.ZodTypeDef,
2400
- unknown
2401
- > = z.object({
2402
- role: DeploymentsMessages5Role$inboundSchema,
2403
- content: z.union([z.string(), z.array(z.string())]),
2404
- tool_call_id: z.string(),
2405
- }).transform((v) => {
2406
- return remap$(v, {
2407
- "tool_call_id": "toolCallId",
2408
- });
2409
- });
2410
-
2411
- /** @internal */
2412
- export type MessagesToolMessage$Outbound = {
2413
- role: string;
2414
- content: string | Array<string>;
2415
- tool_call_id: string;
2416
- };
2417
-
2418
- /** @internal */
2419
- export const MessagesToolMessage$outboundSchema: z.ZodType<
2420
- MessagesToolMessage$Outbound,
2421
- z.ZodTypeDef,
2422
- MessagesToolMessage
2423
- > = z.object({
2424
- role: DeploymentsMessages5Role$outboundSchema,
2425
- content: z.union([z.string(), z.array(z.string())]),
2426
- toolCallId: z.string(),
2427
- }).transform((v) => {
2428
- return remap$(v, {
2429
- toolCallId: "tool_call_id",
2430
- });
2431
- });
2432
-
2433
- /**
2434
- * @internal
2435
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2436
- */
2437
- export namespace MessagesToolMessage$ {
2438
- /** @deprecated use `MessagesToolMessage$inboundSchema` instead. */
2439
- export const inboundSchema = MessagesToolMessage$inboundSchema;
2440
- /** @deprecated use `MessagesToolMessage$outboundSchema` instead. */
2441
- export const outboundSchema = MessagesToolMessage$outboundSchema;
2442
- /** @deprecated use `MessagesToolMessage$Outbound` instead. */
2443
- export type Outbound = MessagesToolMessage$Outbound;
2444
- }
2445
-
2446
- export function messagesToolMessageToJSON(
2447
- messagesToolMessage: MessagesToolMessage,
2448
- ): string {
2449
- return JSON.stringify(
2450
- MessagesToolMessage$outboundSchema.parse(messagesToolMessage),
2451
- );
2452
- }
2453
-
2454
- export function messagesToolMessageFromJSON(
2455
- jsonString: string,
2456
- ): SafeParseResult<MessagesToolMessage, SDKValidationError> {
2457
- return safeParse(
2458
- jsonString,
2459
- (x) => MessagesToolMessage$inboundSchema.parse(JSON.parse(x)),
2460
- `Failed to parse 'MessagesToolMessage' from JSON`,
2461
- );
2462
- }
2463
-
2464
- /** @internal */
2465
- export const Deployments2Messages4ContentType$inboundSchema: z.ZodNativeEnum<
2466
- typeof Deployments2Messages4ContentType
2467
- > = z.nativeEnum(Deployments2Messages4ContentType);
2468
-
2469
- /** @internal */
2470
- export const Deployments2Messages4ContentType$outboundSchema: z.ZodNativeEnum<
2471
- typeof Deployments2Messages4ContentType
2472
- > = Deployments2Messages4ContentType$inboundSchema;
2473
-
2474
- /**
2475
- * @internal
2476
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2477
- */
2478
- export namespace Deployments2Messages4ContentType$ {
2479
- /** @deprecated use `Deployments2Messages4ContentType$inboundSchema` instead. */
2480
- export const inboundSchema = Deployments2Messages4ContentType$inboundSchema;
2481
- /** @deprecated use `Deployments2Messages4ContentType$outboundSchema` instead. */
2482
- export const outboundSchema = Deployments2Messages4ContentType$outboundSchema;
2483
- }
2484
-
2485
- /** @internal */
2486
- export const TwoRefusalContentPart$inboundSchema: z.ZodType<
2487
- TwoRefusalContentPart,
2488
- z.ZodTypeDef,
2489
- unknown
2490
- > = z.object({
2491
- type: Deployments2Messages4ContentType$inboundSchema,
2492
- refusal: z.string(),
2493
- });
2494
-
2495
- /** @internal */
2496
- export type TwoRefusalContentPart$Outbound = {
2497
- type: string;
2498
- refusal: string;
2499
- };
2500
-
2501
- /** @internal */
2502
- export const TwoRefusalContentPart$outboundSchema: z.ZodType<
2503
- TwoRefusalContentPart$Outbound,
2504
- z.ZodTypeDef,
2505
- TwoRefusalContentPart
2506
- > = z.object({
2507
- type: Deployments2Messages4ContentType$outboundSchema,
2508
- refusal: z.string(),
2509
- });
2510
-
2511
- /**
2512
- * @internal
2513
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2514
- */
2515
- export namespace TwoRefusalContentPart$ {
2516
- /** @deprecated use `TwoRefusalContentPart$inboundSchema` instead. */
2517
- export const inboundSchema = TwoRefusalContentPart$inboundSchema;
2518
- /** @deprecated use `TwoRefusalContentPart$outboundSchema` instead. */
2519
- export const outboundSchema = TwoRefusalContentPart$outboundSchema;
2520
- /** @deprecated use `TwoRefusalContentPart$Outbound` instead. */
2521
- export type Outbound = TwoRefusalContentPart$Outbound;
2522
- }
2523
-
2524
- export function twoRefusalContentPartToJSON(
2525
- twoRefusalContentPart: TwoRefusalContentPart,
2526
- ): string {
2527
- return JSON.stringify(
2528
- TwoRefusalContentPart$outboundSchema.parse(twoRefusalContentPart),
2529
- );
2530
- }
2531
-
2532
- export function twoRefusalContentPartFromJSON(
2533
- jsonString: string,
2534
- ): SafeParseResult<TwoRefusalContentPart, SDKValidationError> {
2535
- return safeParse(
2536
- jsonString,
2537
- (x) => TwoRefusalContentPart$inboundSchema.parse(JSON.parse(x)),
2538
- `Failed to parse 'TwoRefusalContentPart' from JSON`,
2539
- );
2540
- }
2541
-
2542
- /** @internal */
2543
- export const Deployments2Messages4Type$inboundSchema: z.ZodNativeEnum<
2544
- typeof Deployments2Messages4Type
2545
- > = z.nativeEnum(Deployments2Messages4Type);
2546
-
2547
- /** @internal */
2548
- export const Deployments2Messages4Type$outboundSchema: z.ZodNativeEnum<
2549
- typeof Deployments2Messages4Type
2550
- > = Deployments2Messages4Type$inboundSchema;
2551
-
2552
- /**
2553
- * @internal
2554
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2555
- */
2556
- export namespace Deployments2Messages4Type$ {
2557
- /** @deprecated use `Deployments2Messages4Type$inboundSchema` instead. */
2558
- export const inboundSchema = Deployments2Messages4Type$inboundSchema;
2559
- /** @deprecated use `Deployments2Messages4Type$outboundSchema` instead. */
2560
- export const outboundSchema = Deployments2Messages4Type$outboundSchema;
2561
- }
2562
-
2563
- /** @internal */
2564
- export const TwoTextContentPart$inboundSchema: z.ZodType<
2565
- TwoTextContentPart,
2566
- z.ZodTypeDef,
2567
- unknown
2568
- > = z.object({
2569
- type: Deployments2Messages4Type$inboundSchema,
2570
- text: z.string(),
2571
- });
2572
-
2573
- /** @internal */
2574
- export type TwoTextContentPart$Outbound = {
2575
- type: string;
2576
- text: string;
2577
- };
2578
-
2579
- /** @internal */
2580
- export const TwoTextContentPart$outboundSchema: z.ZodType<
2581
- TwoTextContentPart$Outbound,
2582
- z.ZodTypeDef,
2583
- TwoTextContentPart
2584
- > = z.object({
2585
- type: Deployments2Messages4Type$outboundSchema,
2586
- text: z.string(),
2587
- });
2588
-
2589
- /**
2590
- * @internal
2591
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2592
- */
2593
- export namespace TwoTextContentPart$ {
2594
- /** @deprecated use `TwoTextContentPart$inboundSchema` instead. */
2595
- export const inboundSchema = TwoTextContentPart$inboundSchema;
2596
- /** @deprecated use `TwoTextContentPart$outboundSchema` instead. */
2597
- export const outboundSchema = TwoTextContentPart$outboundSchema;
2598
- /** @deprecated use `TwoTextContentPart$Outbound` instead. */
2599
- export type Outbound = TwoTextContentPart$Outbound;
2600
- }
2601
-
2602
- export function twoTextContentPartToJSON(
2603
- twoTextContentPart: TwoTextContentPart,
2604
- ): string {
2605
- return JSON.stringify(
2606
- TwoTextContentPart$outboundSchema.parse(twoTextContentPart),
2607
- );
2608
- }
2609
-
2610
- export function twoTextContentPartFromJSON(
2611
- jsonString: string,
2612
- ): SafeParseResult<TwoTextContentPart, SDKValidationError> {
2613
- return safeParse(
2614
- jsonString,
2615
- (x) => TwoTextContentPart$inboundSchema.parse(JSON.parse(x)),
2616
- `Failed to parse 'TwoTextContentPart' from JSON`,
2617
- );
2618
- }
2619
-
2620
- /** @internal */
2621
- export const DeploymentsContentMessages2$inboundSchema: z.ZodType<
2622
- DeploymentsContentMessages2,
2623
- z.ZodTypeDef,
2624
- unknown
2625
- > = z.union([
2626
- z.lazy(() => TwoTextContentPart$inboundSchema),
2627
- z.lazy(() => TwoRefusalContentPart$inboundSchema),
2628
- ]);
2629
-
2630
- /** @internal */
2631
- export type DeploymentsContentMessages2$Outbound =
2632
- | TwoTextContentPart$Outbound
2633
- | TwoRefusalContentPart$Outbound;
2634
-
2635
- /** @internal */
2636
- export const DeploymentsContentMessages2$outboundSchema: z.ZodType<
2637
- DeploymentsContentMessages2$Outbound,
2638
- z.ZodTypeDef,
2639
- DeploymentsContentMessages2
2640
- > = z.union([
2641
- z.lazy(() => TwoTextContentPart$outboundSchema),
2642
- z.lazy(() => TwoRefusalContentPart$outboundSchema),
2643
- ]);
2644
-
2645
- /**
2646
- * @internal
2647
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2648
- */
2649
- export namespace DeploymentsContentMessages2$ {
2650
- /** @deprecated use `DeploymentsContentMessages2$inboundSchema` instead. */
2651
- export const inboundSchema = DeploymentsContentMessages2$inboundSchema;
2652
- /** @deprecated use `DeploymentsContentMessages2$outboundSchema` instead. */
2653
- export const outboundSchema = DeploymentsContentMessages2$outboundSchema;
2654
- /** @deprecated use `DeploymentsContentMessages2$Outbound` instead. */
2655
- export type Outbound = DeploymentsContentMessages2$Outbound;
2656
- }
2657
-
2658
- export function deploymentsContentMessages2ToJSON(
2659
- deploymentsContentMessages2: DeploymentsContentMessages2,
2660
- ): string {
2661
- return JSON.stringify(
2662
- DeploymentsContentMessages2$outboundSchema.parse(
2663
- deploymentsContentMessages2,
2664
- ),
2665
- );
2666
- }
2667
-
2668
- export function deploymentsContentMessages2FromJSON(
2669
- jsonString: string,
2670
- ): SafeParseResult<DeploymentsContentMessages2, SDKValidationError> {
2671
- return safeParse(
2672
- jsonString,
2673
- (x) => DeploymentsContentMessages2$inboundSchema.parse(JSON.parse(x)),
2674
- `Failed to parse 'DeploymentsContentMessages2' from JSON`,
2675
- );
2676
- }
2677
-
2678
- /** @internal */
2679
- export const DeploymentsMessagesContent$inboundSchema: z.ZodType<
2680
- DeploymentsMessagesContent,
2681
- z.ZodTypeDef,
2682
- unknown
2683
- > = z.union([
2684
- z.string(),
2685
- z.array(z.union([
2686
- z.lazy(() => TwoTextContentPart$inboundSchema),
2687
- z.lazy(() => TwoRefusalContentPart$inboundSchema),
2688
- ])),
2689
- ]);
2690
-
2691
- /** @internal */
2692
- export type DeploymentsMessagesContent$Outbound =
2693
- | string
2694
- | Array<TwoTextContentPart$Outbound | TwoRefusalContentPart$Outbound>;
2695
-
2696
- /** @internal */
2697
- export const DeploymentsMessagesContent$outboundSchema: z.ZodType<
2698
- DeploymentsMessagesContent$Outbound,
2699
- z.ZodTypeDef,
2700
- DeploymentsMessagesContent
2701
- > = z.union([
2702
- z.string(),
2703
- z.array(z.union([
2704
- z.lazy(() => TwoTextContentPart$outboundSchema),
2705
- z.lazy(() => TwoRefusalContentPart$outboundSchema),
2706
- ])),
2707
- ]);
2708
-
2709
- /**
2710
- * @internal
2711
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2712
- */
2713
- export namespace DeploymentsMessagesContent$ {
2714
- /** @deprecated use `DeploymentsMessagesContent$inboundSchema` instead. */
2715
- export const inboundSchema = DeploymentsMessagesContent$inboundSchema;
2716
- /** @deprecated use `DeploymentsMessagesContent$outboundSchema` instead. */
2717
- export const outboundSchema = DeploymentsMessagesContent$outboundSchema;
2718
- /** @deprecated use `DeploymentsMessagesContent$Outbound` instead. */
2719
- export type Outbound = DeploymentsMessagesContent$Outbound;
2720
- }
2721
-
2722
- export function deploymentsMessagesContentToJSON(
2723
- deploymentsMessagesContent: DeploymentsMessagesContent,
2724
- ): string {
2725
- return JSON.stringify(
2726
- DeploymentsMessagesContent$outboundSchema.parse(deploymentsMessagesContent),
2727
- );
2728
- }
2729
-
2730
- export function deploymentsMessagesContentFromJSON(
2731
- jsonString: string,
2732
- ): SafeParseResult<DeploymentsMessagesContent, SDKValidationError> {
2733
- return safeParse(
2734
- jsonString,
2735
- (x) => DeploymentsMessagesContent$inboundSchema.parse(JSON.parse(x)),
2736
- `Failed to parse 'DeploymentsMessagesContent' from JSON`,
2737
- );
2738
- }
2739
-
2740
- /** @internal */
2741
- export const DeploymentsMessages4Role$inboundSchema: z.ZodNativeEnum<
2742
- typeof DeploymentsMessages4Role
2743
- > = z.nativeEnum(DeploymentsMessages4Role);
2744
-
2745
- /** @internal */
2746
- export const DeploymentsMessages4Role$outboundSchema: z.ZodNativeEnum<
2747
- typeof DeploymentsMessages4Role
2748
- > = DeploymentsMessages4Role$inboundSchema;
2749
-
2750
- /**
2751
- * @internal
2752
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2753
- */
2754
- export namespace DeploymentsMessages4Role$ {
2755
- /** @deprecated use `DeploymentsMessages4Role$inboundSchema` instead. */
2756
- export const inboundSchema = DeploymentsMessages4Role$inboundSchema;
2757
- /** @deprecated use `DeploymentsMessages4Role$outboundSchema` instead. */
2758
- export const outboundSchema = DeploymentsMessages4Role$outboundSchema;
2759
- }
2760
-
2761
- /** @internal */
2762
- export const MessagesAudio$inboundSchema: z.ZodType<
2763
- MessagesAudio,
2764
- z.ZodTypeDef,
2765
- unknown
2766
- > = z.object({
2767
- id: z.string(),
2768
- });
2769
-
2770
- /** @internal */
2771
- export type MessagesAudio$Outbound = {
2772
- id: string;
2773
- };
2774
-
2775
- /** @internal */
2776
- export const MessagesAudio$outboundSchema: z.ZodType<
2777
- MessagesAudio$Outbound,
2778
- z.ZodTypeDef,
2779
- MessagesAudio
2780
- > = z.object({
2781
- id: z.string(),
2782
- });
2783
-
2784
- /**
2785
- * @internal
2786
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2787
- */
2788
- export namespace MessagesAudio$ {
2789
- /** @deprecated use `MessagesAudio$inboundSchema` instead. */
2790
- export const inboundSchema = MessagesAudio$inboundSchema;
2791
- /** @deprecated use `MessagesAudio$outboundSchema` instead. */
2792
- export const outboundSchema = MessagesAudio$outboundSchema;
2793
- /** @deprecated use `MessagesAudio$Outbound` instead. */
2794
- export type Outbound = MessagesAudio$Outbound;
2795
- }
2796
-
2797
- export function messagesAudioToJSON(messagesAudio: MessagesAudio): string {
2798
- return JSON.stringify(MessagesAudio$outboundSchema.parse(messagesAudio));
2799
- }
2800
-
2801
- export function messagesAudioFromJSON(
2802
- jsonString: string,
2803
- ): SafeParseResult<MessagesAudio, SDKValidationError> {
2804
- return safeParse(
2805
- jsonString,
2806
- (x) => MessagesAudio$inboundSchema.parse(JSON.parse(x)),
2807
- `Failed to parse 'MessagesAudio' from JSON`,
2808
- );
2809
- }
2810
-
2811
- /** @internal */
2812
- export const MessagesType$inboundSchema: z.ZodNativeEnum<typeof MessagesType> =
2813
- z.nativeEnum(MessagesType);
2814
-
2815
- /** @internal */
2816
- export const MessagesType$outboundSchema: z.ZodNativeEnum<typeof MessagesType> =
2817
- MessagesType$inboundSchema;
2818
-
2819
- /**
2820
- * @internal
2821
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2822
- */
2823
- export namespace MessagesType$ {
2824
- /** @deprecated use `MessagesType$inboundSchema` instead. */
2825
- export const inboundSchema = MessagesType$inboundSchema;
2826
- /** @deprecated use `MessagesType$outboundSchema` instead. */
2827
- export const outboundSchema = MessagesType$outboundSchema;
2828
- }
2829
-
2830
- /** @internal */
2831
- export const MessagesFunction$inboundSchema: z.ZodType<
2832
- MessagesFunction,
2833
- z.ZodTypeDef,
2834
- unknown
2835
- > = z.object({
2836
- name: z.string().optional(),
2837
- arguments: z.string().optional(),
2838
- });
2839
-
2840
- /** @internal */
2841
- export type MessagesFunction$Outbound = {
2842
- name?: string | undefined;
2843
- arguments?: string | undefined;
2844
- };
2845
-
2846
- /** @internal */
2847
- export const MessagesFunction$outboundSchema: z.ZodType<
2848
- MessagesFunction$Outbound,
2849
- z.ZodTypeDef,
2850
- MessagesFunction
2851
- > = z.object({
2852
- name: z.string().optional(),
2853
- arguments: z.string().optional(),
2854
- });
2855
-
2856
- /**
2857
- * @internal
2858
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2859
- */
2860
- export namespace MessagesFunction$ {
2861
- /** @deprecated use `MessagesFunction$inboundSchema` instead. */
2862
- export const inboundSchema = MessagesFunction$inboundSchema;
2863
- /** @deprecated use `MessagesFunction$outboundSchema` instead. */
2864
- export const outboundSchema = MessagesFunction$outboundSchema;
2865
- /** @deprecated use `MessagesFunction$Outbound` instead. */
2866
- export type Outbound = MessagesFunction$Outbound;
2867
- }
2868
-
2869
- export function messagesFunctionToJSON(
2870
- messagesFunction: MessagesFunction,
2871
- ): string {
2872
- return JSON.stringify(
2873
- MessagesFunction$outboundSchema.parse(messagesFunction),
2874
- );
2875
- }
2876
-
2877
- export function messagesFunctionFromJSON(
2878
- jsonString: string,
2879
- ): SafeParseResult<MessagesFunction, SDKValidationError> {
2880
- return safeParse(
2881
- jsonString,
2882
- (x) => MessagesFunction$inboundSchema.parse(JSON.parse(x)),
2883
- `Failed to parse 'MessagesFunction' from JSON`,
2884
- );
2885
- }
2886
-
2887
- /** @internal */
2888
- export const MessagesToolCalls$inboundSchema: z.ZodType<
2889
- MessagesToolCalls,
2890
- z.ZodTypeDef,
2891
- unknown
2892
- > = z.object({
2893
- id: z.string(),
2894
- type: MessagesType$inboundSchema,
2895
- function: z.lazy(() => MessagesFunction$inboundSchema),
2896
- });
2897
-
2898
- /** @internal */
2899
- export type MessagesToolCalls$Outbound = {
2900
- id: string;
2901
- type: string;
2902
- function: MessagesFunction$Outbound;
2903
- };
2904
-
2905
- /** @internal */
2906
- export const MessagesToolCalls$outboundSchema: z.ZodType<
2907
- MessagesToolCalls$Outbound,
2908
- z.ZodTypeDef,
2909
- MessagesToolCalls
2910
- > = z.object({
2911
- id: z.string(),
2912
- type: MessagesType$outboundSchema,
2913
- function: z.lazy(() => MessagesFunction$outboundSchema),
2914
- });
2915
-
2916
- /**
2917
- * @internal
2918
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2919
- */
2920
- export namespace MessagesToolCalls$ {
2921
- /** @deprecated use `MessagesToolCalls$inboundSchema` instead. */
2922
- export const inboundSchema = MessagesToolCalls$inboundSchema;
2923
- /** @deprecated use `MessagesToolCalls$outboundSchema` instead. */
2924
- export const outboundSchema = MessagesToolCalls$outboundSchema;
2925
- /** @deprecated use `MessagesToolCalls$Outbound` instead. */
2926
- export type Outbound = MessagesToolCalls$Outbound;
2927
- }
2928
-
2929
- export function messagesToolCallsToJSON(
2930
- messagesToolCalls: MessagesToolCalls,
2931
- ): string {
2932
- return JSON.stringify(
2933
- MessagesToolCalls$outboundSchema.parse(messagesToolCalls),
2934
- );
2935
- }
2936
-
2937
- export function messagesToolCallsFromJSON(
2938
- jsonString: string,
2939
- ): SafeParseResult<MessagesToolCalls, SDKValidationError> {
2940
- return safeParse(
2941
- jsonString,
2942
- (x) => MessagesToolCalls$inboundSchema.parse(JSON.parse(x)),
2943
- `Failed to parse 'MessagesToolCalls' from JSON`,
2944
- );
2945
- }
2946
-
2947
- /** @internal */
2948
- export const MessagesAssistantMessage$inboundSchema: z.ZodType<
2949
- MessagesAssistantMessage,
2950
- z.ZodTypeDef,
2951
- unknown
2952
- > = z.object({
2953
- content: z.union([
2954
- z.string(),
2955
- z.array(z.union([
2956
- z.lazy(() => TwoTextContentPart$inboundSchema),
2957
- z.lazy(() => TwoRefusalContentPart$inboundSchema),
2958
- ])),
2959
- ]).optional(),
2960
- refusal: z.nullable(z.string()).optional(),
2961
- role: DeploymentsMessages4Role$inboundSchema,
2962
- name: z.string().optional(),
2963
- audio: z.nullable(z.lazy(() => MessagesAudio$inboundSchema)).optional(),
2964
- tool_calls: z.array(z.lazy(() => MessagesToolCalls$inboundSchema)).optional(),
2965
- }).transform((v) => {
2966
- return remap$(v, {
2967
- "tool_calls": "toolCalls",
2968
- });
2969
- });
2970
-
2971
- /** @internal */
2972
- export type MessagesAssistantMessage$Outbound = {
2973
- content?:
2974
- | string
2975
- | Array<TwoTextContentPart$Outbound | TwoRefusalContentPart$Outbound>
2976
- | undefined;
2977
- refusal?: string | null | undefined;
2978
- role: string;
2979
- name?: string | undefined;
2980
- audio?: MessagesAudio$Outbound | null | undefined;
2981
- tool_calls?: Array<MessagesToolCalls$Outbound> | undefined;
2982
- };
2983
-
2984
- /** @internal */
2985
- export const MessagesAssistantMessage$outboundSchema: z.ZodType<
2986
- MessagesAssistantMessage$Outbound,
2987
- z.ZodTypeDef,
2988
- MessagesAssistantMessage
2989
- > = z.object({
2990
- content: z.union([
2991
- z.string(),
2992
- z.array(z.union([
2993
- z.lazy(() => TwoTextContentPart$outboundSchema),
2994
- z.lazy(() => TwoRefusalContentPart$outboundSchema),
2995
- ])),
2996
- ]).optional(),
2997
- refusal: z.nullable(z.string()).optional(),
2998
- role: DeploymentsMessages4Role$outboundSchema,
2999
- name: z.string().optional(),
3000
- audio: z.nullable(z.lazy(() => MessagesAudio$outboundSchema)).optional(),
3001
- toolCalls: z.array(z.lazy(() => MessagesToolCalls$outboundSchema)).optional(),
3002
- }).transform((v) => {
3003
- return remap$(v, {
3004
- toolCalls: "tool_calls",
3005
- });
3006
- });
3007
-
3008
- /**
3009
- * @internal
3010
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
3011
- */
3012
- export namespace MessagesAssistantMessage$ {
3013
- /** @deprecated use `MessagesAssistantMessage$inboundSchema` instead. */
3014
- export const inboundSchema = MessagesAssistantMessage$inboundSchema;
3015
- /** @deprecated use `MessagesAssistantMessage$outboundSchema` instead. */
3016
- export const outboundSchema = MessagesAssistantMessage$outboundSchema;
3017
- /** @deprecated use `MessagesAssistantMessage$Outbound` instead. */
3018
- export type Outbound = MessagesAssistantMessage$Outbound;
3019
- }
3020
-
3021
- export function messagesAssistantMessageToJSON(
3022
- messagesAssistantMessage: MessagesAssistantMessage,
3023
- ): string {
3024
- return JSON.stringify(
3025
- MessagesAssistantMessage$outboundSchema.parse(messagesAssistantMessage),
3026
- );
3027
- }
3028
-
3029
- export function messagesAssistantMessageFromJSON(
3030
- jsonString: string,
3031
- ): SafeParseResult<MessagesAssistantMessage, SDKValidationError> {
3032
- return safeParse(
3033
- jsonString,
3034
- (x) => MessagesAssistantMessage$inboundSchema.parse(JSON.parse(x)),
3035
- `Failed to parse 'MessagesAssistantMessage' from JSON`,
3036
- );
3037
- }
3038
-
3039
- /** @internal */
3040
- export const DeploymentsMessages3Role$inboundSchema: z.ZodNativeEnum<
3041
- typeof DeploymentsMessages3Role
3042
- > = z.nativeEnum(DeploymentsMessages3Role);
3043
-
3044
- /** @internal */
3045
- export const DeploymentsMessages3Role$outboundSchema: z.ZodNativeEnum<
3046
- typeof DeploymentsMessages3Role
3047
- > = DeploymentsMessages3Role$inboundSchema;
3048
-
3049
- /**
3050
- * @internal
3051
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
3052
- */
3053
- export namespace DeploymentsMessages3Role$ {
3054
- /** @deprecated use `DeploymentsMessages3Role$inboundSchema` instead. */
3055
- export const inboundSchema = DeploymentsMessages3Role$inboundSchema;
3056
- /** @deprecated use `DeploymentsMessages3Role$outboundSchema` instead. */
3057
- export const outboundSchema = DeploymentsMessages3Role$outboundSchema;
3058
- }
3059
-
3060
- /** @internal */
3061
- export const Deployments2Messages3ContentType$inboundSchema: z.ZodNativeEnum<
3062
- typeof Deployments2Messages3ContentType
3063
- > = z.nativeEnum(Deployments2Messages3ContentType);
3064
-
3065
- /** @internal */
3066
- export const Deployments2Messages3ContentType$outboundSchema: z.ZodNativeEnum<
3067
- typeof Deployments2Messages3ContentType
3068
- > = Deployments2Messages3ContentType$inboundSchema;
3069
-
3070
- /**
3071
- * @internal
3072
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
3073
- */
3074
- export namespace Deployments2Messages3ContentType$ {
3075
- /** @deprecated use `Deployments2Messages3ContentType$inboundSchema` instead. */
3076
- export const inboundSchema = Deployments2Messages3ContentType$inboundSchema;
3077
- /** @deprecated use `Deployments2Messages3ContentType$outboundSchema` instead. */
3078
- export const outboundSchema = Deployments2Messages3ContentType$outboundSchema;
3079
- }
3080
-
3081
- /** @internal */
3082
- export const TwoFormat$inboundSchema: z.ZodNativeEnum<typeof TwoFormat> = z
3083
- .nativeEnum(TwoFormat);
3084
-
3085
- /** @internal */
3086
- export const TwoFormat$outboundSchema: z.ZodNativeEnum<typeof TwoFormat> =
3087
- TwoFormat$inboundSchema;
3088
-
3089
- /**
3090
- * @internal
3091
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
3092
- */
3093
- export namespace TwoFormat$ {
3094
- /** @deprecated use `TwoFormat$inboundSchema` instead. */
3095
- export const inboundSchema = TwoFormat$inboundSchema;
3096
- /** @deprecated use `TwoFormat$outboundSchema` instead. */
3097
- export const outboundSchema = TwoFormat$outboundSchema;
3098
- }
3099
-
3100
- /** @internal */
3101
- export const TwoInputAudio$inboundSchema: z.ZodType<
3102
- TwoInputAudio,
3103
- z.ZodTypeDef,
3104
- unknown
3105
- > = z.object({
3106
- data: z.string(),
3107
- format: TwoFormat$inboundSchema,
3108
- });
3109
-
3110
- /** @internal */
3111
- export type TwoInputAudio$Outbound = {
3112
- data: string;
3113
- format: string;
3114
- };
3115
-
3116
- /** @internal */
3117
- export const TwoInputAudio$outboundSchema: z.ZodType<
3118
- TwoInputAudio$Outbound,
3119
- z.ZodTypeDef,
3120
- TwoInputAudio
3121
- > = z.object({
3122
- data: z.string(),
3123
- format: TwoFormat$outboundSchema,
3124
- });
3125
-
3126
- /**
3127
- * @internal
3128
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
3129
- */
3130
- export namespace TwoInputAudio$ {
3131
- /** @deprecated use `TwoInputAudio$inboundSchema` instead. */
3132
- export const inboundSchema = TwoInputAudio$inboundSchema;
3133
- /** @deprecated use `TwoInputAudio$outboundSchema` instead. */
3134
- export const outboundSchema = TwoInputAudio$outboundSchema;
3135
- /** @deprecated use `TwoInputAudio$Outbound` instead. */
3136
- export type Outbound = TwoInputAudio$Outbound;
3137
- }
3138
-
3139
- export function twoInputAudioToJSON(twoInputAudio: TwoInputAudio): string {
3140
- return JSON.stringify(TwoInputAudio$outboundSchema.parse(twoInputAudio));
3141
- }
3142
-
3143
- export function twoInputAudioFromJSON(
3144
- jsonString: string,
3145
- ): SafeParseResult<TwoInputAudio, SDKValidationError> {
3146
- return safeParse(
3147
- jsonString,
3148
- (x) => TwoInputAudio$inboundSchema.parse(JSON.parse(x)),
3149
- `Failed to parse 'TwoInputAudio' from JSON`,
3150
- );
3151
- }
3152
-
3153
- /** @internal */
3154
- export const Two3$inboundSchema: z.ZodType<Two3, z.ZodTypeDef, unknown> = z
3155
- .object({
3156
- type: Deployments2Messages3ContentType$inboundSchema,
3157
- input_audio: z.lazy(() => TwoInputAudio$inboundSchema),
3158
- }).transform((v) => {
3159
- return remap$(v, {
3160
- "input_audio": "inputAudio",
3161
- });
3162
- });
3163
-
3164
- /** @internal */
3165
- export type Two3$Outbound = {
3166
- type: string;
3167
- input_audio: TwoInputAudio$Outbound;
3168
- };
3169
-
3170
- /** @internal */
3171
- export const Two3$outboundSchema: z.ZodType<Two3$Outbound, z.ZodTypeDef, Two3> =
3172
- z.object({
3173
- type: Deployments2Messages3ContentType$outboundSchema,
3174
- inputAudio: z.lazy(() => TwoInputAudio$outboundSchema),
3175
- }).transform((v) => {
3176
- return remap$(v, {
3177
- inputAudio: "input_audio",
3178
- });
3179
- });
3180
-
3181
- /**
3182
- * @internal
3183
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
3184
- */
3185
- export namespace Two3$ {
3186
- /** @deprecated use `Two3$inboundSchema` instead. */
3187
- export const inboundSchema = Two3$inboundSchema;
3188
- /** @deprecated use `Two3$outboundSchema` instead. */
3189
- export const outboundSchema = Two3$outboundSchema;
3190
- /** @deprecated use `Two3$Outbound` instead. */
3191
- export type Outbound = Two3$Outbound;
3192
- }
3193
-
3194
- export function two3ToJSON(two3: Two3): string {
3195
- return JSON.stringify(Two3$outboundSchema.parse(two3));
3196
- }
3197
-
3198
- export function two3FromJSON(
3199
- jsonString: string,
3200
- ): SafeParseResult<Two3, SDKValidationError> {
3201
- return safeParse(
3202
- jsonString,
3203
- (x) => Two3$inboundSchema.parse(JSON.parse(x)),
3204
- `Failed to parse 'Two3' from JSON`,
3205
- );
3206
- }
3207
-
3208
- /** @internal */
3209
- export const Deployments2Messages3Type$inboundSchema: z.ZodNativeEnum<
3210
- typeof Deployments2Messages3Type
3211
- > = z.nativeEnum(Deployments2Messages3Type);
3212
-
3213
- /** @internal */
3214
- export const Deployments2Messages3Type$outboundSchema: z.ZodNativeEnum<
3215
- typeof Deployments2Messages3Type
3216
- > = Deployments2Messages3Type$inboundSchema;
3217
-
3218
- /**
3219
- * @internal
3220
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
3221
- */
3222
- export namespace Deployments2Messages3Type$ {
3223
- /** @deprecated use `Deployments2Messages3Type$inboundSchema` instead. */
3224
- export const inboundSchema = Deployments2Messages3Type$inboundSchema;
3225
- /** @deprecated use `Deployments2Messages3Type$outboundSchema` instead. */
3226
- export const outboundSchema = Deployments2Messages3Type$outboundSchema;
3227
- }
3228
-
3229
- /** @internal */
3230
- export const TwoDetail$inboundSchema: z.ZodNativeEnum<typeof TwoDetail> = z
3231
- .nativeEnum(TwoDetail);
3232
-
3233
- /** @internal */
3234
- export const TwoDetail$outboundSchema: z.ZodNativeEnum<typeof TwoDetail> =
3235
- TwoDetail$inboundSchema;
3236
-
3237
- /**
3238
- * @internal
3239
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
3240
- */
3241
- export namespace TwoDetail$ {
3242
- /** @deprecated use `TwoDetail$inboundSchema` instead. */
3243
- export const inboundSchema = TwoDetail$inboundSchema;
3244
- /** @deprecated use `TwoDetail$outboundSchema` instead. */
3245
- export const outboundSchema = TwoDetail$outboundSchema;
3246
- }
3247
-
3248
- /** @internal */
3249
- export const TwoImageUrl$inboundSchema: z.ZodType<
3250
- TwoImageUrl,
3251
- z.ZodTypeDef,
3252
- unknown
3253
- > = z.object({
3254
- url: z.string(),
3255
- detail: TwoDetail$inboundSchema.optional(),
3256
- });
3257
-
3258
- /** @internal */
3259
- export type TwoImageUrl$Outbound = {
3260
- url: string;
3261
- detail?: string | undefined;
3262
- };
3263
-
3264
- /** @internal */
3265
- export const TwoImageUrl$outboundSchema: z.ZodType<
3266
- TwoImageUrl$Outbound,
3267
- z.ZodTypeDef,
3268
- TwoImageUrl
3269
- > = z.object({
3270
- url: z.string(),
3271
- detail: TwoDetail$outboundSchema.optional(),
3272
- });
3273
-
3274
- /**
3275
- * @internal
3276
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
3277
- */
3278
- export namespace TwoImageUrl$ {
3279
- /** @deprecated use `TwoImageUrl$inboundSchema` instead. */
3280
- export const inboundSchema = TwoImageUrl$inboundSchema;
3281
- /** @deprecated use `TwoImageUrl$outboundSchema` instead. */
3282
- export const outboundSchema = TwoImageUrl$outboundSchema;
3283
- /** @deprecated use `TwoImageUrl$Outbound` instead. */
3284
- export type Outbound = TwoImageUrl$Outbound;
3285
- }
3286
-
3287
- export function twoImageUrlToJSON(twoImageUrl: TwoImageUrl): string {
3288
- return JSON.stringify(TwoImageUrl$outboundSchema.parse(twoImageUrl));
3289
- }
3290
-
3291
- export function twoImageUrlFromJSON(
3292
- jsonString: string,
3293
- ): SafeParseResult<TwoImageUrl, SDKValidationError> {
3294
- return safeParse(
3295
- jsonString,
3296
- (x) => TwoImageUrl$inboundSchema.parse(JSON.parse(x)),
3297
- `Failed to parse 'TwoImageUrl' from JSON`,
3298
- );
3299
- }
3300
-
3301
- /** @internal */
3302
- export const Deployments22$inboundSchema: z.ZodType<
3303
- Deployments22,
3304
- z.ZodTypeDef,
3305
- unknown
3306
- > = z.object({
3307
- type: Deployments2Messages3Type$inboundSchema,
3308
- image_url: z.lazy(() => TwoImageUrl$inboundSchema),
3309
- }).transform((v) => {
3310
- return remap$(v, {
3311
- "image_url": "imageUrl",
3312
- });
3313
- });
3314
-
3315
- /** @internal */
3316
- export type Deployments22$Outbound = {
3317
- type: string;
3318
- image_url: TwoImageUrl$Outbound;
3319
- };
3320
-
3321
- /** @internal */
3322
- export const Deployments22$outboundSchema: z.ZodType<
3323
- Deployments22$Outbound,
3324
- z.ZodTypeDef,
3325
- Deployments22
3326
- > = z.object({
3327
- type: Deployments2Messages3Type$outboundSchema,
3328
- imageUrl: z.lazy(() => TwoImageUrl$outboundSchema),
3329
- }).transform((v) => {
3330
- return remap$(v, {
3331
- imageUrl: "image_url",
3332
- });
3333
- });
3334
-
3335
- /**
3336
- * @internal
3337
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
3338
- */
3339
- export namespace Deployments22$ {
3340
- /** @deprecated use `Deployments22$inboundSchema` instead. */
3341
- export const inboundSchema = Deployments22$inboundSchema;
3342
- /** @deprecated use `Deployments22$outboundSchema` instead. */
3343
- export const outboundSchema = Deployments22$outboundSchema;
3344
- /** @deprecated use `Deployments22$Outbound` instead. */
3345
- export type Outbound = Deployments22$Outbound;
3346
- }
3347
-
3348
- export function deployments22ToJSON(deployments22: Deployments22): string {
3349
- return JSON.stringify(Deployments22$outboundSchema.parse(deployments22));
3350
- }
3351
-
3352
- export function deployments22FromJSON(
3353
- jsonString: string,
3354
- ): SafeParseResult<Deployments22, SDKValidationError> {
3355
- return safeParse(
3356
- jsonString,
3357
- (x) => Deployments22$inboundSchema.parse(JSON.parse(x)),
3358
- `Failed to parse 'Deployments22' from JSON`,
3359
- );
3360
- }
3361
-
3362
- /** @internal */
3363
- export const Deployments2MessagesType$inboundSchema: z.ZodNativeEnum<
3364
- typeof Deployments2MessagesType
3365
- > = z.nativeEnum(Deployments2MessagesType);
3366
-
3367
- /** @internal */
3368
- export const Deployments2MessagesType$outboundSchema: z.ZodNativeEnum<
3369
- typeof Deployments2MessagesType
3370
- > = Deployments2MessagesType$inboundSchema;
3371
-
3372
- /**
3373
- * @internal
3374
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
3375
- */
3376
- export namespace Deployments2MessagesType$ {
3377
- /** @deprecated use `Deployments2MessagesType$inboundSchema` instead. */
3378
- export const inboundSchema = Deployments2MessagesType$inboundSchema;
3379
- /** @deprecated use `Deployments2MessagesType$outboundSchema` instead. */
3380
- export const outboundSchema = Deployments2MessagesType$outboundSchema;
3381
- }
3382
-
3383
- /** @internal */
3384
- export const Two1$inboundSchema: z.ZodType<Two1, z.ZodTypeDef, unknown> = z
3385
- .object({
3386
- type: Deployments2MessagesType$inboundSchema,
3387
- text: z.string(),
3388
- });
3389
-
3390
- /** @internal */
3391
- export type Two1$Outbound = {
3392
- type: string;
3393
- text: string;
3394
- };
3395
-
3396
- /** @internal */
3397
- export const Two1$outboundSchema: z.ZodType<Two1$Outbound, z.ZodTypeDef, Two1> =
3398
- z.object({
3399
- type: Deployments2MessagesType$outboundSchema,
3400
- text: z.string(),
3401
- });
3402
-
3403
- /**
3404
- * @internal
3405
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
3406
- */
3407
- export namespace Two1$ {
3408
- /** @deprecated use `Two1$inboundSchema` instead. */
3409
- export const inboundSchema = Two1$inboundSchema;
3410
- /** @deprecated use `Two1$outboundSchema` instead. */
3411
- export const outboundSchema = Two1$outboundSchema;
3412
- /** @deprecated use `Two1$Outbound` instead. */
3413
- export type Outbound = Two1$Outbound;
3414
- }
3415
-
3416
- export function two1ToJSON(two1: Two1): string {
3417
- return JSON.stringify(Two1$outboundSchema.parse(two1));
3418
- }
3419
-
3420
- export function two1FromJSON(
3421
- jsonString: string,
3422
- ): SafeParseResult<Two1, SDKValidationError> {
3423
- return safeParse(
3424
- jsonString,
3425
- (x) => Two1$inboundSchema.parse(JSON.parse(x)),
3426
- `Failed to parse 'Two1' from JSON`,
3427
- );
3428
- }
3429
-
3430
- /** @internal */
3431
- export const DeploymentsContent2$inboundSchema: z.ZodType<
3432
- DeploymentsContent2,
3433
- z.ZodTypeDef,
3434
- unknown
3435
- > = z.union([
3436
- z.lazy(() => Two1$inboundSchema),
3437
- z.lazy(() => Deployments22$inboundSchema),
3438
- z.lazy(() => Two3$inboundSchema),
3439
- ]);
3440
-
3441
- /** @internal */
3442
- export type DeploymentsContent2$Outbound =
3443
- | Two1$Outbound
3444
- | Deployments22$Outbound
3445
- | Two3$Outbound;
3446
-
3447
- /** @internal */
3448
- export const DeploymentsContent2$outboundSchema: z.ZodType<
3449
- DeploymentsContent2$Outbound,
3450
- z.ZodTypeDef,
3451
- DeploymentsContent2
3452
- > = z.union([
3453
- z.lazy(() => Two1$outboundSchema),
3454
- z.lazy(() => Deployments22$outboundSchema),
3455
- z.lazy(() => Two3$outboundSchema),
3456
- ]);
3457
-
3458
- /**
3459
- * @internal
3460
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
3461
- */
3462
- export namespace DeploymentsContent2$ {
3463
- /** @deprecated use `DeploymentsContent2$inboundSchema` instead. */
3464
- export const inboundSchema = DeploymentsContent2$inboundSchema;
3465
- /** @deprecated use `DeploymentsContent2$outboundSchema` instead. */
3466
- export const outboundSchema = DeploymentsContent2$outboundSchema;
3467
- /** @deprecated use `DeploymentsContent2$Outbound` instead. */
3468
- export type Outbound = DeploymentsContent2$Outbound;
3469
- }
3470
-
3471
- export function deploymentsContent2ToJSON(
3472
- deploymentsContent2: DeploymentsContent2,
3473
- ): string {
3474
- return JSON.stringify(
3475
- DeploymentsContent2$outboundSchema.parse(deploymentsContent2),
3476
- );
3477
- }
3478
-
3479
- export function deploymentsContent2FromJSON(
3480
- jsonString: string,
3481
- ): SafeParseResult<DeploymentsContent2, SDKValidationError> {
3482
- return safeParse(
3483
- jsonString,
3484
- (x) => DeploymentsContent2$inboundSchema.parse(JSON.parse(x)),
3485
- `Failed to parse 'DeploymentsContent2' from JSON`,
3486
- );
3487
- }
3488
-
3489
- /** @internal */
3490
- export const MessagesContent$inboundSchema: z.ZodType<
3491
- MessagesContent,
3492
- z.ZodTypeDef,
3493
- unknown
3494
- > = z.union([
3495
- z.string(),
3496
- z.array(z.union([
3497
- z.lazy(() => Two1$inboundSchema),
3498
- z.lazy(() => Deployments22$inboundSchema),
3499
- z.lazy(() => Two3$inboundSchema),
3500
- ])),
3501
- ]);
3502
-
3503
- /** @internal */
3504
- export type MessagesContent$Outbound =
3505
- | string
3506
- | Array<Two1$Outbound | Deployments22$Outbound | Two3$Outbound>;
3507
-
3508
- /** @internal */
3509
- export const MessagesContent$outboundSchema: z.ZodType<
3510
- MessagesContent$Outbound,
3511
- z.ZodTypeDef,
3512
- MessagesContent
3513
- > = z.union([
3514
- z.string(),
3515
- z.array(z.union([
3516
- z.lazy(() => Two1$outboundSchema),
3517
- z.lazy(() => Deployments22$outboundSchema),
3518
- z.lazy(() => Two3$outboundSchema),
3519
- ])),
3520
- ]);
3521
-
3522
- /**
3523
- * @internal
3524
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
3525
- */
3526
- export namespace MessagesContent$ {
3527
- /** @deprecated use `MessagesContent$inboundSchema` instead. */
3528
- export const inboundSchema = MessagesContent$inboundSchema;
3529
- /** @deprecated use `MessagesContent$outboundSchema` instead. */
3530
- export const outboundSchema = MessagesContent$outboundSchema;
3531
- /** @deprecated use `MessagesContent$Outbound` instead. */
3532
- export type Outbound = MessagesContent$Outbound;
3533
- }
3534
-
3535
- export function messagesContentToJSON(
3536
- messagesContent: MessagesContent,
3537
- ): string {
3538
- return JSON.stringify(MessagesContent$outboundSchema.parse(messagesContent));
3539
- }
3540
-
3541
- export function messagesContentFromJSON(
3542
- jsonString: string,
3543
- ): SafeParseResult<MessagesContent, SDKValidationError> {
3544
- return safeParse(
3545
- jsonString,
3546
- (x) => MessagesContent$inboundSchema.parse(JSON.parse(x)),
3547
- `Failed to parse 'MessagesContent' from JSON`,
3548
- );
3549
- }
3550
-
3551
- /** @internal */
3552
- export const MessagesUserMessage$inboundSchema: z.ZodType<
3553
- MessagesUserMessage,
3554
- z.ZodTypeDef,
3555
- unknown
3556
- > = z.object({
3557
- role: DeploymentsMessages3Role$inboundSchema,
3558
- name: z.string().optional(),
3559
- content: z.union([
3560
- z.string(),
3561
- z.array(z.union([
3562
- z.lazy(() => Two1$inboundSchema),
3563
- z.lazy(() => Deployments22$inboundSchema),
3564
- z.lazy(() => Two3$inboundSchema),
3565
- ])),
3566
- ]),
3567
- });
3568
-
3569
- /** @internal */
3570
- export type MessagesUserMessage$Outbound = {
3571
- role: string;
3572
- name?: string | undefined;
3573
- content:
3574
- | string
3575
- | Array<Two1$Outbound | Deployments22$Outbound | Two3$Outbound>;
3576
- };
3577
-
3578
- /** @internal */
3579
- export const MessagesUserMessage$outboundSchema: z.ZodType<
3580
- MessagesUserMessage$Outbound,
3581
- z.ZodTypeDef,
3582
- MessagesUserMessage
3583
- > = z.object({
3584
- role: DeploymentsMessages3Role$outboundSchema,
3585
- name: z.string().optional(),
3586
- content: z.union([
3587
- z.string(),
3588
- z.array(z.union([
3589
- z.lazy(() => Two1$outboundSchema),
3590
- z.lazy(() => Deployments22$outboundSchema),
3591
- z.lazy(() => Two3$outboundSchema),
3592
- ])),
3593
- ]),
3594
- });
3595
-
3596
- /**
3597
- * @internal
3598
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
3599
- */
3600
- export namespace MessagesUserMessage$ {
3601
- /** @deprecated use `MessagesUserMessage$inboundSchema` instead. */
3602
- export const inboundSchema = MessagesUserMessage$inboundSchema;
3603
- /** @deprecated use `MessagesUserMessage$outboundSchema` instead. */
3604
- export const outboundSchema = MessagesUserMessage$outboundSchema;
3605
- /** @deprecated use `MessagesUserMessage$Outbound` instead. */
3606
- export type Outbound = MessagesUserMessage$Outbound;
3607
- }
3608
-
3609
- export function messagesUserMessageToJSON(
3610
- messagesUserMessage: MessagesUserMessage,
3611
- ): string {
3612
- return JSON.stringify(
3613
- MessagesUserMessage$outboundSchema.parse(messagesUserMessage),
3614
- );
3615
- }
3616
-
3617
- export function messagesUserMessageFromJSON(
3618
- jsonString: string,
3619
- ): SafeParseResult<MessagesUserMessage, SDKValidationError> {
3620
- return safeParse(
3621
- jsonString,
3622
- (x) => MessagesUserMessage$inboundSchema.parse(JSON.parse(x)),
3623
- `Failed to parse 'MessagesUserMessage' from JSON`,
3624
- );
3625
- }
3626
-
3627
- /** @internal */
3628
- export const DeploymentsMessagesRole$inboundSchema: z.ZodNativeEnum<
3629
- typeof DeploymentsMessagesRole
3630
- > = z.nativeEnum(DeploymentsMessagesRole);
3631
-
3632
- /** @internal */
3633
- export const DeploymentsMessagesRole$outboundSchema: z.ZodNativeEnum<
3634
- typeof DeploymentsMessagesRole
3635
- > = DeploymentsMessagesRole$inboundSchema;
3636
-
3637
- /**
3638
- * @internal
3639
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
3640
- */
3641
- export namespace DeploymentsMessagesRole$ {
3642
- /** @deprecated use `DeploymentsMessagesRole$inboundSchema` instead. */
3643
- export const inboundSchema = DeploymentsMessagesRole$inboundSchema;
3644
- /** @deprecated use `DeploymentsMessagesRole$outboundSchema` instead. */
3645
- export const outboundSchema = DeploymentsMessagesRole$outboundSchema;
3646
- }
3647
-
3648
- /** @internal */
3649
- export const MessagesSystemMessage$inboundSchema: z.ZodType<
3650
- MessagesSystemMessage,
3651
- z.ZodTypeDef,
3652
- unknown
3653
- > = z.object({
3654
- role: DeploymentsMessagesRole$inboundSchema,
3655
- content: z.string(),
3656
- name: z.string().optional(),
3657
- });
3658
-
3659
- /** @internal */
3660
- export type MessagesSystemMessage$Outbound = {
3661
- role: string;
3662
- content: string;
3663
- name?: string | undefined;
3664
- };
3665
-
3666
- /** @internal */
3667
- export const MessagesSystemMessage$outboundSchema: z.ZodType<
3668
- MessagesSystemMessage$Outbound,
3669
- z.ZodTypeDef,
3670
- MessagesSystemMessage
3671
- > = z.object({
3672
- role: DeploymentsMessagesRole$outboundSchema,
3673
- content: z.string(),
3674
- name: z.string().optional(),
3675
- });
3676
-
3677
- /**
3678
- * @internal
3679
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
3680
- */
3681
- export namespace MessagesSystemMessage$ {
3682
- /** @deprecated use `MessagesSystemMessage$inboundSchema` instead. */
3683
- export const inboundSchema = MessagesSystemMessage$inboundSchema;
3684
- /** @deprecated use `MessagesSystemMessage$outboundSchema` instead. */
3685
- export const outboundSchema = MessagesSystemMessage$outboundSchema;
3686
- /** @deprecated use `MessagesSystemMessage$Outbound` instead. */
3687
- export type Outbound = MessagesSystemMessage$Outbound;
3688
- }
3689
-
3690
- export function messagesSystemMessageToJSON(
3691
- messagesSystemMessage: MessagesSystemMessage,
3692
- ): string {
3693
- return JSON.stringify(
3694
- MessagesSystemMessage$outboundSchema.parse(messagesSystemMessage),
3695
- );
3696
- }
3697
-
3698
- export function messagesSystemMessageFromJSON(
3699
- jsonString: string,
3700
- ): SafeParseResult<MessagesSystemMessage, SDKValidationError> {
3701
- return safeParse(
3702
- jsonString,
3703
- (x) => MessagesSystemMessage$inboundSchema.parse(JSON.parse(x)),
3704
- `Failed to parse 'MessagesSystemMessage' from JSON`,
3705
- );
3706
- }
3707
-
3708
- /** @internal */
3709
- export const MessagesRole$inboundSchema: z.ZodNativeEnum<typeof MessagesRole> =
3710
- z.nativeEnum(MessagesRole);
3711
-
3712
- /** @internal */
3713
- export const MessagesRole$outboundSchema: z.ZodNativeEnum<typeof MessagesRole> =
3714
- MessagesRole$inboundSchema;
3715
-
3716
- /**
3717
- * @internal
3718
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
3719
- */
3720
- export namespace MessagesRole$ {
3721
- /** @deprecated use `MessagesRole$inboundSchema` instead. */
3722
- export const inboundSchema = MessagesRole$inboundSchema;
3723
- /** @deprecated use `MessagesRole$outboundSchema` instead. */
3724
- export const outboundSchema = MessagesRole$outboundSchema;
3725
- }
3726
-
3727
- /** @internal */
3728
- export const MessagesDeveloperMessage$inboundSchema: z.ZodType<
3729
- MessagesDeveloperMessage,
3730
- z.ZodTypeDef,
3731
- unknown
3732
- > = z.object({
3733
- role: MessagesRole$inboundSchema,
3734
- content: z.string(),
3735
- name: z.string().optional(),
3736
- });
3737
-
3738
- /** @internal */
3739
- export type MessagesDeveloperMessage$Outbound = {
3740
- role: string;
3741
- content: string;
3742
- name?: string | undefined;
3743
- };
3744
-
3745
- /** @internal */
3746
- export const MessagesDeveloperMessage$outboundSchema: z.ZodType<
3747
- MessagesDeveloperMessage$Outbound,
3748
- z.ZodTypeDef,
3749
- MessagesDeveloperMessage
3750
- > = z.object({
3751
- role: MessagesRole$outboundSchema,
3752
- content: z.string(),
3753
- name: z.string().optional(),
3754
- });
3755
-
3756
- /**
3757
- * @internal
3758
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
3759
- */
3760
- export namespace MessagesDeveloperMessage$ {
3761
- /** @deprecated use `MessagesDeveloperMessage$inboundSchema` instead. */
3762
- export const inboundSchema = MessagesDeveloperMessage$inboundSchema;
3763
- /** @deprecated use `MessagesDeveloperMessage$outboundSchema` instead. */
3764
- export const outboundSchema = MessagesDeveloperMessage$outboundSchema;
3765
- /** @deprecated use `MessagesDeveloperMessage$Outbound` instead. */
3766
- export type Outbound = MessagesDeveloperMessage$Outbound;
3767
- }
3768
-
3769
- export function messagesDeveloperMessageToJSON(
3770
- messagesDeveloperMessage: MessagesDeveloperMessage,
3771
- ): string {
3772
- return JSON.stringify(
3773
- MessagesDeveloperMessage$outboundSchema.parse(messagesDeveloperMessage),
3774
- );
3775
- }
3776
-
3777
- export function messagesDeveloperMessageFromJSON(
3778
- jsonString: string,
3779
- ): SafeParseResult<MessagesDeveloperMessage, SDKValidationError> {
3780
- return safeParse(
3781
- jsonString,
3782
- (x) => MessagesDeveloperMessage$inboundSchema.parse(JSON.parse(x)),
3783
- `Failed to parse 'MessagesDeveloperMessage' from JSON`,
3784
- );
3785
- }
3786
-
3787
- /** @internal */
3788
- export const Messages$inboundSchema: z.ZodType<
3789
- Messages,
3790
- z.ZodTypeDef,
3791
- unknown
3792
- > = z.union([
3793
- z.lazy(() => MessagesDeveloperMessage$inboundSchema),
3794
- z.lazy(() => MessagesSystemMessage$inboundSchema),
3795
- z.lazy(() => MessagesUserMessage$inboundSchema),
3796
- z.lazy(() => MessagesToolMessage$inboundSchema),
3797
- z.lazy(() => MessagesAssistantMessage$inboundSchema),
3798
- ]);
3799
-
3800
- /** @internal */
3801
- export type Messages$Outbound =
3802
- | MessagesDeveloperMessage$Outbound
3803
- | MessagesSystemMessage$Outbound
3804
- | MessagesUserMessage$Outbound
3805
- | MessagesToolMessage$Outbound
3806
- | MessagesAssistantMessage$Outbound;
3807
-
3808
- /** @internal */
3809
- export const Messages$outboundSchema: z.ZodType<
3810
- Messages$Outbound,
3811
- z.ZodTypeDef,
3812
- Messages
3813
- > = z.union([
3814
- z.lazy(() => MessagesDeveloperMessage$outboundSchema),
3815
- z.lazy(() => MessagesSystemMessage$outboundSchema),
3816
- z.lazy(() => MessagesUserMessage$outboundSchema),
3817
- z.lazy(() => MessagesToolMessage$outboundSchema),
3818
- z.lazy(() => MessagesAssistantMessage$outboundSchema),
3819
- ]);
3820
-
3821
- /**
3822
- * @internal
3823
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
3824
- */
3825
- export namespace Messages$ {
3826
- /** @deprecated use `Messages$inboundSchema` instead. */
3827
- export const inboundSchema = Messages$inboundSchema;
3828
- /** @deprecated use `Messages$outboundSchema` instead. */
3829
- export const outboundSchema = Messages$outboundSchema;
3830
- /** @deprecated use `Messages$Outbound` instead. */
3831
- export type Outbound = Messages$Outbound;
3832
- }
3833
-
3834
- export function messagesToJSON(messages: Messages): string {
3835
- return JSON.stringify(Messages$outboundSchema.parse(messages));
3836
- }
3837
-
3838
- export function messagesFromJSON(
3839
- jsonString: string,
3840
- ): SafeParseResult<Messages, SDKValidationError> {
3841
- return safeParse(
3842
- jsonString,
3843
- (x) => Messages$inboundSchema.parse(JSON.parse(x)),
3844
- `Failed to parse 'Messages' from JSON`,
3845
- );
3846
- }
3847
-
3848
- /** @internal */
3849
- export const Metadata$inboundSchema: z.ZodType<
3850
- Metadata,
3851
- z.ZodTypeDef,
3852
- unknown
3853
- > = z.object({
3854
- file_name: z.string().optional(),
3855
- file_type: z.string().optional(),
3856
- page_number: z.number().optional(),
3857
- }).transform((v) => {
3858
- return remap$(v, {
3859
- "file_name": "fileName",
3860
- "file_type": "fileType",
3861
- "page_number": "pageNumber",
3862
- });
3863
- });
3864
-
3865
- /** @internal */
3866
- export type Metadata$Outbound = {
3867
- file_name?: string | undefined;
3868
- file_type?: string | undefined;
3869
- page_number?: number | undefined;
3870
- };
3871
-
3872
- /** @internal */
3873
- export const Metadata$outboundSchema: z.ZodType<
3874
- Metadata$Outbound,
3875
- z.ZodTypeDef,
3876
- Metadata
3877
- > = z.object({
3878
- fileName: z.string().optional(),
3879
- fileType: z.string().optional(),
3880
- pageNumber: z.number().optional(),
3881
- }).transform((v) => {
3882
- return remap$(v, {
3883
- fileName: "file_name",
3884
- fileType: "file_type",
3885
- pageNumber: "page_number",
3886
- });
3887
- });
3888
-
3889
- /**
3890
- * @internal
3891
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
3892
- */
3893
- export namespace Metadata$ {
3894
- /** @deprecated use `Metadata$inboundSchema` instead. */
3895
- export const inboundSchema = Metadata$inboundSchema;
3896
- /** @deprecated use `Metadata$outboundSchema` instead. */
3897
- export const outboundSchema = Metadata$outboundSchema;
3898
- /** @deprecated use `Metadata$Outbound` instead. */
3899
- export type Outbound = Metadata$Outbound;
3900
- }
3901
-
3902
- export function metadataToJSON(metadata: Metadata): string {
3903
- return JSON.stringify(Metadata$outboundSchema.parse(metadata));
3904
- }
3905
-
3906
- export function metadataFromJSON(
3907
- jsonString: string,
3908
- ): SafeParseResult<Metadata, SDKValidationError> {
3909
- return safeParse(
3910
- jsonString,
3911
- (x) => Metadata$inboundSchema.parse(JSON.parse(x)),
3912
- `Failed to parse 'Metadata' from JSON`,
3913
- );
3914
- }
3915
-
3916
- /** @internal */
3917
- export const Documents$inboundSchema: z.ZodType<
3918
- Documents,
3919
- z.ZodTypeDef,
3920
- unknown
3921
- > = z.object({
3922
- text: z.string(),
3923
- metadata: z.lazy(() => Metadata$inboundSchema).optional(),
3924
- });
3925
-
3926
- /** @internal */
3927
- export type Documents$Outbound = {
3928
- text: string;
3929
- metadata?: Metadata$Outbound | undefined;
3930
- };
3931
-
3932
- /** @internal */
3933
- export const Documents$outboundSchema: z.ZodType<
3934
- Documents$Outbound,
3935
- z.ZodTypeDef,
3936
- Documents
3937
- > = z.object({
3938
- text: z.string(),
3939
- metadata: z.lazy(() => Metadata$outboundSchema).optional(),
3940
- });
3941
-
3942
- /**
3943
- * @internal
3944
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
3945
- */
3946
- export namespace Documents$ {
3947
- /** @deprecated use `Documents$inboundSchema` instead. */
3948
- export const inboundSchema = Documents$inboundSchema;
3949
- /** @deprecated use `Documents$outboundSchema` instead. */
3950
- export const outboundSchema = Documents$outboundSchema;
3951
- /** @deprecated use `Documents$Outbound` instead. */
3952
- export type Outbound = Documents$Outbound;
3953
- }
3954
-
3955
- export function documentsToJSON(documents: Documents): string {
3956
- return JSON.stringify(Documents$outboundSchema.parse(documents));
3957
- }
3958
-
3959
- export function documentsFromJSON(
3960
- jsonString: string,
3961
- ): SafeParseResult<Documents, SDKValidationError> {
3962
- return safeParse(
3963
- jsonString,
3964
- (x) => Documents$inboundSchema.parse(JSON.parse(x)),
3965
- `Failed to parse 'Documents' from JSON`,
3966
- );
3967
- }
3968
-
3969
- /** @internal */
3970
- export const InvokeOptions$inboundSchema: z.ZodType<
3971
- InvokeOptions,
3972
- z.ZodTypeDef,
3973
- unknown
3974
- > = z.object({
3975
- include_retrievals: z.boolean().default(false),
3976
- }).transform((v) => {
3977
- return remap$(v, {
3978
- "include_retrievals": "includeRetrievals",
3979
- });
3980
- });
3981
-
3982
- /** @internal */
3983
- export type InvokeOptions$Outbound = {
3984
- include_retrievals: boolean;
3985
- };
3986
-
3987
- /** @internal */
3988
- export const InvokeOptions$outboundSchema: z.ZodType<
3989
- InvokeOptions$Outbound,
3990
- z.ZodTypeDef,
3991
- InvokeOptions
3992
- > = z.object({
3993
- includeRetrievals: z.boolean().default(false),
3994
- }).transform((v) => {
3995
- return remap$(v, {
3996
- includeRetrievals: "include_retrievals",
3997
- });
3998
- });
3999
-
4000
- /**
4001
- * @internal
4002
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
4003
- */
4004
- export namespace InvokeOptions$ {
4005
- /** @deprecated use `InvokeOptions$inboundSchema` instead. */
4006
- export const inboundSchema = InvokeOptions$inboundSchema;
4007
- /** @deprecated use `InvokeOptions$outboundSchema` instead. */
4008
- export const outboundSchema = InvokeOptions$outboundSchema;
4009
- /** @deprecated use `InvokeOptions$Outbound` instead. */
4010
- export type Outbound = InvokeOptions$Outbound;
4011
- }
4012
-
4013
- export function invokeOptionsToJSON(invokeOptions: InvokeOptions): string {
4014
- return JSON.stringify(InvokeOptions$outboundSchema.parse(invokeOptions));
4015
- }
4016
-
4017
- export function invokeOptionsFromJSON(
4018
- jsonString: string,
4019
- ): SafeParseResult<InvokeOptions, SDKValidationError> {
4020
- return safeParse(
4021
- jsonString,
4022
- (x) => InvokeOptions$inboundSchema.parse(JSON.parse(x)),
4023
- `Failed to parse 'InvokeOptions' from JSON`,
4024
- );
4025
- }
4026
-
4027
- /** @internal */
4028
- export const Deployments$inboundSchema: z.ZodType<
4029
- Deployments,
4030
- z.ZodTypeDef,
4031
- unknown
4032
- > = z.object({
4033
- key: z.string(),
4034
- inputs: z.record(z.union([z.string(), z.number(), z.boolean()])).optional(),
4035
- context: z.record(z.any()).optional(),
4036
- prefix_messages: z.array(
4037
- z.union([
4038
- z.lazy(() => DeveloperMessage$inboundSchema),
4039
- z.lazy(() => SystemMessage$inboundSchema),
4040
- z.lazy(() => UserMessage$inboundSchema),
4041
- z.lazy(() => ToolMessage$inboundSchema),
4042
- z.lazy(() => AssistantMessage$inboundSchema),
4043
- ]),
4044
- ).optional(),
4045
- messages: z.array(
4046
- z.union([
4047
- z.lazy(() => MessagesDeveloperMessage$inboundSchema),
4048
- z.lazy(() => MessagesSystemMessage$inboundSchema),
4049
- z.lazy(() => MessagesUserMessage$inboundSchema),
4050
- z.lazy(() => MessagesToolMessage$inboundSchema),
4051
- z.lazy(() => MessagesAssistantMessage$inboundSchema),
4052
- ]),
4053
- ).optional(),
4054
- file_ids: z.array(z.string()).optional(),
4055
- metadata: z.record(z.any()).optional(),
4056
- extra_params: z.record(z.any()).optional(),
4057
- documents: z.array(z.lazy(() => Documents$inboundSchema)).optional(),
4058
- invoke_options: z.lazy(() => InvokeOptions$inboundSchema).optional(),
4059
- }).transform((v) => {
4060
- return remap$(v, {
4061
- "prefix_messages": "prefixMessages",
4062
- "file_ids": "fileIds",
4063
- "extra_params": "extraParams",
4064
- "invoke_options": "invokeOptions",
4065
- });
4066
- });
4067
-
4068
- /** @internal */
4069
- export type Deployments$Outbound = {
4070
- key: string;
4071
- inputs?: { [k: string]: string | number | boolean } | undefined;
4072
- context?: { [k: string]: any } | undefined;
4073
- prefix_messages?:
4074
- | Array<
4075
- | DeveloperMessage$Outbound
4076
- | SystemMessage$Outbound
4077
- | UserMessage$Outbound
4078
- | ToolMessage$Outbound
4079
- | AssistantMessage$Outbound
4080
- >
4081
- | undefined;
4082
- messages?:
4083
- | Array<
4084
- | MessagesDeveloperMessage$Outbound
4085
- | MessagesSystemMessage$Outbound
4086
- | MessagesUserMessage$Outbound
4087
- | MessagesToolMessage$Outbound
4088
- | MessagesAssistantMessage$Outbound
4089
- >
4090
- | undefined;
4091
- file_ids?: Array<string> | undefined;
4092
- metadata?: { [k: string]: any } | undefined;
4093
- extra_params?: { [k: string]: any } | undefined;
4094
- documents?: Array<Documents$Outbound> | undefined;
4095
- invoke_options?: InvokeOptions$Outbound | undefined;
4096
- };
4097
-
4098
- /** @internal */
4099
- export const Deployments$outboundSchema: z.ZodType<
4100
- Deployments$Outbound,
4101
- z.ZodTypeDef,
4102
- Deployments
4103
- > = z.object({
4104
- key: z.string(),
4105
- inputs: z.record(z.union([z.string(), z.number(), z.boolean()])).optional(),
4106
- context: z.record(z.any()).optional(),
4107
- prefixMessages: z.array(
4108
- z.union([
4109
- z.lazy(() => DeveloperMessage$outboundSchema),
4110
- z.lazy(() => SystemMessage$outboundSchema),
4111
- z.lazy(() => UserMessage$outboundSchema),
4112
- z.lazy(() => ToolMessage$outboundSchema),
4113
- z.lazy(() => AssistantMessage$outboundSchema),
4114
- ]),
4115
- ).optional(),
4116
- messages: z.array(
4117
- z.union([
4118
- z.lazy(() => MessagesDeveloperMessage$outboundSchema),
4119
- z.lazy(() => MessagesSystemMessage$outboundSchema),
4120
- z.lazy(() => MessagesUserMessage$outboundSchema),
4121
- z.lazy(() => MessagesToolMessage$outboundSchema),
4122
- z.lazy(() => MessagesAssistantMessage$outboundSchema),
4123
- ]),
4124
- ).optional(),
4125
- fileIds: z.array(z.string()).optional(),
4126
- metadata: z.record(z.any()).optional(),
4127
- extraParams: z.record(z.any()).optional(),
4128
- documents: z.array(z.lazy(() => Documents$outboundSchema)).optional(),
4129
- invokeOptions: z.lazy(() => InvokeOptions$outboundSchema).optional(),
4130
- }).transform((v) => {
4131
- return remap$(v, {
4132
- prefixMessages: "prefix_messages",
4133
- fileIds: "file_ids",
4134
- extraParams: "extra_params",
4135
- invokeOptions: "invoke_options",
4136
- });
4137
- });
4138
-
4139
- /**
4140
- * @internal
4141
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
4142
- */
4143
- export namespace Deployments$ {
4144
- /** @deprecated use `Deployments$inboundSchema` instead. */
4145
- export const inboundSchema = Deployments$inboundSchema;
4146
- /** @deprecated use `Deployments$outboundSchema` instead. */
4147
- export const outboundSchema = Deployments$outboundSchema;
4148
- /** @deprecated use `Deployments$Outbound` instead. */
4149
- export type Outbound = Deployments$Outbound;
4150
- }
4151
-
4152
- export function deploymentsToJSON(deployments: Deployments): string {
4153
- return JSON.stringify(Deployments$outboundSchema.parse(deployments));
4154
- }
4155
-
4156
- export function deploymentsFromJSON(
4157
- jsonString: string,
4158
- ): SafeParseResult<Deployments, SDKValidationError> {
4159
- return safeParse(
4160
- jsonString,
4161
- (x) => Deployments$inboundSchema.parse(JSON.parse(x)),
4162
- `Failed to parse 'Deployments' from JSON`,
4163
- );
4164
- }