@orq-ai/node 3.1.7 → 3.2.0-rc.3

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 (147) hide show
  1. package/README.md +0 -38
  2. package/docs/sdks/deployments/README.md +0 -81
  3. package/jsr.json +1 -2
  4. package/lib/config.d.ts +3 -3
  5. package/lib/config.js +3 -3
  6. package/lib/config.js.map +1 -1
  7. package/lib/matchers.d.ts.map +1 -1
  8. package/lib/matchers.js +1 -4
  9. package/lib/matchers.js.map +1 -1
  10. package/models/operations/createcontact.js +2 -2
  11. package/models/operations/fileget.js +2 -2
  12. package/models/operations/filelist.js +2 -2
  13. package/models/operations/fileupload.js +2 -2
  14. package/models/operations/index.d.ts +0 -1
  15. package/models/operations/index.d.ts.map +1 -1
  16. package/models/operations/index.js +0 -1
  17. package/models/operations/index.js.map +1 -1
  18. package/package.json +3 -2
  19. package/sdk/deployments.d.ts +0 -8
  20. package/sdk/deployments.d.ts.map +1 -1
  21. package/sdk/deployments.js +0 -10
  22. package/sdk/deployments.js.map +1 -1
  23. package/src/lib/config.ts +3 -3
  24. package/src/lib/matchers.ts +1 -4
  25. package/src/models/operations/createcontact.ts +2 -2
  26. package/src/models/operations/fileget.ts +2 -2
  27. package/src/models/operations/filelist.ts +2 -2
  28. package/src/models/operations/fileupload.ts +2 -2
  29. package/src/models/operations/index.ts +0 -1
  30. package/src/sdk/deployments.ts +0 -19
  31. package/funcs/deploymentsStream.d.ts +0 -16
  32. package/funcs/deploymentsStream.d.ts.map +0 -1
  33. package/funcs/deploymentsStream.js +0 -126
  34. package/funcs/deploymentsStream.js.map +0 -1
  35. package/lib/event-streams.d.ts +0 -17
  36. package/lib/event-streams.d.ts.map +0 -1
  37. package/lib/event-streams.js +0 -220
  38. package/lib/event-streams.js.map +0 -1
  39. package/models/operations/deploymentstream.d.ts +0 -1622
  40. package/models/operations/deploymentstream.d.ts.map +0 -1
  41. package/models/operations/deploymentstream.js +0 -1571
  42. package/models/operations/deploymentstream.js.map +0 -1
  43. package/packages/orq-rc/FUNCTIONS.md +0 -106
  44. package/packages/orq-rc/README.md +0 -506
  45. package/packages/orq-rc/RUNTIMES.md +0 -48
  46. package/packages/orq-rc/docs/sdks/contacts/README.md +0 -84
  47. package/packages/orq-rc/docs/sdks/deployments/README.md +0 -235
  48. package/packages/orq-rc/docs/sdks/feedback/README.md +0 -92
  49. package/packages/orq-rc/docs/sdks/files/README.md +0 -305
  50. package/packages/orq-rc/docs/sdks/metrics/README.md +0 -86
  51. package/packages/orq-rc/docs/sdks/orq/README.md +0 -10
  52. package/packages/orq-rc/docs/sdks/prompts/README.md +0 -608
  53. package/packages/orq-rc/docs/sdks/remoteconfigs/README.md +0 -80
  54. package/packages/orq-rc/jsr.json +0 -27
  55. package/packages/orq-rc/package-lock.json +0 -1861
  56. package/packages/orq-rc/package.json +0 -31
  57. package/packages/orq-rc/src/core.ts +0 -13
  58. package/packages/orq-rc/src/funcs/contactsCreate.ts +0 -127
  59. package/packages/orq-rc/src/funcs/deploymentsGetConfig.ts +0 -135
  60. package/packages/orq-rc/src/funcs/deploymentsInvoke.ts +0 -143
  61. package/packages/orq-rc/src/funcs/deploymentsList.ts +0 -142
  62. package/packages/orq-rc/src/funcs/deploymentsMetricsCreate.ts +0 -135
  63. package/packages/orq-rc/src/funcs/feedbackCreate.ts +0 -127
  64. package/packages/orq-rc/src/funcs/filesCreate.ts +0 -150
  65. package/packages/orq-rc/src/funcs/filesDelete.ts +0 -131
  66. package/packages/orq-rc/src/funcs/filesGet.ts +0 -133
  67. package/packages/orq-rc/src/funcs/filesList.ts +0 -134
  68. package/packages/orq-rc/src/funcs/promptsCreate.ts +0 -127
  69. package/packages/orq-rc/src/funcs/promptsDelete.ts +0 -131
  70. package/packages/orq-rc/src/funcs/promptsGetVersion.ts +0 -147
  71. package/packages/orq-rc/src/funcs/promptsList.ts +0 -134
  72. package/packages/orq-rc/src/funcs/promptsListVersions.ts +0 -140
  73. package/packages/orq-rc/src/funcs/promptsRetrieve.ts +0 -133
  74. package/packages/orq-rc/src/funcs/promptsUpdate.ts +0 -139
  75. package/packages/orq-rc/src/funcs/remoteconfigsRetrieve.ts +0 -128
  76. package/packages/orq-rc/src/hooks/global.ts +0 -44
  77. package/packages/orq-rc/src/hooks/hooks.ts +0 -132
  78. package/packages/orq-rc/src/hooks/index.ts +0 -6
  79. package/packages/orq-rc/src/hooks/registration.ts +0 -15
  80. package/packages/orq-rc/src/hooks/types.ts +0 -110
  81. package/packages/orq-rc/src/index.ts +0 -7
  82. package/packages/orq-rc/src/lib/base64.ts +0 -37
  83. package/packages/orq-rc/src/lib/config.ts +0 -70
  84. package/packages/orq-rc/src/lib/dlv.ts +0 -53
  85. package/packages/orq-rc/src/lib/encodings.ts +0 -483
  86. package/packages/orq-rc/src/lib/env.ts +0 -73
  87. package/packages/orq-rc/src/lib/files.ts +0 -40
  88. package/packages/orq-rc/src/lib/http.ts +0 -323
  89. package/packages/orq-rc/src/lib/is-plain-object.ts +0 -43
  90. package/packages/orq-rc/src/lib/logger.ts +0 -9
  91. package/packages/orq-rc/src/lib/matchers.ts +0 -322
  92. package/packages/orq-rc/src/lib/primitives.ts +0 -136
  93. package/packages/orq-rc/src/lib/retries.ts +0 -218
  94. package/packages/orq-rc/src/lib/schemas.ts +0 -91
  95. package/packages/orq-rc/src/lib/sdks.ts +0 -400
  96. package/packages/orq-rc/src/lib/security.ts +0 -253
  97. package/packages/orq-rc/src/lib/url.ts +0 -33
  98. package/packages/orq-rc/src/models/components/deployments.ts +0 -1666
  99. package/packages/orq-rc/src/models/components/index.ts +0 -6
  100. package/packages/orq-rc/src/models/components/security.ts +0 -71
  101. package/packages/orq-rc/src/models/errors/apierror.ts +0 -27
  102. package/packages/orq-rc/src/models/errors/getpromptversion.ts +0 -71
  103. package/packages/orq-rc/src/models/errors/honoapierror.ts +0 -82
  104. package/packages/orq-rc/src/models/errors/httpclienterrors.ts +0 -62
  105. package/packages/orq-rc/src/models/errors/index.ts +0 -10
  106. package/packages/orq-rc/src/models/errors/sdkvalidationerror.ts +0 -97
  107. package/packages/orq-rc/src/models/errors/updateprompt.ts +0 -71
  108. package/packages/orq-rc/src/models/operations/createcontact.ts +0 -256
  109. package/packages/orq-rc/src/models/operations/createfeedback.ts +0 -286
  110. package/packages/orq-rc/src/models/operations/createprompt.ts +0 -3717
  111. package/packages/orq-rc/src/models/operations/deleteprompt.ts +0 -69
  112. package/packages/orq-rc/src/models/operations/deploymentcreatemetric.ts +0 -1790
  113. package/packages/orq-rc/src/models/operations/deploymentgetconfig.ts +0 -3527
  114. package/packages/orq-rc/src/models/operations/deploymentinvoke.ts +0 -1144
  115. package/packages/orq-rc/src/models/operations/deployments.ts +0 -2148
  116. package/packages/orq-rc/src/models/operations/filedelete.ts +0 -78
  117. package/packages/orq-rc/src/models/operations/fileget.ts +0 -222
  118. package/packages/orq-rc/src/models/operations/filelist.ts +0 -336
  119. package/packages/orq-rc/src/models/operations/fileupload.ts +0 -322
  120. package/packages/orq-rc/src/models/operations/getallprompts.ts +0 -2116
  121. package/packages/orq-rc/src/models/operations/getoneprompt.ts +0 -1982
  122. package/packages/orq-rc/src/models/operations/getpromptversion.ts +0 -2012
  123. package/packages/orq-rc/src/models/operations/index.ts +0 -22
  124. package/packages/orq-rc/src/models/operations/listpromptversions.ts +0 -2146
  125. package/packages/orq-rc/src/models/operations/remoteconfigsgetconfig.ts +0 -190
  126. package/packages/orq-rc/src/models/operations/updateprompt.ts +0 -3900
  127. package/packages/orq-rc/src/sdk/contacts.ts +0 -27
  128. package/packages/orq-rc/src/sdk/deployments.ts +0 -70
  129. package/packages/orq-rc/src/sdk/feedback.ts +0 -27
  130. package/packages/orq-rc/src/sdk/files.ts +0 -78
  131. package/packages/orq-rc/src/sdk/index.ts +0 -5
  132. package/packages/orq-rc/src/sdk/metrics.ts +0 -27
  133. package/packages/orq-rc/src/sdk/prompts.ts +0 -126
  134. package/packages/orq-rc/src/sdk/remoteconfigs.ts +0 -24
  135. package/packages/orq-rc/src/sdk/sdk.ts +0 -43
  136. package/packages/orq-rc/src/types/blobs.ts +0 -31
  137. package/packages/orq-rc/src/types/constdatetime.ts +0 -15
  138. package/packages/orq-rc/src/types/enums.ts +0 -16
  139. package/packages/orq-rc/src/types/fp.ts +0 -50
  140. package/packages/orq-rc/src/types/index.ts +0 -11
  141. package/packages/orq-rc/src/types/operations.ts +0 -105
  142. package/packages/orq-rc/src/types/rfcdate.ts +0 -54
  143. package/packages/orq-rc/src/types/streams.ts +0 -21
  144. package/packages/orq-rc/tsconfig.json +0 -41
  145. package/src/funcs/deploymentsStream.ts +0 -151
  146. package/src/lib/event-streams.ts +0 -264
  147. package/src/models/operations/deploymentstream.ts +0 -3062
@@ -1,3062 +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 DeploymentStreamGlobals = {
13
- environment?: string | undefined;
14
- contactId?: string | undefined;
15
- };
16
-
17
- export type DeploymentStreamInputs = string | number | boolean;
18
-
19
- /**
20
- * The role of the prompt message
21
- */
22
- export const DeploymentStreamRole = {
23
- System: "system",
24
- Assistant: "assistant",
25
- User: "user",
26
- Exception: "exception",
27
- Tool: "tool",
28
- Prompt: "prompt",
29
- Correction: "correction",
30
- ExpectedOutput: "expected_output",
31
- } as const;
32
- /**
33
- * The role of the prompt message
34
- */
35
- export type DeploymentStreamRole = ClosedEnum<typeof DeploymentStreamRole>;
36
-
37
- export const DeploymentStream2DeploymentsType = {
38
- ImageUrl: "image_url",
39
- } as const;
40
- export type DeploymentStream2DeploymentsType = ClosedEnum<
41
- typeof DeploymentStream2DeploymentsType
42
- >;
43
-
44
- export type DeploymentStream2ImageUrl = {
45
- /**
46
- * Either a URL of the image or the base64 encoded data URI.
47
- */
48
- url: string;
49
- /**
50
- * Specifies the detail level of the image. Currently only supported with OpenAI models
51
- */
52
- detail?: string | undefined;
53
- };
54
-
55
- /**
56
- * The image part of the prompt message. Only supported with vision models.
57
- */
58
- export type DeploymentStream22 = {
59
- type: DeploymentStream2DeploymentsType;
60
- imageUrl: DeploymentStream2ImageUrl;
61
- };
62
-
63
- export const DeploymentStream2Type = {
64
- Text: "text",
65
- } as const;
66
- export type DeploymentStream2Type = ClosedEnum<typeof DeploymentStream2Type>;
67
-
68
- /**
69
- * Text content part of a prompt message
70
- */
71
- export type DeploymentStream21 = {
72
- type: DeploymentStream2Type;
73
- text: string;
74
- };
75
-
76
- export type DeploymentStreamContent2 = DeploymentStream21 | DeploymentStream22;
77
-
78
- /**
79
- * The contents of the user message. Either the text content of the message or an array of content parts with a defined type, each can be of type `text` or `image_url` when passing in images. You can pass multiple images by adding multiple `image_url` content parts.
80
- */
81
- export type DeploymentStreamContent =
82
- | string
83
- | Array<DeploymentStream21 | DeploymentStream22>;
84
-
85
- export const DeploymentStreamType = {
86
- Function: "function",
87
- } as const;
88
- export type DeploymentStreamType = ClosedEnum<typeof DeploymentStreamType>;
89
-
90
- export type DeploymentStreamFunction = {
91
- name: string;
92
- /**
93
- * JSON string arguments for the functions
94
- */
95
- arguments: string;
96
- };
97
-
98
- export type DeploymentStreamToolCalls = {
99
- id?: string | undefined;
100
- index?: number | undefined;
101
- type: DeploymentStreamType;
102
- function: DeploymentStreamFunction;
103
- };
104
-
105
- export type DeploymentStreamPrefixMessages = {
106
- /**
107
- * The role of the prompt message
108
- */
109
- role: DeploymentStreamRole;
110
- /**
111
- * The contents of the user message. Either the text content of the message or an array of content parts with a defined type, each can be of type `text` or `image_url` when passing in images. You can pass multiple images by adding multiple `image_url` content parts.
112
- */
113
- content: string | Array<DeploymentStream21 | DeploymentStream22>;
114
- toolCalls?: Array<DeploymentStreamToolCalls> | undefined;
115
- };
116
-
117
- /**
118
- * The role of the prompt message
119
- */
120
- export const DeploymentStreamDeploymentsRole = {
121
- System: "system",
122
- Assistant: "assistant",
123
- User: "user",
124
- Exception: "exception",
125
- Tool: "tool",
126
- Prompt: "prompt",
127
- Correction: "correction",
128
- ExpectedOutput: "expected_output",
129
- } as const;
130
- /**
131
- * The role of the prompt message
132
- */
133
- export type DeploymentStreamDeploymentsRole = ClosedEnum<
134
- typeof DeploymentStreamDeploymentsRole
135
- >;
136
-
137
- export const DeploymentStream2DeploymentsRequestRequestBodyType = {
138
- ImageUrl: "image_url",
139
- } as const;
140
- export type DeploymentStream2DeploymentsRequestRequestBodyType = ClosedEnum<
141
- typeof DeploymentStream2DeploymentsRequestRequestBodyType
142
- >;
143
-
144
- export type DeploymentStream2ImageUrlInput = {
145
- /**
146
- * Either a URL of the image or the base64 encoded data URI.
147
- */
148
- url: string;
149
- /**
150
- * Specifies the detail level of the image. Currently only supported with OpenAI models
151
- */
152
- detail?: string | undefined;
153
- };
154
-
155
- /**
156
- * The image part of the prompt message. Only supported with vision models.
157
- */
158
- export type DeploymentStream22Input = {
159
- type: DeploymentStream2DeploymentsRequestRequestBodyType;
160
- imageUrl: DeploymentStream2ImageUrlInput;
161
- };
162
-
163
- export const DeploymentStream2DeploymentsRequestType = {
164
- Text: "text",
165
- } as const;
166
- export type DeploymentStream2DeploymentsRequestType = ClosedEnum<
167
- typeof DeploymentStream2DeploymentsRequestType
168
- >;
169
-
170
- /**
171
- * Text content part of a prompt message
172
- */
173
- export type DeploymentStream2Deployments1 = {
174
- type: DeploymentStream2DeploymentsRequestType;
175
- text: string;
176
- };
177
-
178
- export type DeploymentStreamContent2Input =
179
- | DeploymentStream2Deployments1
180
- | DeploymentStream22Input;
181
-
182
- /**
183
- * The contents of the user message. Either the text content of the message or an array of content parts with a defined type, each can be of type `text` or `image_url` when passing in images. You can pass multiple images by adding multiple `image_url` content parts.
184
- */
185
- export type DeploymentStreamContentInput =
186
- | string
187
- | Array<DeploymentStream2Deployments1 | DeploymentStream22Input>;
188
-
189
- export const DeploymentStreamDeploymentsType = {
190
- Function: "function",
191
- } as const;
192
- export type DeploymentStreamDeploymentsType = ClosedEnum<
193
- typeof DeploymentStreamDeploymentsType
194
- >;
195
-
196
- export type DeploymentStreamDeploymentsFunction = {
197
- name: string;
198
- /**
199
- * JSON string arguments for the functions
200
- */
201
- arguments: string;
202
- };
203
-
204
- export type DeploymentStreamDeploymentsToolCalls = {
205
- id?: string | undefined;
206
- index?: number | undefined;
207
- type: DeploymentStreamDeploymentsType;
208
- function: DeploymentStreamDeploymentsFunction;
209
- };
210
-
211
- export type DeploymentStreamMessages = {
212
- /**
213
- * The role of the prompt message
214
- */
215
- role: DeploymentStreamDeploymentsRole;
216
- /**
217
- * The contents of the user message. Either the text content of the message or an array of content parts with a defined type, each can be of type `text` or `image_url` when passing in images. You can pass multiple images by adding multiple `image_url` content parts.
218
- */
219
- content:
220
- | string
221
- | Array<DeploymentStream2Deployments1 | DeploymentStream22Input>;
222
- toolCalls?: Array<DeploymentStreamDeploymentsToolCalls> | undefined;
223
- };
224
-
225
- /**
226
- * Metadata about the document
227
- */
228
- export type DeploymentStreamMetadata = {
229
- /**
230
- * Name of the file the text is from.
231
- */
232
- fileName?: string | undefined;
233
- /**
234
- * Content type of the file the text is from.
235
- */
236
- fileType?: string | undefined;
237
- /**
238
- * The page number the text is from.
239
- */
240
- pageNumber?: number | undefined;
241
- };
242
-
243
- export type DeploymentStreamDocuments = {
244
- /**
245
- * The text content of the document
246
- */
247
- text: string;
248
- /**
249
- * Metadata about the document
250
- */
251
- metadata?: DeploymentStreamMetadata | undefined;
252
- };
253
-
254
- export type DeploymentStreamInvokeOptions = {
255
- /**
256
- * Whether to include the retrieved knowledge chunks in the response.
257
- */
258
- includeRetrievals?: boolean | undefined;
259
- };
260
-
261
- export type DeploymentStreamRequestBody = {
262
- /**
263
- * The deployment key to invoke
264
- */
265
- key: string;
266
- /**
267
- * 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.
268
- */
269
- inputs?: { [k: string]: string | number | boolean } | undefined;
270
- /**
271
- * 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.
272
- */
273
- context?: { [k: string]: any } | undefined;
274
- /**
275
- * A list of messages to include after the `System` message, but before the `User` and `Assistant` pairs configured in your deployment.
276
- */
277
- prefixMessages?: Array<DeploymentStreamPrefixMessages> | undefined;
278
- /**
279
- * A list of messages to send to the deployment.
280
- */
281
- messages?: Array<DeploymentStreamMessages> | undefined;
282
- /**
283
- * A list of file IDs that are associated with the deployment request.
284
- */
285
- fileIds?: Array<string> | undefined;
286
- /**
287
- * Key-value pairs that you want to attach to the log generated by this request.
288
- */
289
- metadata?: { [k: string]: any } | undefined;
290
- /**
291
- * 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.
292
- */
293
- extraParams?: { [k: string]: any } | undefined;
294
- /**
295
- * 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.
296
- */
297
- documents?: Array<DeploymentStreamDocuments> | undefined;
298
- invokeOptions?: DeploymentStreamInvokeOptions | undefined;
299
- };
300
-
301
- /**
302
- * Indicates the type of model used to generate the response
303
- */
304
- export const DeploymentStreamObject = {
305
- Chat: "chat",
306
- Completion: "completion",
307
- Image: "image",
308
- Vision: "vision",
309
- } as const;
310
- /**
311
- * Indicates the type of model used to generate the response
312
- */
313
- export type DeploymentStreamObject = ClosedEnum<typeof DeploymentStreamObject>;
314
-
315
- /**
316
- * The provider used to generate the response
317
- */
318
- export const DeploymentStreamProvider = {
319
- Cohere: "cohere",
320
- Openai: "openai",
321
- Anthropic: "anthropic",
322
- Huggingface: "huggingface",
323
- Replicate: "replicate",
324
- Google: "google",
325
- GoogleAi: "google-ai",
326
- Azure: "azure",
327
- Aws: "aws",
328
- Anyscale: "anyscale",
329
- Perplexity: "perplexity",
330
- Groq: "groq",
331
- Fal: "fal",
332
- Leonardoai: "leonardoai",
333
- Nvidia: "nvidia",
334
- Jina: "jina",
335
- Togetherai: "togetherai",
336
- Elevenlabs: "elevenlabs",
337
- } as const;
338
- /**
339
- * The provider used to generate the response
340
- */
341
- export type DeploymentStreamProvider = ClosedEnum<
342
- typeof DeploymentStreamProvider
343
- >;
344
-
345
- /**
346
- * The role of the prompt message
347
- */
348
- export const DeploymentStreamMessageDeploymentsResponseRole = {
349
- System: "system",
350
- Assistant: "assistant",
351
- User: "user",
352
- Exception: "exception",
353
- Tool: "tool",
354
- Prompt: "prompt",
355
- Correction: "correction",
356
- ExpectedOutput: "expected_output",
357
- } as const;
358
- /**
359
- * The role of the prompt message
360
- */
361
- export type DeploymentStreamMessageDeploymentsResponseRole = ClosedEnum<
362
- typeof DeploymentStreamMessageDeploymentsResponseRole
363
- >;
364
-
365
- export type DeploymentStreamMessage3 = {
366
- /**
367
- * The role of the prompt message
368
- */
369
- role: DeploymentStreamMessageDeploymentsResponseRole;
370
- url: string;
371
- };
372
-
373
- /**
374
- * The role of the prompt message
375
- */
376
- export const DeploymentStreamMessageDeploymentsRole = {
377
- System: "system",
378
- Assistant: "assistant",
379
- User: "user",
380
- Exception: "exception",
381
- Tool: "tool",
382
- Prompt: "prompt",
383
- Correction: "correction",
384
- ExpectedOutput: "expected_output",
385
- } as const;
386
- /**
387
- * The role of the prompt message
388
- */
389
- export type DeploymentStreamMessageDeploymentsRole = ClosedEnum<
390
- typeof DeploymentStreamMessageDeploymentsRole
391
- >;
392
-
393
- export type DeploymentStreamMessage2 = {
394
- /**
395
- * The role of the prompt message
396
- */
397
- role: DeploymentStreamMessageDeploymentsRole;
398
- content: string | null;
399
- };
400
-
401
- /**
402
- * The role of the prompt message
403
- */
404
- export const DeploymentStreamMessageRole = {
405
- System: "system",
406
- Assistant: "assistant",
407
- User: "user",
408
- Exception: "exception",
409
- Tool: "tool",
410
- Prompt: "prompt",
411
- Correction: "correction",
412
- ExpectedOutput: "expected_output",
413
- } as const;
414
- /**
415
- * The role of the prompt message
416
- */
417
- export type DeploymentStreamMessageRole = ClosedEnum<
418
- typeof DeploymentStreamMessageRole
419
- >;
420
-
421
- export const DeploymentStreamMessageType = {
422
- Function: "function",
423
- } as const;
424
- export type DeploymentStreamMessageType = ClosedEnum<
425
- typeof DeploymentStreamMessageType
426
- >;
427
-
428
- export type DeploymentStreamMessageFunction = {
429
- name: string;
430
- /**
431
- * JSON string arguments for the functions
432
- */
433
- arguments: string;
434
- };
435
-
436
- export type DeploymentStreamMessageToolCalls = {
437
- id?: string | undefined;
438
- index?: number | undefined;
439
- type: DeploymentStreamMessageType;
440
- function: DeploymentStreamMessageFunction;
441
- };
442
-
443
- export type DeploymentStreamMessage1 = {
444
- /**
445
- * The role of the prompt message
446
- */
447
- role: DeploymentStreamMessageRole;
448
- content?: string | null | undefined;
449
- toolCalls: Array<DeploymentStreamMessageToolCalls>;
450
- };
451
-
452
- export type DeploymentStreamMessage =
453
- | DeploymentStreamMessage2
454
- | DeploymentStreamMessage3
455
- | DeploymentStreamMessage1;
456
-
457
- export type DeploymentStreamChoices = {
458
- index: number;
459
- message?:
460
- | DeploymentStreamMessage2
461
- | DeploymentStreamMessage3
462
- | DeploymentStreamMessage1
463
- | undefined;
464
- finishReason?: string | null | undefined;
465
- };
466
-
467
- /**
468
- * Metadata of the retrieved chunk from the knowledge base
469
- */
470
- export type DeploymentStreamDeploymentsMetadata = {
471
- /**
472
- * Name of the file
473
- */
474
- fileName: string;
475
- /**
476
- * Page number of the chunk
477
- */
478
- pageNumber: number | null;
479
- /**
480
- * Type of the file
481
- */
482
- fileType: string;
483
- /**
484
- * 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
485
- */
486
- rerankScore?: number | undefined;
487
- /**
488
- * 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.
489
- */
490
- searchScore: number;
491
- };
492
-
493
- export type DeploymentStreamRetrievals = {
494
- /**
495
- * Content of the retrieved chunk from the knowledge base
496
- */
497
- document: string;
498
- /**
499
- * Metadata of the retrieved chunk from the knowledge base
500
- */
501
- metadata: DeploymentStreamDeploymentsMetadata;
502
- };
503
-
504
- export type DeploymentStreamData = {
505
- /**
506
- * A unique identifier for the response. Can be used to add metrics to the transaction.
507
- */
508
- id?: string | undefined;
509
- /**
510
- * A timestamp indicating when the object was created. Usually in a standardized format like ISO 8601
511
- */
512
- created?: Date | undefined;
513
- /**
514
- * Indicates the type of model used to generate the response
515
- */
516
- object?: DeploymentStreamObject | undefined;
517
- /**
518
- * The model used to generate the response
519
- */
520
- model?: string | undefined;
521
- /**
522
- * The provider used to generate the response
523
- */
524
- provider?: DeploymentStreamProvider | undefined;
525
- /**
526
- * Indicates if the response is the final response
527
- */
528
- isFinal?: boolean | undefined;
529
- /**
530
- * Indicates integration id used to generate the response
531
- */
532
- integrationId?: string | undefined;
533
- /**
534
- * A timestamp indicating when the object was finalized. Usually in a standardized format like ISO 8601
535
- */
536
- finalized?: Date | undefined;
537
- /**
538
- * Provider backed system fingerprint.
539
- */
540
- systemFingerprint?: string | null | undefined;
541
- /**
542
- * A list of choices generated by the model
543
- */
544
- choices?: Array<DeploymentStreamChoices> | undefined;
545
- /**
546
- * 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`.
547
- */
548
- retrievals?: Array<DeploymentStreamRetrievals> | undefined;
549
- /**
550
- * 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`.
551
- */
552
- providerResponse?: any | undefined;
553
- };
554
-
555
- /**
556
- * Response from the gateway
557
- */
558
- export type DeploymentStreamResponseBody = {
559
- data?: DeploymentStreamData | undefined;
560
- };
561
-
562
- /** @internal */
563
- export const DeploymentStreamGlobals$inboundSchema: z.ZodType<
564
- DeploymentStreamGlobals,
565
- z.ZodTypeDef,
566
- unknown
567
- > = z.object({
568
- environment: z.string().optional(),
569
- contactId: z.string().optional(),
570
- });
571
-
572
- /** @internal */
573
- export type DeploymentStreamGlobals$Outbound = {
574
- environment?: string | undefined;
575
- contactId?: string | undefined;
576
- };
577
-
578
- /** @internal */
579
- export const DeploymentStreamGlobals$outboundSchema: z.ZodType<
580
- DeploymentStreamGlobals$Outbound,
581
- z.ZodTypeDef,
582
- DeploymentStreamGlobals
583
- > = z.object({
584
- environment: z.string().optional(),
585
- contactId: z.string().optional(),
586
- });
587
-
588
- /**
589
- * @internal
590
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
591
- */
592
- export namespace DeploymentStreamGlobals$ {
593
- /** @deprecated use `DeploymentStreamGlobals$inboundSchema` instead. */
594
- export const inboundSchema = DeploymentStreamGlobals$inboundSchema;
595
- /** @deprecated use `DeploymentStreamGlobals$outboundSchema` instead. */
596
- export const outboundSchema = DeploymentStreamGlobals$outboundSchema;
597
- /** @deprecated use `DeploymentStreamGlobals$Outbound` instead. */
598
- export type Outbound = DeploymentStreamGlobals$Outbound;
599
- }
600
-
601
- export function deploymentStreamGlobalsToJSON(
602
- deploymentStreamGlobals: DeploymentStreamGlobals,
603
- ): string {
604
- return JSON.stringify(
605
- DeploymentStreamGlobals$outboundSchema.parse(deploymentStreamGlobals),
606
- );
607
- }
608
-
609
- export function deploymentStreamGlobalsFromJSON(
610
- jsonString: string,
611
- ): SafeParseResult<DeploymentStreamGlobals, SDKValidationError> {
612
- return safeParse(
613
- jsonString,
614
- (x) => DeploymentStreamGlobals$inboundSchema.parse(JSON.parse(x)),
615
- `Failed to parse 'DeploymentStreamGlobals' from JSON`,
616
- );
617
- }
618
-
619
- /** @internal */
620
- export const DeploymentStreamInputs$inboundSchema: z.ZodType<
621
- DeploymentStreamInputs,
622
- z.ZodTypeDef,
623
- unknown
624
- > = z.union([z.string(), z.number(), z.boolean()]);
625
-
626
- /** @internal */
627
- export type DeploymentStreamInputs$Outbound = string | number | boolean;
628
-
629
- /** @internal */
630
- export const DeploymentStreamInputs$outboundSchema: z.ZodType<
631
- DeploymentStreamInputs$Outbound,
632
- z.ZodTypeDef,
633
- DeploymentStreamInputs
634
- > = z.union([z.string(), z.number(), z.boolean()]);
635
-
636
- /**
637
- * @internal
638
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
639
- */
640
- export namespace DeploymentStreamInputs$ {
641
- /** @deprecated use `DeploymentStreamInputs$inboundSchema` instead. */
642
- export const inboundSchema = DeploymentStreamInputs$inboundSchema;
643
- /** @deprecated use `DeploymentStreamInputs$outboundSchema` instead. */
644
- export const outboundSchema = DeploymentStreamInputs$outboundSchema;
645
- /** @deprecated use `DeploymentStreamInputs$Outbound` instead. */
646
- export type Outbound = DeploymentStreamInputs$Outbound;
647
- }
648
-
649
- export function deploymentStreamInputsToJSON(
650
- deploymentStreamInputs: DeploymentStreamInputs,
651
- ): string {
652
- return JSON.stringify(
653
- DeploymentStreamInputs$outboundSchema.parse(deploymentStreamInputs),
654
- );
655
- }
656
-
657
- export function deploymentStreamInputsFromJSON(
658
- jsonString: string,
659
- ): SafeParseResult<DeploymentStreamInputs, SDKValidationError> {
660
- return safeParse(
661
- jsonString,
662
- (x) => DeploymentStreamInputs$inboundSchema.parse(JSON.parse(x)),
663
- `Failed to parse 'DeploymentStreamInputs' from JSON`,
664
- );
665
- }
666
-
667
- /** @internal */
668
- export const DeploymentStreamRole$inboundSchema: z.ZodNativeEnum<
669
- typeof DeploymentStreamRole
670
- > = z.nativeEnum(DeploymentStreamRole);
671
-
672
- /** @internal */
673
- export const DeploymentStreamRole$outboundSchema: z.ZodNativeEnum<
674
- typeof DeploymentStreamRole
675
- > = DeploymentStreamRole$inboundSchema;
676
-
677
- /**
678
- * @internal
679
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
680
- */
681
- export namespace DeploymentStreamRole$ {
682
- /** @deprecated use `DeploymentStreamRole$inboundSchema` instead. */
683
- export const inboundSchema = DeploymentStreamRole$inboundSchema;
684
- /** @deprecated use `DeploymentStreamRole$outboundSchema` instead. */
685
- export const outboundSchema = DeploymentStreamRole$outboundSchema;
686
- }
687
-
688
- /** @internal */
689
- export const DeploymentStream2DeploymentsType$inboundSchema: z.ZodNativeEnum<
690
- typeof DeploymentStream2DeploymentsType
691
- > = z.nativeEnum(DeploymentStream2DeploymentsType);
692
-
693
- /** @internal */
694
- export const DeploymentStream2DeploymentsType$outboundSchema: z.ZodNativeEnum<
695
- typeof DeploymentStream2DeploymentsType
696
- > = DeploymentStream2DeploymentsType$inboundSchema;
697
-
698
- /**
699
- * @internal
700
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
701
- */
702
- export namespace DeploymentStream2DeploymentsType$ {
703
- /** @deprecated use `DeploymentStream2DeploymentsType$inboundSchema` instead. */
704
- export const inboundSchema = DeploymentStream2DeploymentsType$inboundSchema;
705
- /** @deprecated use `DeploymentStream2DeploymentsType$outboundSchema` instead. */
706
- export const outboundSchema = DeploymentStream2DeploymentsType$outboundSchema;
707
- }
708
-
709
- /** @internal */
710
- export const DeploymentStream2ImageUrl$inboundSchema: z.ZodType<
711
- DeploymentStream2ImageUrl,
712
- z.ZodTypeDef,
713
- unknown
714
- > = z.object({
715
- url: z.string(),
716
- detail: z.string().optional(),
717
- });
718
-
719
- /** @internal */
720
- export type DeploymentStream2ImageUrl$Outbound = {
721
- url: string;
722
- detail?: string | undefined;
723
- };
724
-
725
- /** @internal */
726
- export const DeploymentStream2ImageUrl$outboundSchema: z.ZodType<
727
- DeploymentStream2ImageUrl$Outbound,
728
- z.ZodTypeDef,
729
- DeploymentStream2ImageUrl
730
- > = z.object({
731
- url: z.string(),
732
- detail: z.string().optional(),
733
- });
734
-
735
- /**
736
- * @internal
737
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
738
- */
739
- export namespace DeploymentStream2ImageUrl$ {
740
- /** @deprecated use `DeploymentStream2ImageUrl$inboundSchema` instead. */
741
- export const inboundSchema = DeploymentStream2ImageUrl$inboundSchema;
742
- /** @deprecated use `DeploymentStream2ImageUrl$outboundSchema` instead. */
743
- export const outboundSchema = DeploymentStream2ImageUrl$outboundSchema;
744
- /** @deprecated use `DeploymentStream2ImageUrl$Outbound` instead. */
745
- export type Outbound = DeploymentStream2ImageUrl$Outbound;
746
- }
747
-
748
- export function deploymentStream2ImageUrlToJSON(
749
- deploymentStream2ImageUrl: DeploymentStream2ImageUrl,
750
- ): string {
751
- return JSON.stringify(
752
- DeploymentStream2ImageUrl$outboundSchema.parse(deploymentStream2ImageUrl),
753
- );
754
- }
755
-
756
- export function deploymentStream2ImageUrlFromJSON(
757
- jsonString: string,
758
- ): SafeParseResult<DeploymentStream2ImageUrl, SDKValidationError> {
759
- return safeParse(
760
- jsonString,
761
- (x) => DeploymentStream2ImageUrl$inboundSchema.parse(JSON.parse(x)),
762
- `Failed to parse 'DeploymentStream2ImageUrl' from JSON`,
763
- );
764
- }
765
-
766
- /** @internal */
767
- export const DeploymentStream22$inboundSchema: z.ZodType<
768
- DeploymentStream22,
769
- z.ZodTypeDef,
770
- unknown
771
- > = z.object({
772
- type: DeploymentStream2DeploymentsType$inboundSchema,
773
- image_url: z.lazy(() => DeploymentStream2ImageUrl$inboundSchema),
774
- }).transform((v) => {
775
- return remap$(v, {
776
- "image_url": "imageUrl",
777
- });
778
- });
779
-
780
- /** @internal */
781
- export type DeploymentStream22$Outbound = {
782
- type: string;
783
- image_url: DeploymentStream2ImageUrl$Outbound;
784
- };
785
-
786
- /** @internal */
787
- export const DeploymentStream22$outboundSchema: z.ZodType<
788
- DeploymentStream22$Outbound,
789
- z.ZodTypeDef,
790
- DeploymentStream22
791
- > = z.object({
792
- type: DeploymentStream2DeploymentsType$outboundSchema,
793
- imageUrl: z.lazy(() => DeploymentStream2ImageUrl$outboundSchema),
794
- }).transform((v) => {
795
- return remap$(v, {
796
- imageUrl: "image_url",
797
- });
798
- });
799
-
800
- /**
801
- * @internal
802
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
803
- */
804
- export namespace DeploymentStream22$ {
805
- /** @deprecated use `DeploymentStream22$inboundSchema` instead. */
806
- export const inboundSchema = DeploymentStream22$inboundSchema;
807
- /** @deprecated use `DeploymentStream22$outboundSchema` instead. */
808
- export const outboundSchema = DeploymentStream22$outboundSchema;
809
- /** @deprecated use `DeploymentStream22$Outbound` instead. */
810
- export type Outbound = DeploymentStream22$Outbound;
811
- }
812
-
813
- export function deploymentStream22ToJSON(
814
- deploymentStream22: DeploymentStream22,
815
- ): string {
816
- return JSON.stringify(
817
- DeploymentStream22$outboundSchema.parse(deploymentStream22),
818
- );
819
- }
820
-
821
- export function deploymentStream22FromJSON(
822
- jsonString: string,
823
- ): SafeParseResult<DeploymentStream22, SDKValidationError> {
824
- return safeParse(
825
- jsonString,
826
- (x) => DeploymentStream22$inboundSchema.parse(JSON.parse(x)),
827
- `Failed to parse 'DeploymentStream22' from JSON`,
828
- );
829
- }
830
-
831
- /** @internal */
832
- export const DeploymentStream2Type$inboundSchema: z.ZodNativeEnum<
833
- typeof DeploymentStream2Type
834
- > = z.nativeEnum(DeploymentStream2Type);
835
-
836
- /** @internal */
837
- export const DeploymentStream2Type$outboundSchema: z.ZodNativeEnum<
838
- typeof DeploymentStream2Type
839
- > = DeploymentStream2Type$inboundSchema;
840
-
841
- /**
842
- * @internal
843
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
844
- */
845
- export namespace DeploymentStream2Type$ {
846
- /** @deprecated use `DeploymentStream2Type$inboundSchema` instead. */
847
- export const inboundSchema = DeploymentStream2Type$inboundSchema;
848
- /** @deprecated use `DeploymentStream2Type$outboundSchema` instead. */
849
- export const outboundSchema = DeploymentStream2Type$outboundSchema;
850
- }
851
-
852
- /** @internal */
853
- export const DeploymentStream21$inboundSchema: z.ZodType<
854
- DeploymentStream21,
855
- z.ZodTypeDef,
856
- unknown
857
- > = z.object({
858
- type: DeploymentStream2Type$inboundSchema,
859
- text: z.string(),
860
- });
861
-
862
- /** @internal */
863
- export type DeploymentStream21$Outbound = {
864
- type: string;
865
- text: string;
866
- };
867
-
868
- /** @internal */
869
- export const DeploymentStream21$outboundSchema: z.ZodType<
870
- DeploymentStream21$Outbound,
871
- z.ZodTypeDef,
872
- DeploymentStream21
873
- > = z.object({
874
- type: DeploymentStream2Type$outboundSchema,
875
- text: z.string(),
876
- });
877
-
878
- /**
879
- * @internal
880
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
881
- */
882
- export namespace DeploymentStream21$ {
883
- /** @deprecated use `DeploymentStream21$inboundSchema` instead. */
884
- export const inboundSchema = DeploymentStream21$inboundSchema;
885
- /** @deprecated use `DeploymentStream21$outboundSchema` instead. */
886
- export const outboundSchema = DeploymentStream21$outboundSchema;
887
- /** @deprecated use `DeploymentStream21$Outbound` instead. */
888
- export type Outbound = DeploymentStream21$Outbound;
889
- }
890
-
891
- export function deploymentStream21ToJSON(
892
- deploymentStream21: DeploymentStream21,
893
- ): string {
894
- return JSON.stringify(
895
- DeploymentStream21$outboundSchema.parse(deploymentStream21),
896
- );
897
- }
898
-
899
- export function deploymentStream21FromJSON(
900
- jsonString: string,
901
- ): SafeParseResult<DeploymentStream21, SDKValidationError> {
902
- return safeParse(
903
- jsonString,
904
- (x) => DeploymentStream21$inboundSchema.parse(JSON.parse(x)),
905
- `Failed to parse 'DeploymentStream21' from JSON`,
906
- );
907
- }
908
-
909
- /** @internal */
910
- export const DeploymentStreamContent2$inboundSchema: z.ZodType<
911
- DeploymentStreamContent2,
912
- z.ZodTypeDef,
913
- unknown
914
- > = z.union([
915
- z.lazy(() => DeploymentStream21$inboundSchema),
916
- z.lazy(() => DeploymentStream22$inboundSchema),
917
- ]);
918
-
919
- /** @internal */
920
- export type DeploymentStreamContent2$Outbound =
921
- | DeploymentStream21$Outbound
922
- | DeploymentStream22$Outbound;
923
-
924
- /** @internal */
925
- export const DeploymentStreamContent2$outboundSchema: z.ZodType<
926
- DeploymentStreamContent2$Outbound,
927
- z.ZodTypeDef,
928
- DeploymentStreamContent2
929
- > = z.union([
930
- z.lazy(() => DeploymentStream21$outboundSchema),
931
- z.lazy(() => DeploymentStream22$outboundSchema),
932
- ]);
933
-
934
- /**
935
- * @internal
936
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
937
- */
938
- export namespace DeploymentStreamContent2$ {
939
- /** @deprecated use `DeploymentStreamContent2$inboundSchema` instead. */
940
- export const inboundSchema = DeploymentStreamContent2$inboundSchema;
941
- /** @deprecated use `DeploymentStreamContent2$outboundSchema` instead. */
942
- export const outboundSchema = DeploymentStreamContent2$outboundSchema;
943
- /** @deprecated use `DeploymentStreamContent2$Outbound` instead. */
944
- export type Outbound = DeploymentStreamContent2$Outbound;
945
- }
946
-
947
- export function deploymentStreamContent2ToJSON(
948
- deploymentStreamContent2: DeploymentStreamContent2,
949
- ): string {
950
- return JSON.stringify(
951
- DeploymentStreamContent2$outboundSchema.parse(deploymentStreamContent2),
952
- );
953
- }
954
-
955
- export function deploymentStreamContent2FromJSON(
956
- jsonString: string,
957
- ): SafeParseResult<DeploymentStreamContent2, SDKValidationError> {
958
- return safeParse(
959
- jsonString,
960
- (x) => DeploymentStreamContent2$inboundSchema.parse(JSON.parse(x)),
961
- `Failed to parse 'DeploymentStreamContent2' from JSON`,
962
- );
963
- }
964
-
965
- /** @internal */
966
- export const DeploymentStreamContent$inboundSchema: z.ZodType<
967
- DeploymentStreamContent,
968
- z.ZodTypeDef,
969
- unknown
970
- > = z.union([
971
- z.string(),
972
- z.array(z.union([
973
- z.lazy(() => DeploymentStream21$inboundSchema),
974
- z.lazy(() => DeploymentStream22$inboundSchema),
975
- ])),
976
- ]);
977
-
978
- /** @internal */
979
- export type DeploymentStreamContent$Outbound =
980
- | string
981
- | Array<DeploymentStream21$Outbound | DeploymentStream22$Outbound>;
982
-
983
- /** @internal */
984
- export const DeploymentStreamContent$outboundSchema: z.ZodType<
985
- DeploymentStreamContent$Outbound,
986
- z.ZodTypeDef,
987
- DeploymentStreamContent
988
- > = z.union([
989
- z.string(),
990
- z.array(z.union([
991
- z.lazy(() => DeploymentStream21$outboundSchema),
992
- z.lazy(() => DeploymentStream22$outboundSchema),
993
- ])),
994
- ]);
995
-
996
- /**
997
- * @internal
998
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
999
- */
1000
- export namespace DeploymentStreamContent$ {
1001
- /** @deprecated use `DeploymentStreamContent$inboundSchema` instead. */
1002
- export const inboundSchema = DeploymentStreamContent$inboundSchema;
1003
- /** @deprecated use `DeploymentStreamContent$outboundSchema` instead. */
1004
- export const outboundSchema = DeploymentStreamContent$outboundSchema;
1005
- /** @deprecated use `DeploymentStreamContent$Outbound` instead. */
1006
- export type Outbound = DeploymentStreamContent$Outbound;
1007
- }
1008
-
1009
- export function deploymentStreamContentToJSON(
1010
- deploymentStreamContent: DeploymentStreamContent,
1011
- ): string {
1012
- return JSON.stringify(
1013
- DeploymentStreamContent$outboundSchema.parse(deploymentStreamContent),
1014
- );
1015
- }
1016
-
1017
- export function deploymentStreamContentFromJSON(
1018
- jsonString: string,
1019
- ): SafeParseResult<DeploymentStreamContent, SDKValidationError> {
1020
- return safeParse(
1021
- jsonString,
1022
- (x) => DeploymentStreamContent$inboundSchema.parse(JSON.parse(x)),
1023
- `Failed to parse 'DeploymentStreamContent' from JSON`,
1024
- );
1025
- }
1026
-
1027
- /** @internal */
1028
- export const DeploymentStreamType$inboundSchema: z.ZodNativeEnum<
1029
- typeof DeploymentStreamType
1030
- > = z.nativeEnum(DeploymentStreamType);
1031
-
1032
- /** @internal */
1033
- export const DeploymentStreamType$outboundSchema: z.ZodNativeEnum<
1034
- typeof DeploymentStreamType
1035
- > = DeploymentStreamType$inboundSchema;
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 DeploymentStreamType$ {
1042
- /** @deprecated use `DeploymentStreamType$inboundSchema` instead. */
1043
- export const inboundSchema = DeploymentStreamType$inboundSchema;
1044
- /** @deprecated use `DeploymentStreamType$outboundSchema` instead. */
1045
- export const outboundSchema = DeploymentStreamType$outboundSchema;
1046
- }
1047
-
1048
- /** @internal */
1049
- export const DeploymentStreamFunction$inboundSchema: z.ZodType<
1050
- DeploymentStreamFunction,
1051
- z.ZodTypeDef,
1052
- unknown
1053
- > = z.object({
1054
- name: z.string(),
1055
- arguments: z.string(),
1056
- });
1057
-
1058
- /** @internal */
1059
- export type DeploymentStreamFunction$Outbound = {
1060
- name: string;
1061
- arguments: string;
1062
- };
1063
-
1064
- /** @internal */
1065
- export const DeploymentStreamFunction$outboundSchema: z.ZodType<
1066
- DeploymentStreamFunction$Outbound,
1067
- z.ZodTypeDef,
1068
- DeploymentStreamFunction
1069
- > = z.object({
1070
- name: z.string(),
1071
- arguments: z.string(),
1072
- });
1073
-
1074
- /**
1075
- * @internal
1076
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1077
- */
1078
- export namespace DeploymentStreamFunction$ {
1079
- /** @deprecated use `DeploymentStreamFunction$inboundSchema` instead. */
1080
- export const inboundSchema = DeploymentStreamFunction$inboundSchema;
1081
- /** @deprecated use `DeploymentStreamFunction$outboundSchema` instead. */
1082
- export const outboundSchema = DeploymentStreamFunction$outboundSchema;
1083
- /** @deprecated use `DeploymentStreamFunction$Outbound` instead. */
1084
- export type Outbound = DeploymentStreamFunction$Outbound;
1085
- }
1086
-
1087
- export function deploymentStreamFunctionToJSON(
1088
- deploymentStreamFunction: DeploymentStreamFunction,
1089
- ): string {
1090
- return JSON.stringify(
1091
- DeploymentStreamFunction$outboundSchema.parse(deploymentStreamFunction),
1092
- );
1093
- }
1094
-
1095
- export function deploymentStreamFunctionFromJSON(
1096
- jsonString: string,
1097
- ): SafeParseResult<DeploymentStreamFunction, SDKValidationError> {
1098
- return safeParse(
1099
- jsonString,
1100
- (x) => DeploymentStreamFunction$inboundSchema.parse(JSON.parse(x)),
1101
- `Failed to parse 'DeploymentStreamFunction' from JSON`,
1102
- );
1103
- }
1104
-
1105
- /** @internal */
1106
- export const DeploymentStreamToolCalls$inboundSchema: z.ZodType<
1107
- DeploymentStreamToolCalls,
1108
- z.ZodTypeDef,
1109
- unknown
1110
- > = z.object({
1111
- id: z.string().optional(),
1112
- index: z.number().optional(),
1113
- type: DeploymentStreamType$inboundSchema,
1114
- function: z.lazy(() => DeploymentStreamFunction$inboundSchema),
1115
- });
1116
-
1117
- /** @internal */
1118
- export type DeploymentStreamToolCalls$Outbound = {
1119
- id?: string | undefined;
1120
- index?: number | undefined;
1121
- type: string;
1122
- function: DeploymentStreamFunction$Outbound;
1123
- };
1124
-
1125
- /** @internal */
1126
- export const DeploymentStreamToolCalls$outboundSchema: z.ZodType<
1127
- DeploymentStreamToolCalls$Outbound,
1128
- z.ZodTypeDef,
1129
- DeploymentStreamToolCalls
1130
- > = z.object({
1131
- id: z.string().optional(),
1132
- index: z.number().optional(),
1133
- type: DeploymentStreamType$outboundSchema,
1134
- function: z.lazy(() => DeploymentStreamFunction$outboundSchema),
1135
- });
1136
-
1137
- /**
1138
- * @internal
1139
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1140
- */
1141
- export namespace DeploymentStreamToolCalls$ {
1142
- /** @deprecated use `DeploymentStreamToolCalls$inboundSchema` instead. */
1143
- export const inboundSchema = DeploymentStreamToolCalls$inboundSchema;
1144
- /** @deprecated use `DeploymentStreamToolCalls$outboundSchema` instead. */
1145
- export const outboundSchema = DeploymentStreamToolCalls$outboundSchema;
1146
- /** @deprecated use `DeploymentStreamToolCalls$Outbound` instead. */
1147
- export type Outbound = DeploymentStreamToolCalls$Outbound;
1148
- }
1149
-
1150
- export function deploymentStreamToolCallsToJSON(
1151
- deploymentStreamToolCalls: DeploymentStreamToolCalls,
1152
- ): string {
1153
- return JSON.stringify(
1154
- DeploymentStreamToolCalls$outboundSchema.parse(deploymentStreamToolCalls),
1155
- );
1156
- }
1157
-
1158
- export function deploymentStreamToolCallsFromJSON(
1159
- jsonString: string,
1160
- ): SafeParseResult<DeploymentStreamToolCalls, SDKValidationError> {
1161
- return safeParse(
1162
- jsonString,
1163
- (x) => DeploymentStreamToolCalls$inboundSchema.parse(JSON.parse(x)),
1164
- `Failed to parse 'DeploymentStreamToolCalls' from JSON`,
1165
- );
1166
- }
1167
-
1168
- /** @internal */
1169
- export const DeploymentStreamPrefixMessages$inboundSchema: z.ZodType<
1170
- DeploymentStreamPrefixMessages,
1171
- z.ZodTypeDef,
1172
- unknown
1173
- > = z.object({
1174
- role: DeploymentStreamRole$inboundSchema,
1175
- content: z.union([
1176
- z.string(),
1177
- z.array(z.union([
1178
- z.lazy(() => DeploymentStream21$inboundSchema),
1179
- z.lazy(() => DeploymentStream22$inboundSchema),
1180
- ])),
1181
- ]),
1182
- tool_calls: z.array(z.lazy(() => DeploymentStreamToolCalls$inboundSchema))
1183
- .optional(),
1184
- }).transform((v) => {
1185
- return remap$(v, {
1186
- "tool_calls": "toolCalls",
1187
- });
1188
- });
1189
-
1190
- /** @internal */
1191
- export type DeploymentStreamPrefixMessages$Outbound = {
1192
- role: string;
1193
- content:
1194
- | string
1195
- | Array<DeploymentStream21$Outbound | DeploymentStream22$Outbound>;
1196
- tool_calls?: Array<DeploymentStreamToolCalls$Outbound> | undefined;
1197
- };
1198
-
1199
- /** @internal */
1200
- export const DeploymentStreamPrefixMessages$outboundSchema: z.ZodType<
1201
- DeploymentStreamPrefixMessages$Outbound,
1202
- z.ZodTypeDef,
1203
- DeploymentStreamPrefixMessages
1204
- > = z.object({
1205
- role: DeploymentStreamRole$outboundSchema,
1206
- content: z.union([
1207
- z.string(),
1208
- z.array(z.union([
1209
- z.lazy(() => DeploymentStream21$outboundSchema),
1210
- z.lazy(() => DeploymentStream22$outboundSchema),
1211
- ])),
1212
- ]),
1213
- toolCalls: z.array(z.lazy(() => DeploymentStreamToolCalls$outboundSchema))
1214
- .optional(),
1215
- }).transform((v) => {
1216
- return remap$(v, {
1217
- toolCalls: "tool_calls",
1218
- });
1219
- });
1220
-
1221
- /**
1222
- * @internal
1223
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1224
- */
1225
- export namespace DeploymentStreamPrefixMessages$ {
1226
- /** @deprecated use `DeploymentStreamPrefixMessages$inboundSchema` instead. */
1227
- export const inboundSchema = DeploymentStreamPrefixMessages$inboundSchema;
1228
- /** @deprecated use `DeploymentStreamPrefixMessages$outboundSchema` instead. */
1229
- export const outboundSchema = DeploymentStreamPrefixMessages$outboundSchema;
1230
- /** @deprecated use `DeploymentStreamPrefixMessages$Outbound` instead. */
1231
- export type Outbound = DeploymentStreamPrefixMessages$Outbound;
1232
- }
1233
-
1234
- export function deploymentStreamPrefixMessagesToJSON(
1235
- deploymentStreamPrefixMessages: DeploymentStreamPrefixMessages,
1236
- ): string {
1237
- return JSON.stringify(
1238
- DeploymentStreamPrefixMessages$outboundSchema.parse(
1239
- deploymentStreamPrefixMessages,
1240
- ),
1241
- );
1242
- }
1243
-
1244
- export function deploymentStreamPrefixMessagesFromJSON(
1245
- jsonString: string,
1246
- ): SafeParseResult<DeploymentStreamPrefixMessages, SDKValidationError> {
1247
- return safeParse(
1248
- jsonString,
1249
- (x) => DeploymentStreamPrefixMessages$inboundSchema.parse(JSON.parse(x)),
1250
- `Failed to parse 'DeploymentStreamPrefixMessages' from JSON`,
1251
- );
1252
- }
1253
-
1254
- /** @internal */
1255
- export const DeploymentStreamDeploymentsRole$inboundSchema: z.ZodNativeEnum<
1256
- typeof DeploymentStreamDeploymentsRole
1257
- > = z.nativeEnum(DeploymentStreamDeploymentsRole);
1258
-
1259
- /** @internal */
1260
- export const DeploymentStreamDeploymentsRole$outboundSchema: z.ZodNativeEnum<
1261
- typeof DeploymentStreamDeploymentsRole
1262
- > = DeploymentStreamDeploymentsRole$inboundSchema;
1263
-
1264
- /**
1265
- * @internal
1266
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1267
- */
1268
- export namespace DeploymentStreamDeploymentsRole$ {
1269
- /** @deprecated use `DeploymentStreamDeploymentsRole$inboundSchema` instead. */
1270
- export const inboundSchema = DeploymentStreamDeploymentsRole$inboundSchema;
1271
- /** @deprecated use `DeploymentStreamDeploymentsRole$outboundSchema` instead. */
1272
- export const outboundSchema = DeploymentStreamDeploymentsRole$outboundSchema;
1273
- }
1274
-
1275
- /** @internal */
1276
- export const DeploymentStream2DeploymentsRequestRequestBodyType$inboundSchema:
1277
- z.ZodNativeEnum<typeof DeploymentStream2DeploymentsRequestRequestBodyType> = z
1278
- .nativeEnum(DeploymentStream2DeploymentsRequestRequestBodyType);
1279
-
1280
- /** @internal */
1281
- export const DeploymentStream2DeploymentsRequestRequestBodyType$outboundSchema:
1282
- z.ZodNativeEnum<typeof DeploymentStream2DeploymentsRequestRequestBodyType> =
1283
- DeploymentStream2DeploymentsRequestRequestBodyType$inboundSchema;
1284
-
1285
- /**
1286
- * @internal
1287
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1288
- */
1289
- export namespace DeploymentStream2DeploymentsRequestRequestBodyType$ {
1290
- /** @deprecated use `DeploymentStream2DeploymentsRequestRequestBodyType$inboundSchema` instead. */
1291
- export const inboundSchema =
1292
- DeploymentStream2DeploymentsRequestRequestBodyType$inboundSchema;
1293
- /** @deprecated use `DeploymentStream2DeploymentsRequestRequestBodyType$outboundSchema` instead. */
1294
- export const outboundSchema =
1295
- DeploymentStream2DeploymentsRequestRequestBodyType$outboundSchema;
1296
- }
1297
-
1298
- /** @internal */
1299
- export const DeploymentStream2ImageUrlInput$inboundSchema: z.ZodType<
1300
- DeploymentStream2ImageUrlInput,
1301
- z.ZodTypeDef,
1302
- unknown
1303
- > = z.object({
1304
- url: z.string(),
1305
- detail: z.string().optional(),
1306
- });
1307
-
1308
- /** @internal */
1309
- export type DeploymentStream2ImageUrlInput$Outbound = {
1310
- url: string;
1311
- detail?: string | undefined;
1312
- };
1313
-
1314
- /** @internal */
1315
- export const DeploymentStream2ImageUrlInput$outboundSchema: z.ZodType<
1316
- DeploymentStream2ImageUrlInput$Outbound,
1317
- z.ZodTypeDef,
1318
- DeploymentStream2ImageUrlInput
1319
- > = z.object({
1320
- url: z.string(),
1321
- detail: z.string().optional(),
1322
- });
1323
-
1324
- /**
1325
- * @internal
1326
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1327
- */
1328
- export namespace DeploymentStream2ImageUrlInput$ {
1329
- /** @deprecated use `DeploymentStream2ImageUrlInput$inboundSchema` instead. */
1330
- export const inboundSchema = DeploymentStream2ImageUrlInput$inboundSchema;
1331
- /** @deprecated use `DeploymentStream2ImageUrlInput$outboundSchema` instead. */
1332
- export const outboundSchema = DeploymentStream2ImageUrlInput$outboundSchema;
1333
- /** @deprecated use `DeploymentStream2ImageUrlInput$Outbound` instead. */
1334
- export type Outbound = DeploymentStream2ImageUrlInput$Outbound;
1335
- }
1336
-
1337
- export function deploymentStream2ImageUrlInputToJSON(
1338
- deploymentStream2ImageUrlInput: DeploymentStream2ImageUrlInput,
1339
- ): string {
1340
- return JSON.stringify(
1341
- DeploymentStream2ImageUrlInput$outboundSchema.parse(
1342
- deploymentStream2ImageUrlInput,
1343
- ),
1344
- );
1345
- }
1346
-
1347
- export function deploymentStream2ImageUrlInputFromJSON(
1348
- jsonString: string,
1349
- ): SafeParseResult<DeploymentStream2ImageUrlInput, SDKValidationError> {
1350
- return safeParse(
1351
- jsonString,
1352
- (x) => DeploymentStream2ImageUrlInput$inboundSchema.parse(JSON.parse(x)),
1353
- `Failed to parse 'DeploymentStream2ImageUrlInput' from JSON`,
1354
- );
1355
- }
1356
-
1357
- /** @internal */
1358
- export const DeploymentStream22Input$inboundSchema: z.ZodType<
1359
- DeploymentStream22Input,
1360
- z.ZodTypeDef,
1361
- unknown
1362
- > = z.object({
1363
- type: DeploymentStream2DeploymentsRequestRequestBodyType$inboundSchema,
1364
- image_url: z.lazy(() => DeploymentStream2ImageUrlInput$inboundSchema),
1365
- }).transform((v) => {
1366
- return remap$(v, {
1367
- "image_url": "imageUrl",
1368
- });
1369
- });
1370
-
1371
- /** @internal */
1372
- export type DeploymentStream22Input$Outbound = {
1373
- type: string;
1374
- image_url: DeploymentStream2ImageUrlInput$Outbound;
1375
- };
1376
-
1377
- /** @internal */
1378
- export const DeploymentStream22Input$outboundSchema: z.ZodType<
1379
- DeploymentStream22Input$Outbound,
1380
- z.ZodTypeDef,
1381
- DeploymentStream22Input
1382
- > = z.object({
1383
- type: DeploymentStream2DeploymentsRequestRequestBodyType$outboundSchema,
1384
- imageUrl: z.lazy(() => DeploymentStream2ImageUrlInput$outboundSchema),
1385
- }).transform((v) => {
1386
- return remap$(v, {
1387
- imageUrl: "image_url",
1388
- });
1389
- });
1390
-
1391
- /**
1392
- * @internal
1393
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1394
- */
1395
- export namespace DeploymentStream22Input$ {
1396
- /** @deprecated use `DeploymentStream22Input$inboundSchema` instead. */
1397
- export const inboundSchema = DeploymentStream22Input$inboundSchema;
1398
- /** @deprecated use `DeploymentStream22Input$outboundSchema` instead. */
1399
- export const outboundSchema = DeploymentStream22Input$outboundSchema;
1400
- /** @deprecated use `DeploymentStream22Input$Outbound` instead. */
1401
- export type Outbound = DeploymentStream22Input$Outbound;
1402
- }
1403
-
1404
- export function deploymentStream22InputToJSON(
1405
- deploymentStream22Input: DeploymentStream22Input,
1406
- ): string {
1407
- return JSON.stringify(
1408
- DeploymentStream22Input$outboundSchema.parse(deploymentStream22Input),
1409
- );
1410
- }
1411
-
1412
- export function deploymentStream22InputFromJSON(
1413
- jsonString: string,
1414
- ): SafeParseResult<DeploymentStream22Input, SDKValidationError> {
1415
- return safeParse(
1416
- jsonString,
1417
- (x) => DeploymentStream22Input$inboundSchema.parse(JSON.parse(x)),
1418
- `Failed to parse 'DeploymentStream22Input' from JSON`,
1419
- );
1420
- }
1421
-
1422
- /** @internal */
1423
- export const DeploymentStream2DeploymentsRequestType$inboundSchema:
1424
- z.ZodNativeEnum<typeof DeploymentStream2DeploymentsRequestType> = z
1425
- .nativeEnum(DeploymentStream2DeploymentsRequestType);
1426
-
1427
- /** @internal */
1428
- export const DeploymentStream2DeploymentsRequestType$outboundSchema:
1429
- z.ZodNativeEnum<typeof DeploymentStream2DeploymentsRequestType> =
1430
- DeploymentStream2DeploymentsRequestType$inboundSchema;
1431
-
1432
- /**
1433
- * @internal
1434
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1435
- */
1436
- export namespace DeploymentStream2DeploymentsRequestType$ {
1437
- /** @deprecated use `DeploymentStream2DeploymentsRequestType$inboundSchema` instead. */
1438
- export const inboundSchema =
1439
- DeploymentStream2DeploymentsRequestType$inboundSchema;
1440
- /** @deprecated use `DeploymentStream2DeploymentsRequestType$outboundSchema` instead. */
1441
- export const outboundSchema =
1442
- DeploymentStream2DeploymentsRequestType$outboundSchema;
1443
- }
1444
-
1445
- /** @internal */
1446
- export const DeploymentStream2Deployments1$inboundSchema: z.ZodType<
1447
- DeploymentStream2Deployments1,
1448
- z.ZodTypeDef,
1449
- unknown
1450
- > = z.object({
1451
- type: DeploymentStream2DeploymentsRequestType$inboundSchema,
1452
- text: z.string(),
1453
- });
1454
-
1455
- /** @internal */
1456
- export type DeploymentStream2Deployments1$Outbound = {
1457
- type: string;
1458
- text: string;
1459
- };
1460
-
1461
- /** @internal */
1462
- export const DeploymentStream2Deployments1$outboundSchema: z.ZodType<
1463
- DeploymentStream2Deployments1$Outbound,
1464
- z.ZodTypeDef,
1465
- DeploymentStream2Deployments1
1466
- > = z.object({
1467
- type: DeploymentStream2DeploymentsRequestType$outboundSchema,
1468
- text: z.string(),
1469
- });
1470
-
1471
- /**
1472
- * @internal
1473
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1474
- */
1475
- export namespace DeploymentStream2Deployments1$ {
1476
- /** @deprecated use `DeploymentStream2Deployments1$inboundSchema` instead. */
1477
- export const inboundSchema = DeploymentStream2Deployments1$inboundSchema;
1478
- /** @deprecated use `DeploymentStream2Deployments1$outboundSchema` instead. */
1479
- export const outboundSchema = DeploymentStream2Deployments1$outboundSchema;
1480
- /** @deprecated use `DeploymentStream2Deployments1$Outbound` instead. */
1481
- export type Outbound = DeploymentStream2Deployments1$Outbound;
1482
- }
1483
-
1484
- export function deploymentStream2Deployments1ToJSON(
1485
- deploymentStream2Deployments1: DeploymentStream2Deployments1,
1486
- ): string {
1487
- return JSON.stringify(
1488
- DeploymentStream2Deployments1$outboundSchema.parse(
1489
- deploymentStream2Deployments1,
1490
- ),
1491
- );
1492
- }
1493
-
1494
- export function deploymentStream2Deployments1FromJSON(
1495
- jsonString: string,
1496
- ): SafeParseResult<DeploymentStream2Deployments1, SDKValidationError> {
1497
- return safeParse(
1498
- jsonString,
1499
- (x) => DeploymentStream2Deployments1$inboundSchema.parse(JSON.parse(x)),
1500
- `Failed to parse 'DeploymentStream2Deployments1' from JSON`,
1501
- );
1502
- }
1503
-
1504
- /** @internal */
1505
- export const DeploymentStreamContent2Input$inboundSchema: z.ZodType<
1506
- DeploymentStreamContent2Input,
1507
- z.ZodTypeDef,
1508
- unknown
1509
- > = z.union([
1510
- z.lazy(() => DeploymentStream2Deployments1$inboundSchema),
1511
- z.lazy(() => DeploymentStream22Input$inboundSchema),
1512
- ]);
1513
-
1514
- /** @internal */
1515
- export type DeploymentStreamContent2Input$Outbound =
1516
- | DeploymentStream2Deployments1$Outbound
1517
- | DeploymentStream22Input$Outbound;
1518
-
1519
- /** @internal */
1520
- export const DeploymentStreamContent2Input$outboundSchema: z.ZodType<
1521
- DeploymentStreamContent2Input$Outbound,
1522
- z.ZodTypeDef,
1523
- DeploymentStreamContent2Input
1524
- > = z.union([
1525
- z.lazy(() => DeploymentStream2Deployments1$outboundSchema),
1526
- z.lazy(() => DeploymentStream22Input$outboundSchema),
1527
- ]);
1528
-
1529
- /**
1530
- * @internal
1531
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1532
- */
1533
- export namespace DeploymentStreamContent2Input$ {
1534
- /** @deprecated use `DeploymentStreamContent2Input$inboundSchema` instead. */
1535
- export const inboundSchema = DeploymentStreamContent2Input$inboundSchema;
1536
- /** @deprecated use `DeploymentStreamContent2Input$outboundSchema` instead. */
1537
- export const outboundSchema = DeploymentStreamContent2Input$outboundSchema;
1538
- /** @deprecated use `DeploymentStreamContent2Input$Outbound` instead. */
1539
- export type Outbound = DeploymentStreamContent2Input$Outbound;
1540
- }
1541
-
1542
- export function deploymentStreamContent2InputToJSON(
1543
- deploymentStreamContent2Input: DeploymentStreamContent2Input,
1544
- ): string {
1545
- return JSON.stringify(
1546
- DeploymentStreamContent2Input$outboundSchema.parse(
1547
- deploymentStreamContent2Input,
1548
- ),
1549
- );
1550
- }
1551
-
1552
- export function deploymentStreamContent2InputFromJSON(
1553
- jsonString: string,
1554
- ): SafeParseResult<DeploymentStreamContent2Input, SDKValidationError> {
1555
- return safeParse(
1556
- jsonString,
1557
- (x) => DeploymentStreamContent2Input$inboundSchema.parse(JSON.parse(x)),
1558
- `Failed to parse 'DeploymentStreamContent2Input' from JSON`,
1559
- );
1560
- }
1561
-
1562
- /** @internal */
1563
- export const DeploymentStreamContentInput$inboundSchema: z.ZodType<
1564
- DeploymentStreamContentInput,
1565
- z.ZodTypeDef,
1566
- unknown
1567
- > = z.union([
1568
- z.string(),
1569
- z.array(z.union([
1570
- z.lazy(() => DeploymentStream2Deployments1$inboundSchema),
1571
- z.lazy(() => DeploymentStream22Input$inboundSchema),
1572
- ])),
1573
- ]);
1574
-
1575
- /** @internal */
1576
- export type DeploymentStreamContentInput$Outbound =
1577
- | string
1578
- | Array<
1579
- DeploymentStream2Deployments1$Outbound | DeploymentStream22Input$Outbound
1580
- >;
1581
-
1582
- /** @internal */
1583
- export const DeploymentStreamContentInput$outboundSchema: z.ZodType<
1584
- DeploymentStreamContentInput$Outbound,
1585
- z.ZodTypeDef,
1586
- DeploymentStreamContentInput
1587
- > = z.union([
1588
- z.string(),
1589
- z.array(z.union([
1590
- z.lazy(() => DeploymentStream2Deployments1$outboundSchema),
1591
- z.lazy(() => DeploymentStream22Input$outboundSchema),
1592
- ])),
1593
- ]);
1594
-
1595
- /**
1596
- * @internal
1597
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1598
- */
1599
- export namespace DeploymentStreamContentInput$ {
1600
- /** @deprecated use `DeploymentStreamContentInput$inboundSchema` instead. */
1601
- export const inboundSchema = DeploymentStreamContentInput$inboundSchema;
1602
- /** @deprecated use `DeploymentStreamContentInput$outboundSchema` instead. */
1603
- export const outboundSchema = DeploymentStreamContentInput$outboundSchema;
1604
- /** @deprecated use `DeploymentStreamContentInput$Outbound` instead. */
1605
- export type Outbound = DeploymentStreamContentInput$Outbound;
1606
- }
1607
-
1608
- export function deploymentStreamContentInputToJSON(
1609
- deploymentStreamContentInput: DeploymentStreamContentInput,
1610
- ): string {
1611
- return JSON.stringify(
1612
- DeploymentStreamContentInput$outboundSchema.parse(
1613
- deploymentStreamContentInput,
1614
- ),
1615
- );
1616
- }
1617
-
1618
- export function deploymentStreamContentInputFromJSON(
1619
- jsonString: string,
1620
- ): SafeParseResult<DeploymentStreamContentInput, SDKValidationError> {
1621
- return safeParse(
1622
- jsonString,
1623
- (x) => DeploymentStreamContentInput$inboundSchema.parse(JSON.parse(x)),
1624
- `Failed to parse 'DeploymentStreamContentInput' from JSON`,
1625
- );
1626
- }
1627
-
1628
- /** @internal */
1629
- export const DeploymentStreamDeploymentsType$inboundSchema: z.ZodNativeEnum<
1630
- typeof DeploymentStreamDeploymentsType
1631
- > = z.nativeEnum(DeploymentStreamDeploymentsType);
1632
-
1633
- /** @internal */
1634
- export const DeploymentStreamDeploymentsType$outboundSchema: z.ZodNativeEnum<
1635
- typeof DeploymentStreamDeploymentsType
1636
- > = DeploymentStreamDeploymentsType$inboundSchema;
1637
-
1638
- /**
1639
- * @internal
1640
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1641
- */
1642
- export namespace DeploymentStreamDeploymentsType$ {
1643
- /** @deprecated use `DeploymentStreamDeploymentsType$inboundSchema` instead. */
1644
- export const inboundSchema = DeploymentStreamDeploymentsType$inboundSchema;
1645
- /** @deprecated use `DeploymentStreamDeploymentsType$outboundSchema` instead. */
1646
- export const outboundSchema = DeploymentStreamDeploymentsType$outboundSchema;
1647
- }
1648
-
1649
- /** @internal */
1650
- export const DeploymentStreamDeploymentsFunction$inboundSchema: z.ZodType<
1651
- DeploymentStreamDeploymentsFunction,
1652
- z.ZodTypeDef,
1653
- unknown
1654
- > = z.object({
1655
- name: z.string(),
1656
- arguments: z.string(),
1657
- });
1658
-
1659
- /** @internal */
1660
- export type DeploymentStreamDeploymentsFunction$Outbound = {
1661
- name: string;
1662
- arguments: string;
1663
- };
1664
-
1665
- /** @internal */
1666
- export const DeploymentStreamDeploymentsFunction$outboundSchema: z.ZodType<
1667
- DeploymentStreamDeploymentsFunction$Outbound,
1668
- z.ZodTypeDef,
1669
- DeploymentStreamDeploymentsFunction
1670
- > = z.object({
1671
- name: z.string(),
1672
- arguments: z.string(),
1673
- });
1674
-
1675
- /**
1676
- * @internal
1677
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1678
- */
1679
- export namespace DeploymentStreamDeploymentsFunction$ {
1680
- /** @deprecated use `DeploymentStreamDeploymentsFunction$inboundSchema` instead. */
1681
- export const inboundSchema =
1682
- DeploymentStreamDeploymentsFunction$inboundSchema;
1683
- /** @deprecated use `DeploymentStreamDeploymentsFunction$outboundSchema` instead. */
1684
- export const outboundSchema =
1685
- DeploymentStreamDeploymentsFunction$outboundSchema;
1686
- /** @deprecated use `DeploymentStreamDeploymentsFunction$Outbound` instead. */
1687
- export type Outbound = DeploymentStreamDeploymentsFunction$Outbound;
1688
- }
1689
-
1690
- export function deploymentStreamDeploymentsFunctionToJSON(
1691
- deploymentStreamDeploymentsFunction: DeploymentStreamDeploymentsFunction,
1692
- ): string {
1693
- return JSON.stringify(
1694
- DeploymentStreamDeploymentsFunction$outboundSchema.parse(
1695
- deploymentStreamDeploymentsFunction,
1696
- ),
1697
- );
1698
- }
1699
-
1700
- export function deploymentStreamDeploymentsFunctionFromJSON(
1701
- jsonString: string,
1702
- ): SafeParseResult<DeploymentStreamDeploymentsFunction, SDKValidationError> {
1703
- return safeParse(
1704
- jsonString,
1705
- (x) =>
1706
- DeploymentStreamDeploymentsFunction$inboundSchema.parse(JSON.parse(x)),
1707
- `Failed to parse 'DeploymentStreamDeploymentsFunction' from JSON`,
1708
- );
1709
- }
1710
-
1711
- /** @internal */
1712
- export const DeploymentStreamDeploymentsToolCalls$inboundSchema: z.ZodType<
1713
- DeploymentStreamDeploymentsToolCalls,
1714
- z.ZodTypeDef,
1715
- unknown
1716
- > = z.object({
1717
- id: z.string().optional(),
1718
- index: z.number().optional(),
1719
- type: DeploymentStreamDeploymentsType$inboundSchema,
1720
- function: z.lazy(() => DeploymentStreamDeploymentsFunction$inboundSchema),
1721
- });
1722
-
1723
- /** @internal */
1724
- export type DeploymentStreamDeploymentsToolCalls$Outbound = {
1725
- id?: string | undefined;
1726
- index?: number | undefined;
1727
- type: string;
1728
- function: DeploymentStreamDeploymentsFunction$Outbound;
1729
- };
1730
-
1731
- /** @internal */
1732
- export const DeploymentStreamDeploymentsToolCalls$outboundSchema: z.ZodType<
1733
- DeploymentStreamDeploymentsToolCalls$Outbound,
1734
- z.ZodTypeDef,
1735
- DeploymentStreamDeploymentsToolCalls
1736
- > = z.object({
1737
- id: z.string().optional(),
1738
- index: z.number().optional(),
1739
- type: DeploymentStreamDeploymentsType$outboundSchema,
1740
- function: z.lazy(() => DeploymentStreamDeploymentsFunction$outboundSchema),
1741
- });
1742
-
1743
- /**
1744
- * @internal
1745
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1746
- */
1747
- export namespace DeploymentStreamDeploymentsToolCalls$ {
1748
- /** @deprecated use `DeploymentStreamDeploymentsToolCalls$inboundSchema` instead. */
1749
- export const inboundSchema =
1750
- DeploymentStreamDeploymentsToolCalls$inboundSchema;
1751
- /** @deprecated use `DeploymentStreamDeploymentsToolCalls$outboundSchema` instead. */
1752
- export const outboundSchema =
1753
- DeploymentStreamDeploymentsToolCalls$outboundSchema;
1754
- /** @deprecated use `DeploymentStreamDeploymentsToolCalls$Outbound` instead. */
1755
- export type Outbound = DeploymentStreamDeploymentsToolCalls$Outbound;
1756
- }
1757
-
1758
- export function deploymentStreamDeploymentsToolCallsToJSON(
1759
- deploymentStreamDeploymentsToolCalls: DeploymentStreamDeploymentsToolCalls,
1760
- ): string {
1761
- return JSON.stringify(
1762
- DeploymentStreamDeploymentsToolCalls$outboundSchema.parse(
1763
- deploymentStreamDeploymentsToolCalls,
1764
- ),
1765
- );
1766
- }
1767
-
1768
- export function deploymentStreamDeploymentsToolCallsFromJSON(
1769
- jsonString: string,
1770
- ): SafeParseResult<DeploymentStreamDeploymentsToolCalls, SDKValidationError> {
1771
- return safeParse(
1772
- jsonString,
1773
- (x) =>
1774
- DeploymentStreamDeploymentsToolCalls$inboundSchema.parse(JSON.parse(x)),
1775
- `Failed to parse 'DeploymentStreamDeploymentsToolCalls' from JSON`,
1776
- );
1777
- }
1778
-
1779
- /** @internal */
1780
- export const DeploymentStreamMessages$inboundSchema: z.ZodType<
1781
- DeploymentStreamMessages,
1782
- z.ZodTypeDef,
1783
- unknown
1784
- > = z.object({
1785
- role: DeploymentStreamDeploymentsRole$inboundSchema,
1786
- content: z.union([
1787
- z.string(),
1788
- z.array(z.union([
1789
- z.lazy(() => DeploymentStream2Deployments1$inboundSchema),
1790
- z.lazy(() => DeploymentStream22Input$inboundSchema),
1791
- ])),
1792
- ]),
1793
- tool_calls: z.array(
1794
- z.lazy(() => DeploymentStreamDeploymentsToolCalls$inboundSchema),
1795
- ).optional(),
1796
- }).transform((v) => {
1797
- return remap$(v, {
1798
- "tool_calls": "toolCalls",
1799
- });
1800
- });
1801
-
1802
- /** @internal */
1803
- export type DeploymentStreamMessages$Outbound = {
1804
- role: string;
1805
- content:
1806
- | string
1807
- | Array<
1808
- DeploymentStream2Deployments1$Outbound | DeploymentStream22Input$Outbound
1809
- >;
1810
- tool_calls?: Array<DeploymentStreamDeploymentsToolCalls$Outbound> | undefined;
1811
- };
1812
-
1813
- /** @internal */
1814
- export const DeploymentStreamMessages$outboundSchema: z.ZodType<
1815
- DeploymentStreamMessages$Outbound,
1816
- z.ZodTypeDef,
1817
- DeploymentStreamMessages
1818
- > = z.object({
1819
- role: DeploymentStreamDeploymentsRole$outboundSchema,
1820
- content: z.union([
1821
- z.string(),
1822
- z.array(z.union([
1823
- z.lazy(() => DeploymentStream2Deployments1$outboundSchema),
1824
- z.lazy(() => DeploymentStream22Input$outboundSchema),
1825
- ])),
1826
- ]),
1827
- toolCalls: z.array(
1828
- z.lazy(() => DeploymentStreamDeploymentsToolCalls$outboundSchema),
1829
- ).optional(),
1830
- }).transform((v) => {
1831
- return remap$(v, {
1832
- toolCalls: "tool_calls",
1833
- });
1834
- });
1835
-
1836
- /**
1837
- * @internal
1838
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1839
- */
1840
- export namespace DeploymentStreamMessages$ {
1841
- /** @deprecated use `DeploymentStreamMessages$inboundSchema` instead. */
1842
- export const inboundSchema = DeploymentStreamMessages$inboundSchema;
1843
- /** @deprecated use `DeploymentStreamMessages$outboundSchema` instead. */
1844
- export const outboundSchema = DeploymentStreamMessages$outboundSchema;
1845
- /** @deprecated use `DeploymentStreamMessages$Outbound` instead. */
1846
- export type Outbound = DeploymentStreamMessages$Outbound;
1847
- }
1848
-
1849
- export function deploymentStreamMessagesToJSON(
1850
- deploymentStreamMessages: DeploymentStreamMessages,
1851
- ): string {
1852
- return JSON.stringify(
1853
- DeploymentStreamMessages$outboundSchema.parse(deploymentStreamMessages),
1854
- );
1855
- }
1856
-
1857
- export function deploymentStreamMessagesFromJSON(
1858
- jsonString: string,
1859
- ): SafeParseResult<DeploymentStreamMessages, SDKValidationError> {
1860
- return safeParse(
1861
- jsonString,
1862
- (x) => DeploymentStreamMessages$inboundSchema.parse(JSON.parse(x)),
1863
- `Failed to parse 'DeploymentStreamMessages' from JSON`,
1864
- );
1865
- }
1866
-
1867
- /** @internal */
1868
- export const DeploymentStreamMetadata$inboundSchema: z.ZodType<
1869
- DeploymentStreamMetadata,
1870
- z.ZodTypeDef,
1871
- unknown
1872
- > = z.object({
1873
- file_name: z.string().optional(),
1874
- file_type: z.string().optional(),
1875
- page_number: z.number().optional(),
1876
- }).transform((v) => {
1877
- return remap$(v, {
1878
- "file_name": "fileName",
1879
- "file_type": "fileType",
1880
- "page_number": "pageNumber",
1881
- });
1882
- });
1883
-
1884
- /** @internal */
1885
- export type DeploymentStreamMetadata$Outbound = {
1886
- file_name?: string | undefined;
1887
- file_type?: string | undefined;
1888
- page_number?: number | undefined;
1889
- };
1890
-
1891
- /** @internal */
1892
- export const DeploymentStreamMetadata$outboundSchema: z.ZodType<
1893
- DeploymentStreamMetadata$Outbound,
1894
- z.ZodTypeDef,
1895
- DeploymentStreamMetadata
1896
- > = z.object({
1897
- fileName: z.string().optional(),
1898
- fileType: z.string().optional(),
1899
- pageNumber: z.number().optional(),
1900
- }).transform((v) => {
1901
- return remap$(v, {
1902
- fileName: "file_name",
1903
- fileType: "file_type",
1904
- pageNumber: "page_number",
1905
- });
1906
- });
1907
-
1908
- /**
1909
- * @internal
1910
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1911
- */
1912
- export namespace DeploymentStreamMetadata$ {
1913
- /** @deprecated use `DeploymentStreamMetadata$inboundSchema` instead. */
1914
- export const inboundSchema = DeploymentStreamMetadata$inboundSchema;
1915
- /** @deprecated use `DeploymentStreamMetadata$outboundSchema` instead. */
1916
- export const outboundSchema = DeploymentStreamMetadata$outboundSchema;
1917
- /** @deprecated use `DeploymentStreamMetadata$Outbound` instead. */
1918
- export type Outbound = DeploymentStreamMetadata$Outbound;
1919
- }
1920
-
1921
- export function deploymentStreamMetadataToJSON(
1922
- deploymentStreamMetadata: DeploymentStreamMetadata,
1923
- ): string {
1924
- return JSON.stringify(
1925
- DeploymentStreamMetadata$outboundSchema.parse(deploymentStreamMetadata),
1926
- );
1927
- }
1928
-
1929
- export function deploymentStreamMetadataFromJSON(
1930
- jsonString: string,
1931
- ): SafeParseResult<DeploymentStreamMetadata, SDKValidationError> {
1932
- return safeParse(
1933
- jsonString,
1934
- (x) => DeploymentStreamMetadata$inboundSchema.parse(JSON.parse(x)),
1935
- `Failed to parse 'DeploymentStreamMetadata' from JSON`,
1936
- );
1937
- }
1938
-
1939
- /** @internal */
1940
- export const DeploymentStreamDocuments$inboundSchema: z.ZodType<
1941
- DeploymentStreamDocuments,
1942
- z.ZodTypeDef,
1943
- unknown
1944
- > = z.object({
1945
- text: z.string(),
1946
- metadata: z.lazy(() => DeploymentStreamMetadata$inboundSchema).optional(),
1947
- });
1948
-
1949
- /** @internal */
1950
- export type DeploymentStreamDocuments$Outbound = {
1951
- text: string;
1952
- metadata?: DeploymentStreamMetadata$Outbound | undefined;
1953
- };
1954
-
1955
- /** @internal */
1956
- export const DeploymentStreamDocuments$outboundSchema: z.ZodType<
1957
- DeploymentStreamDocuments$Outbound,
1958
- z.ZodTypeDef,
1959
- DeploymentStreamDocuments
1960
- > = z.object({
1961
- text: z.string(),
1962
- metadata: z.lazy(() => DeploymentStreamMetadata$outboundSchema).optional(),
1963
- });
1964
-
1965
- /**
1966
- * @internal
1967
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1968
- */
1969
- export namespace DeploymentStreamDocuments$ {
1970
- /** @deprecated use `DeploymentStreamDocuments$inboundSchema` instead. */
1971
- export const inboundSchema = DeploymentStreamDocuments$inboundSchema;
1972
- /** @deprecated use `DeploymentStreamDocuments$outboundSchema` instead. */
1973
- export const outboundSchema = DeploymentStreamDocuments$outboundSchema;
1974
- /** @deprecated use `DeploymentStreamDocuments$Outbound` instead. */
1975
- export type Outbound = DeploymentStreamDocuments$Outbound;
1976
- }
1977
-
1978
- export function deploymentStreamDocumentsToJSON(
1979
- deploymentStreamDocuments: DeploymentStreamDocuments,
1980
- ): string {
1981
- return JSON.stringify(
1982
- DeploymentStreamDocuments$outboundSchema.parse(deploymentStreamDocuments),
1983
- );
1984
- }
1985
-
1986
- export function deploymentStreamDocumentsFromJSON(
1987
- jsonString: string,
1988
- ): SafeParseResult<DeploymentStreamDocuments, SDKValidationError> {
1989
- return safeParse(
1990
- jsonString,
1991
- (x) => DeploymentStreamDocuments$inboundSchema.parse(JSON.parse(x)),
1992
- `Failed to parse 'DeploymentStreamDocuments' from JSON`,
1993
- );
1994
- }
1995
-
1996
- /** @internal */
1997
- export const DeploymentStreamInvokeOptions$inboundSchema: z.ZodType<
1998
- DeploymentStreamInvokeOptions,
1999
- z.ZodTypeDef,
2000
- unknown
2001
- > = z.object({
2002
- include_retrievals: z.boolean().default(false),
2003
- }).transform((v) => {
2004
- return remap$(v, {
2005
- "include_retrievals": "includeRetrievals",
2006
- });
2007
- });
2008
-
2009
- /** @internal */
2010
- export type DeploymentStreamInvokeOptions$Outbound = {
2011
- include_retrievals: boolean;
2012
- };
2013
-
2014
- /** @internal */
2015
- export const DeploymentStreamInvokeOptions$outboundSchema: z.ZodType<
2016
- DeploymentStreamInvokeOptions$Outbound,
2017
- z.ZodTypeDef,
2018
- DeploymentStreamInvokeOptions
2019
- > = z.object({
2020
- includeRetrievals: z.boolean().default(false),
2021
- }).transform((v) => {
2022
- return remap$(v, {
2023
- includeRetrievals: "include_retrievals",
2024
- });
2025
- });
2026
-
2027
- /**
2028
- * @internal
2029
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2030
- */
2031
- export namespace DeploymentStreamInvokeOptions$ {
2032
- /** @deprecated use `DeploymentStreamInvokeOptions$inboundSchema` instead. */
2033
- export const inboundSchema = DeploymentStreamInvokeOptions$inboundSchema;
2034
- /** @deprecated use `DeploymentStreamInvokeOptions$outboundSchema` instead. */
2035
- export const outboundSchema = DeploymentStreamInvokeOptions$outboundSchema;
2036
- /** @deprecated use `DeploymentStreamInvokeOptions$Outbound` instead. */
2037
- export type Outbound = DeploymentStreamInvokeOptions$Outbound;
2038
- }
2039
-
2040
- export function deploymentStreamInvokeOptionsToJSON(
2041
- deploymentStreamInvokeOptions: DeploymentStreamInvokeOptions,
2042
- ): string {
2043
- return JSON.stringify(
2044
- DeploymentStreamInvokeOptions$outboundSchema.parse(
2045
- deploymentStreamInvokeOptions,
2046
- ),
2047
- );
2048
- }
2049
-
2050
- export function deploymentStreamInvokeOptionsFromJSON(
2051
- jsonString: string,
2052
- ): SafeParseResult<DeploymentStreamInvokeOptions, SDKValidationError> {
2053
- return safeParse(
2054
- jsonString,
2055
- (x) => DeploymentStreamInvokeOptions$inboundSchema.parse(JSON.parse(x)),
2056
- `Failed to parse 'DeploymentStreamInvokeOptions' from JSON`,
2057
- );
2058
- }
2059
-
2060
- /** @internal */
2061
- export const DeploymentStreamRequestBody$inboundSchema: z.ZodType<
2062
- DeploymentStreamRequestBody,
2063
- z.ZodTypeDef,
2064
- unknown
2065
- > = z.object({
2066
- key: z.string(),
2067
- inputs: z.record(z.union([z.string(), z.number(), z.boolean()])).optional(),
2068
- context: z.record(z.any()).optional(),
2069
- prefix_messages: z.array(
2070
- z.lazy(() => DeploymentStreamPrefixMessages$inboundSchema),
2071
- ).optional(),
2072
- messages: z.array(z.lazy(() => DeploymentStreamMessages$inboundSchema))
2073
- .optional(),
2074
- file_ids: z.array(z.string()).optional(),
2075
- metadata: z.record(z.any()).optional(),
2076
- extra_params: z.record(z.any()).optional(),
2077
- documents: z.array(z.lazy(() => DeploymentStreamDocuments$inboundSchema))
2078
- .optional(),
2079
- invoke_options: z.lazy(() => DeploymentStreamInvokeOptions$inboundSchema)
2080
- .optional(),
2081
- }).transform((v) => {
2082
- return remap$(v, {
2083
- "prefix_messages": "prefixMessages",
2084
- "file_ids": "fileIds",
2085
- "extra_params": "extraParams",
2086
- "invoke_options": "invokeOptions",
2087
- });
2088
- });
2089
-
2090
- /** @internal */
2091
- export type DeploymentStreamRequestBody$Outbound = {
2092
- key: string;
2093
- inputs?: { [k: string]: string | number | boolean } | undefined;
2094
- context?: { [k: string]: any } | undefined;
2095
- prefix_messages?: Array<DeploymentStreamPrefixMessages$Outbound> | undefined;
2096
- messages?: Array<DeploymentStreamMessages$Outbound> | undefined;
2097
- file_ids?: Array<string> | undefined;
2098
- metadata?: { [k: string]: any } | undefined;
2099
- extra_params?: { [k: string]: any } | undefined;
2100
- documents?: Array<DeploymentStreamDocuments$Outbound> | undefined;
2101
- invoke_options?: DeploymentStreamInvokeOptions$Outbound | undefined;
2102
- };
2103
-
2104
- /** @internal */
2105
- export const DeploymentStreamRequestBody$outboundSchema: z.ZodType<
2106
- DeploymentStreamRequestBody$Outbound,
2107
- z.ZodTypeDef,
2108
- DeploymentStreamRequestBody
2109
- > = z.object({
2110
- key: z.string(),
2111
- inputs: z.record(z.union([z.string(), z.number(), z.boolean()])).optional(),
2112
- context: z.record(z.any()).optional(),
2113
- prefixMessages: z.array(
2114
- z.lazy(() => DeploymentStreamPrefixMessages$outboundSchema),
2115
- ).optional(),
2116
- messages: z.array(z.lazy(() => DeploymentStreamMessages$outboundSchema))
2117
- .optional(),
2118
- fileIds: z.array(z.string()).optional(),
2119
- metadata: z.record(z.any()).optional(),
2120
- extraParams: z.record(z.any()).optional(),
2121
- documents: z.array(z.lazy(() => DeploymentStreamDocuments$outboundSchema))
2122
- .optional(),
2123
- invokeOptions: z.lazy(() => DeploymentStreamInvokeOptions$outboundSchema)
2124
- .optional(),
2125
- }).transform((v) => {
2126
- return remap$(v, {
2127
- prefixMessages: "prefix_messages",
2128
- fileIds: "file_ids",
2129
- extraParams: "extra_params",
2130
- invokeOptions: "invoke_options",
2131
- });
2132
- });
2133
-
2134
- /**
2135
- * @internal
2136
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2137
- */
2138
- export namespace DeploymentStreamRequestBody$ {
2139
- /** @deprecated use `DeploymentStreamRequestBody$inboundSchema` instead. */
2140
- export const inboundSchema = DeploymentStreamRequestBody$inboundSchema;
2141
- /** @deprecated use `DeploymentStreamRequestBody$outboundSchema` instead. */
2142
- export const outboundSchema = DeploymentStreamRequestBody$outboundSchema;
2143
- /** @deprecated use `DeploymentStreamRequestBody$Outbound` instead. */
2144
- export type Outbound = DeploymentStreamRequestBody$Outbound;
2145
- }
2146
-
2147
- export function deploymentStreamRequestBodyToJSON(
2148
- deploymentStreamRequestBody: DeploymentStreamRequestBody,
2149
- ): string {
2150
- return JSON.stringify(
2151
- DeploymentStreamRequestBody$outboundSchema.parse(
2152
- deploymentStreamRequestBody,
2153
- ),
2154
- );
2155
- }
2156
-
2157
- export function deploymentStreamRequestBodyFromJSON(
2158
- jsonString: string,
2159
- ): SafeParseResult<DeploymentStreamRequestBody, SDKValidationError> {
2160
- return safeParse(
2161
- jsonString,
2162
- (x) => DeploymentStreamRequestBody$inboundSchema.parse(JSON.parse(x)),
2163
- `Failed to parse 'DeploymentStreamRequestBody' from JSON`,
2164
- );
2165
- }
2166
-
2167
- /** @internal */
2168
- export const DeploymentStreamObject$inboundSchema: z.ZodNativeEnum<
2169
- typeof DeploymentStreamObject
2170
- > = z.nativeEnum(DeploymentStreamObject);
2171
-
2172
- /** @internal */
2173
- export const DeploymentStreamObject$outboundSchema: z.ZodNativeEnum<
2174
- typeof DeploymentStreamObject
2175
- > = DeploymentStreamObject$inboundSchema;
2176
-
2177
- /**
2178
- * @internal
2179
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2180
- */
2181
- export namespace DeploymentStreamObject$ {
2182
- /** @deprecated use `DeploymentStreamObject$inboundSchema` instead. */
2183
- export const inboundSchema = DeploymentStreamObject$inboundSchema;
2184
- /** @deprecated use `DeploymentStreamObject$outboundSchema` instead. */
2185
- export const outboundSchema = DeploymentStreamObject$outboundSchema;
2186
- }
2187
-
2188
- /** @internal */
2189
- export const DeploymentStreamProvider$inboundSchema: z.ZodNativeEnum<
2190
- typeof DeploymentStreamProvider
2191
- > = z.nativeEnum(DeploymentStreamProvider);
2192
-
2193
- /** @internal */
2194
- export const DeploymentStreamProvider$outboundSchema: z.ZodNativeEnum<
2195
- typeof DeploymentStreamProvider
2196
- > = DeploymentStreamProvider$inboundSchema;
2197
-
2198
- /**
2199
- * @internal
2200
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2201
- */
2202
- export namespace DeploymentStreamProvider$ {
2203
- /** @deprecated use `DeploymentStreamProvider$inboundSchema` instead. */
2204
- export const inboundSchema = DeploymentStreamProvider$inboundSchema;
2205
- /** @deprecated use `DeploymentStreamProvider$outboundSchema` instead. */
2206
- export const outboundSchema = DeploymentStreamProvider$outboundSchema;
2207
- }
2208
-
2209
- /** @internal */
2210
- export const DeploymentStreamMessageDeploymentsResponseRole$inboundSchema:
2211
- z.ZodNativeEnum<typeof DeploymentStreamMessageDeploymentsResponseRole> = z
2212
- .nativeEnum(DeploymentStreamMessageDeploymentsResponseRole);
2213
-
2214
- /** @internal */
2215
- export const DeploymentStreamMessageDeploymentsResponseRole$outboundSchema:
2216
- z.ZodNativeEnum<typeof DeploymentStreamMessageDeploymentsResponseRole> =
2217
- DeploymentStreamMessageDeploymentsResponseRole$inboundSchema;
2218
-
2219
- /**
2220
- * @internal
2221
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2222
- */
2223
- export namespace DeploymentStreamMessageDeploymentsResponseRole$ {
2224
- /** @deprecated use `DeploymentStreamMessageDeploymentsResponseRole$inboundSchema` instead. */
2225
- export const inboundSchema =
2226
- DeploymentStreamMessageDeploymentsResponseRole$inboundSchema;
2227
- /** @deprecated use `DeploymentStreamMessageDeploymentsResponseRole$outboundSchema` instead. */
2228
- export const outboundSchema =
2229
- DeploymentStreamMessageDeploymentsResponseRole$outboundSchema;
2230
- }
2231
-
2232
- /** @internal */
2233
- export const DeploymentStreamMessage3$inboundSchema: z.ZodType<
2234
- DeploymentStreamMessage3,
2235
- z.ZodTypeDef,
2236
- unknown
2237
- > = z.object({
2238
- role: DeploymentStreamMessageDeploymentsResponseRole$inboundSchema,
2239
- url: z.string(),
2240
- });
2241
-
2242
- /** @internal */
2243
- export type DeploymentStreamMessage3$Outbound = {
2244
- role: string;
2245
- url: string;
2246
- };
2247
-
2248
- /** @internal */
2249
- export const DeploymentStreamMessage3$outboundSchema: z.ZodType<
2250
- DeploymentStreamMessage3$Outbound,
2251
- z.ZodTypeDef,
2252
- DeploymentStreamMessage3
2253
- > = z.object({
2254
- role: DeploymentStreamMessageDeploymentsResponseRole$outboundSchema,
2255
- url: z.string(),
2256
- });
2257
-
2258
- /**
2259
- * @internal
2260
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2261
- */
2262
- export namespace DeploymentStreamMessage3$ {
2263
- /** @deprecated use `DeploymentStreamMessage3$inboundSchema` instead. */
2264
- export const inboundSchema = DeploymentStreamMessage3$inboundSchema;
2265
- /** @deprecated use `DeploymentStreamMessage3$outboundSchema` instead. */
2266
- export const outboundSchema = DeploymentStreamMessage3$outboundSchema;
2267
- /** @deprecated use `DeploymentStreamMessage3$Outbound` instead. */
2268
- export type Outbound = DeploymentStreamMessage3$Outbound;
2269
- }
2270
-
2271
- export function deploymentStreamMessage3ToJSON(
2272
- deploymentStreamMessage3: DeploymentStreamMessage3,
2273
- ): string {
2274
- return JSON.stringify(
2275
- DeploymentStreamMessage3$outboundSchema.parse(deploymentStreamMessage3),
2276
- );
2277
- }
2278
-
2279
- export function deploymentStreamMessage3FromJSON(
2280
- jsonString: string,
2281
- ): SafeParseResult<DeploymentStreamMessage3, SDKValidationError> {
2282
- return safeParse(
2283
- jsonString,
2284
- (x) => DeploymentStreamMessage3$inboundSchema.parse(JSON.parse(x)),
2285
- `Failed to parse 'DeploymentStreamMessage3' from JSON`,
2286
- );
2287
- }
2288
-
2289
- /** @internal */
2290
- export const DeploymentStreamMessageDeploymentsRole$inboundSchema:
2291
- z.ZodNativeEnum<typeof DeploymentStreamMessageDeploymentsRole> = z.nativeEnum(
2292
- DeploymentStreamMessageDeploymentsRole,
2293
- );
2294
-
2295
- /** @internal */
2296
- export const DeploymentStreamMessageDeploymentsRole$outboundSchema:
2297
- z.ZodNativeEnum<typeof DeploymentStreamMessageDeploymentsRole> =
2298
- DeploymentStreamMessageDeploymentsRole$inboundSchema;
2299
-
2300
- /**
2301
- * @internal
2302
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2303
- */
2304
- export namespace DeploymentStreamMessageDeploymentsRole$ {
2305
- /** @deprecated use `DeploymentStreamMessageDeploymentsRole$inboundSchema` instead. */
2306
- export const inboundSchema =
2307
- DeploymentStreamMessageDeploymentsRole$inboundSchema;
2308
- /** @deprecated use `DeploymentStreamMessageDeploymentsRole$outboundSchema` instead. */
2309
- export const outboundSchema =
2310
- DeploymentStreamMessageDeploymentsRole$outboundSchema;
2311
- }
2312
-
2313
- /** @internal */
2314
- export const DeploymentStreamMessage2$inboundSchema: z.ZodType<
2315
- DeploymentStreamMessage2,
2316
- z.ZodTypeDef,
2317
- unknown
2318
- > = z.object({
2319
- role: DeploymentStreamMessageDeploymentsRole$inboundSchema,
2320
- content: z.nullable(z.string()),
2321
- });
2322
-
2323
- /** @internal */
2324
- export type DeploymentStreamMessage2$Outbound = {
2325
- role: string;
2326
- content: string | null;
2327
- };
2328
-
2329
- /** @internal */
2330
- export const DeploymentStreamMessage2$outboundSchema: z.ZodType<
2331
- DeploymentStreamMessage2$Outbound,
2332
- z.ZodTypeDef,
2333
- DeploymentStreamMessage2
2334
- > = z.object({
2335
- role: DeploymentStreamMessageDeploymentsRole$outboundSchema,
2336
- content: z.nullable(z.string()),
2337
- });
2338
-
2339
- /**
2340
- * @internal
2341
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2342
- */
2343
- export namespace DeploymentStreamMessage2$ {
2344
- /** @deprecated use `DeploymentStreamMessage2$inboundSchema` instead. */
2345
- export const inboundSchema = DeploymentStreamMessage2$inboundSchema;
2346
- /** @deprecated use `DeploymentStreamMessage2$outboundSchema` instead. */
2347
- export const outboundSchema = DeploymentStreamMessage2$outboundSchema;
2348
- /** @deprecated use `DeploymentStreamMessage2$Outbound` instead. */
2349
- export type Outbound = DeploymentStreamMessage2$Outbound;
2350
- }
2351
-
2352
- export function deploymentStreamMessage2ToJSON(
2353
- deploymentStreamMessage2: DeploymentStreamMessage2,
2354
- ): string {
2355
- return JSON.stringify(
2356
- DeploymentStreamMessage2$outboundSchema.parse(deploymentStreamMessage2),
2357
- );
2358
- }
2359
-
2360
- export function deploymentStreamMessage2FromJSON(
2361
- jsonString: string,
2362
- ): SafeParseResult<DeploymentStreamMessage2, SDKValidationError> {
2363
- return safeParse(
2364
- jsonString,
2365
- (x) => DeploymentStreamMessage2$inboundSchema.parse(JSON.parse(x)),
2366
- `Failed to parse 'DeploymentStreamMessage2' from JSON`,
2367
- );
2368
- }
2369
-
2370
- /** @internal */
2371
- export const DeploymentStreamMessageRole$inboundSchema: z.ZodNativeEnum<
2372
- typeof DeploymentStreamMessageRole
2373
- > = z.nativeEnum(DeploymentStreamMessageRole);
2374
-
2375
- /** @internal */
2376
- export const DeploymentStreamMessageRole$outboundSchema: z.ZodNativeEnum<
2377
- typeof DeploymentStreamMessageRole
2378
- > = DeploymentStreamMessageRole$inboundSchema;
2379
-
2380
- /**
2381
- * @internal
2382
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2383
- */
2384
- export namespace DeploymentStreamMessageRole$ {
2385
- /** @deprecated use `DeploymentStreamMessageRole$inboundSchema` instead. */
2386
- export const inboundSchema = DeploymentStreamMessageRole$inboundSchema;
2387
- /** @deprecated use `DeploymentStreamMessageRole$outboundSchema` instead. */
2388
- export const outboundSchema = DeploymentStreamMessageRole$outboundSchema;
2389
- }
2390
-
2391
- /** @internal */
2392
- export const DeploymentStreamMessageType$inboundSchema: z.ZodNativeEnum<
2393
- typeof DeploymentStreamMessageType
2394
- > = z.nativeEnum(DeploymentStreamMessageType);
2395
-
2396
- /** @internal */
2397
- export const DeploymentStreamMessageType$outboundSchema: z.ZodNativeEnum<
2398
- typeof DeploymentStreamMessageType
2399
- > = DeploymentStreamMessageType$inboundSchema;
2400
-
2401
- /**
2402
- * @internal
2403
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2404
- */
2405
- export namespace DeploymentStreamMessageType$ {
2406
- /** @deprecated use `DeploymentStreamMessageType$inboundSchema` instead. */
2407
- export const inboundSchema = DeploymentStreamMessageType$inboundSchema;
2408
- /** @deprecated use `DeploymentStreamMessageType$outboundSchema` instead. */
2409
- export const outboundSchema = DeploymentStreamMessageType$outboundSchema;
2410
- }
2411
-
2412
- /** @internal */
2413
- export const DeploymentStreamMessageFunction$inboundSchema: z.ZodType<
2414
- DeploymentStreamMessageFunction,
2415
- z.ZodTypeDef,
2416
- unknown
2417
- > = z.object({
2418
- name: z.string(),
2419
- arguments: z.string(),
2420
- });
2421
-
2422
- /** @internal */
2423
- export type DeploymentStreamMessageFunction$Outbound = {
2424
- name: string;
2425
- arguments: string;
2426
- };
2427
-
2428
- /** @internal */
2429
- export const DeploymentStreamMessageFunction$outboundSchema: z.ZodType<
2430
- DeploymentStreamMessageFunction$Outbound,
2431
- z.ZodTypeDef,
2432
- DeploymentStreamMessageFunction
2433
- > = z.object({
2434
- name: z.string(),
2435
- arguments: z.string(),
2436
- });
2437
-
2438
- /**
2439
- * @internal
2440
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2441
- */
2442
- export namespace DeploymentStreamMessageFunction$ {
2443
- /** @deprecated use `DeploymentStreamMessageFunction$inboundSchema` instead. */
2444
- export const inboundSchema = DeploymentStreamMessageFunction$inboundSchema;
2445
- /** @deprecated use `DeploymentStreamMessageFunction$outboundSchema` instead. */
2446
- export const outboundSchema = DeploymentStreamMessageFunction$outboundSchema;
2447
- /** @deprecated use `DeploymentStreamMessageFunction$Outbound` instead. */
2448
- export type Outbound = DeploymentStreamMessageFunction$Outbound;
2449
- }
2450
-
2451
- export function deploymentStreamMessageFunctionToJSON(
2452
- deploymentStreamMessageFunction: DeploymentStreamMessageFunction,
2453
- ): string {
2454
- return JSON.stringify(
2455
- DeploymentStreamMessageFunction$outboundSchema.parse(
2456
- deploymentStreamMessageFunction,
2457
- ),
2458
- );
2459
- }
2460
-
2461
- export function deploymentStreamMessageFunctionFromJSON(
2462
- jsonString: string,
2463
- ): SafeParseResult<DeploymentStreamMessageFunction, SDKValidationError> {
2464
- return safeParse(
2465
- jsonString,
2466
- (x) => DeploymentStreamMessageFunction$inboundSchema.parse(JSON.parse(x)),
2467
- `Failed to parse 'DeploymentStreamMessageFunction' from JSON`,
2468
- );
2469
- }
2470
-
2471
- /** @internal */
2472
- export const DeploymentStreamMessageToolCalls$inboundSchema: z.ZodType<
2473
- DeploymentStreamMessageToolCalls,
2474
- z.ZodTypeDef,
2475
- unknown
2476
- > = z.object({
2477
- id: z.string().optional(),
2478
- index: z.number().optional(),
2479
- type: DeploymentStreamMessageType$inboundSchema,
2480
- function: z.lazy(() => DeploymentStreamMessageFunction$inboundSchema),
2481
- });
2482
-
2483
- /** @internal */
2484
- export type DeploymentStreamMessageToolCalls$Outbound = {
2485
- id?: string | undefined;
2486
- index?: number | undefined;
2487
- type: string;
2488
- function: DeploymentStreamMessageFunction$Outbound;
2489
- };
2490
-
2491
- /** @internal */
2492
- export const DeploymentStreamMessageToolCalls$outboundSchema: z.ZodType<
2493
- DeploymentStreamMessageToolCalls$Outbound,
2494
- z.ZodTypeDef,
2495
- DeploymentStreamMessageToolCalls
2496
- > = z.object({
2497
- id: z.string().optional(),
2498
- index: z.number().optional(),
2499
- type: DeploymentStreamMessageType$outboundSchema,
2500
- function: z.lazy(() => DeploymentStreamMessageFunction$outboundSchema),
2501
- });
2502
-
2503
- /**
2504
- * @internal
2505
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2506
- */
2507
- export namespace DeploymentStreamMessageToolCalls$ {
2508
- /** @deprecated use `DeploymentStreamMessageToolCalls$inboundSchema` instead. */
2509
- export const inboundSchema = DeploymentStreamMessageToolCalls$inboundSchema;
2510
- /** @deprecated use `DeploymentStreamMessageToolCalls$outboundSchema` instead. */
2511
- export const outboundSchema = DeploymentStreamMessageToolCalls$outboundSchema;
2512
- /** @deprecated use `DeploymentStreamMessageToolCalls$Outbound` instead. */
2513
- export type Outbound = DeploymentStreamMessageToolCalls$Outbound;
2514
- }
2515
-
2516
- export function deploymentStreamMessageToolCallsToJSON(
2517
- deploymentStreamMessageToolCalls: DeploymentStreamMessageToolCalls,
2518
- ): string {
2519
- return JSON.stringify(
2520
- DeploymentStreamMessageToolCalls$outboundSchema.parse(
2521
- deploymentStreamMessageToolCalls,
2522
- ),
2523
- );
2524
- }
2525
-
2526
- export function deploymentStreamMessageToolCallsFromJSON(
2527
- jsonString: string,
2528
- ): SafeParseResult<DeploymentStreamMessageToolCalls, SDKValidationError> {
2529
- return safeParse(
2530
- jsonString,
2531
- (x) => DeploymentStreamMessageToolCalls$inboundSchema.parse(JSON.parse(x)),
2532
- `Failed to parse 'DeploymentStreamMessageToolCalls' from JSON`,
2533
- );
2534
- }
2535
-
2536
- /** @internal */
2537
- export const DeploymentStreamMessage1$inboundSchema: z.ZodType<
2538
- DeploymentStreamMessage1,
2539
- z.ZodTypeDef,
2540
- unknown
2541
- > = z.object({
2542
- role: DeploymentStreamMessageRole$inboundSchema,
2543
- content: z.nullable(z.string()).optional(),
2544
- tool_calls: z.array(
2545
- z.lazy(() => DeploymentStreamMessageToolCalls$inboundSchema),
2546
- ),
2547
- }).transform((v) => {
2548
- return remap$(v, {
2549
- "tool_calls": "toolCalls",
2550
- });
2551
- });
2552
-
2553
- /** @internal */
2554
- export type DeploymentStreamMessage1$Outbound = {
2555
- role: string;
2556
- content?: string | null | undefined;
2557
- tool_calls: Array<DeploymentStreamMessageToolCalls$Outbound>;
2558
- };
2559
-
2560
- /** @internal */
2561
- export const DeploymentStreamMessage1$outboundSchema: z.ZodType<
2562
- DeploymentStreamMessage1$Outbound,
2563
- z.ZodTypeDef,
2564
- DeploymentStreamMessage1
2565
- > = z.object({
2566
- role: DeploymentStreamMessageRole$outboundSchema,
2567
- content: z.nullable(z.string()).optional(),
2568
- toolCalls: z.array(
2569
- z.lazy(() => DeploymentStreamMessageToolCalls$outboundSchema),
2570
- ),
2571
- }).transform((v) => {
2572
- return remap$(v, {
2573
- toolCalls: "tool_calls",
2574
- });
2575
- });
2576
-
2577
- /**
2578
- * @internal
2579
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2580
- */
2581
- export namespace DeploymentStreamMessage1$ {
2582
- /** @deprecated use `DeploymentStreamMessage1$inboundSchema` instead. */
2583
- export const inboundSchema = DeploymentStreamMessage1$inboundSchema;
2584
- /** @deprecated use `DeploymentStreamMessage1$outboundSchema` instead. */
2585
- export const outboundSchema = DeploymentStreamMessage1$outboundSchema;
2586
- /** @deprecated use `DeploymentStreamMessage1$Outbound` instead. */
2587
- export type Outbound = DeploymentStreamMessage1$Outbound;
2588
- }
2589
-
2590
- export function deploymentStreamMessage1ToJSON(
2591
- deploymentStreamMessage1: DeploymentStreamMessage1,
2592
- ): string {
2593
- return JSON.stringify(
2594
- DeploymentStreamMessage1$outboundSchema.parse(deploymentStreamMessage1),
2595
- );
2596
- }
2597
-
2598
- export function deploymentStreamMessage1FromJSON(
2599
- jsonString: string,
2600
- ): SafeParseResult<DeploymentStreamMessage1, SDKValidationError> {
2601
- return safeParse(
2602
- jsonString,
2603
- (x) => DeploymentStreamMessage1$inboundSchema.parse(JSON.parse(x)),
2604
- `Failed to parse 'DeploymentStreamMessage1' from JSON`,
2605
- );
2606
- }
2607
-
2608
- /** @internal */
2609
- export const DeploymentStreamMessage$inboundSchema: z.ZodType<
2610
- DeploymentStreamMessage,
2611
- z.ZodTypeDef,
2612
- unknown
2613
- > = z.union([
2614
- z.lazy(() => DeploymentStreamMessage2$inboundSchema),
2615
- z.lazy(() => DeploymentStreamMessage3$inboundSchema),
2616
- z.lazy(() => DeploymentStreamMessage1$inboundSchema),
2617
- ]);
2618
-
2619
- /** @internal */
2620
- export type DeploymentStreamMessage$Outbound =
2621
- | DeploymentStreamMessage2$Outbound
2622
- | DeploymentStreamMessage3$Outbound
2623
- | DeploymentStreamMessage1$Outbound;
2624
-
2625
- /** @internal */
2626
- export const DeploymentStreamMessage$outboundSchema: z.ZodType<
2627
- DeploymentStreamMessage$Outbound,
2628
- z.ZodTypeDef,
2629
- DeploymentStreamMessage
2630
- > = z.union([
2631
- z.lazy(() => DeploymentStreamMessage2$outboundSchema),
2632
- z.lazy(() => DeploymentStreamMessage3$outboundSchema),
2633
- z.lazy(() => DeploymentStreamMessage1$outboundSchema),
2634
- ]);
2635
-
2636
- /**
2637
- * @internal
2638
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2639
- */
2640
- export namespace DeploymentStreamMessage$ {
2641
- /** @deprecated use `DeploymentStreamMessage$inboundSchema` instead. */
2642
- export const inboundSchema = DeploymentStreamMessage$inboundSchema;
2643
- /** @deprecated use `DeploymentStreamMessage$outboundSchema` instead. */
2644
- export const outboundSchema = DeploymentStreamMessage$outboundSchema;
2645
- /** @deprecated use `DeploymentStreamMessage$Outbound` instead. */
2646
- export type Outbound = DeploymentStreamMessage$Outbound;
2647
- }
2648
-
2649
- export function deploymentStreamMessageToJSON(
2650
- deploymentStreamMessage: DeploymentStreamMessage,
2651
- ): string {
2652
- return JSON.stringify(
2653
- DeploymentStreamMessage$outboundSchema.parse(deploymentStreamMessage),
2654
- );
2655
- }
2656
-
2657
- export function deploymentStreamMessageFromJSON(
2658
- jsonString: string,
2659
- ): SafeParseResult<DeploymentStreamMessage, SDKValidationError> {
2660
- return safeParse(
2661
- jsonString,
2662
- (x) => DeploymentStreamMessage$inboundSchema.parse(JSON.parse(x)),
2663
- `Failed to parse 'DeploymentStreamMessage' from JSON`,
2664
- );
2665
- }
2666
-
2667
- /** @internal */
2668
- export const DeploymentStreamChoices$inboundSchema: z.ZodType<
2669
- DeploymentStreamChoices,
2670
- z.ZodTypeDef,
2671
- unknown
2672
- > = z.object({
2673
- index: z.number(),
2674
- message: z.union([
2675
- z.lazy(() => DeploymentStreamMessage2$inboundSchema),
2676
- z.lazy(() => DeploymentStreamMessage3$inboundSchema),
2677
- z.lazy(() => DeploymentStreamMessage1$inboundSchema),
2678
- ]).optional(),
2679
- finish_reason: z.nullable(z.string()).optional(),
2680
- }).transform((v) => {
2681
- return remap$(v, {
2682
- "finish_reason": "finishReason",
2683
- });
2684
- });
2685
-
2686
- /** @internal */
2687
- export type DeploymentStreamChoices$Outbound = {
2688
- index: number;
2689
- message?:
2690
- | DeploymentStreamMessage2$Outbound
2691
- | DeploymentStreamMessage3$Outbound
2692
- | DeploymentStreamMessage1$Outbound
2693
- | undefined;
2694
- finish_reason?: string | null | undefined;
2695
- };
2696
-
2697
- /** @internal */
2698
- export const DeploymentStreamChoices$outboundSchema: z.ZodType<
2699
- DeploymentStreamChoices$Outbound,
2700
- z.ZodTypeDef,
2701
- DeploymentStreamChoices
2702
- > = z.object({
2703
- index: z.number(),
2704
- message: z.union([
2705
- z.lazy(() => DeploymentStreamMessage2$outboundSchema),
2706
- z.lazy(() => DeploymentStreamMessage3$outboundSchema),
2707
- z.lazy(() => DeploymentStreamMessage1$outboundSchema),
2708
- ]).optional(),
2709
- finishReason: z.nullable(z.string()).optional(),
2710
- }).transform((v) => {
2711
- return remap$(v, {
2712
- finishReason: "finish_reason",
2713
- });
2714
- });
2715
-
2716
- /**
2717
- * @internal
2718
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2719
- */
2720
- export namespace DeploymentStreamChoices$ {
2721
- /** @deprecated use `DeploymentStreamChoices$inboundSchema` instead. */
2722
- export const inboundSchema = DeploymentStreamChoices$inboundSchema;
2723
- /** @deprecated use `DeploymentStreamChoices$outboundSchema` instead. */
2724
- export const outboundSchema = DeploymentStreamChoices$outboundSchema;
2725
- /** @deprecated use `DeploymentStreamChoices$Outbound` instead. */
2726
- export type Outbound = DeploymentStreamChoices$Outbound;
2727
- }
2728
-
2729
- export function deploymentStreamChoicesToJSON(
2730
- deploymentStreamChoices: DeploymentStreamChoices,
2731
- ): string {
2732
- return JSON.stringify(
2733
- DeploymentStreamChoices$outboundSchema.parse(deploymentStreamChoices),
2734
- );
2735
- }
2736
-
2737
- export function deploymentStreamChoicesFromJSON(
2738
- jsonString: string,
2739
- ): SafeParseResult<DeploymentStreamChoices, SDKValidationError> {
2740
- return safeParse(
2741
- jsonString,
2742
- (x) => DeploymentStreamChoices$inboundSchema.parse(JSON.parse(x)),
2743
- `Failed to parse 'DeploymentStreamChoices' from JSON`,
2744
- );
2745
- }
2746
-
2747
- /** @internal */
2748
- export const DeploymentStreamDeploymentsMetadata$inboundSchema: z.ZodType<
2749
- DeploymentStreamDeploymentsMetadata,
2750
- z.ZodTypeDef,
2751
- unknown
2752
- > = z.object({
2753
- file_name: z.string(),
2754
- page_number: z.nullable(z.number()),
2755
- file_type: z.string(),
2756
- rerank_score: z.number().optional(),
2757
- search_score: z.number(),
2758
- }).transform((v) => {
2759
- return remap$(v, {
2760
- "file_name": "fileName",
2761
- "page_number": "pageNumber",
2762
- "file_type": "fileType",
2763
- "rerank_score": "rerankScore",
2764
- "search_score": "searchScore",
2765
- });
2766
- });
2767
-
2768
- /** @internal */
2769
- export type DeploymentStreamDeploymentsMetadata$Outbound = {
2770
- file_name: string;
2771
- page_number: number | null;
2772
- file_type: string;
2773
- rerank_score?: number | undefined;
2774
- search_score: number;
2775
- };
2776
-
2777
- /** @internal */
2778
- export const DeploymentStreamDeploymentsMetadata$outboundSchema: z.ZodType<
2779
- DeploymentStreamDeploymentsMetadata$Outbound,
2780
- z.ZodTypeDef,
2781
- DeploymentStreamDeploymentsMetadata
2782
- > = z.object({
2783
- fileName: z.string(),
2784
- pageNumber: z.nullable(z.number()),
2785
- fileType: z.string(),
2786
- rerankScore: z.number().optional(),
2787
- searchScore: z.number(),
2788
- }).transform((v) => {
2789
- return remap$(v, {
2790
- fileName: "file_name",
2791
- pageNumber: "page_number",
2792
- fileType: "file_type",
2793
- rerankScore: "rerank_score",
2794
- searchScore: "search_score",
2795
- });
2796
- });
2797
-
2798
- /**
2799
- * @internal
2800
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2801
- */
2802
- export namespace DeploymentStreamDeploymentsMetadata$ {
2803
- /** @deprecated use `DeploymentStreamDeploymentsMetadata$inboundSchema` instead. */
2804
- export const inboundSchema =
2805
- DeploymentStreamDeploymentsMetadata$inboundSchema;
2806
- /** @deprecated use `DeploymentStreamDeploymentsMetadata$outboundSchema` instead. */
2807
- export const outboundSchema =
2808
- DeploymentStreamDeploymentsMetadata$outboundSchema;
2809
- /** @deprecated use `DeploymentStreamDeploymentsMetadata$Outbound` instead. */
2810
- export type Outbound = DeploymentStreamDeploymentsMetadata$Outbound;
2811
- }
2812
-
2813
- export function deploymentStreamDeploymentsMetadataToJSON(
2814
- deploymentStreamDeploymentsMetadata: DeploymentStreamDeploymentsMetadata,
2815
- ): string {
2816
- return JSON.stringify(
2817
- DeploymentStreamDeploymentsMetadata$outboundSchema.parse(
2818
- deploymentStreamDeploymentsMetadata,
2819
- ),
2820
- );
2821
- }
2822
-
2823
- export function deploymentStreamDeploymentsMetadataFromJSON(
2824
- jsonString: string,
2825
- ): SafeParseResult<DeploymentStreamDeploymentsMetadata, SDKValidationError> {
2826
- return safeParse(
2827
- jsonString,
2828
- (x) =>
2829
- DeploymentStreamDeploymentsMetadata$inboundSchema.parse(JSON.parse(x)),
2830
- `Failed to parse 'DeploymentStreamDeploymentsMetadata' from JSON`,
2831
- );
2832
- }
2833
-
2834
- /** @internal */
2835
- export const DeploymentStreamRetrievals$inboundSchema: z.ZodType<
2836
- DeploymentStreamRetrievals,
2837
- z.ZodTypeDef,
2838
- unknown
2839
- > = z.object({
2840
- document: z.string(),
2841
- metadata: z.lazy(() => DeploymentStreamDeploymentsMetadata$inboundSchema),
2842
- });
2843
-
2844
- /** @internal */
2845
- export type DeploymentStreamRetrievals$Outbound = {
2846
- document: string;
2847
- metadata: DeploymentStreamDeploymentsMetadata$Outbound;
2848
- };
2849
-
2850
- /** @internal */
2851
- export const DeploymentStreamRetrievals$outboundSchema: z.ZodType<
2852
- DeploymentStreamRetrievals$Outbound,
2853
- z.ZodTypeDef,
2854
- DeploymentStreamRetrievals
2855
- > = z.object({
2856
- document: z.string(),
2857
- metadata: z.lazy(() => DeploymentStreamDeploymentsMetadata$outboundSchema),
2858
- });
2859
-
2860
- /**
2861
- * @internal
2862
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2863
- */
2864
- export namespace DeploymentStreamRetrievals$ {
2865
- /** @deprecated use `DeploymentStreamRetrievals$inboundSchema` instead. */
2866
- export const inboundSchema = DeploymentStreamRetrievals$inboundSchema;
2867
- /** @deprecated use `DeploymentStreamRetrievals$outboundSchema` instead. */
2868
- export const outboundSchema = DeploymentStreamRetrievals$outboundSchema;
2869
- /** @deprecated use `DeploymentStreamRetrievals$Outbound` instead. */
2870
- export type Outbound = DeploymentStreamRetrievals$Outbound;
2871
- }
2872
-
2873
- export function deploymentStreamRetrievalsToJSON(
2874
- deploymentStreamRetrievals: DeploymentStreamRetrievals,
2875
- ): string {
2876
- return JSON.stringify(
2877
- DeploymentStreamRetrievals$outboundSchema.parse(deploymentStreamRetrievals),
2878
- );
2879
- }
2880
-
2881
- export function deploymentStreamRetrievalsFromJSON(
2882
- jsonString: string,
2883
- ): SafeParseResult<DeploymentStreamRetrievals, SDKValidationError> {
2884
- return safeParse(
2885
- jsonString,
2886
- (x) => DeploymentStreamRetrievals$inboundSchema.parse(JSON.parse(x)),
2887
- `Failed to parse 'DeploymentStreamRetrievals' from JSON`,
2888
- );
2889
- }
2890
-
2891
- /** @internal */
2892
- export const DeploymentStreamData$inboundSchema: z.ZodType<
2893
- DeploymentStreamData,
2894
- z.ZodTypeDef,
2895
- unknown
2896
- > = z.object({
2897
- id: z.string().optional(),
2898
- created: z.string().datetime({ offset: true }).transform(v => new Date(v))
2899
- .optional(),
2900
- object: DeploymentStreamObject$inboundSchema.optional(),
2901
- model: z.string().optional(),
2902
- provider: DeploymentStreamProvider$inboundSchema.optional(),
2903
- is_final: z.boolean().optional(),
2904
- integration_id: z.string().optional(),
2905
- finalized: z.string().datetime({ offset: true }).transform(v => new Date(v))
2906
- .optional(),
2907
- system_fingerprint: z.nullable(z.string()).optional(),
2908
- choices: z.array(z.lazy(() => DeploymentStreamChoices$inboundSchema))
2909
- .optional(),
2910
- retrievals: z.array(z.lazy(() => DeploymentStreamRetrievals$inboundSchema))
2911
- .optional(),
2912
- provider_response: z.any().optional(),
2913
- }).transform((v) => {
2914
- return remap$(v, {
2915
- "is_final": "isFinal",
2916
- "integration_id": "integrationId",
2917
- "system_fingerprint": "systemFingerprint",
2918
- "provider_response": "providerResponse",
2919
- });
2920
- });
2921
-
2922
- /** @internal */
2923
- export type DeploymentStreamData$Outbound = {
2924
- id?: string | undefined;
2925
- created?: string | undefined;
2926
- object?: string | undefined;
2927
- model?: string | undefined;
2928
- provider?: string | undefined;
2929
- is_final?: boolean | undefined;
2930
- integration_id?: string | undefined;
2931
- finalized?: string | undefined;
2932
- system_fingerprint?: string | null | undefined;
2933
- choices?: Array<DeploymentStreamChoices$Outbound> | undefined;
2934
- retrievals?: Array<DeploymentStreamRetrievals$Outbound> | undefined;
2935
- provider_response?: any | undefined;
2936
- };
2937
-
2938
- /** @internal */
2939
- export const DeploymentStreamData$outboundSchema: z.ZodType<
2940
- DeploymentStreamData$Outbound,
2941
- z.ZodTypeDef,
2942
- DeploymentStreamData
2943
- > = z.object({
2944
- id: z.string().optional(),
2945
- created: z.date().transform(v => v.toISOString()).optional(),
2946
- object: DeploymentStreamObject$outboundSchema.optional(),
2947
- model: z.string().optional(),
2948
- provider: DeploymentStreamProvider$outboundSchema.optional(),
2949
- isFinal: z.boolean().optional(),
2950
- integrationId: z.string().optional(),
2951
- finalized: z.date().transform(v => v.toISOString()).optional(),
2952
- systemFingerprint: z.nullable(z.string()).optional(),
2953
- choices: z.array(z.lazy(() => DeploymentStreamChoices$outboundSchema))
2954
- .optional(),
2955
- retrievals: z.array(z.lazy(() => DeploymentStreamRetrievals$outboundSchema))
2956
- .optional(),
2957
- providerResponse: z.any().optional(),
2958
- }).transform((v) => {
2959
- return remap$(v, {
2960
- isFinal: "is_final",
2961
- integrationId: "integration_id",
2962
- systemFingerprint: "system_fingerprint",
2963
- providerResponse: "provider_response",
2964
- });
2965
- });
2966
-
2967
- /**
2968
- * @internal
2969
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2970
- */
2971
- export namespace DeploymentStreamData$ {
2972
- /** @deprecated use `DeploymentStreamData$inboundSchema` instead. */
2973
- export const inboundSchema = DeploymentStreamData$inboundSchema;
2974
- /** @deprecated use `DeploymentStreamData$outboundSchema` instead. */
2975
- export const outboundSchema = DeploymentStreamData$outboundSchema;
2976
- /** @deprecated use `DeploymentStreamData$Outbound` instead. */
2977
- export type Outbound = DeploymentStreamData$Outbound;
2978
- }
2979
-
2980
- export function deploymentStreamDataToJSON(
2981
- deploymentStreamData: DeploymentStreamData,
2982
- ): string {
2983
- return JSON.stringify(
2984
- DeploymentStreamData$outboundSchema.parse(deploymentStreamData),
2985
- );
2986
- }
2987
-
2988
- export function deploymentStreamDataFromJSON(
2989
- jsonString: string,
2990
- ): SafeParseResult<DeploymentStreamData, SDKValidationError> {
2991
- return safeParse(
2992
- jsonString,
2993
- (x) => DeploymentStreamData$inboundSchema.parse(JSON.parse(x)),
2994
- `Failed to parse 'DeploymentStreamData' from JSON`,
2995
- );
2996
- }
2997
-
2998
- /** @internal */
2999
- export const DeploymentStreamResponseBody$inboundSchema: z.ZodType<
3000
- DeploymentStreamResponseBody,
3001
- z.ZodTypeDef,
3002
- unknown
3003
- > = z.object({
3004
- data: z.string().transform((v, ctx) => {
3005
- try {
3006
- return JSON.parse(v);
3007
- } catch (err) {
3008
- ctx.addIssue({
3009
- code: z.ZodIssueCode.custom,
3010
- message: `malformed json: ${err}`,
3011
- });
3012
- return z.NEVER;
3013
- }
3014
- }).pipe(z.lazy(() => DeploymentStreamData$inboundSchema).optional()),
3015
- });
3016
-
3017
- /** @internal */
3018
- export type DeploymentStreamResponseBody$Outbound = {
3019
- data?: DeploymentStreamData$Outbound | undefined;
3020
- };
3021
-
3022
- /** @internal */
3023
- export const DeploymentStreamResponseBody$outboundSchema: z.ZodType<
3024
- DeploymentStreamResponseBody$Outbound,
3025
- z.ZodTypeDef,
3026
- DeploymentStreamResponseBody
3027
- > = z.object({
3028
- data: z.lazy(() => DeploymentStreamData$outboundSchema).optional(),
3029
- });
3030
-
3031
- /**
3032
- * @internal
3033
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
3034
- */
3035
- export namespace DeploymentStreamResponseBody$ {
3036
- /** @deprecated use `DeploymentStreamResponseBody$inboundSchema` instead. */
3037
- export const inboundSchema = DeploymentStreamResponseBody$inboundSchema;
3038
- /** @deprecated use `DeploymentStreamResponseBody$outboundSchema` instead. */
3039
- export const outboundSchema = DeploymentStreamResponseBody$outboundSchema;
3040
- /** @deprecated use `DeploymentStreamResponseBody$Outbound` instead. */
3041
- export type Outbound = DeploymentStreamResponseBody$Outbound;
3042
- }
3043
-
3044
- export function deploymentStreamResponseBodyToJSON(
3045
- deploymentStreamResponseBody: DeploymentStreamResponseBody,
3046
- ): string {
3047
- return JSON.stringify(
3048
- DeploymentStreamResponseBody$outboundSchema.parse(
3049
- deploymentStreamResponseBody,
3050
- ),
3051
- );
3052
- }
3053
-
3054
- export function deploymentStreamResponseBodyFromJSON(
3055
- jsonString: string,
3056
- ): SafeParseResult<DeploymentStreamResponseBody, SDKValidationError> {
3057
- return safeParse(
3058
- jsonString,
3059
- (x) => DeploymentStreamResponseBody$inboundSchema.parse(JSON.parse(x)),
3060
- `Failed to parse 'DeploymentStreamResponseBody' from JSON`,
3061
- );
3062
- }