@orq-ai/node 3.1.12 → 3.1.14

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 (141) hide show
  1. package/bin/mcp-server.js +74 -38
  2. package/bin/mcp-server.js.map +32 -31
  3. package/jsr.json +1 -1
  4. package/lib/config.d.ts +3 -3
  5. package/lib/config.js +3 -3
  6. package/lib/sdks.d.ts.map +1 -1
  7. package/lib/sdks.js +2 -8
  8. package/lib/sdks.js.map +1 -1
  9. package/mcp-server/extensions.d.ts +9 -0
  10. package/mcp-server/extensions.d.ts.map +1 -0
  11. package/mcp-server/extensions.js +6 -0
  12. package/mcp-server/extensions.js.map +1 -0
  13. package/mcp-server/mcp-server.js +1 -1
  14. package/mcp-server/resources.d.ts +9 -4
  15. package/mcp-server/resources.d.ts.map +1 -1
  16. package/mcp-server/resources.js +36 -9
  17. package/mcp-server/resources.js.map +1 -1
  18. package/mcp-server/server.d.ts.map +1 -1
  19. package/mcp-server/server.js +6 -1
  20. package/mcp-server/server.js.map +1 -1
  21. package/mcp-server/tools/contactsCreate.js +1 -1
  22. package/mcp-server/tools/deploymentsGetConfig.js +1 -1
  23. package/mcp-server/tools/deploymentsInvoke.js +1 -1
  24. package/mcp-server/tools/deploymentsList.js +1 -1
  25. package/mcp-server/tools/deploymentsMetricsCreate.js +1 -1
  26. package/mcp-server/tools/deploymentsStream.js +1 -1
  27. package/mcp-server/tools/feedbackCreate.js +1 -1
  28. package/mcp-server/tools/filesCreate.js +1 -1
  29. package/mcp-server/tools/filesDelete.js +1 -1
  30. package/mcp-server/tools/filesGet.js +1 -1
  31. package/mcp-server/tools/filesList.js +1 -1
  32. package/mcp-server/tools/promptsCreate.js +1 -1
  33. package/mcp-server/tools/promptsDelete.js +1 -1
  34. package/mcp-server/tools/promptsGetVersion.js +1 -1
  35. package/mcp-server/tools/promptsList.js +1 -1
  36. package/mcp-server/tools/promptsListVersions.js +1 -1
  37. package/mcp-server/tools/promptsRetrieve.js +1 -1
  38. package/mcp-server/tools/promptsUpdate.js +1 -1
  39. package/mcp-server/tools/remoteconfigsRetrieve.js +1 -1
  40. package/mcp-server/tools.d.ts.map +1 -1
  41. package/mcp-server/tools.js +3 -0
  42. package/mcp-server/tools.js.map +1 -1
  43. package/models/operations/createcontact.js +2 -2
  44. package/models/operations/fileget.js +2 -2
  45. package/models/operations/filelist.js +2 -2
  46. package/models/operations/fileupload.js +2 -2
  47. package/package.json +1 -1
  48. package/packages/orq-rc/jsr.json +1 -1
  49. package/packages/orq-rc/package-lock.json +2 -2
  50. package/packages/orq-rc/package.json +1 -1
  51. package/packages/orq-rc/src/funcs/datasetsList.ts +1 -0
  52. package/packages/orq-rc/src/funcs/datasetsListDatapoints.ts +1 -0
  53. package/packages/orq-rc/src/funcs/deploymentsList.ts +1 -0
  54. package/packages/orq-rc/src/funcs/filesList.ts +1 -0
  55. package/packages/orq-rc/src/funcs/promptsList.ts +1 -0
  56. package/packages/orq-rc/src/funcs/promptsListVersions.ts +1 -0
  57. package/packages/orq-rc/src/lib/config.ts +3 -3
  58. package/packages/orq-rc/src/lib/sdks.ts +2 -7
  59. package/packages/orq-rc/src/mcp-server/extensions.ts +13 -0
  60. package/packages/orq-rc/src/mcp-server/mcp-server.ts +1 -1
  61. package/packages/orq-rc/src/mcp-server/resources.ts +75 -14
  62. package/packages/orq-rc/src/mcp-server/server.ts +16 -1
  63. package/packages/orq-rc/src/mcp-server/tools/contactsCreate.ts +1 -1
  64. package/packages/orq-rc/src/mcp-server/tools/datasetsClear.ts +1 -1
  65. package/packages/orq-rc/src/mcp-server/tools/datasetsCreate.ts +1 -1
  66. package/packages/orq-rc/src/mcp-server/tools/datasetsCreateDatapoint.ts +1 -1
  67. package/packages/orq-rc/src/mcp-server/tools/datasetsCreateDatapoints.ts +1 -1
  68. package/packages/orq-rc/src/mcp-server/tools/datasetsDelete.ts +1 -1
  69. package/packages/orq-rc/src/mcp-server/tools/datasetsDeleteDatapoint.ts +1 -1
  70. package/packages/orq-rc/src/mcp-server/tools/datasetsList.ts +1 -1
  71. package/packages/orq-rc/src/mcp-server/tools/datasetsListDatapoints.ts +1 -1
  72. package/packages/orq-rc/src/mcp-server/tools/datasetsRetrieve.ts +1 -1
  73. package/packages/orq-rc/src/mcp-server/tools/datasetsRetrieveDatapoint.ts +1 -1
  74. package/packages/orq-rc/src/mcp-server/tools/datasetsUpdate.ts +1 -1
  75. package/packages/orq-rc/src/mcp-server/tools/datasetsUpdateDatapoint.ts +1 -1
  76. package/packages/orq-rc/src/mcp-server/tools/deploymentsGetConfig.ts +1 -1
  77. package/packages/orq-rc/src/mcp-server/tools/deploymentsInvoke.ts +1 -1
  78. package/packages/orq-rc/src/mcp-server/tools/deploymentsList.ts +1 -1
  79. package/packages/orq-rc/src/mcp-server/tools/deploymentsMetricsCreate.ts +1 -1
  80. package/packages/orq-rc/src/mcp-server/tools/feedbackCreate.ts +1 -1
  81. package/packages/orq-rc/src/mcp-server/tools/filesCreate.ts +1 -1
  82. package/packages/orq-rc/src/mcp-server/tools/filesDelete.ts +1 -1
  83. package/packages/orq-rc/src/mcp-server/tools/filesGet.ts +1 -1
  84. package/packages/orq-rc/src/mcp-server/tools/filesList.ts +1 -1
  85. package/packages/orq-rc/src/mcp-server/tools/promptsCreate.ts +1 -1
  86. package/packages/orq-rc/src/mcp-server/tools/promptsDelete.ts +1 -1
  87. package/packages/orq-rc/src/mcp-server/tools/promptsGetVersion.ts +1 -1
  88. package/packages/orq-rc/src/mcp-server/tools/promptsList.ts +1 -1
  89. package/packages/orq-rc/src/mcp-server/tools/promptsListVersions.ts +1 -1
  90. package/packages/orq-rc/src/mcp-server/tools/promptsRetrieve.ts +1 -1
  91. package/packages/orq-rc/src/mcp-server/tools/promptsUpdate.ts +1 -1
  92. package/packages/orq-rc/src/mcp-server/tools/remoteconfigsRetrieve.ts +1 -1
  93. package/packages/orq-rc/src/mcp-server/tools.ts +4 -0
  94. package/packages/orq-rc/src/models/operations/bulkcreatedatapoints.ts +2 -2
  95. package/packages/orq-rc/src/models/operations/createcontact.ts +2 -2
  96. package/packages/orq-rc/src/models/operations/createdataset.ts +2 -2
  97. package/packages/orq-rc/src/models/operations/createdatasetitem.ts +2 -2
  98. package/packages/orq-rc/src/models/operations/deploymentcreatemetric.ts +2944 -1326
  99. package/packages/orq-rc/src/models/operations/deploymentinvoke.ts +458 -407
  100. package/packages/orq-rc/src/models/operations/deployments.ts +39 -0
  101. package/packages/orq-rc/src/models/operations/fileget.ts +2 -2
  102. package/packages/orq-rc/src/models/operations/filelist.ts +42 -2
  103. package/packages/orq-rc/src/models/operations/fileupload.ts +2 -2
  104. package/packages/orq-rc/src/models/operations/getallprompts.ts +42 -0
  105. package/packages/orq-rc/src/models/operations/listdatasetdatapoints.ts +46 -2
  106. package/packages/orq-rc/src/models/operations/listdatasets.ts +44 -2
  107. package/packages/orq-rc/src/models/operations/listpromptversions.ts +42 -0
  108. package/packages/orq-rc/src/models/operations/retrievedatapoint.ts +2 -2
  109. package/packages/orq-rc/src/models/operations/retrievedataset.ts +2 -2
  110. package/packages/orq-rc/src/models/operations/updatedatapoint.ts +2 -2
  111. package/packages/orq-rc/src/models/operations/updatedataset.ts +2 -2
  112. package/src/lib/config.ts +3 -3
  113. package/src/lib/sdks.ts +2 -7
  114. package/src/mcp-server/extensions.ts +13 -0
  115. package/src/mcp-server/mcp-server.ts +1 -1
  116. package/src/mcp-server/resources.ts +75 -14
  117. package/src/mcp-server/server.ts +16 -1
  118. package/src/mcp-server/tools/contactsCreate.ts +1 -1
  119. package/src/mcp-server/tools/deploymentsGetConfig.ts +1 -1
  120. package/src/mcp-server/tools/deploymentsInvoke.ts +1 -1
  121. package/src/mcp-server/tools/deploymentsList.ts +1 -1
  122. package/src/mcp-server/tools/deploymentsMetricsCreate.ts +1 -1
  123. package/src/mcp-server/tools/deploymentsStream.ts +1 -1
  124. package/src/mcp-server/tools/feedbackCreate.ts +1 -1
  125. package/src/mcp-server/tools/filesCreate.ts +1 -1
  126. package/src/mcp-server/tools/filesDelete.ts +1 -1
  127. package/src/mcp-server/tools/filesGet.ts +1 -1
  128. package/src/mcp-server/tools/filesList.ts +1 -1
  129. package/src/mcp-server/tools/promptsCreate.ts +1 -1
  130. package/src/mcp-server/tools/promptsDelete.ts +1 -1
  131. package/src/mcp-server/tools/promptsGetVersion.ts +1 -1
  132. package/src/mcp-server/tools/promptsList.ts +1 -1
  133. package/src/mcp-server/tools/promptsListVersions.ts +1 -1
  134. package/src/mcp-server/tools/promptsRetrieve.ts +1 -1
  135. package/src/mcp-server/tools/promptsUpdate.ts +1 -1
  136. package/src/mcp-server/tools/remoteconfigsRetrieve.ts +1 -1
  137. package/src/mcp-server/tools.ts +4 -0
  138. package/src/models/operations/createcontact.ts +2 -2
  139. package/src/models/operations/fileget.ts +2 -2
  140. package/src/models/operations/filelist.ts +2 -2
  141. package/src/models/operations/fileupload.ts +2 -2
@@ -58,6 +58,50 @@ export type DeploymentInvokeProvider = ClosedEnum<
58
58
  typeof DeploymentInvokeProvider
59
59
  >;
60
60
 
61
+ /**
62
+ * Metadata of the retrieved chunk from the knowledge base
63
+ */
64
+ export type DeploymentInvokeMetadata = {
65
+ /**
66
+ * Name of the file
67
+ */
68
+ fileName: string;
69
+ /**
70
+ * Page number of the chunk
71
+ */
72
+ pageNumber: number | null;
73
+ /**
74
+ * Type of the file
75
+ */
76
+ fileType: string;
77
+ /**
78
+ * Rerank scores are normalized to be in the range [0, 1]. Scores close to 1 indicate a high relevance to the query, and scores closer to 0 indicate low relevance. It is not accurate to assume a score of 0.9 means the document is 2x more relevant than a document with a score of 0.45
79
+ */
80
+ rerankScore?: number | undefined;
81
+ /**
82
+ * Search scores are normalized to be in the range [0, 1]. Search score is calculated based on `[Cosine Similarity](https://en.wikipedia.org/wiki/Cosine_similarity)` algorithm. Scores close to 1 indicate the document is closer to the query, and scores closer to 0 indicate the document is farther from the query.
83
+ */
84
+ searchScore: number;
85
+ };
86
+
87
+ export type Retrievals = {
88
+ /**
89
+ * Content of the retrieved chunk from the knowledge base
90
+ */
91
+ document: string;
92
+ /**
93
+ * Metadata of the retrieved chunk from the knowledge base
94
+ */
95
+ metadata: DeploymentInvokeMetadata;
96
+ };
97
+
98
+ export const DeploymentInvokeMessageDeploymentsType = {
99
+ Image: "image",
100
+ } as const;
101
+ export type DeploymentInvokeMessageDeploymentsType = ClosedEnum<
102
+ typeof DeploymentInvokeMessageDeploymentsType
103
+ >;
104
+
61
105
  /**
62
106
  * The role of the prompt message
63
107
  */
@@ -78,7 +122,8 @@ export type DeploymentInvokeMessageDeploymentsRole = ClosedEnum<
78
122
  typeof DeploymentInvokeMessageDeploymentsRole
79
123
  >;
80
124
 
81
- export type DeploymentInvokeMessage3 = {
125
+ export type Message3 = {
126
+ type: DeploymentInvokeMessageDeploymentsType;
82
127
  /**
83
128
  * The role of the prompt message
84
129
  */
@@ -86,6 +131,13 @@ export type DeploymentInvokeMessage3 = {
86
131
  url: string;
87
132
  };
88
133
 
134
+ export const DeploymentInvokeMessageType = {
135
+ Content: "content",
136
+ } as const;
137
+ export type DeploymentInvokeMessageType = ClosedEnum<
138
+ typeof DeploymentInvokeMessageType
139
+ >;
140
+
89
141
  /**
90
142
  * The role of the prompt message
91
143
  */
@@ -106,7 +158,8 @@ export type DeploymentInvokeMessageRole = ClosedEnum<
106
158
  typeof DeploymentInvokeMessageRole
107
159
  >;
108
160
 
109
- export type DeploymentInvokeMessage2 = {
161
+ export type Message2 = {
162
+ type: DeploymentInvokeMessageType;
110
163
  /**
111
164
  * The role of the prompt message
112
165
  */
@@ -114,10 +167,15 @@ export type DeploymentInvokeMessage2 = {
114
167
  content: string | null;
115
168
  };
116
169
 
170
+ export const MessageType = {
171
+ ToolCalls: "tool_calls",
172
+ } as const;
173
+ export type MessageType = ClosedEnum<typeof MessageType>;
174
+
117
175
  /**
118
176
  * The role of the prompt message
119
177
  */
120
- export const DeploymentInvokeMessageDeploymentsResponseRole = {
178
+ export const MessageRole = {
121
179
  System: "system",
122
180
  Assistant: "assistant",
123
181
  User: "user",
@@ -130,18 +188,16 @@ export const DeploymentInvokeMessageDeploymentsResponseRole = {
130
188
  /**
131
189
  * The role of the prompt message
132
190
  */
133
- export type DeploymentInvokeMessageDeploymentsResponseRole = ClosedEnum<
134
- typeof DeploymentInvokeMessageDeploymentsResponseRole
135
- >;
191
+ export type MessageRole = ClosedEnum<typeof MessageRole>;
136
192
 
137
- export const DeploymentInvokeMessageType = {
193
+ export const DeploymentInvokeMessageDeploymentsResponseType = {
138
194
  Function: "function",
139
195
  } as const;
140
- export type DeploymentInvokeMessageType = ClosedEnum<
141
- typeof DeploymentInvokeMessageType
196
+ export type DeploymentInvokeMessageDeploymentsResponseType = ClosedEnum<
197
+ typeof DeploymentInvokeMessageDeploymentsResponseType
142
198
  >;
143
199
 
144
- export type DeploymentInvokeMessageFunction = {
200
+ export type MessageFunction = {
145
201
  name: string;
146
202
  /**
147
203
  * JSON string arguments for the functions
@@ -149,76 +205,33 @@ export type DeploymentInvokeMessageFunction = {
149
205
  arguments: string;
150
206
  };
151
207
 
152
- export type DeploymentInvokeMessageToolCalls = {
208
+ export type MessageToolCalls = {
153
209
  id?: string | undefined;
154
210
  index?: number | undefined;
155
- type: DeploymentInvokeMessageType;
156
- function: DeploymentInvokeMessageFunction;
211
+ type: DeploymentInvokeMessageDeploymentsResponseType;
212
+ function: MessageFunction;
157
213
  };
158
214
 
159
- export type DeploymentInvokeMessage1 = {
215
+ export type Message1 = {
216
+ type: MessageType;
160
217
  /**
161
218
  * The role of the prompt message
162
219
  */
163
- role: DeploymentInvokeMessageDeploymentsResponseRole;
220
+ role: MessageRole;
164
221
  content?: string | null | undefined;
165
- toolCalls: Array<DeploymentInvokeMessageToolCalls>;
222
+ toolCalls: Array<MessageToolCalls>;
166
223
  };
167
224
 
168
- export type DeploymentInvokeMessage =
169
- | DeploymentInvokeMessage2
170
- | DeploymentInvokeMessage3
171
- | DeploymentInvokeMessage1;
225
+ export type Message = Message2 | Message3 | Message1;
172
226
 
173
227
  export type DeploymentInvokeChoices = {
174
228
  index: number;
175
- message?:
176
- | DeploymentInvokeMessage2
177
- | DeploymentInvokeMessage3
178
- | DeploymentInvokeMessage1
179
- | undefined;
229
+ message: Message2 | Message3 | Message1;
180
230
  finishReason?: string | null | undefined;
181
231
  };
182
232
 
183
233
  /**
184
- * Metadata of the retrieved chunk from the knowledge base
185
- */
186
- export type DeploymentInvokeMetadata = {
187
- /**
188
- * Name of the file
189
- */
190
- fileName: string;
191
- /**
192
- * Page number of the chunk
193
- */
194
- pageNumber: number | null;
195
- /**
196
- * Type of the file
197
- */
198
- fileType: string;
199
- /**
200
- * 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
201
- */
202
- rerankScore?: number | undefined;
203
- /**
204
- * 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.
205
- */
206
- searchScore: number;
207
- };
208
-
209
- export type Retrievals = {
210
- /**
211
- * Content of the retrieved chunk from the knowledge base
212
- */
213
- document: string;
214
- /**
215
- * Metadata of the retrieved chunk from the knowledge base
216
- */
217
- metadata: DeploymentInvokeMetadata;
218
- };
219
-
220
- /**
221
- * Response from the gateway
234
+ * Successful operation
222
235
  */
223
236
  export type DeploymentInvokeResponseBody = {
224
237
  /**
@@ -257,10 +270,6 @@ export type DeploymentInvokeResponseBody = {
257
270
  * Provider backed system fingerprint.
258
271
  */
259
272
  systemFingerprint?: string | null | undefined;
260
- /**
261
- * A list of choices generated by the model
262
- */
263
- choices: Array<DeploymentInvokeChoices>;
264
273
  /**
265
274
  * List of documents retrieved from the knowledge base. This property is only available when the `include_retrievals` flag is set to `true` in the invoke settings. When stream is set to true, the `retrievals` property will be returned in the last streamed chunk where the property `is_final` is set to `true`.
266
275
  */
@@ -269,6 +278,10 @@ export type DeploymentInvokeResponseBody = {
269
278
  * Response returned by the model provider. This functionality is only supported when streaming is not used. If streaming is used, the `provider_response` property will be set to `null`.
270
279
  */
271
280
  providerResponse?: any | undefined;
281
+ /**
282
+ * A list of choices generated by the model
283
+ */
284
+ choices: Array<DeploymentInvokeChoices>;
272
285
  };
273
286
 
274
287
  /** @internal */
@@ -370,6 +383,165 @@ export namespace DeploymentInvokeProvider$ {
370
383
  export const outboundSchema = DeploymentInvokeProvider$outboundSchema;
371
384
  }
372
385
 
386
+ /** @internal */
387
+ export const DeploymentInvokeMetadata$inboundSchema: z.ZodType<
388
+ DeploymentInvokeMetadata,
389
+ z.ZodTypeDef,
390
+ unknown
391
+ > = z.object({
392
+ file_name: z.string(),
393
+ page_number: z.nullable(z.number()),
394
+ file_type: z.string(),
395
+ rerank_score: z.number().optional(),
396
+ search_score: z.number(),
397
+ }).transform((v) => {
398
+ return remap$(v, {
399
+ "file_name": "fileName",
400
+ "page_number": "pageNumber",
401
+ "file_type": "fileType",
402
+ "rerank_score": "rerankScore",
403
+ "search_score": "searchScore",
404
+ });
405
+ });
406
+
407
+ /** @internal */
408
+ export type DeploymentInvokeMetadata$Outbound = {
409
+ file_name: string;
410
+ page_number: number | null;
411
+ file_type: string;
412
+ rerank_score?: number | undefined;
413
+ search_score: number;
414
+ };
415
+
416
+ /** @internal */
417
+ export const DeploymentInvokeMetadata$outboundSchema: z.ZodType<
418
+ DeploymentInvokeMetadata$Outbound,
419
+ z.ZodTypeDef,
420
+ DeploymentInvokeMetadata
421
+ > = z.object({
422
+ fileName: z.string(),
423
+ pageNumber: z.nullable(z.number()),
424
+ fileType: z.string(),
425
+ rerankScore: z.number().optional(),
426
+ searchScore: z.number(),
427
+ }).transform((v) => {
428
+ return remap$(v, {
429
+ fileName: "file_name",
430
+ pageNumber: "page_number",
431
+ fileType: "file_type",
432
+ rerankScore: "rerank_score",
433
+ searchScore: "search_score",
434
+ });
435
+ });
436
+
437
+ /**
438
+ * @internal
439
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
440
+ */
441
+ export namespace DeploymentInvokeMetadata$ {
442
+ /** @deprecated use `DeploymentInvokeMetadata$inboundSchema` instead. */
443
+ export const inboundSchema = DeploymentInvokeMetadata$inboundSchema;
444
+ /** @deprecated use `DeploymentInvokeMetadata$outboundSchema` instead. */
445
+ export const outboundSchema = DeploymentInvokeMetadata$outboundSchema;
446
+ /** @deprecated use `DeploymentInvokeMetadata$Outbound` instead. */
447
+ export type Outbound = DeploymentInvokeMetadata$Outbound;
448
+ }
449
+
450
+ export function deploymentInvokeMetadataToJSON(
451
+ deploymentInvokeMetadata: DeploymentInvokeMetadata,
452
+ ): string {
453
+ return JSON.stringify(
454
+ DeploymentInvokeMetadata$outboundSchema.parse(deploymentInvokeMetadata),
455
+ );
456
+ }
457
+
458
+ export function deploymentInvokeMetadataFromJSON(
459
+ jsonString: string,
460
+ ): SafeParseResult<DeploymentInvokeMetadata, SDKValidationError> {
461
+ return safeParse(
462
+ jsonString,
463
+ (x) => DeploymentInvokeMetadata$inboundSchema.parse(JSON.parse(x)),
464
+ `Failed to parse 'DeploymentInvokeMetadata' from JSON`,
465
+ );
466
+ }
467
+
468
+ /** @internal */
469
+ export const Retrievals$inboundSchema: z.ZodType<
470
+ Retrievals,
471
+ z.ZodTypeDef,
472
+ unknown
473
+ > = z.object({
474
+ document: z.string(),
475
+ metadata: z.lazy(() => DeploymentInvokeMetadata$inboundSchema),
476
+ });
477
+
478
+ /** @internal */
479
+ export type Retrievals$Outbound = {
480
+ document: string;
481
+ metadata: DeploymentInvokeMetadata$Outbound;
482
+ };
483
+
484
+ /** @internal */
485
+ export const Retrievals$outboundSchema: z.ZodType<
486
+ Retrievals$Outbound,
487
+ z.ZodTypeDef,
488
+ Retrievals
489
+ > = z.object({
490
+ document: z.string(),
491
+ metadata: z.lazy(() => DeploymentInvokeMetadata$outboundSchema),
492
+ });
493
+
494
+ /**
495
+ * @internal
496
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
497
+ */
498
+ export namespace Retrievals$ {
499
+ /** @deprecated use `Retrievals$inboundSchema` instead. */
500
+ export const inboundSchema = Retrievals$inboundSchema;
501
+ /** @deprecated use `Retrievals$outboundSchema` instead. */
502
+ export const outboundSchema = Retrievals$outboundSchema;
503
+ /** @deprecated use `Retrievals$Outbound` instead. */
504
+ export type Outbound = Retrievals$Outbound;
505
+ }
506
+
507
+ export function retrievalsToJSON(retrievals: Retrievals): string {
508
+ return JSON.stringify(Retrievals$outboundSchema.parse(retrievals));
509
+ }
510
+
511
+ export function retrievalsFromJSON(
512
+ jsonString: string,
513
+ ): SafeParseResult<Retrievals, SDKValidationError> {
514
+ return safeParse(
515
+ jsonString,
516
+ (x) => Retrievals$inboundSchema.parse(JSON.parse(x)),
517
+ `Failed to parse 'Retrievals' from JSON`,
518
+ );
519
+ }
520
+
521
+ /** @internal */
522
+ export const DeploymentInvokeMessageDeploymentsType$inboundSchema:
523
+ z.ZodNativeEnum<typeof DeploymentInvokeMessageDeploymentsType> = z.nativeEnum(
524
+ DeploymentInvokeMessageDeploymentsType,
525
+ );
526
+
527
+ /** @internal */
528
+ export const DeploymentInvokeMessageDeploymentsType$outboundSchema:
529
+ z.ZodNativeEnum<typeof DeploymentInvokeMessageDeploymentsType> =
530
+ DeploymentInvokeMessageDeploymentsType$inboundSchema;
531
+
532
+ /**
533
+ * @internal
534
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
535
+ */
536
+ export namespace DeploymentInvokeMessageDeploymentsType$ {
537
+ /** @deprecated use `DeploymentInvokeMessageDeploymentsType$inboundSchema` instead. */
538
+ export const inboundSchema =
539
+ DeploymentInvokeMessageDeploymentsType$inboundSchema;
540
+ /** @deprecated use `DeploymentInvokeMessageDeploymentsType$outboundSchema` instead. */
541
+ export const outboundSchema =
542
+ DeploymentInvokeMessageDeploymentsType$outboundSchema;
543
+ }
544
+
373
545
  /** @internal */
374
546
  export const DeploymentInvokeMessageDeploymentsRole$inboundSchema:
375
547
  z.ZodNativeEnum<typeof DeploymentInvokeMessageDeploymentsRole> = z.nativeEnum(
@@ -395,27 +567,30 @@ export namespace DeploymentInvokeMessageDeploymentsRole$ {
395
567
  }
396
568
 
397
569
  /** @internal */
398
- export const DeploymentInvokeMessage3$inboundSchema: z.ZodType<
399
- DeploymentInvokeMessage3,
570
+ export const Message3$inboundSchema: z.ZodType<
571
+ Message3,
400
572
  z.ZodTypeDef,
401
573
  unknown
402
574
  > = z.object({
575
+ type: DeploymentInvokeMessageDeploymentsType$inboundSchema,
403
576
  role: DeploymentInvokeMessageDeploymentsRole$inboundSchema,
404
577
  url: z.string(),
405
578
  });
406
579
 
407
580
  /** @internal */
408
- export type DeploymentInvokeMessage3$Outbound = {
581
+ export type Message3$Outbound = {
582
+ type: string;
409
583
  role: string;
410
584
  url: string;
411
585
  };
412
586
 
413
587
  /** @internal */
414
- export const DeploymentInvokeMessage3$outboundSchema: z.ZodType<
415
- DeploymentInvokeMessage3$Outbound,
588
+ export const Message3$outboundSchema: z.ZodType<
589
+ Message3$Outbound,
416
590
  z.ZodTypeDef,
417
- DeploymentInvokeMessage3
591
+ Message3
418
592
  > = z.object({
593
+ type: DeploymentInvokeMessageDeploymentsType$outboundSchema,
419
594
  role: DeploymentInvokeMessageDeploymentsRole$outboundSchema,
420
595
  url: z.string(),
421
596
  });
@@ -424,33 +599,50 @@ export const DeploymentInvokeMessage3$outboundSchema: z.ZodType<
424
599
  * @internal
425
600
  * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
426
601
  */
427
- export namespace DeploymentInvokeMessage3$ {
428
- /** @deprecated use `DeploymentInvokeMessage3$inboundSchema` instead. */
429
- export const inboundSchema = DeploymentInvokeMessage3$inboundSchema;
430
- /** @deprecated use `DeploymentInvokeMessage3$outboundSchema` instead. */
431
- export const outboundSchema = DeploymentInvokeMessage3$outboundSchema;
432
- /** @deprecated use `DeploymentInvokeMessage3$Outbound` instead. */
433
- export type Outbound = DeploymentInvokeMessage3$Outbound;
602
+ export namespace Message3$ {
603
+ /** @deprecated use `Message3$inboundSchema` instead. */
604
+ export const inboundSchema = Message3$inboundSchema;
605
+ /** @deprecated use `Message3$outboundSchema` instead. */
606
+ export const outboundSchema = Message3$outboundSchema;
607
+ /** @deprecated use `Message3$Outbound` instead. */
608
+ export type Outbound = Message3$Outbound;
434
609
  }
435
610
 
436
- export function deploymentInvokeMessage3ToJSON(
437
- deploymentInvokeMessage3: DeploymentInvokeMessage3,
438
- ): string {
439
- return JSON.stringify(
440
- DeploymentInvokeMessage3$outboundSchema.parse(deploymentInvokeMessage3),
441
- );
611
+ export function message3ToJSON(message3: Message3): string {
612
+ return JSON.stringify(Message3$outboundSchema.parse(message3));
442
613
  }
443
614
 
444
- export function deploymentInvokeMessage3FromJSON(
615
+ export function message3FromJSON(
445
616
  jsonString: string,
446
- ): SafeParseResult<DeploymentInvokeMessage3, SDKValidationError> {
617
+ ): SafeParseResult<Message3, SDKValidationError> {
447
618
  return safeParse(
448
619
  jsonString,
449
- (x) => DeploymentInvokeMessage3$inboundSchema.parse(JSON.parse(x)),
450
- `Failed to parse 'DeploymentInvokeMessage3' from JSON`,
620
+ (x) => Message3$inboundSchema.parse(JSON.parse(x)),
621
+ `Failed to parse 'Message3' from JSON`,
451
622
  );
452
623
  }
453
624
 
625
+ /** @internal */
626
+ export const DeploymentInvokeMessageType$inboundSchema: z.ZodNativeEnum<
627
+ typeof DeploymentInvokeMessageType
628
+ > = z.nativeEnum(DeploymentInvokeMessageType);
629
+
630
+ /** @internal */
631
+ export const DeploymentInvokeMessageType$outboundSchema: z.ZodNativeEnum<
632
+ typeof DeploymentInvokeMessageType
633
+ > = DeploymentInvokeMessageType$inboundSchema;
634
+
635
+ /**
636
+ * @internal
637
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
638
+ */
639
+ export namespace DeploymentInvokeMessageType$ {
640
+ /** @deprecated use `DeploymentInvokeMessageType$inboundSchema` instead. */
641
+ export const inboundSchema = DeploymentInvokeMessageType$inboundSchema;
642
+ /** @deprecated use `DeploymentInvokeMessageType$outboundSchema` instead. */
643
+ export const outboundSchema = DeploymentInvokeMessageType$outboundSchema;
644
+ }
645
+
454
646
  /** @internal */
455
647
  export const DeploymentInvokeMessageRole$inboundSchema: z.ZodNativeEnum<
456
648
  typeof DeploymentInvokeMessageRole
@@ -473,27 +665,30 @@ export namespace DeploymentInvokeMessageRole$ {
473
665
  }
474
666
 
475
667
  /** @internal */
476
- export const DeploymentInvokeMessage2$inboundSchema: z.ZodType<
477
- DeploymentInvokeMessage2,
668
+ export const Message2$inboundSchema: z.ZodType<
669
+ Message2,
478
670
  z.ZodTypeDef,
479
671
  unknown
480
672
  > = z.object({
673
+ type: DeploymentInvokeMessageType$inboundSchema,
481
674
  role: DeploymentInvokeMessageRole$inboundSchema,
482
675
  content: z.nullable(z.string()),
483
676
  });
484
677
 
485
678
  /** @internal */
486
- export type DeploymentInvokeMessage2$Outbound = {
679
+ export type Message2$Outbound = {
680
+ type: string;
487
681
  role: string;
488
682
  content: string | null;
489
683
  };
490
684
 
491
685
  /** @internal */
492
- export const DeploymentInvokeMessage2$outboundSchema: z.ZodType<
493
- DeploymentInvokeMessage2$Outbound,
686
+ export const Message2$outboundSchema: z.ZodType<
687
+ Message2$Outbound,
494
688
  z.ZodTypeDef,
495
- DeploymentInvokeMessage2
689
+ Message2
496
690
  > = z.object({
691
+ type: DeploymentInvokeMessageType$outboundSchema,
497
692
  role: DeploymentInvokeMessageRole$outboundSchema,
498
693
  content: z.nullable(z.string()),
499
694
  });
@@ -502,80 +697,93 @@ export const DeploymentInvokeMessage2$outboundSchema: z.ZodType<
502
697
  * @internal
503
698
  * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
504
699
  */
505
- export namespace DeploymentInvokeMessage2$ {
506
- /** @deprecated use `DeploymentInvokeMessage2$inboundSchema` instead. */
507
- export const inboundSchema = DeploymentInvokeMessage2$inboundSchema;
508
- /** @deprecated use `DeploymentInvokeMessage2$outboundSchema` instead. */
509
- export const outboundSchema = DeploymentInvokeMessage2$outboundSchema;
510
- /** @deprecated use `DeploymentInvokeMessage2$Outbound` instead. */
511
- export type Outbound = DeploymentInvokeMessage2$Outbound;
700
+ export namespace Message2$ {
701
+ /** @deprecated use `Message2$inboundSchema` instead. */
702
+ export const inboundSchema = Message2$inboundSchema;
703
+ /** @deprecated use `Message2$outboundSchema` instead. */
704
+ export const outboundSchema = Message2$outboundSchema;
705
+ /** @deprecated use `Message2$Outbound` instead. */
706
+ export type Outbound = Message2$Outbound;
512
707
  }
513
708
 
514
- export function deploymentInvokeMessage2ToJSON(
515
- deploymentInvokeMessage2: DeploymentInvokeMessage2,
516
- ): string {
517
- return JSON.stringify(
518
- DeploymentInvokeMessage2$outboundSchema.parse(deploymentInvokeMessage2),
519
- );
709
+ export function message2ToJSON(message2: Message2): string {
710
+ return JSON.stringify(Message2$outboundSchema.parse(message2));
520
711
  }
521
712
 
522
- export function deploymentInvokeMessage2FromJSON(
713
+ export function message2FromJSON(
523
714
  jsonString: string,
524
- ): SafeParseResult<DeploymentInvokeMessage2, SDKValidationError> {
715
+ ): SafeParseResult<Message2, SDKValidationError> {
525
716
  return safeParse(
526
717
  jsonString,
527
- (x) => DeploymentInvokeMessage2$inboundSchema.parse(JSON.parse(x)),
528
- `Failed to parse 'DeploymentInvokeMessage2' from JSON`,
718
+ (x) => Message2$inboundSchema.parse(JSON.parse(x)),
719
+ `Failed to parse 'Message2' from JSON`,
529
720
  );
530
721
  }
531
722
 
532
723
  /** @internal */
533
- export const DeploymentInvokeMessageDeploymentsResponseRole$inboundSchema:
534
- z.ZodNativeEnum<typeof DeploymentInvokeMessageDeploymentsResponseRole> = z
535
- .nativeEnum(DeploymentInvokeMessageDeploymentsResponseRole);
724
+ export const MessageType$inboundSchema: z.ZodNativeEnum<typeof MessageType> = z
725
+ .nativeEnum(MessageType);
536
726
 
537
727
  /** @internal */
538
- export const DeploymentInvokeMessageDeploymentsResponseRole$outboundSchema:
539
- z.ZodNativeEnum<typeof DeploymentInvokeMessageDeploymentsResponseRole> =
540
- DeploymentInvokeMessageDeploymentsResponseRole$inboundSchema;
728
+ export const MessageType$outboundSchema: z.ZodNativeEnum<typeof MessageType> =
729
+ MessageType$inboundSchema;
541
730
 
542
731
  /**
543
732
  * @internal
544
733
  * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
545
734
  */
546
- export namespace DeploymentInvokeMessageDeploymentsResponseRole$ {
547
- /** @deprecated use `DeploymentInvokeMessageDeploymentsResponseRole$inboundSchema` instead. */
548
- export const inboundSchema =
549
- DeploymentInvokeMessageDeploymentsResponseRole$inboundSchema;
550
- /** @deprecated use `DeploymentInvokeMessageDeploymentsResponseRole$outboundSchema` instead. */
551
- export const outboundSchema =
552
- DeploymentInvokeMessageDeploymentsResponseRole$outboundSchema;
735
+ export namespace MessageType$ {
736
+ /** @deprecated use `MessageType$inboundSchema` instead. */
737
+ export const inboundSchema = MessageType$inboundSchema;
738
+ /** @deprecated use `MessageType$outboundSchema` instead. */
739
+ export const outboundSchema = MessageType$outboundSchema;
553
740
  }
554
741
 
555
742
  /** @internal */
556
- export const DeploymentInvokeMessageType$inboundSchema: z.ZodNativeEnum<
557
- typeof DeploymentInvokeMessageType
558
- > = z.nativeEnum(DeploymentInvokeMessageType);
743
+ export const MessageRole$inboundSchema: z.ZodNativeEnum<typeof MessageRole> = z
744
+ .nativeEnum(MessageRole);
559
745
 
560
746
  /** @internal */
561
- export const DeploymentInvokeMessageType$outboundSchema: z.ZodNativeEnum<
562
- typeof DeploymentInvokeMessageType
563
- > = DeploymentInvokeMessageType$inboundSchema;
747
+ export const MessageRole$outboundSchema: z.ZodNativeEnum<typeof MessageRole> =
748
+ MessageRole$inboundSchema;
564
749
 
565
750
  /**
566
751
  * @internal
567
752
  * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
568
753
  */
569
- export namespace DeploymentInvokeMessageType$ {
570
- /** @deprecated use `DeploymentInvokeMessageType$inboundSchema` instead. */
571
- export const inboundSchema = DeploymentInvokeMessageType$inboundSchema;
572
- /** @deprecated use `DeploymentInvokeMessageType$outboundSchema` instead. */
573
- export const outboundSchema = DeploymentInvokeMessageType$outboundSchema;
754
+ export namespace MessageRole$ {
755
+ /** @deprecated use `MessageRole$inboundSchema` instead. */
756
+ export const inboundSchema = MessageRole$inboundSchema;
757
+ /** @deprecated use `MessageRole$outboundSchema` instead. */
758
+ export const outboundSchema = MessageRole$outboundSchema;
759
+ }
760
+
761
+ /** @internal */
762
+ export const DeploymentInvokeMessageDeploymentsResponseType$inboundSchema:
763
+ z.ZodNativeEnum<typeof DeploymentInvokeMessageDeploymentsResponseType> = z
764
+ .nativeEnum(DeploymentInvokeMessageDeploymentsResponseType);
765
+
766
+ /** @internal */
767
+ export const DeploymentInvokeMessageDeploymentsResponseType$outboundSchema:
768
+ z.ZodNativeEnum<typeof DeploymentInvokeMessageDeploymentsResponseType> =
769
+ DeploymentInvokeMessageDeploymentsResponseType$inboundSchema;
770
+
771
+ /**
772
+ * @internal
773
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
774
+ */
775
+ export namespace DeploymentInvokeMessageDeploymentsResponseType$ {
776
+ /** @deprecated use `DeploymentInvokeMessageDeploymentsResponseType$inboundSchema` instead. */
777
+ export const inboundSchema =
778
+ DeploymentInvokeMessageDeploymentsResponseType$inboundSchema;
779
+ /** @deprecated use `DeploymentInvokeMessageDeploymentsResponseType$outboundSchema` instead. */
780
+ export const outboundSchema =
781
+ DeploymentInvokeMessageDeploymentsResponseType$outboundSchema;
574
782
  }
575
783
 
576
784
  /** @internal */
577
- export const DeploymentInvokeMessageFunction$inboundSchema: z.ZodType<
578
- DeploymentInvokeMessageFunction,
785
+ export const MessageFunction$inboundSchema: z.ZodType<
786
+ MessageFunction,
579
787
  z.ZodTypeDef,
580
788
  unknown
581
789
  > = z.object({
@@ -584,16 +792,16 @@ export const DeploymentInvokeMessageFunction$inboundSchema: z.ZodType<
584
792
  });
585
793
 
586
794
  /** @internal */
587
- export type DeploymentInvokeMessageFunction$Outbound = {
795
+ export type MessageFunction$Outbound = {
588
796
  name: string;
589
797
  arguments: string;
590
798
  };
591
799
 
592
800
  /** @internal */
593
- export const DeploymentInvokeMessageFunction$outboundSchema: z.ZodType<
594
- DeploymentInvokeMessageFunction$Outbound,
801
+ export const MessageFunction$outboundSchema: z.ZodType<
802
+ MessageFunction$Outbound,
595
803
  z.ZodTypeDef,
596
- DeploymentInvokeMessageFunction
804
+ MessageFunction
597
805
  > = z.object({
598
806
  name: z.string(),
599
807
  arguments: z.string(),
@@ -603,111 +811,104 @@ export const DeploymentInvokeMessageFunction$outboundSchema: z.ZodType<
603
811
  * @internal
604
812
  * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
605
813
  */
606
- export namespace DeploymentInvokeMessageFunction$ {
607
- /** @deprecated use `DeploymentInvokeMessageFunction$inboundSchema` instead. */
608
- export const inboundSchema = DeploymentInvokeMessageFunction$inboundSchema;
609
- /** @deprecated use `DeploymentInvokeMessageFunction$outboundSchema` instead. */
610
- export const outboundSchema = DeploymentInvokeMessageFunction$outboundSchema;
611
- /** @deprecated use `DeploymentInvokeMessageFunction$Outbound` instead. */
612
- export type Outbound = DeploymentInvokeMessageFunction$Outbound;
814
+ export namespace MessageFunction$ {
815
+ /** @deprecated use `MessageFunction$inboundSchema` instead. */
816
+ export const inboundSchema = MessageFunction$inboundSchema;
817
+ /** @deprecated use `MessageFunction$outboundSchema` instead. */
818
+ export const outboundSchema = MessageFunction$outboundSchema;
819
+ /** @deprecated use `MessageFunction$Outbound` instead. */
820
+ export type Outbound = MessageFunction$Outbound;
613
821
  }
614
822
 
615
- export function deploymentInvokeMessageFunctionToJSON(
616
- deploymentInvokeMessageFunction: DeploymentInvokeMessageFunction,
823
+ export function messageFunctionToJSON(
824
+ messageFunction: MessageFunction,
617
825
  ): string {
618
- return JSON.stringify(
619
- DeploymentInvokeMessageFunction$outboundSchema.parse(
620
- deploymentInvokeMessageFunction,
621
- ),
622
- );
826
+ return JSON.stringify(MessageFunction$outboundSchema.parse(messageFunction));
623
827
  }
624
828
 
625
- export function deploymentInvokeMessageFunctionFromJSON(
829
+ export function messageFunctionFromJSON(
626
830
  jsonString: string,
627
- ): SafeParseResult<DeploymentInvokeMessageFunction, SDKValidationError> {
831
+ ): SafeParseResult<MessageFunction, SDKValidationError> {
628
832
  return safeParse(
629
833
  jsonString,
630
- (x) => DeploymentInvokeMessageFunction$inboundSchema.parse(JSON.parse(x)),
631
- `Failed to parse 'DeploymentInvokeMessageFunction' from JSON`,
834
+ (x) => MessageFunction$inboundSchema.parse(JSON.parse(x)),
835
+ `Failed to parse 'MessageFunction' from JSON`,
632
836
  );
633
837
  }
634
838
 
635
839
  /** @internal */
636
- export const DeploymentInvokeMessageToolCalls$inboundSchema: z.ZodType<
637
- DeploymentInvokeMessageToolCalls,
840
+ export const MessageToolCalls$inboundSchema: z.ZodType<
841
+ MessageToolCalls,
638
842
  z.ZodTypeDef,
639
843
  unknown
640
844
  > = z.object({
641
845
  id: z.string().optional(),
642
846
  index: z.number().optional(),
643
- type: DeploymentInvokeMessageType$inboundSchema,
644
- function: z.lazy(() => DeploymentInvokeMessageFunction$inboundSchema),
847
+ type: DeploymentInvokeMessageDeploymentsResponseType$inboundSchema,
848
+ function: z.lazy(() => MessageFunction$inboundSchema),
645
849
  });
646
850
 
647
851
  /** @internal */
648
- export type DeploymentInvokeMessageToolCalls$Outbound = {
852
+ export type MessageToolCalls$Outbound = {
649
853
  id?: string | undefined;
650
854
  index?: number | undefined;
651
855
  type: string;
652
- function: DeploymentInvokeMessageFunction$Outbound;
856
+ function: MessageFunction$Outbound;
653
857
  };
654
858
 
655
859
  /** @internal */
656
- export const DeploymentInvokeMessageToolCalls$outboundSchema: z.ZodType<
657
- DeploymentInvokeMessageToolCalls$Outbound,
860
+ export const MessageToolCalls$outboundSchema: z.ZodType<
861
+ MessageToolCalls$Outbound,
658
862
  z.ZodTypeDef,
659
- DeploymentInvokeMessageToolCalls
863
+ MessageToolCalls
660
864
  > = z.object({
661
865
  id: z.string().optional(),
662
866
  index: z.number().optional(),
663
- type: DeploymentInvokeMessageType$outboundSchema,
664
- function: z.lazy(() => DeploymentInvokeMessageFunction$outboundSchema),
867
+ type: DeploymentInvokeMessageDeploymentsResponseType$outboundSchema,
868
+ function: z.lazy(() => MessageFunction$outboundSchema),
665
869
  });
666
870
 
667
871
  /**
668
872
  * @internal
669
873
  * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
670
874
  */
671
- export namespace DeploymentInvokeMessageToolCalls$ {
672
- /** @deprecated use `DeploymentInvokeMessageToolCalls$inboundSchema` instead. */
673
- export const inboundSchema = DeploymentInvokeMessageToolCalls$inboundSchema;
674
- /** @deprecated use `DeploymentInvokeMessageToolCalls$outboundSchema` instead. */
675
- export const outboundSchema = DeploymentInvokeMessageToolCalls$outboundSchema;
676
- /** @deprecated use `DeploymentInvokeMessageToolCalls$Outbound` instead. */
677
- export type Outbound = DeploymentInvokeMessageToolCalls$Outbound;
875
+ export namespace MessageToolCalls$ {
876
+ /** @deprecated use `MessageToolCalls$inboundSchema` instead. */
877
+ export const inboundSchema = MessageToolCalls$inboundSchema;
878
+ /** @deprecated use `MessageToolCalls$outboundSchema` instead. */
879
+ export const outboundSchema = MessageToolCalls$outboundSchema;
880
+ /** @deprecated use `MessageToolCalls$Outbound` instead. */
881
+ export type Outbound = MessageToolCalls$Outbound;
678
882
  }
679
883
 
680
- export function deploymentInvokeMessageToolCallsToJSON(
681
- deploymentInvokeMessageToolCalls: DeploymentInvokeMessageToolCalls,
884
+ export function messageToolCallsToJSON(
885
+ messageToolCalls: MessageToolCalls,
682
886
  ): string {
683
887
  return JSON.stringify(
684
- DeploymentInvokeMessageToolCalls$outboundSchema.parse(
685
- deploymentInvokeMessageToolCalls,
686
- ),
888
+ MessageToolCalls$outboundSchema.parse(messageToolCalls),
687
889
  );
688
890
  }
689
891
 
690
- export function deploymentInvokeMessageToolCallsFromJSON(
892
+ export function messageToolCallsFromJSON(
691
893
  jsonString: string,
692
- ): SafeParseResult<DeploymentInvokeMessageToolCalls, SDKValidationError> {
894
+ ): SafeParseResult<MessageToolCalls, SDKValidationError> {
693
895
  return safeParse(
694
896
  jsonString,
695
- (x) => DeploymentInvokeMessageToolCalls$inboundSchema.parse(JSON.parse(x)),
696
- `Failed to parse 'DeploymentInvokeMessageToolCalls' from JSON`,
897
+ (x) => MessageToolCalls$inboundSchema.parse(JSON.parse(x)),
898
+ `Failed to parse 'MessageToolCalls' from JSON`,
697
899
  );
698
900
  }
699
901
 
700
902
  /** @internal */
701
- export const DeploymentInvokeMessage1$inboundSchema: z.ZodType<
702
- DeploymentInvokeMessage1,
903
+ export const Message1$inboundSchema: z.ZodType<
904
+ Message1,
703
905
  z.ZodTypeDef,
704
906
  unknown
705
907
  > = z.object({
706
- role: DeploymentInvokeMessageDeploymentsResponseRole$inboundSchema,
908
+ type: MessageType$inboundSchema,
909
+ role: MessageRole$inboundSchema,
707
910
  content: z.nullable(z.string()).optional(),
708
- tool_calls: z.array(
709
- z.lazy(() => DeploymentInvokeMessageToolCalls$inboundSchema),
710
- ),
911
+ tool_calls: z.array(z.lazy(() => MessageToolCalls$inboundSchema)),
711
912
  }).transform((v) => {
712
913
  return remap$(v, {
713
914
  "tool_calls": "toolCalls",
@@ -715,23 +916,23 @@ export const DeploymentInvokeMessage1$inboundSchema: z.ZodType<
715
916
  });
716
917
 
717
918
  /** @internal */
718
- export type DeploymentInvokeMessage1$Outbound = {
919
+ export type Message1$Outbound = {
920
+ type: string;
719
921
  role: string;
720
922
  content?: string | null | undefined;
721
- tool_calls: Array<DeploymentInvokeMessageToolCalls$Outbound>;
923
+ tool_calls: Array<MessageToolCalls$Outbound>;
722
924
  };
723
925
 
724
926
  /** @internal */
725
- export const DeploymentInvokeMessage1$outboundSchema: z.ZodType<
726
- DeploymentInvokeMessage1$Outbound,
927
+ export const Message1$outboundSchema: z.ZodType<
928
+ Message1$Outbound,
727
929
  z.ZodTypeDef,
728
- DeploymentInvokeMessage1
930
+ Message1
729
931
  > = z.object({
730
- role: DeploymentInvokeMessageDeploymentsResponseRole$outboundSchema,
932
+ type: MessageType$outboundSchema,
933
+ role: MessageRole$outboundSchema,
731
934
  content: z.nullable(z.string()).optional(),
732
- toolCalls: z.array(
733
- z.lazy(() => DeploymentInvokeMessageToolCalls$outboundSchema),
734
- ),
935
+ toolCalls: z.array(z.lazy(() => MessageToolCalls$outboundSchema)),
735
936
  }).transform((v) => {
736
937
  return remap$(v, {
737
938
  toolCalls: "tool_calls",
@@ -742,89 +943,78 @@ export const DeploymentInvokeMessage1$outboundSchema: z.ZodType<
742
943
  * @internal
743
944
  * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
744
945
  */
745
- export namespace DeploymentInvokeMessage1$ {
746
- /** @deprecated use `DeploymentInvokeMessage1$inboundSchema` instead. */
747
- export const inboundSchema = DeploymentInvokeMessage1$inboundSchema;
748
- /** @deprecated use `DeploymentInvokeMessage1$outboundSchema` instead. */
749
- export const outboundSchema = DeploymentInvokeMessage1$outboundSchema;
750
- /** @deprecated use `DeploymentInvokeMessage1$Outbound` instead. */
751
- export type Outbound = DeploymentInvokeMessage1$Outbound;
946
+ export namespace Message1$ {
947
+ /** @deprecated use `Message1$inboundSchema` instead. */
948
+ export const inboundSchema = Message1$inboundSchema;
949
+ /** @deprecated use `Message1$outboundSchema` instead. */
950
+ export const outboundSchema = Message1$outboundSchema;
951
+ /** @deprecated use `Message1$Outbound` instead. */
952
+ export type Outbound = Message1$Outbound;
752
953
  }
753
954
 
754
- export function deploymentInvokeMessage1ToJSON(
755
- deploymentInvokeMessage1: DeploymentInvokeMessage1,
756
- ): string {
757
- return JSON.stringify(
758
- DeploymentInvokeMessage1$outboundSchema.parse(deploymentInvokeMessage1),
759
- );
955
+ export function message1ToJSON(message1: Message1): string {
956
+ return JSON.stringify(Message1$outboundSchema.parse(message1));
760
957
  }
761
958
 
762
- export function deploymentInvokeMessage1FromJSON(
959
+ export function message1FromJSON(
763
960
  jsonString: string,
764
- ): SafeParseResult<DeploymentInvokeMessage1, SDKValidationError> {
961
+ ): SafeParseResult<Message1, SDKValidationError> {
765
962
  return safeParse(
766
963
  jsonString,
767
- (x) => DeploymentInvokeMessage1$inboundSchema.parse(JSON.parse(x)),
768
- `Failed to parse 'DeploymentInvokeMessage1' from JSON`,
964
+ (x) => Message1$inboundSchema.parse(JSON.parse(x)),
965
+ `Failed to parse 'Message1' from JSON`,
769
966
  );
770
967
  }
771
968
 
772
969
  /** @internal */
773
- export const DeploymentInvokeMessage$inboundSchema: z.ZodType<
774
- DeploymentInvokeMessage,
775
- z.ZodTypeDef,
776
- unknown
777
- > = z.union([
778
- z.lazy(() => DeploymentInvokeMessage2$inboundSchema),
779
- z.lazy(() => DeploymentInvokeMessage3$inboundSchema),
780
- z.lazy(() => DeploymentInvokeMessage1$inboundSchema),
781
- ]);
970
+ export const Message$inboundSchema: z.ZodType<Message, z.ZodTypeDef, unknown> =
971
+ z.union([
972
+ z.lazy(() => Message2$inboundSchema),
973
+ z.lazy(() => Message3$inboundSchema),
974
+ z.lazy(() => Message1$inboundSchema),
975
+ ]);
782
976
 
783
977
  /** @internal */
784
- export type DeploymentInvokeMessage$Outbound =
785
- | DeploymentInvokeMessage2$Outbound
786
- | DeploymentInvokeMessage3$Outbound
787
- | DeploymentInvokeMessage1$Outbound;
978
+ export type Message$Outbound =
979
+ | Message2$Outbound
980
+ | Message3$Outbound
981
+ | Message1$Outbound;
788
982
 
789
983
  /** @internal */
790
- export const DeploymentInvokeMessage$outboundSchema: z.ZodType<
791
- DeploymentInvokeMessage$Outbound,
984
+ export const Message$outboundSchema: z.ZodType<
985
+ Message$Outbound,
792
986
  z.ZodTypeDef,
793
- DeploymentInvokeMessage
987
+ Message
794
988
  > = z.union([
795
- z.lazy(() => DeploymentInvokeMessage2$outboundSchema),
796
- z.lazy(() => DeploymentInvokeMessage3$outboundSchema),
797
- z.lazy(() => DeploymentInvokeMessage1$outboundSchema),
989
+ z.lazy(() => Message2$outboundSchema),
990
+ z.lazy(() => Message3$outboundSchema),
991
+ z.lazy(() => Message1$outboundSchema),
798
992
  ]);
799
993
 
800
994
  /**
801
995
  * @internal
802
996
  * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
803
997
  */
804
- export namespace DeploymentInvokeMessage$ {
805
- /** @deprecated use `DeploymentInvokeMessage$inboundSchema` instead. */
806
- export const inboundSchema = DeploymentInvokeMessage$inboundSchema;
807
- /** @deprecated use `DeploymentInvokeMessage$outboundSchema` instead. */
808
- export const outboundSchema = DeploymentInvokeMessage$outboundSchema;
809
- /** @deprecated use `DeploymentInvokeMessage$Outbound` instead. */
810
- export type Outbound = DeploymentInvokeMessage$Outbound;
998
+ export namespace Message$ {
999
+ /** @deprecated use `Message$inboundSchema` instead. */
1000
+ export const inboundSchema = Message$inboundSchema;
1001
+ /** @deprecated use `Message$outboundSchema` instead. */
1002
+ export const outboundSchema = Message$outboundSchema;
1003
+ /** @deprecated use `Message$Outbound` instead. */
1004
+ export type Outbound = Message$Outbound;
811
1005
  }
812
1006
 
813
- export function deploymentInvokeMessageToJSON(
814
- deploymentInvokeMessage: DeploymentInvokeMessage,
815
- ): string {
816
- return JSON.stringify(
817
- DeploymentInvokeMessage$outboundSchema.parse(deploymentInvokeMessage),
818
- );
1007
+ export function messageToJSON(message: Message): string {
1008
+ return JSON.stringify(Message$outboundSchema.parse(message));
819
1009
  }
820
1010
 
821
- export function deploymentInvokeMessageFromJSON(
1011
+ export function messageFromJSON(
822
1012
  jsonString: string,
823
- ): SafeParseResult<DeploymentInvokeMessage, SDKValidationError> {
1013
+ ): SafeParseResult<Message, SDKValidationError> {
824
1014
  return safeParse(
825
1015
  jsonString,
826
- (x) => DeploymentInvokeMessage$inboundSchema.parse(JSON.parse(x)),
827
- `Failed to parse 'DeploymentInvokeMessage' from JSON`,
1016
+ (x) => Message$inboundSchema.parse(JSON.parse(x)),
1017
+ `Failed to parse 'Message' from JSON`,
828
1018
  );
829
1019
  }
830
1020
 
@@ -836,10 +1026,10 @@ export const DeploymentInvokeChoices$inboundSchema: z.ZodType<
836
1026
  > = z.object({
837
1027
  index: z.number(),
838
1028
  message: z.union([
839
- z.lazy(() => DeploymentInvokeMessage2$inboundSchema),
840
- z.lazy(() => DeploymentInvokeMessage3$inboundSchema),
841
- z.lazy(() => DeploymentInvokeMessage1$inboundSchema),
842
- ]).optional(),
1029
+ z.lazy(() => Message2$inboundSchema),
1030
+ z.lazy(() => Message3$inboundSchema),
1031
+ z.lazy(() => Message1$inboundSchema),
1032
+ ]),
843
1033
  finish_reason: z.nullable(z.string()).optional(),
844
1034
  }).transform((v) => {
845
1035
  return remap$(v, {
@@ -850,11 +1040,7 @@ export const DeploymentInvokeChoices$inboundSchema: z.ZodType<
850
1040
  /** @internal */
851
1041
  export type DeploymentInvokeChoices$Outbound = {
852
1042
  index: number;
853
- message?:
854
- | DeploymentInvokeMessage2$Outbound
855
- | DeploymentInvokeMessage3$Outbound
856
- | DeploymentInvokeMessage1$Outbound
857
- | undefined;
1043
+ message: Message2$Outbound | Message3$Outbound | Message1$Outbound;
858
1044
  finish_reason?: string | null | undefined;
859
1045
  };
860
1046
 
@@ -866,10 +1052,10 @@ export const DeploymentInvokeChoices$outboundSchema: z.ZodType<
866
1052
  > = z.object({
867
1053
  index: z.number(),
868
1054
  message: z.union([
869
- z.lazy(() => DeploymentInvokeMessage2$outboundSchema),
870
- z.lazy(() => DeploymentInvokeMessage3$outboundSchema),
871
- z.lazy(() => DeploymentInvokeMessage1$outboundSchema),
872
- ]).optional(),
1055
+ z.lazy(() => Message2$outboundSchema),
1056
+ z.lazy(() => Message3$outboundSchema),
1057
+ z.lazy(() => Message1$outboundSchema),
1058
+ ]),
873
1059
  finishReason: z.nullable(z.string()).optional(),
874
1060
  }).transform((v) => {
875
1061
  return remap$(v, {
@@ -908,141 +1094,6 @@ export function deploymentInvokeChoicesFromJSON(
908
1094
  );
909
1095
  }
910
1096
 
911
- /** @internal */
912
- export const DeploymentInvokeMetadata$inboundSchema: z.ZodType<
913
- DeploymentInvokeMetadata,
914
- z.ZodTypeDef,
915
- unknown
916
- > = z.object({
917
- file_name: z.string(),
918
- page_number: z.nullable(z.number()),
919
- file_type: z.string(),
920
- rerank_score: z.number().optional(),
921
- search_score: z.number(),
922
- }).transform((v) => {
923
- return remap$(v, {
924
- "file_name": "fileName",
925
- "page_number": "pageNumber",
926
- "file_type": "fileType",
927
- "rerank_score": "rerankScore",
928
- "search_score": "searchScore",
929
- });
930
- });
931
-
932
- /** @internal */
933
- export type DeploymentInvokeMetadata$Outbound = {
934
- file_name: string;
935
- page_number: number | null;
936
- file_type: string;
937
- rerank_score?: number | undefined;
938
- search_score: number;
939
- };
940
-
941
- /** @internal */
942
- export const DeploymentInvokeMetadata$outboundSchema: z.ZodType<
943
- DeploymentInvokeMetadata$Outbound,
944
- z.ZodTypeDef,
945
- DeploymentInvokeMetadata
946
- > = z.object({
947
- fileName: z.string(),
948
- pageNumber: z.nullable(z.number()),
949
- fileType: z.string(),
950
- rerankScore: z.number().optional(),
951
- searchScore: z.number(),
952
- }).transform((v) => {
953
- return remap$(v, {
954
- fileName: "file_name",
955
- pageNumber: "page_number",
956
- fileType: "file_type",
957
- rerankScore: "rerank_score",
958
- searchScore: "search_score",
959
- });
960
- });
961
-
962
- /**
963
- * @internal
964
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
965
- */
966
- export namespace DeploymentInvokeMetadata$ {
967
- /** @deprecated use `DeploymentInvokeMetadata$inboundSchema` instead. */
968
- export const inboundSchema = DeploymentInvokeMetadata$inboundSchema;
969
- /** @deprecated use `DeploymentInvokeMetadata$outboundSchema` instead. */
970
- export const outboundSchema = DeploymentInvokeMetadata$outboundSchema;
971
- /** @deprecated use `DeploymentInvokeMetadata$Outbound` instead. */
972
- export type Outbound = DeploymentInvokeMetadata$Outbound;
973
- }
974
-
975
- export function deploymentInvokeMetadataToJSON(
976
- deploymentInvokeMetadata: DeploymentInvokeMetadata,
977
- ): string {
978
- return JSON.stringify(
979
- DeploymentInvokeMetadata$outboundSchema.parse(deploymentInvokeMetadata),
980
- );
981
- }
982
-
983
- export function deploymentInvokeMetadataFromJSON(
984
- jsonString: string,
985
- ): SafeParseResult<DeploymentInvokeMetadata, SDKValidationError> {
986
- return safeParse(
987
- jsonString,
988
- (x) => DeploymentInvokeMetadata$inboundSchema.parse(JSON.parse(x)),
989
- `Failed to parse 'DeploymentInvokeMetadata' from JSON`,
990
- );
991
- }
992
-
993
- /** @internal */
994
- export const Retrievals$inboundSchema: z.ZodType<
995
- Retrievals,
996
- z.ZodTypeDef,
997
- unknown
998
- > = z.object({
999
- document: z.string(),
1000
- metadata: z.lazy(() => DeploymentInvokeMetadata$inboundSchema),
1001
- });
1002
-
1003
- /** @internal */
1004
- export type Retrievals$Outbound = {
1005
- document: string;
1006
- metadata: DeploymentInvokeMetadata$Outbound;
1007
- };
1008
-
1009
- /** @internal */
1010
- export const Retrievals$outboundSchema: z.ZodType<
1011
- Retrievals$Outbound,
1012
- z.ZodTypeDef,
1013
- Retrievals
1014
- > = z.object({
1015
- document: z.string(),
1016
- metadata: z.lazy(() => DeploymentInvokeMetadata$outboundSchema),
1017
- });
1018
-
1019
- /**
1020
- * @internal
1021
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1022
- */
1023
- export namespace Retrievals$ {
1024
- /** @deprecated use `Retrievals$inboundSchema` instead. */
1025
- export const inboundSchema = Retrievals$inboundSchema;
1026
- /** @deprecated use `Retrievals$outboundSchema` instead. */
1027
- export const outboundSchema = Retrievals$outboundSchema;
1028
- /** @deprecated use `Retrievals$Outbound` instead. */
1029
- export type Outbound = Retrievals$Outbound;
1030
- }
1031
-
1032
- export function retrievalsToJSON(retrievals: Retrievals): string {
1033
- return JSON.stringify(Retrievals$outboundSchema.parse(retrievals));
1034
- }
1035
-
1036
- export function retrievalsFromJSON(
1037
- jsonString: string,
1038
- ): SafeParseResult<Retrievals, SDKValidationError> {
1039
- return safeParse(
1040
- jsonString,
1041
- (x) => Retrievals$inboundSchema.parse(JSON.parse(x)),
1042
- `Failed to parse 'Retrievals' from JSON`,
1043
- );
1044
- }
1045
-
1046
1097
  /** @internal */
1047
1098
  export const DeploymentInvokeResponseBody$inboundSchema: z.ZodType<
1048
1099
  DeploymentInvokeResponseBody,
@@ -1059,9 +1110,9 @@ export const DeploymentInvokeResponseBody$inboundSchema: z.ZodType<
1059
1110
  finalized: z.string().datetime({ offset: true }).transform(v => new Date(v))
1060
1111
  .optional(),
1061
1112
  system_fingerprint: z.nullable(z.string()).optional(),
1062
- choices: z.array(z.lazy(() => DeploymentInvokeChoices$inboundSchema)),
1063
1113
  retrievals: z.array(z.lazy(() => Retrievals$inboundSchema)).optional(),
1064
1114
  provider_response: z.any().optional(),
1115
+ choices: z.array(z.lazy(() => DeploymentInvokeChoices$inboundSchema)),
1065
1116
  }).transform((v) => {
1066
1117
  return remap$(v, {
1067
1118
  "is_final": "isFinal",
@@ -1082,9 +1133,9 @@ export type DeploymentInvokeResponseBody$Outbound = {
1082
1133
  integration_id?: string | undefined;
1083
1134
  finalized?: string | undefined;
1084
1135
  system_fingerprint?: string | null | undefined;
1085
- choices: Array<DeploymentInvokeChoices$Outbound>;
1086
1136
  retrievals?: Array<Retrievals$Outbound> | undefined;
1087
1137
  provider_response?: any | undefined;
1138
+ choices: Array<DeploymentInvokeChoices$Outbound>;
1088
1139
  };
1089
1140
 
1090
1141
  /** @internal */
@@ -1102,9 +1153,9 @@ export const DeploymentInvokeResponseBody$outboundSchema: z.ZodType<
1102
1153
  integrationId: z.string().optional(),
1103
1154
  finalized: z.date().transform(v => v.toISOString()).optional(),
1104
1155
  systemFingerprint: z.nullable(z.string()).optional(),
1105
- choices: z.array(z.lazy(() => DeploymentInvokeChoices$outboundSchema)),
1106
1156
  retrievals: z.array(z.lazy(() => Retrievals$outboundSchema)).optional(),
1107
1157
  providerResponse: z.any().optional(),
1158
+ choices: z.array(z.lazy(() => DeploymentInvokeChoices$outboundSchema)),
1108
1159
  }).transform((v) => {
1109
1160
  return remap$(v, {
1110
1161
  isFinal: "is_final",