@orq-ai/node 3.2.8 → 3.3.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (215) hide show
  1. package/bin/mcp-server.js +32 -35
  2. package/bin/mcp-server.js.map +20 -20
  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/models/operations/bulkcreatedatapoints.js +2 -2
  12. package/models/operations/createcontact.js +2 -2
  13. package/models/operations/createdataset.js +2 -2
  14. package/models/operations/createdatasetitem.js +2 -2
  15. package/models/operations/fileget.js +2 -2
  16. package/models/operations/filelist.js +2 -2
  17. package/models/operations/fileupload.js +2 -2
  18. package/models/operations/listdatasetdatapoints.js +2 -2
  19. package/models/operations/listdatasets.js +2 -2
  20. package/models/operations/retrievedatapoint.js +2 -2
  21. package/models/operations/retrievedataset.js +2 -2
  22. package/models/operations/updatedatapoint.js +2 -2
  23. package/models/operations/updatedataset.js +2 -2
  24. package/package.json +3 -2
  25. package/src/lib/config.ts +2 -2
  26. package/src/mcp-server/mcp-server.ts +1 -1
  27. package/src/mcp-server/server.ts +1 -1
  28. package/src/models/operations/bulkcreatedatapoints.ts +2 -2
  29. package/src/models/operations/createcontact.ts +2 -2
  30. package/src/models/operations/createdataset.ts +2 -2
  31. package/src/models/operations/createdatasetitem.ts +2 -2
  32. package/src/models/operations/fileget.ts +2 -2
  33. package/src/models/operations/filelist.ts +2 -2
  34. package/src/models/operations/fileupload.ts +2 -2
  35. package/src/models/operations/listdatasetdatapoints.ts +2 -2
  36. package/src/models/operations/listdatasets.ts +2 -2
  37. package/src/models/operations/retrievedatapoint.ts +2 -2
  38. package/src/models/operations/retrievedataset.ts +2 -2
  39. package/src/models/operations/updatedatapoint.ts +2 -2
  40. package/src/models/operations/updatedataset.ts +2 -2
  41. package/packages/orq-rc/FUNCTIONS.md +0 -106
  42. package/packages/orq-rc/README.md +0 -660
  43. package/packages/orq-rc/RUNTIMES.md +0 -48
  44. package/packages/orq-rc/docs/sdks/contacts/README.md +0 -84
  45. package/packages/orq-rc/docs/sdks/datasets/README.md +0 -934
  46. package/packages/orq-rc/docs/sdks/deployments/README.md +0 -316
  47. package/packages/orq-rc/docs/sdks/feedback/README.md +0 -92
  48. package/packages/orq-rc/docs/sdks/files/README.md +0 -305
  49. package/packages/orq-rc/docs/sdks/metrics/README.md +0 -86
  50. package/packages/orq-rc/docs/sdks/orq/README.md +0 -10
  51. package/packages/orq-rc/docs/sdks/prompts/README.md +0 -608
  52. package/packages/orq-rc/docs/sdks/remoteconfigs/README.md +0 -80
  53. package/packages/orq-rc/jsr.json +0 -28
  54. package/packages/orq-rc/package-lock.json +0 -3217
  55. package/packages/orq-rc/package.json +0 -45
  56. package/packages/orq-rc/src/core.ts +0 -13
  57. package/packages/orq-rc/src/funcs/contactsCreate.ts +0 -154
  58. package/packages/orq-rc/src/funcs/datasetsClear.ts +0 -161
  59. package/packages/orq-rc/src/funcs/datasetsCreate.ts +0 -159
  60. package/packages/orq-rc/src/funcs/datasetsCreateDatapoint.ts +0 -161
  61. package/packages/orq-rc/src/funcs/datasetsCreateDatapoints.ts +0 -165
  62. package/packages/orq-rc/src/funcs/datasetsDelete.ts +0 -161
  63. package/packages/orq-rc/src/funcs/datasetsDeleteDatapoint.ts +0 -176
  64. package/packages/orq-rc/src/funcs/datasetsList.ts +0 -162
  65. package/packages/orq-rc/src/funcs/datasetsListDatapoints.ts +0 -169
  66. package/packages/orq-rc/src/funcs/datasetsRetrieve.ts +0 -169
  67. package/packages/orq-rc/src/funcs/datasetsRetrieveDatapoint.ts +0 -175
  68. package/packages/orq-rc/src/funcs/datasetsUpdate.ts +0 -170
  69. package/packages/orq-rc/src/funcs/datasetsUpdateDatapoint.ts +0 -173
  70. package/packages/orq-rc/src/funcs/deploymentsGetConfig.ts +0 -162
  71. package/packages/orq-rc/src/funcs/deploymentsInvoke.ts +0 -170
  72. package/packages/orq-rc/src/funcs/deploymentsList.ts +0 -171
  73. package/packages/orq-rc/src/funcs/deploymentsMetricsCreate.ts +0 -162
  74. package/packages/orq-rc/src/funcs/deploymentsStream.ts +0 -178
  75. package/packages/orq-rc/src/funcs/feedbackCreate.ts +0 -154
  76. package/packages/orq-rc/src/funcs/filesCreate.ts +0 -177
  77. package/packages/orq-rc/src/funcs/filesDelete.ts +0 -158
  78. package/packages/orq-rc/src/funcs/filesGet.ts +0 -160
  79. package/packages/orq-rc/src/funcs/filesList.ts +0 -162
  80. package/packages/orq-rc/src/funcs/promptsCreate.ts +0 -154
  81. package/packages/orq-rc/src/funcs/promptsDelete.ts +0 -158
  82. package/packages/orq-rc/src/funcs/promptsGetVersion.ts +0 -175
  83. package/packages/orq-rc/src/funcs/promptsList.ts +0 -162
  84. package/packages/orq-rc/src/funcs/promptsListVersions.ts +0 -168
  85. package/packages/orq-rc/src/funcs/promptsRetrieve.ts +0 -160
  86. package/packages/orq-rc/src/funcs/promptsUpdate.ts +0 -167
  87. package/packages/orq-rc/src/funcs/remoteconfigsRetrieve.ts +0 -155
  88. package/packages/orq-rc/src/hooks/global.ts +0 -44
  89. package/packages/orq-rc/src/hooks/hooks.ts +0 -132
  90. package/packages/orq-rc/src/hooks/index.ts +0 -6
  91. package/packages/orq-rc/src/hooks/registration.ts +0 -15
  92. package/packages/orq-rc/src/hooks/types.ts +0 -110
  93. package/packages/orq-rc/src/index.ts +0 -7
  94. package/packages/orq-rc/src/lib/base64.ts +0 -37
  95. package/packages/orq-rc/src/lib/config.ts +0 -70
  96. package/packages/orq-rc/src/lib/dlv.ts +0 -53
  97. package/packages/orq-rc/src/lib/encodings.ts +0 -483
  98. package/packages/orq-rc/src/lib/env.ts +0 -73
  99. package/packages/orq-rc/src/lib/event-streams.ts +0 -264
  100. package/packages/orq-rc/src/lib/files.ts +0 -40
  101. package/packages/orq-rc/src/lib/http.ts +0 -323
  102. package/packages/orq-rc/src/lib/is-plain-object.ts +0 -43
  103. package/packages/orq-rc/src/lib/logger.ts +0 -9
  104. package/packages/orq-rc/src/lib/matchers.ts +0 -325
  105. package/packages/orq-rc/src/lib/primitives.ts +0 -150
  106. package/packages/orq-rc/src/lib/retries.ts +0 -218
  107. package/packages/orq-rc/src/lib/schemas.ts +0 -91
  108. package/packages/orq-rc/src/lib/sdks.ts +0 -395
  109. package/packages/orq-rc/src/lib/security.ts +0 -261
  110. package/packages/orq-rc/src/lib/url.ts +0 -33
  111. package/packages/orq-rc/src/mcp-server/cli/start/command.ts +0 -125
  112. package/packages/orq-rc/src/mcp-server/cli/start/impl.ts +0 -140
  113. package/packages/orq-rc/src/mcp-server/cli.ts +0 -13
  114. package/packages/orq-rc/src/mcp-server/console-logger.ts +0 -71
  115. package/packages/orq-rc/src/mcp-server/extensions.ts +0 -17
  116. package/packages/orq-rc/src/mcp-server/mcp-server.ts +0 -26
  117. package/packages/orq-rc/src/mcp-server/prompts.ts +0 -110
  118. package/packages/orq-rc/src/mcp-server/resources.ts +0 -158
  119. package/packages/orq-rc/src/mcp-server/scopes.ts +0 -7
  120. package/packages/orq-rc/src/mcp-server/server.ts +0 -125
  121. package/packages/orq-rc/src/mcp-server/shared.ts +0 -75
  122. package/packages/orq-rc/src/mcp-server/tools/contactsCreate.ts +0 -37
  123. package/packages/orq-rc/src/mcp-server/tools/datasetsClear.ts +0 -35
  124. package/packages/orq-rc/src/mcp-server/tools/datasetsCreate.ts +0 -37
  125. package/packages/orq-rc/src/mcp-server/tools/datasetsCreateDatapoint.ts +0 -37
  126. package/packages/orq-rc/src/mcp-server/tools/datasetsCreateDatapoints.ts +0 -37
  127. package/packages/orq-rc/src/mcp-server/tools/datasetsDelete.ts +0 -35
  128. package/packages/orq-rc/src/mcp-server/tools/datasetsDeleteDatapoint.ts +0 -35
  129. package/packages/orq-rc/src/mcp-server/tools/datasetsList.ts +0 -37
  130. package/packages/orq-rc/src/mcp-server/tools/datasetsListDatapoints.ts +0 -37
  131. package/packages/orq-rc/src/mcp-server/tools/datasetsRetrieve.ts +0 -37
  132. package/packages/orq-rc/src/mcp-server/tools/datasetsRetrieveDatapoint.ts +0 -37
  133. package/packages/orq-rc/src/mcp-server/tools/datasetsUpdate.ts +0 -37
  134. package/packages/orq-rc/src/mcp-server/tools/datasetsUpdateDatapoint.ts +0 -35
  135. package/packages/orq-rc/src/mcp-server/tools/deploymentsGetConfig.ts +0 -37
  136. package/packages/orq-rc/src/mcp-server/tools/deploymentsInvoke.ts +0 -37
  137. package/packages/orq-rc/src/mcp-server/tools/deploymentsList.ts +0 -37
  138. package/packages/orq-rc/src/mcp-server/tools/deploymentsMetricsCreate.ts +0 -37
  139. package/packages/orq-rc/src/mcp-server/tools/deploymentsStream.ts +0 -37
  140. package/packages/orq-rc/src/mcp-server/tools/feedbackCreate.ts +0 -37
  141. package/packages/orq-rc/src/mcp-server/tools/filesCreate.ts +0 -37
  142. package/packages/orq-rc/src/mcp-server/tools/filesDelete.ts +0 -33
  143. package/packages/orq-rc/src/mcp-server/tools/filesGet.ts +0 -37
  144. package/packages/orq-rc/src/mcp-server/tools/filesList.ts +0 -37
  145. package/packages/orq-rc/src/mcp-server/tools/promptsCreate.ts +0 -35
  146. package/packages/orq-rc/src/mcp-server/tools/promptsDelete.ts +0 -33
  147. package/packages/orq-rc/src/mcp-server/tools/promptsGetVersion.ts +0 -37
  148. package/packages/orq-rc/src/mcp-server/tools/promptsList.ts +0 -37
  149. package/packages/orq-rc/src/mcp-server/tools/promptsListVersions.ts +0 -37
  150. package/packages/orq-rc/src/mcp-server/tools/promptsRetrieve.ts +0 -37
  151. package/packages/orq-rc/src/mcp-server/tools/promptsUpdate.ts +0 -35
  152. package/packages/orq-rc/src/mcp-server/tools/remoteconfigsRetrieve.ts +0 -36
  153. package/packages/orq-rc/src/mcp-server/tools.ts +0 -126
  154. package/packages/orq-rc/src/models/components/deployments.ts +0 -4164
  155. package/packages/orq-rc/src/models/components/index.ts +0 -6
  156. package/packages/orq-rc/src/models/components/security.ts +0 -71
  157. package/packages/orq-rc/src/models/errors/apierror.ts +0 -27
  158. package/packages/orq-rc/src/models/errors/getpromptversion.ts +0 -71
  159. package/packages/orq-rc/src/models/errors/honoapierror.ts +0 -82
  160. package/packages/orq-rc/src/models/errors/httpclienterrors.ts +0 -62
  161. package/packages/orq-rc/src/models/errors/index.ts +0 -10
  162. package/packages/orq-rc/src/models/errors/sdkvalidationerror.ts +0 -97
  163. package/packages/orq-rc/src/models/errors/updateprompt.ts +0 -71
  164. package/packages/orq-rc/src/models/operations/bulkcreatedatapoints.ts +0 -1816
  165. package/packages/orq-rc/src/models/operations/cleardataset.ts +0 -75
  166. package/packages/orq-rc/src/models/operations/createcontact.ts +0 -256
  167. package/packages/orq-rc/src/models/operations/createdataset.ts +0 -296
  168. package/packages/orq-rc/src/models/operations/createdatasetitem.ts +0 -1740
  169. package/packages/orq-rc/src/models/operations/createfeedback.ts +0 -286
  170. package/packages/orq-rc/src/models/operations/createprompt.ts +0 -3735
  171. package/packages/orq-rc/src/models/operations/deletedatapoint.ts +0 -81
  172. package/packages/orq-rc/src/models/operations/deletedataset.ts +0 -75
  173. package/packages/orq-rc/src/models/operations/deleteprompt.ts +0 -69
  174. package/packages/orq-rc/src/models/operations/deploymentcreatemetric.ts +0 -4936
  175. package/packages/orq-rc/src/models/operations/deploymentgetconfig.ts +0 -6090
  176. package/packages/orq-rc/src/models/operations/deploymentinvoke.ts +0 -1199
  177. package/packages/orq-rc/src/models/operations/deployments.ts +0 -2194
  178. package/packages/orq-rc/src/models/operations/deploymentstream.ts +0 -5960
  179. package/packages/orq-rc/src/models/operations/filedelete.ts +0 -78
  180. package/packages/orq-rc/src/models/operations/fileget.ts +0 -223
  181. package/packages/orq-rc/src/models/operations/filelist.ts +0 -377
  182. package/packages/orq-rc/src/models/operations/fileupload.ts +0 -324
  183. package/packages/orq-rc/src/models/operations/getallprompts.ts +0 -2165
  184. package/packages/orq-rc/src/models/operations/getoneprompt.ts +0 -1989
  185. package/packages/orq-rc/src/models/operations/getpromptversion.ts +0 -1987
  186. package/packages/orq-rc/src/models/operations/index.ts +0 -35
  187. package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +0 -1115
  188. package/packages/orq-rc/src/models/operations/listdatasets.ts +0 -448
  189. package/packages/orq-rc/src/models/operations/listpromptversions.ts +0 -2163
  190. package/packages/orq-rc/src/models/operations/remoteconfigsgetconfig.ts +0 -190
  191. package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +0 -924
  192. package/packages/orq-rc/src/models/operations/retrievedataset.ts +0 -288
  193. package/packages/orq-rc/src/models/operations/updatedatapoint.ts +0 -1729
  194. package/packages/orq-rc/src/models/operations/updatedataset.ts +0 -374
  195. package/packages/orq-rc/src/models/operations/updateprompt.ts +0 -3914
  196. package/packages/orq-rc/src/sdk/contacts.ts +0 -27
  197. package/packages/orq-rc/src/sdk/datasets.ts +0 -222
  198. package/packages/orq-rc/src/sdk/deployments.ts +0 -89
  199. package/packages/orq-rc/src/sdk/feedback.ts +0 -27
  200. package/packages/orq-rc/src/sdk/files.ts +0 -78
  201. package/packages/orq-rc/src/sdk/index.ts +0 -5
  202. package/packages/orq-rc/src/sdk/metrics.ts +0 -27
  203. package/packages/orq-rc/src/sdk/prompts.ts +0 -126
  204. package/packages/orq-rc/src/sdk/remoteconfigs.ts +0 -24
  205. package/packages/orq-rc/src/sdk/sdk.ts +0 -49
  206. package/packages/orq-rc/src/types/async.ts +0 -68
  207. package/packages/orq-rc/src/types/blobs.ts +0 -31
  208. package/packages/orq-rc/src/types/constdatetime.ts +0 -15
  209. package/packages/orq-rc/src/types/enums.ts +0 -16
  210. package/packages/orq-rc/src/types/fp.ts +0 -50
  211. package/packages/orq-rc/src/types/index.ts +0 -11
  212. package/packages/orq-rc/src/types/operations.ts +0 -105
  213. package/packages/orq-rc/src/types/rfcdate.ts +0 -54
  214. package/packages/orq-rc/src/types/streams.ts +0 -21
  215. package/packages/orq-rc/tsconfig.json +0 -41
@@ -1,1199 +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 DeploymentInvokeGlobals = {
13
- environment?: string | undefined;
14
- contactId?: string | undefined;
15
- };
16
-
17
- /**
18
- * Indicates the type of model used to generate the response
19
- */
20
- export const DeploymentInvokeObject = {
21
- Chat: "chat",
22
- Completion: "completion",
23
- Image: "image",
24
- Vision: "vision",
25
- } as const;
26
- /**
27
- * Indicates the type of model used to generate the response
28
- */
29
- export type DeploymentInvokeObject = ClosedEnum<typeof DeploymentInvokeObject>;
30
-
31
- /**
32
- * The provider used to generate the response
33
- */
34
- export const DeploymentInvokeProvider = {
35
- Cohere: "cohere",
36
- Openai: "openai",
37
- Anthropic: "anthropic",
38
- Huggingface: "huggingface",
39
- Replicate: "replicate",
40
- Google: "google",
41
- GoogleAi: "google-ai",
42
- Azure: "azure",
43
- Aws: "aws",
44
- Anyscale: "anyscale",
45
- Perplexity: "perplexity",
46
- Groq: "groq",
47
- Fal: "fal",
48
- Leonardoai: "leonardoai",
49
- Nvidia: "nvidia",
50
- Jina: "jina",
51
- Togetherai: "togetherai",
52
- Elevenlabs: "elevenlabs",
53
- } as const;
54
- /**
55
- * The provider used to generate the response
56
- */
57
- export type DeploymentInvokeProvider = ClosedEnum<
58
- typeof DeploymentInvokeProvider
59
- >;
60
-
61
- /**
62
- * Metadata of the retrieved chunk from the knowledge base
63
- */
64
- export type DeploymentInvokeMetadata = {
65
- /**
66
- * Name of the file
67
- */
68
- fileName: string;
69
- /**
70
- * Page number of the chunk
71
- */
72
- pageNumber: number | null;
73
- /**
74
- * Type of the file
75
- */
76
- fileType: string;
77
- /**
78
- * Rerank scores are normalized to be in the range [0, 1]. Scores close to 1 indicate a high relevance to the query, and scores closer to 0 indicate low relevance. It is not accurate to assume a score of 0.9 means the document is 2x more relevant than a document with a score of 0.45
79
- */
80
- rerankScore?: number | undefined;
81
- /**
82
- * Search scores are normalized to be in the range [0, 1]. Search score is calculated based on `[Cosine Similarity](https://en.wikipedia.org/wiki/Cosine_similarity)` algorithm. Scores close to 1 indicate the document is closer to the query, and scores closer to 0 indicate the document is farther from the query.
83
- */
84
- searchScore: number;
85
- };
86
-
87
- export type Retrievals = {
88
- /**
89
- * Content of the retrieved chunk from the knowledge base
90
- */
91
- document: string;
92
- /**
93
- * Metadata of the retrieved chunk from the knowledge base
94
- */
95
- metadata: DeploymentInvokeMetadata;
96
- };
97
-
98
- export const DeploymentInvokeMessageDeploymentsType = {
99
- Image: "image",
100
- } as const;
101
- export type DeploymentInvokeMessageDeploymentsType = ClosedEnum<
102
- typeof DeploymentInvokeMessageDeploymentsType
103
- >;
104
-
105
- /**
106
- * The role of the prompt message
107
- */
108
- export const DeploymentInvokeMessageDeploymentsRole = {
109
- System: "system",
110
- Assistant: "assistant",
111
- User: "user",
112
- Exception: "exception",
113
- Tool: "tool",
114
- Prompt: "prompt",
115
- Correction: "correction",
116
- ExpectedOutput: "expected_output",
117
- } as const;
118
- /**
119
- * The role of the prompt message
120
- */
121
- export type DeploymentInvokeMessageDeploymentsRole = ClosedEnum<
122
- typeof DeploymentInvokeMessageDeploymentsRole
123
- >;
124
-
125
- export type Message3 = {
126
- type: DeploymentInvokeMessageDeploymentsType;
127
- /**
128
- * The role of the prompt message
129
- */
130
- role: DeploymentInvokeMessageDeploymentsRole;
131
- url: string;
132
- };
133
-
134
- export const DeploymentInvokeMessageType = {
135
- Content: "content",
136
- } as const;
137
- export type DeploymentInvokeMessageType = ClosedEnum<
138
- typeof DeploymentInvokeMessageType
139
- >;
140
-
141
- /**
142
- * The role of the prompt message
143
- */
144
- export const DeploymentInvokeMessageRole = {
145
- System: "system",
146
- Assistant: "assistant",
147
- User: "user",
148
- Exception: "exception",
149
- Tool: "tool",
150
- Prompt: "prompt",
151
- Correction: "correction",
152
- ExpectedOutput: "expected_output",
153
- } as const;
154
- /**
155
- * The role of the prompt message
156
- */
157
- export type DeploymentInvokeMessageRole = ClosedEnum<
158
- typeof DeploymentInvokeMessageRole
159
- >;
160
-
161
- export type Message2 = {
162
- type: DeploymentInvokeMessageType;
163
- /**
164
- * The role of the prompt message
165
- */
166
- role: DeploymentInvokeMessageRole;
167
- content: string | null;
168
- };
169
-
170
- export const MessageType = {
171
- ToolCalls: "tool_calls",
172
- } as const;
173
- export type MessageType = ClosedEnum<typeof MessageType>;
174
-
175
- /**
176
- * The role of the prompt message
177
- */
178
- export const MessageRole = {
179
- System: "system",
180
- Assistant: "assistant",
181
- User: "user",
182
- Exception: "exception",
183
- Tool: "tool",
184
- Prompt: "prompt",
185
- Correction: "correction",
186
- ExpectedOutput: "expected_output",
187
- } as const;
188
- /**
189
- * The role of the prompt message
190
- */
191
- export type MessageRole = ClosedEnum<typeof MessageRole>;
192
-
193
- export const DeploymentInvokeMessageDeploymentsResponseType = {
194
- Function: "function",
195
- } as const;
196
- export type DeploymentInvokeMessageDeploymentsResponseType = ClosedEnum<
197
- typeof DeploymentInvokeMessageDeploymentsResponseType
198
- >;
199
-
200
- export type MessageFunction = {
201
- name: string;
202
- /**
203
- * JSON string arguments for the functions
204
- */
205
- arguments: string;
206
- };
207
-
208
- export type MessageToolCalls = {
209
- id?: string | undefined;
210
- index?: number | undefined;
211
- type: DeploymentInvokeMessageDeploymentsResponseType;
212
- function: MessageFunction;
213
- };
214
-
215
- export type Message1 = {
216
- type: MessageType;
217
- /**
218
- * The role of the prompt message
219
- */
220
- role: MessageRole;
221
- content?: string | null | undefined;
222
- toolCalls: Array<MessageToolCalls>;
223
- };
224
-
225
- export type Message = Message2 | Message3 | Message1;
226
-
227
- export type DeploymentInvokeChoices = {
228
- index: number;
229
- message: Message2 | Message3 | Message1;
230
- finishReason?: string | null | undefined;
231
- };
232
-
233
- /**
234
- * Successful operation
235
- */
236
- export type DeploymentInvokeResponseBody = {
237
- /**
238
- * A unique identifier for the response. Can be used to add metrics to the transaction.
239
- */
240
- id: string;
241
- /**
242
- * A timestamp indicating when the object was created. Usually in a standardized format like ISO 8601
243
- */
244
- created: Date;
245
- /**
246
- * Indicates the type of model used to generate the response
247
- */
248
- object: DeploymentInvokeObject;
249
- /**
250
- * The model used to generate the response
251
- */
252
- model: string;
253
- /**
254
- * The provider used to generate the response
255
- */
256
- provider: DeploymentInvokeProvider;
257
- /**
258
- * Indicates if the response is the final response
259
- */
260
- isFinal: boolean;
261
- /**
262
- * Indicates integration id used to generate the response
263
- */
264
- integrationId?: string | undefined;
265
- /**
266
- * A timestamp indicating when the object was finalized. Usually in a standardized format like ISO 8601
267
- */
268
- finalized?: Date | undefined;
269
- /**
270
- * Provider backed system fingerprint.
271
- */
272
- systemFingerprint?: string | null | undefined;
273
- /**
274
- * List of documents retrieved from the knowledge base. This property is only available when the `include_retrievals` flag is set to `true` in the invoke settings. When stream is set to true, the `retrievals` property will be returned in the last streamed chunk where the property `is_final` is set to `true`.
275
- */
276
- retrievals?: Array<Retrievals> | undefined;
277
- /**
278
- * Response returned by the model provider. This functionality is only supported when streaming is not used. If streaming is used, the `provider_response` property will be set to `null`.
279
- */
280
- providerResponse?: any | undefined;
281
- /**
282
- * A list of choices generated by the model
283
- */
284
- choices: Array<DeploymentInvokeChoices>;
285
- };
286
-
287
- /** @internal */
288
- export const DeploymentInvokeGlobals$inboundSchema: z.ZodType<
289
- DeploymentInvokeGlobals,
290
- z.ZodTypeDef,
291
- unknown
292
- > = z.object({
293
- environment: z.string().optional(),
294
- contactId: z.string().optional(),
295
- });
296
-
297
- /** @internal */
298
- export type DeploymentInvokeGlobals$Outbound = {
299
- environment?: string | undefined;
300
- contactId?: string | undefined;
301
- };
302
-
303
- /** @internal */
304
- export const DeploymentInvokeGlobals$outboundSchema: z.ZodType<
305
- DeploymentInvokeGlobals$Outbound,
306
- z.ZodTypeDef,
307
- DeploymentInvokeGlobals
308
- > = z.object({
309
- environment: z.string().optional(),
310
- contactId: z.string().optional(),
311
- });
312
-
313
- /**
314
- * @internal
315
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
316
- */
317
- export namespace DeploymentInvokeGlobals$ {
318
- /** @deprecated use `DeploymentInvokeGlobals$inboundSchema` instead. */
319
- export const inboundSchema = DeploymentInvokeGlobals$inboundSchema;
320
- /** @deprecated use `DeploymentInvokeGlobals$outboundSchema` instead. */
321
- export const outboundSchema = DeploymentInvokeGlobals$outboundSchema;
322
- /** @deprecated use `DeploymentInvokeGlobals$Outbound` instead. */
323
- export type Outbound = DeploymentInvokeGlobals$Outbound;
324
- }
325
-
326
- export function deploymentInvokeGlobalsToJSON(
327
- deploymentInvokeGlobals: DeploymentInvokeGlobals,
328
- ): string {
329
- return JSON.stringify(
330
- DeploymentInvokeGlobals$outboundSchema.parse(deploymentInvokeGlobals),
331
- );
332
- }
333
-
334
- export function deploymentInvokeGlobalsFromJSON(
335
- jsonString: string,
336
- ): SafeParseResult<DeploymentInvokeGlobals, SDKValidationError> {
337
- return safeParse(
338
- jsonString,
339
- (x) => DeploymentInvokeGlobals$inboundSchema.parse(JSON.parse(x)),
340
- `Failed to parse 'DeploymentInvokeGlobals' from JSON`,
341
- );
342
- }
343
-
344
- /** @internal */
345
- export const DeploymentInvokeObject$inboundSchema: z.ZodNativeEnum<
346
- typeof DeploymentInvokeObject
347
- > = z.nativeEnum(DeploymentInvokeObject);
348
-
349
- /** @internal */
350
- export const DeploymentInvokeObject$outboundSchema: z.ZodNativeEnum<
351
- typeof DeploymentInvokeObject
352
- > = DeploymentInvokeObject$inboundSchema;
353
-
354
- /**
355
- * @internal
356
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
357
- */
358
- export namespace DeploymentInvokeObject$ {
359
- /** @deprecated use `DeploymentInvokeObject$inboundSchema` instead. */
360
- export const inboundSchema = DeploymentInvokeObject$inboundSchema;
361
- /** @deprecated use `DeploymentInvokeObject$outboundSchema` instead. */
362
- export const outboundSchema = DeploymentInvokeObject$outboundSchema;
363
- }
364
-
365
- /** @internal */
366
- export const DeploymentInvokeProvider$inboundSchema: z.ZodNativeEnum<
367
- typeof DeploymentInvokeProvider
368
- > = z.nativeEnum(DeploymentInvokeProvider);
369
-
370
- /** @internal */
371
- export const DeploymentInvokeProvider$outboundSchema: z.ZodNativeEnum<
372
- typeof DeploymentInvokeProvider
373
- > = DeploymentInvokeProvider$inboundSchema;
374
-
375
- /**
376
- * @internal
377
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
378
- */
379
- export namespace DeploymentInvokeProvider$ {
380
- /** @deprecated use `DeploymentInvokeProvider$inboundSchema` instead. */
381
- export const inboundSchema = DeploymentInvokeProvider$inboundSchema;
382
- /** @deprecated use `DeploymentInvokeProvider$outboundSchema` instead. */
383
- export const outboundSchema = DeploymentInvokeProvider$outboundSchema;
384
- }
385
-
386
- /** @internal */
387
- export const DeploymentInvokeMetadata$inboundSchema: z.ZodType<
388
- DeploymentInvokeMetadata,
389
- z.ZodTypeDef,
390
- unknown
391
- > = z.object({
392
- file_name: z.string(),
393
- page_number: z.nullable(z.number()),
394
- file_type: z.string(),
395
- rerank_score: z.number().optional(),
396
- search_score: z.number(),
397
- }).transform((v) => {
398
- return remap$(v, {
399
- "file_name": "fileName",
400
- "page_number": "pageNumber",
401
- "file_type": "fileType",
402
- "rerank_score": "rerankScore",
403
- "search_score": "searchScore",
404
- });
405
- });
406
-
407
- /** @internal */
408
- export type DeploymentInvokeMetadata$Outbound = {
409
- file_name: string;
410
- page_number: number | null;
411
- file_type: string;
412
- rerank_score?: number | undefined;
413
- search_score: number;
414
- };
415
-
416
- /** @internal */
417
- export const DeploymentInvokeMetadata$outboundSchema: z.ZodType<
418
- DeploymentInvokeMetadata$Outbound,
419
- z.ZodTypeDef,
420
- DeploymentInvokeMetadata
421
- > = z.object({
422
- fileName: z.string(),
423
- pageNumber: z.nullable(z.number()),
424
- fileType: z.string(),
425
- rerankScore: z.number().optional(),
426
- searchScore: z.number(),
427
- }).transform((v) => {
428
- return remap$(v, {
429
- fileName: "file_name",
430
- pageNumber: "page_number",
431
- fileType: "file_type",
432
- rerankScore: "rerank_score",
433
- searchScore: "search_score",
434
- });
435
- });
436
-
437
- /**
438
- * @internal
439
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
440
- */
441
- export namespace DeploymentInvokeMetadata$ {
442
- /** @deprecated use `DeploymentInvokeMetadata$inboundSchema` instead. */
443
- export const inboundSchema = DeploymentInvokeMetadata$inboundSchema;
444
- /** @deprecated use `DeploymentInvokeMetadata$outboundSchema` instead. */
445
- export const outboundSchema = DeploymentInvokeMetadata$outboundSchema;
446
- /** @deprecated use `DeploymentInvokeMetadata$Outbound` instead. */
447
- export type Outbound = DeploymentInvokeMetadata$Outbound;
448
- }
449
-
450
- export function deploymentInvokeMetadataToJSON(
451
- deploymentInvokeMetadata: DeploymentInvokeMetadata,
452
- ): string {
453
- return JSON.stringify(
454
- DeploymentInvokeMetadata$outboundSchema.parse(deploymentInvokeMetadata),
455
- );
456
- }
457
-
458
- export function deploymentInvokeMetadataFromJSON(
459
- jsonString: string,
460
- ): SafeParseResult<DeploymentInvokeMetadata, SDKValidationError> {
461
- return safeParse(
462
- jsonString,
463
- (x) => DeploymentInvokeMetadata$inboundSchema.parse(JSON.parse(x)),
464
- `Failed to parse 'DeploymentInvokeMetadata' from JSON`,
465
- );
466
- }
467
-
468
- /** @internal */
469
- export const Retrievals$inboundSchema: z.ZodType<
470
- Retrievals,
471
- z.ZodTypeDef,
472
- unknown
473
- > = z.object({
474
- document: z.string(),
475
- metadata: z.lazy(() => DeploymentInvokeMetadata$inboundSchema),
476
- });
477
-
478
- /** @internal */
479
- export type Retrievals$Outbound = {
480
- document: string;
481
- metadata: DeploymentInvokeMetadata$Outbound;
482
- };
483
-
484
- /** @internal */
485
- export const Retrievals$outboundSchema: z.ZodType<
486
- Retrievals$Outbound,
487
- z.ZodTypeDef,
488
- Retrievals
489
- > = z.object({
490
- document: z.string(),
491
- metadata: z.lazy(() => DeploymentInvokeMetadata$outboundSchema),
492
- });
493
-
494
- /**
495
- * @internal
496
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
497
- */
498
- export namespace Retrievals$ {
499
- /** @deprecated use `Retrievals$inboundSchema` instead. */
500
- export const inboundSchema = Retrievals$inboundSchema;
501
- /** @deprecated use `Retrievals$outboundSchema` instead. */
502
- export const outboundSchema = Retrievals$outboundSchema;
503
- /** @deprecated use `Retrievals$Outbound` instead. */
504
- export type Outbound = Retrievals$Outbound;
505
- }
506
-
507
- export function retrievalsToJSON(retrievals: Retrievals): string {
508
- return JSON.stringify(Retrievals$outboundSchema.parse(retrievals));
509
- }
510
-
511
- export function retrievalsFromJSON(
512
- jsonString: string,
513
- ): SafeParseResult<Retrievals, SDKValidationError> {
514
- return safeParse(
515
- jsonString,
516
- (x) => Retrievals$inboundSchema.parse(JSON.parse(x)),
517
- `Failed to parse 'Retrievals' from JSON`,
518
- );
519
- }
520
-
521
- /** @internal */
522
- export const DeploymentInvokeMessageDeploymentsType$inboundSchema:
523
- z.ZodNativeEnum<typeof DeploymentInvokeMessageDeploymentsType> = z.nativeEnum(
524
- DeploymentInvokeMessageDeploymentsType,
525
- );
526
-
527
- /** @internal */
528
- export const DeploymentInvokeMessageDeploymentsType$outboundSchema:
529
- z.ZodNativeEnum<typeof DeploymentInvokeMessageDeploymentsType> =
530
- DeploymentInvokeMessageDeploymentsType$inboundSchema;
531
-
532
- /**
533
- * @internal
534
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
535
- */
536
- export namespace DeploymentInvokeMessageDeploymentsType$ {
537
- /** @deprecated use `DeploymentInvokeMessageDeploymentsType$inboundSchema` instead. */
538
- export const inboundSchema =
539
- DeploymentInvokeMessageDeploymentsType$inboundSchema;
540
- /** @deprecated use `DeploymentInvokeMessageDeploymentsType$outboundSchema` instead. */
541
- export const outboundSchema =
542
- DeploymentInvokeMessageDeploymentsType$outboundSchema;
543
- }
544
-
545
- /** @internal */
546
- export const DeploymentInvokeMessageDeploymentsRole$inboundSchema:
547
- z.ZodNativeEnum<typeof DeploymentInvokeMessageDeploymentsRole> = z.nativeEnum(
548
- DeploymentInvokeMessageDeploymentsRole,
549
- );
550
-
551
- /** @internal */
552
- export const DeploymentInvokeMessageDeploymentsRole$outboundSchema:
553
- z.ZodNativeEnum<typeof DeploymentInvokeMessageDeploymentsRole> =
554
- DeploymentInvokeMessageDeploymentsRole$inboundSchema;
555
-
556
- /**
557
- * @internal
558
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
559
- */
560
- export namespace DeploymentInvokeMessageDeploymentsRole$ {
561
- /** @deprecated use `DeploymentInvokeMessageDeploymentsRole$inboundSchema` instead. */
562
- export const inboundSchema =
563
- DeploymentInvokeMessageDeploymentsRole$inboundSchema;
564
- /** @deprecated use `DeploymentInvokeMessageDeploymentsRole$outboundSchema` instead. */
565
- export const outboundSchema =
566
- DeploymentInvokeMessageDeploymentsRole$outboundSchema;
567
- }
568
-
569
- /** @internal */
570
- export const Message3$inboundSchema: z.ZodType<
571
- Message3,
572
- z.ZodTypeDef,
573
- unknown
574
- > = z.object({
575
- type: DeploymentInvokeMessageDeploymentsType$inboundSchema,
576
- role: DeploymentInvokeMessageDeploymentsRole$inboundSchema,
577
- url: z.string(),
578
- });
579
-
580
- /** @internal */
581
- export type Message3$Outbound = {
582
- type: string;
583
- role: string;
584
- url: string;
585
- };
586
-
587
- /** @internal */
588
- export const Message3$outboundSchema: z.ZodType<
589
- Message3$Outbound,
590
- z.ZodTypeDef,
591
- Message3
592
- > = z.object({
593
- type: DeploymentInvokeMessageDeploymentsType$outboundSchema,
594
- role: DeploymentInvokeMessageDeploymentsRole$outboundSchema,
595
- url: z.string(),
596
- });
597
-
598
- /**
599
- * @internal
600
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
601
- */
602
- export namespace Message3$ {
603
- /** @deprecated use `Message3$inboundSchema` instead. */
604
- export const inboundSchema = Message3$inboundSchema;
605
- /** @deprecated use `Message3$outboundSchema` instead. */
606
- export const outboundSchema = Message3$outboundSchema;
607
- /** @deprecated use `Message3$Outbound` instead. */
608
- export type Outbound = Message3$Outbound;
609
- }
610
-
611
- export function message3ToJSON(message3: Message3): string {
612
- return JSON.stringify(Message3$outboundSchema.parse(message3));
613
- }
614
-
615
- export function message3FromJSON(
616
- jsonString: string,
617
- ): SafeParseResult<Message3, SDKValidationError> {
618
- return safeParse(
619
- jsonString,
620
- (x) => Message3$inboundSchema.parse(JSON.parse(x)),
621
- `Failed to parse 'Message3' from JSON`,
622
- );
623
- }
624
-
625
- /** @internal */
626
- export const DeploymentInvokeMessageType$inboundSchema: z.ZodNativeEnum<
627
- typeof DeploymentInvokeMessageType
628
- > = z.nativeEnum(DeploymentInvokeMessageType);
629
-
630
- /** @internal */
631
- export const DeploymentInvokeMessageType$outboundSchema: z.ZodNativeEnum<
632
- typeof DeploymentInvokeMessageType
633
- > = DeploymentInvokeMessageType$inboundSchema;
634
-
635
- /**
636
- * @internal
637
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
638
- */
639
- export namespace DeploymentInvokeMessageType$ {
640
- /** @deprecated use `DeploymentInvokeMessageType$inboundSchema` instead. */
641
- export const inboundSchema = DeploymentInvokeMessageType$inboundSchema;
642
- /** @deprecated use `DeploymentInvokeMessageType$outboundSchema` instead. */
643
- export const outboundSchema = DeploymentInvokeMessageType$outboundSchema;
644
- }
645
-
646
- /** @internal */
647
- export const DeploymentInvokeMessageRole$inboundSchema: z.ZodNativeEnum<
648
- typeof DeploymentInvokeMessageRole
649
- > = z.nativeEnum(DeploymentInvokeMessageRole);
650
-
651
- /** @internal */
652
- export const DeploymentInvokeMessageRole$outboundSchema: z.ZodNativeEnum<
653
- typeof DeploymentInvokeMessageRole
654
- > = DeploymentInvokeMessageRole$inboundSchema;
655
-
656
- /**
657
- * @internal
658
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
659
- */
660
- export namespace DeploymentInvokeMessageRole$ {
661
- /** @deprecated use `DeploymentInvokeMessageRole$inboundSchema` instead. */
662
- export const inboundSchema = DeploymentInvokeMessageRole$inboundSchema;
663
- /** @deprecated use `DeploymentInvokeMessageRole$outboundSchema` instead. */
664
- export const outboundSchema = DeploymentInvokeMessageRole$outboundSchema;
665
- }
666
-
667
- /** @internal */
668
- export const Message2$inboundSchema: z.ZodType<
669
- Message2,
670
- z.ZodTypeDef,
671
- unknown
672
- > = z.object({
673
- type: DeploymentInvokeMessageType$inboundSchema,
674
- role: DeploymentInvokeMessageRole$inboundSchema,
675
- content: z.nullable(z.string()),
676
- });
677
-
678
- /** @internal */
679
- export type Message2$Outbound = {
680
- type: string;
681
- role: string;
682
- content: string | null;
683
- };
684
-
685
- /** @internal */
686
- export const Message2$outboundSchema: z.ZodType<
687
- Message2$Outbound,
688
- z.ZodTypeDef,
689
- Message2
690
- > = z.object({
691
- type: DeploymentInvokeMessageType$outboundSchema,
692
- role: DeploymentInvokeMessageRole$outboundSchema,
693
- content: z.nullable(z.string()),
694
- });
695
-
696
- /**
697
- * @internal
698
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
699
- */
700
- export namespace Message2$ {
701
- /** @deprecated use `Message2$inboundSchema` instead. */
702
- export const inboundSchema = Message2$inboundSchema;
703
- /** @deprecated use `Message2$outboundSchema` instead. */
704
- export const outboundSchema = Message2$outboundSchema;
705
- /** @deprecated use `Message2$Outbound` instead. */
706
- export type Outbound = Message2$Outbound;
707
- }
708
-
709
- export function message2ToJSON(message2: Message2): string {
710
- return JSON.stringify(Message2$outboundSchema.parse(message2));
711
- }
712
-
713
- export function message2FromJSON(
714
- jsonString: string,
715
- ): SafeParseResult<Message2, SDKValidationError> {
716
- return safeParse(
717
- jsonString,
718
- (x) => Message2$inboundSchema.parse(JSON.parse(x)),
719
- `Failed to parse 'Message2' from JSON`,
720
- );
721
- }
722
-
723
- /** @internal */
724
- export const MessageType$inboundSchema: z.ZodNativeEnum<typeof MessageType> = z
725
- .nativeEnum(MessageType);
726
-
727
- /** @internal */
728
- export const MessageType$outboundSchema: z.ZodNativeEnum<typeof MessageType> =
729
- MessageType$inboundSchema;
730
-
731
- /**
732
- * @internal
733
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
734
- */
735
- export namespace MessageType$ {
736
- /** @deprecated use `MessageType$inboundSchema` instead. */
737
- export const inboundSchema = MessageType$inboundSchema;
738
- /** @deprecated use `MessageType$outboundSchema` instead. */
739
- export const outboundSchema = MessageType$outboundSchema;
740
- }
741
-
742
- /** @internal */
743
- export const MessageRole$inboundSchema: z.ZodNativeEnum<typeof MessageRole> = z
744
- .nativeEnum(MessageRole);
745
-
746
- /** @internal */
747
- export const MessageRole$outboundSchema: z.ZodNativeEnum<typeof MessageRole> =
748
- MessageRole$inboundSchema;
749
-
750
- /**
751
- * @internal
752
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
753
- */
754
- export namespace MessageRole$ {
755
- /** @deprecated use `MessageRole$inboundSchema` instead. */
756
- export const inboundSchema = MessageRole$inboundSchema;
757
- /** @deprecated use `MessageRole$outboundSchema` instead. */
758
- export const outboundSchema = MessageRole$outboundSchema;
759
- }
760
-
761
- /** @internal */
762
- export const DeploymentInvokeMessageDeploymentsResponseType$inboundSchema:
763
- z.ZodNativeEnum<typeof DeploymentInvokeMessageDeploymentsResponseType> = z
764
- .nativeEnum(DeploymentInvokeMessageDeploymentsResponseType);
765
-
766
- /** @internal */
767
- export const DeploymentInvokeMessageDeploymentsResponseType$outboundSchema:
768
- z.ZodNativeEnum<typeof DeploymentInvokeMessageDeploymentsResponseType> =
769
- DeploymentInvokeMessageDeploymentsResponseType$inboundSchema;
770
-
771
- /**
772
- * @internal
773
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
774
- */
775
- export namespace DeploymentInvokeMessageDeploymentsResponseType$ {
776
- /** @deprecated use `DeploymentInvokeMessageDeploymentsResponseType$inboundSchema` instead. */
777
- export const inboundSchema =
778
- DeploymentInvokeMessageDeploymentsResponseType$inboundSchema;
779
- /** @deprecated use `DeploymentInvokeMessageDeploymentsResponseType$outboundSchema` instead. */
780
- export const outboundSchema =
781
- DeploymentInvokeMessageDeploymentsResponseType$outboundSchema;
782
- }
783
-
784
- /** @internal */
785
- export const MessageFunction$inboundSchema: z.ZodType<
786
- MessageFunction,
787
- z.ZodTypeDef,
788
- unknown
789
- > = z.object({
790
- name: z.string(),
791
- arguments: z.string(),
792
- });
793
-
794
- /** @internal */
795
- export type MessageFunction$Outbound = {
796
- name: string;
797
- arguments: string;
798
- };
799
-
800
- /** @internal */
801
- export const MessageFunction$outboundSchema: z.ZodType<
802
- MessageFunction$Outbound,
803
- z.ZodTypeDef,
804
- MessageFunction
805
- > = z.object({
806
- name: z.string(),
807
- arguments: z.string(),
808
- });
809
-
810
- /**
811
- * @internal
812
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
813
- */
814
- export namespace MessageFunction$ {
815
- /** @deprecated use `MessageFunction$inboundSchema` instead. */
816
- export const inboundSchema = MessageFunction$inboundSchema;
817
- /** @deprecated use `MessageFunction$outboundSchema` instead. */
818
- export const outboundSchema = MessageFunction$outboundSchema;
819
- /** @deprecated use `MessageFunction$Outbound` instead. */
820
- export type Outbound = MessageFunction$Outbound;
821
- }
822
-
823
- export function messageFunctionToJSON(
824
- messageFunction: MessageFunction,
825
- ): string {
826
- return JSON.stringify(MessageFunction$outboundSchema.parse(messageFunction));
827
- }
828
-
829
- export function messageFunctionFromJSON(
830
- jsonString: string,
831
- ): SafeParseResult<MessageFunction, SDKValidationError> {
832
- return safeParse(
833
- jsonString,
834
- (x) => MessageFunction$inboundSchema.parse(JSON.parse(x)),
835
- `Failed to parse 'MessageFunction' from JSON`,
836
- );
837
- }
838
-
839
- /** @internal */
840
- export const MessageToolCalls$inboundSchema: z.ZodType<
841
- MessageToolCalls,
842
- z.ZodTypeDef,
843
- unknown
844
- > = z.object({
845
- id: z.string().optional(),
846
- index: z.number().optional(),
847
- type: DeploymentInvokeMessageDeploymentsResponseType$inboundSchema,
848
- function: z.lazy(() => MessageFunction$inboundSchema),
849
- });
850
-
851
- /** @internal */
852
- export type MessageToolCalls$Outbound = {
853
- id?: string | undefined;
854
- index?: number | undefined;
855
- type: string;
856
- function: MessageFunction$Outbound;
857
- };
858
-
859
- /** @internal */
860
- export const MessageToolCalls$outboundSchema: z.ZodType<
861
- MessageToolCalls$Outbound,
862
- z.ZodTypeDef,
863
- MessageToolCalls
864
- > = z.object({
865
- id: z.string().optional(),
866
- index: z.number().optional(),
867
- type: DeploymentInvokeMessageDeploymentsResponseType$outboundSchema,
868
- function: z.lazy(() => MessageFunction$outboundSchema),
869
- });
870
-
871
- /**
872
- * @internal
873
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
874
- */
875
- export namespace MessageToolCalls$ {
876
- /** @deprecated use `MessageToolCalls$inboundSchema` instead. */
877
- export const inboundSchema = MessageToolCalls$inboundSchema;
878
- /** @deprecated use `MessageToolCalls$outboundSchema` instead. */
879
- export const outboundSchema = MessageToolCalls$outboundSchema;
880
- /** @deprecated use `MessageToolCalls$Outbound` instead. */
881
- export type Outbound = MessageToolCalls$Outbound;
882
- }
883
-
884
- export function messageToolCallsToJSON(
885
- messageToolCalls: MessageToolCalls,
886
- ): string {
887
- return JSON.stringify(
888
- MessageToolCalls$outboundSchema.parse(messageToolCalls),
889
- );
890
- }
891
-
892
- export function messageToolCallsFromJSON(
893
- jsonString: string,
894
- ): SafeParseResult<MessageToolCalls, SDKValidationError> {
895
- return safeParse(
896
- jsonString,
897
- (x) => MessageToolCalls$inboundSchema.parse(JSON.parse(x)),
898
- `Failed to parse 'MessageToolCalls' from JSON`,
899
- );
900
- }
901
-
902
- /** @internal */
903
- export const Message1$inboundSchema: z.ZodType<
904
- Message1,
905
- z.ZodTypeDef,
906
- unknown
907
- > = z.object({
908
- type: MessageType$inboundSchema,
909
- role: MessageRole$inboundSchema,
910
- content: z.nullable(z.string()).optional(),
911
- tool_calls: z.array(z.lazy(() => MessageToolCalls$inboundSchema)),
912
- }).transform((v) => {
913
- return remap$(v, {
914
- "tool_calls": "toolCalls",
915
- });
916
- });
917
-
918
- /** @internal */
919
- export type Message1$Outbound = {
920
- type: string;
921
- role: string;
922
- content?: string | null | undefined;
923
- tool_calls: Array<MessageToolCalls$Outbound>;
924
- };
925
-
926
- /** @internal */
927
- export const Message1$outboundSchema: z.ZodType<
928
- Message1$Outbound,
929
- z.ZodTypeDef,
930
- Message1
931
- > = z.object({
932
- type: MessageType$outboundSchema,
933
- role: MessageRole$outboundSchema,
934
- content: z.nullable(z.string()).optional(),
935
- toolCalls: z.array(z.lazy(() => MessageToolCalls$outboundSchema)),
936
- }).transform((v) => {
937
- return remap$(v, {
938
- toolCalls: "tool_calls",
939
- });
940
- });
941
-
942
- /**
943
- * @internal
944
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
945
- */
946
- export namespace Message1$ {
947
- /** @deprecated use `Message1$inboundSchema` instead. */
948
- export const inboundSchema = Message1$inboundSchema;
949
- /** @deprecated use `Message1$outboundSchema` instead. */
950
- export const outboundSchema = Message1$outboundSchema;
951
- /** @deprecated use `Message1$Outbound` instead. */
952
- export type Outbound = Message1$Outbound;
953
- }
954
-
955
- export function message1ToJSON(message1: Message1): string {
956
- return JSON.stringify(Message1$outboundSchema.parse(message1));
957
- }
958
-
959
- export function message1FromJSON(
960
- jsonString: string,
961
- ): SafeParseResult<Message1, SDKValidationError> {
962
- return safeParse(
963
- jsonString,
964
- (x) => Message1$inboundSchema.parse(JSON.parse(x)),
965
- `Failed to parse 'Message1' from JSON`,
966
- );
967
- }
968
-
969
- /** @internal */
970
- export const Message$inboundSchema: z.ZodType<Message, z.ZodTypeDef, unknown> =
971
- z.union([
972
- z.lazy(() => Message2$inboundSchema),
973
- z.lazy(() => Message3$inboundSchema),
974
- z.lazy(() => Message1$inboundSchema),
975
- ]);
976
-
977
- /** @internal */
978
- export type Message$Outbound =
979
- | Message2$Outbound
980
- | Message3$Outbound
981
- | Message1$Outbound;
982
-
983
- /** @internal */
984
- export const Message$outboundSchema: z.ZodType<
985
- Message$Outbound,
986
- z.ZodTypeDef,
987
- Message
988
- > = z.union([
989
- z.lazy(() => Message2$outboundSchema),
990
- z.lazy(() => Message3$outboundSchema),
991
- z.lazy(() => Message1$outboundSchema),
992
- ]);
993
-
994
- /**
995
- * @internal
996
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
997
- */
998
- export namespace Message$ {
999
- /** @deprecated use `Message$inboundSchema` instead. */
1000
- export const inboundSchema = Message$inboundSchema;
1001
- /** @deprecated use `Message$outboundSchema` instead. */
1002
- export const outboundSchema = Message$outboundSchema;
1003
- /** @deprecated use `Message$Outbound` instead. */
1004
- export type Outbound = Message$Outbound;
1005
- }
1006
-
1007
- export function messageToJSON(message: Message): string {
1008
- return JSON.stringify(Message$outboundSchema.parse(message));
1009
- }
1010
-
1011
- export function messageFromJSON(
1012
- jsonString: string,
1013
- ): SafeParseResult<Message, SDKValidationError> {
1014
- return safeParse(
1015
- jsonString,
1016
- (x) => Message$inboundSchema.parse(JSON.parse(x)),
1017
- `Failed to parse 'Message' from JSON`,
1018
- );
1019
- }
1020
-
1021
- /** @internal */
1022
- export const DeploymentInvokeChoices$inboundSchema: z.ZodType<
1023
- DeploymentInvokeChoices,
1024
- z.ZodTypeDef,
1025
- unknown
1026
- > = z.object({
1027
- index: z.number(),
1028
- message: z.union([
1029
- z.lazy(() => Message2$inboundSchema),
1030
- z.lazy(() => Message3$inboundSchema),
1031
- z.lazy(() => Message1$inboundSchema),
1032
- ]),
1033
- finish_reason: z.nullable(z.string()).optional(),
1034
- }).transform((v) => {
1035
- return remap$(v, {
1036
- "finish_reason": "finishReason",
1037
- });
1038
- });
1039
-
1040
- /** @internal */
1041
- export type DeploymentInvokeChoices$Outbound = {
1042
- index: number;
1043
- message: Message2$Outbound | Message3$Outbound | Message1$Outbound;
1044
- finish_reason?: string | null | undefined;
1045
- };
1046
-
1047
- /** @internal */
1048
- export const DeploymentInvokeChoices$outboundSchema: z.ZodType<
1049
- DeploymentInvokeChoices$Outbound,
1050
- z.ZodTypeDef,
1051
- DeploymentInvokeChoices
1052
- > = z.object({
1053
- index: z.number(),
1054
- message: z.union([
1055
- z.lazy(() => Message2$outboundSchema),
1056
- z.lazy(() => Message3$outboundSchema),
1057
- z.lazy(() => Message1$outboundSchema),
1058
- ]),
1059
- finishReason: z.nullable(z.string()).optional(),
1060
- }).transform((v) => {
1061
- return remap$(v, {
1062
- finishReason: "finish_reason",
1063
- });
1064
- });
1065
-
1066
- /**
1067
- * @internal
1068
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1069
- */
1070
- export namespace DeploymentInvokeChoices$ {
1071
- /** @deprecated use `DeploymentInvokeChoices$inboundSchema` instead. */
1072
- export const inboundSchema = DeploymentInvokeChoices$inboundSchema;
1073
- /** @deprecated use `DeploymentInvokeChoices$outboundSchema` instead. */
1074
- export const outboundSchema = DeploymentInvokeChoices$outboundSchema;
1075
- /** @deprecated use `DeploymentInvokeChoices$Outbound` instead. */
1076
- export type Outbound = DeploymentInvokeChoices$Outbound;
1077
- }
1078
-
1079
- export function deploymentInvokeChoicesToJSON(
1080
- deploymentInvokeChoices: DeploymentInvokeChoices,
1081
- ): string {
1082
- return JSON.stringify(
1083
- DeploymentInvokeChoices$outboundSchema.parse(deploymentInvokeChoices),
1084
- );
1085
- }
1086
-
1087
- export function deploymentInvokeChoicesFromJSON(
1088
- jsonString: string,
1089
- ): SafeParseResult<DeploymentInvokeChoices, SDKValidationError> {
1090
- return safeParse(
1091
- jsonString,
1092
- (x) => DeploymentInvokeChoices$inboundSchema.parse(JSON.parse(x)),
1093
- `Failed to parse 'DeploymentInvokeChoices' from JSON`,
1094
- );
1095
- }
1096
-
1097
- /** @internal */
1098
- export const DeploymentInvokeResponseBody$inboundSchema: z.ZodType<
1099
- DeploymentInvokeResponseBody,
1100
- z.ZodTypeDef,
1101
- unknown
1102
- > = z.object({
1103
- id: z.string(),
1104
- created: z.string().datetime({ offset: true }).transform(v => new Date(v)),
1105
- object: DeploymentInvokeObject$inboundSchema,
1106
- model: z.string(),
1107
- provider: DeploymentInvokeProvider$inboundSchema,
1108
- is_final: z.boolean(),
1109
- integration_id: z.string().optional(),
1110
- finalized: z.string().datetime({ offset: true }).transform(v => new Date(v))
1111
- .optional(),
1112
- system_fingerprint: z.nullable(z.string()).optional(),
1113
- retrievals: z.array(z.lazy(() => Retrievals$inboundSchema)).optional(),
1114
- provider_response: z.any().optional(),
1115
- choices: z.array(z.lazy(() => DeploymentInvokeChoices$inboundSchema)),
1116
- }).transform((v) => {
1117
- return remap$(v, {
1118
- "is_final": "isFinal",
1119
- "integration_id": "integrationId",
1120
- "system_fingerprint": "systemFingerprint",
1121
- "provider_response": "providerResponse",
1122
- });
1123
- });
1124
-
1125
- /** @internal */
1126
- export type DeploymentInvokeResponseBody$Outbound = {
1127
- id: string;
1128
- created: string;
1129
- object: string;
1130
- model: string;
1131
- provider: string;
1132
- is_final: boolean;
1133
- integration_id?: string | undefined;
1134
- finalized?: string | undefined;
1135
- system_fingerprint?: string | null | undefined;
1136
- retrievals?: Array<Retrievals$Outbound> | undefined;
1137
- provider_response?: any | undefined;
1138
- choices: Array<DeploymentInvokeChoices$Outbound>;
1139
- };
1140
-
1141
- /** @internal */
1142
- export const DeploymentInvokeResponseBody$outboundSchema: z.ZodType<
1143
- DeploymentInvokeResponseBody$Outbound,
1144
- z.ZodTypeDef,
1145
- DeploymentInvokeResponseBody
1146
- > = z.object({
1147
- id: z.string(),
1148
- created: z.date().transform(v => v.toISOString()),
1149
- object: DeploymentInvokeObject$outboundSchema,
1150
- model: z.string(),
1151
- provider: DeploymentInvokeProvider$outboundSchema,
1152
- isFinal: z.boolean(),
1153
- integrationId: z.string().optional(),
1154
- finalized: z.date().transform(v => v.toISOString()).optional(),
1155
- systemFingerprint: z.nullable(z.string()).optional(),
1156
- retrievals: z.array(z.lazy(() => Retrievals$outboundSchema)).optional(),
1157
- providerResponse: z.any().optional(),
1158
- choices: z.array(z.lazy(() => DeploymentInvokeChoices$outboundSchema)),
1159
- }).transform((v) => {
1160
- return remap$(v, {
1161
- isFinal: "is_final",
1162
- integrationId: "integration_id",
1163
- systemFingerprint: "system_fingerprint",
1164
- providerResponse: "provider_response",
1165
- });
1166
- });
1167
-
1168
- /**
1169
- * @internal
1170
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1171
- */
1172
- export namespace DeploymentInvokeResponseBody$ {
1173
- /** @deprecated use `DeploymentInvokeResponseBody$inboundSchema` instead. */
1174
- export const inboundSchema = DeploymentInvokeResponseBody$inboundSchema;
1175
- /** @deprecated use `DeploymentInvokeResponseBody$outboundSchema` instead. */
1176
- export const outboundSchema = DeploymentInvokeResponseBody$outboundSchema;
1177
- /** @deprecated use `DeploymentInvokeResponseBody$Outbound` instead. */
1178
- export type Outbound = DeploymentInvokeResponseBody$Outbound;
1179
- }
1180
-
1181
- export function deploymentInvokeResponseBodyToJSON(
1182
- deploymentInvokeResponseBody: DeploymentInvokeResponseBody,
1183
- ): string {
1184
- return JSON.stringify(
1185
- DeploymentInvokeResponseBody$outboundSchema.parse(
1186
- deploymentInvokeResponseBody,
1187
- ),
1188
- );
1189
- }
1190
-
1191
- export function deploymentInvokeResponseBodyFromJSON(
1192
- jsonString: string,
1193
- ): SafeParseResult<DeploymentInvokeResponseBody, SDKValidationError> {
1194
- return safeParse(
1195
- jsonString,
1196
- (x) => DeploymentInvokeResponseBody$inboundSchema.parse(JSON.parse(x)),
1197
- `Failed to parse 'DeploymentInvokeResponseBody' from JSON`,
1198
- );
1199
- }