@orq-ai/node 4.10.0-rc.45 → 4.10.0-rc.47

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 (149) hide show
  1. package/README.md +36 -41
  2. package/funcs/annotationsCreate.d.ts +3 -0
  3. package/funcs/annotationsCreate.d.ts.map +1 -1
  4. package/funcs/annotationsCreate.js +3 -0
  5. package/funcs/annotationsCreate.js.map +1 -1
  6. package/funcs/annotationsDelete.d.ts +3 -0
  7. package/funcs/annotationsDelete.d.ts.map +1 -1
  8. package/funcs/annotationsDelete.js +3 -0
  9. package/funcs/annotationsDelete.js.map +1 -1
  10. package/funcs/deploymentsInvoke.d.ts +1 -2
  11. package/funcs/deploymentsInvoke.d.ts.map +1 -1
  12. package/funcs/deploymentsInvoke.js +1 -2
  13. package/funcs/deploymentsInvoke.js.map +1 -1
  14. package/jsr.json +1 -1
  15. package/lib/config.d.ts +3 -3
  16. package/lib/config.js +3 -3
  17. package/models/components/agentthoughtstreamingevent.d.ts +12 -12
  18. package/models/components/agentthoughtstreamingevent.d.ts.map +1 -1
  19. package/models/components/agentthoughtstreamingevent.js +17 -17
  20. package/models/components/agentthoughtstreamingevent.js.map +1 -1
  21. package/models/components/index.d.ts +0 -1
  22. package/models/components/index.d.ts.map +1 -1
  23. package/models/components/index.js +0 -1
  24. package/models/components/index.js.map +1 -1
  25. package/models/components/modelmetadata.d.ts +38 -0
  26. package/models/components/modelmetadata.d.ts.map +1 -1
  27. package/models/components/modelmetadata.js +72 -0
  28. package/models/components/modelmetadata.js.map +1 -1
  29. package/models/components/reasoningpart.js +1 -1
  30. package/models/operations/createdataset.js +1 -1
  31. package/models/operations/createdatasetitem.js +4 -4
  32. package/models/operations/createdatasource.js +1 -1
  33. package/models/operations/createeval.d.ts +67 -210
  34. package/models/operations/createeval.d.ts.map +1 -1
  35. package/models/operations/createeval.js +84 -201
  36. package/models/operations/createeval.js.map +1 -1
  37. package/models/operations/createtool.d.ts +10 -10
  38. package/models/operations/createtool.d.ts.map +1 -1
  39. package/models/operations/createtool.js +15 -15
  40. package/models/operations/createtool.js.map +1 -1
  41. package/models/operations/deploymentgetconfig.d.ts +440 -440
  42. package/models/operations/deploymentgetconfig.d.ts.map +1 -1
  43. package/models/operations/deploymentgetconfig.js +479 -484
  44. package/models/operations/deploymentgetconfig.js.map +1 -1
  45. package/models/operations/deploymentinvoke.d.ts +1568 -8
  46. package/models/operations/deploymentinvoke.d.ts.map +1 -1
  47. package/models/operations/deploymentinvoke.js +1137 -12
  48. package/models/operations/deploymentinvoke.js.map +1 -1
  49. package/models/operations/deploymentstream.d.ts +56 -56
  50. package/models/operations/deploymentstream.d.ts.map +1 -1
  51. package/models/operations/deploymentstream.js +72 -73
  52. package/models/operations/deploymentstream.js.map +1 -1
  53. package/models/operations/getalltools.js +6 -6
  54. package/models/operations/getevals.js +16 -16
  55. package/models/operations/getv2humanevalsets.js +2 -2
  56. package/models/operations/getv2humanevalsetsid.js +2 -2
  57. package/models/operations/index.d.ts +0 -1
  58. package/models/operations/index.d.ts.map +1 -1
  59. package/models/operations/index.js +0 -1
  60. package/models/operations/index.js.map +1 -1
  61. package/models/operations/listdatasetdatapoints.js +4 -4
  62. package/models/operations/listdatasets.js +1 -1
  63. package/models/operations/listdatasources.js +1 -1
  64. package/models/operations/patchv2humanevalsetsid.js +2 -2
  65. package/models/operations/postv2feedbackevaluation.js +3 -3
  66. package/models/operations/postv2humanevalsets.js +2 -2
  67. package/models/operations/retrievedatapoint.js +4 -4
  68. package/models/operations/retrievedataset.js +1 -1
  69. package/models/operations/retrievedatasource.js +1 -1
  70. package/models/operations/retrievetool.js +6 -6
  71. package/models/operations/runagent.js +1 -1
  72. package/models/operations/streamrunagent.js +1 -1
  73. package/models/operations/updatedatapoint.js +4 -4
  74. package/models/operations/updatedataset.js +1 -1
  75. package/models/operations/updatedatasource.js +1 -1
  76. package/models/operations/updateeval.d.ts +8 -8
  77. package/models/operations/updateeval.d.ts.map +1 -1
  78. package/models/operations/updateeval.js +26 -26
  79. package/models/operations/updateeval.js.map +1 -1
  80. package/models/operations/updatetool.js +7 -7
  81. package/package.json +5 -5
  82. package/sdk/annotations.d.ts +6 -0
  83. package/sdk/annotations.d.ts.map +1 -1
  84. package/sdk/annotations.js +6 -0
  85. package/sdk/annotations.js.map +1 -1
  86. package/sdk/deployments.d.ts +1 -5
  87. package/sdk/deployments.d.ts.map +1 -1
  88. package/sdk/deployments.js +0 -4
  89. package/sdk/deployments.js.map +1 -1
  90. package/src/funcs/annotationsCreate.ts +3 -0
  91. package/src/funcs/annotationsDelete.ts +3 -0
  92. package/src/funcs/deploymentsInvoke.ts +4 -4
  93. package/src/lib/config.ts +3 -3
  94. package/src/models/components/agentthoughtstreamingevent.ts +43 -55
  95. package/src/models/components/index.ts +0 -1
  96. package/src/models/components/modelmetadata.ts +110 -0
  97. package/src/models/components/reasoningpart.ts +1 -1
  98. package/src/models/operations/createdataset.ts +1 -1
  99. package/src/models/operations/createdatasetitem.ts +4 -4
  100. package/src/models/operations/createdatasource.ts +1 -1
  101. package/src/models/operations/createeval.ts +214 -543
  102. package/src/models/operations/createtool.ts +24 -28
  103. package/src/models/operations/deploymentgetconfig.ts +1606 -1156
  104. package/src/models/operations/deploymentinvoke.ts +3763 -317
  105. package/src/models/operations/deploymentstream.ts +285 -244
  106. package/src/models/operations/getalltools.ts +6 -6
  107. package/src/models/operations/getevals.ts +16 -16
  108. package/src/models/operations/getv2humanevalsets.ts +2 -2
  109. package/src/models/operations/getv2humanevalsetsid.ts +2 -2
  110. package/src/models/operations/index.ts +0 -1
  111. package/src/models/operations/listdatasetdatapoints.ts +4 -4
  112. package/src/models/operations/listdatasets.ts +1 -1
  113. package/src/models/operations/listdatasources.ts +1 -1
  114. package/src/models/operations/patchv2humanevalsetsid.ts +2 -2
  115. package/src/models/operations/postv2feedbackevaluation.ts +3 -3
  116. package/src/models/operations/postv2humanevalsets.ts +2 -2
  117. package/src/models/operations/retrievedatapoint.ts +4 -4
  118. package/src/models/operations/retrievedataset.ts +1 -1
  119. package/src/models/operations/retrievedatasource.ts +1 -1
  120. package/src/models/operations/retrievetool.ts +6 -6
  121. package/src/models/operations/runagent.ts +1 -1
  122. package/src/models/operations/streamrunagent.ts +1 -1
  123. package/src/models/operations/updatedatapoint.ts +4 -4
  124. package/src/models/operations/updatedataset.ts +1 -1
  125. package/src/models/operations/updatedatasource.ts +1 -1
  126. package/src/models/operations/updateeval.ts +32 -34
  127. package/src/models/operations/updatetool.ts +7 -7
  128. package/src/sdk/annotations.ts +6 -0
  129. package/src/sdk/deployments.ts +1 -8
  130. package/funcs/deploymentsMetricsCreate.d.ts +0 -19
  131. package/funcs/deploymentsMetricsCreate.d.ts.map +0 -1
  132. package/funcs/deploymentsMetricsCreate.js +0 -123
  133. package/funcs/deploymentsMetricsCreate.js.map +0 -1
  134. package/models/components/invokedeploymentrequest.d.ts +0 -1573
  135. package/models/components/invokedeploymentrequest.d.ts.map +0 -1
  136. package/models/components/invokedeploymentrequest.js +0 -1137
  137. package/models/components/invokedeploymentrequest.js.map +0 -1
  138. package/models/operations/deploymentcreatemetric.d.ts +0 -1032
  139. package/models/operations/deploymentcreatemetric.d.ts.map +0 -1
  140. package/models/operations/deploymentcreatemetric.js +0 -749
  141. package/models/operations/deploymentcreatemetric.js.map +0 -1
  142. package/sdk/metrics.d.ts +0 -14
  143. package/sdk/metrics.d.ts.map +0 -1
  144. package/sdk/metrics.js +0 -24
  145. package/sdk/metrics.js.map +0 -1
  146. package/src/funcs/deploymentsMetricsCreate.ts +0 -171
  147. package/src/models/components/invokedeploymentrequest.ts +0 -3457
  148. package/src/models/operations/deploymentcreatemetric.ts +0 -2370
  149. package/src/sdk/metrics.ts +0 -29
@@ -7,334 +7,3787 @@ import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { safeParse } from "../../lib/schemas.js";
8
8
  import { ClosedEnum } from "../../types/enums.js";
9
9
  import { Result as SafeParseResult } from "../../types/fp.js";
10
+ import * as components from "../components/index.js";
10
11
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
12
 
13
+ export type DeploymentInvokeContentDeployments2 =
14
+ components.TextContentPartSchema;
15
+
12
16
  /**
13
- * Indicates the type of model used to generate the response
17
+ * The contents of the tool message.
14
18
  */
15
- export const DeploymentInvokeObject = {
16
- Chat: "chat",
17
- Completion: "completion",
18
- Image: "image",
19
+ export type DeploymentInvokePrefixMessagesDeploymentsRequestRequestBodyContent =
20
+ | string
21
+ | Array<components.TextContentPartSchema>;
22
+
23
+ /**
24
+ * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
25
+ */
26
+ export const DeploymentInvokePrefixMessagesType = {
27
+ Ephemeral: "ephemeral",
19
28
  } as const;
20
29
  /**
21
- * Indicates the type of model used to generate the response
30
+ * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
22
31
  */
23
- export type DeploymentInvokeObject = ClosedEnum<typeof DeploymentInvokeObject>;
32
+ export type DeploymentInvokePrefixMessagesType = ClosedEnum<
33
+ typeof DeploymentInvokePrefixMessagesType
34
+ >;
24
35
 
25
36
  /**
26
- * The provider used to generate the response
37
+ * The time-to-live for the cache control breakpoint. This may be one of the following values:
38
+ *
39
+ * @remarks
40
+ *
41
+ * - `5m`: 5 minutes
42
+ * - `1h`: 1 hour
43
+ *
44
+ * Defaults to `5m`. Only supported by `Anthropic` Claude models.
27
45
  */
28
- export const Provider = {
29
- Openai: "openai",
30
- Groq: "groq",
31
- Cohere: "cohere",
32
- Azure: "azure",
33
- Aws: "aws",
34
- Google: "google",
35
- GoogleAi: "google-ai",
36
- Huggingface: "huggingface",
37
- Togetherai: "togetherai",
38
- Perplexity: "perplexity",
39
- Anthropic: "anthropic",
40
- Leonardoai: "leonardoai",
41
- Fal: "fal",
42
- Nvidia: "nvidia",
43
- Jina: "jina",
44
- Elevenlabs: "elevenlabs",
45
- Litellm: "litellm",
46
- Cerebras: "cerebras",
47
- Openailike: "openailike",
48
- Bytedance: "bytedance",
49
- Mistral: "mistral",
50
- Deepseek: "deepseek",
51
- Contextualai: "contextualai",
52
- Moonshotai: "moonshotai",
53
- Zai: "zai",
54
- Minimax: "minimax",
55
- Xai: "xai",
56
- Alibaba: "alibaba",
57
- Tensorix: "tensorix",
58
- Scaleway: "scaleway",
59
- Hcompany: "hcompany",
60
- Inceptron: "inceptron",
61
- Slack: "slack",
62
- Orq: "orq",
46
+ export const PrefixMessagesTtl = {
47
+ Fivem: "5m",
48
+ Oneh: "1h",
63
49
  } as const;
64
50
  /**
65
- * The provider used to generate the response
51
+ * The time-to-live for the cache control breakpoint. This may be one of the following values:
52
+ *
53
+ * @remarks
54
+ *
55
+ * - `5m`: 5 minutes
56
+ * - `1h`: 1 hour
57
+ *
58
+ * Defaults to `5m`. Only supported by `Anthropic` Claude models.
66
59
  */
67
- export type Provider = ClosedEnum<typeof Provider>;
60
+ export type PrefixMessagesTtl = ClosedEnum<typeof PrefixMessagesTtl>;
68
61
 
69
- export type Telemetry = {
62
+ export type PrefixMessagesCacheControl = {
70
63
  /**
71
- * The trace id for the request that generated this response
64
+ * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
72
65
  */
73
- traceId: string;
66
+ type: DeploymentInvokePrefixMessagesType;
74
67
  /**
75
- * The span id for the request that generated this response
68
+ * The time-to-live for the cache control breakpoint. This may be one of the following values:
69
+ *
70
+ * @remarks
71
+ *
72
+ * - `5m`: 5 minutes
73
+ * - `1h`: 1 hour
74
+ *
75
+ * Defaults to `5m`. Only supported by `Anthropic` Claude models.
76
76
  */
77
- spanId: string;
77
+ ttl?: PrefixMessagesTtl | undefined;
78
+ };
79
+
80
+ export type ToolMessage = {
81
+ /**
82
+ * The role of the messages author, in this case tool.
83
+ */
84
+ role: "tool";
85
+ /**
86
+ * The contents of the tool message.
87
+ */
88
+ content: string | Array<components.TextContentPartSchema>;
89
+ /**
90
+ * Tool call that this message is responding to.
91
+ */
92
+ toolCallId: string | null;
93
+ cacheControl?: PrefixMessagesCacheControl | undefined;
94
+ };
95
+
96
+ export type DeploymentInvokeContent2 =
97
+ | (components.TextContentPartSchema & { type: "text" })
98
+ | components.RefusalPartSchema
99
+ | components.ReasoningPartSchema
100
+ | components.RedactedReasoningPartSchema;
101
+
102
+ /**
103
+ * The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified.
104
+ */
105
+ export type DeploymentInvokePrefixMessagesDeploymentsRequestContent =
106
+ | string
107
+ | Array<
108
+ | (components.TextContentPartSchema & { type: "text" })
109
+ | components.RefusalPartSchema
110
+ | components.ReasoningPartSchema
111
+ | components.RedactedReasoningPartSchema
112
+ >;
113
+
114
+ /**
115
+ * Data about a previous audio response from the model.
116
+ */
117
+ export type Audio = {
118
+ /**
119
+ * Unique identifier for a previous audio response from the model.
120
+ */
121
+ id: string;
78
122
  };
79
123
 
80
124
  /**
81
- * Metadata of the retrieved chunk from the knowledge base
125
+ * The type of the tool. Currently, only `function` is supported.
82
126
  */
83
- export type DeploymentInvokeMetadata = {
127
+ export const PrefixMessagesType = {
128
+ Function: "function",
129
+ } as const;
130
+ /**
131
+ * The type of the tool. Currently, only `function` is supported.
132
+ */
133
+ export type PrefixMessagesType = ClosedEnum<typeof PrefixMessagesType>;
134
+
135
+ export type PrefixMessagesFunction = {
84
136
  /**
85
- * Name of the file
137
+ * The name of the function to call.
86
138
  */
87
- fileName: string;
139
+ name?: string | undefined;
88
140
  /**
89
- * Page number of the chunk
141
+ * The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.
90
142
  */
91
- pageNumber: number | null;
143
+ arguments?: string | undefined;
144
+ };
145
+
146
+ export type PrefixMessagesToolCalls = {
92
147
  /**
93
- * Type of the file
148
+ * The ID of the tool call.
94
149
  */
95
- fileType: string;
150
+ id: string;
96
151
  /**
97
- * 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
152
+ * The type of the tool. Currently, only `function` is supported.
98
153
  */
99
- rerankScore?: number | undefined;
154
+ type: PrefixMessagesType;
155
+ function: PrefixMessagesFunction;
100
156
  /**
101
- * 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.
157
+ * Encrypted representation of the model internal reasoning state during function calling. Required by Gemini 3 models when continuing a conversation after a tool call.
102
158
  */
103
- searchScore: number;
159
+ thoughtSignature?: string | undefined;
104
160
  };
105
161
 
106
- export type Retrievals = {
162
+ export type AssistantMessage = {
107
163
  /**
108
- * Content of the retrieved chunk from the knowledge base
164
+ * The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified.
109
165
  */
110
- document: string;
166
+ content?:
167
+ | string
168
+ | Array<
169
+ | (components.TextContentPartSchema & { type: "text" })
170
+ | components.RefusalPartSchema
171
+ | components.ReasoningPartSchema
172
+ | components.RedactedReasoningPartSchema
173
+ >
174
+ | null
175
+ | undefined;
111
176
  /**
112
- * Metadata of the retrieved chunk from the knowledge base
177
+ * The refusal message by the assistant.
113
178
  */
114
- metadata: DeploymentInvokeMetadata;
179
+ refusal?: string | null | undefined;
180
+ /**
181
+ * The role of the messages author, in this case `assistant`.
182
+ */
183
+ role: "assistant";
184
+ /**
185
+ * An optional name for the participant. Provides the model information to differentiate between participants of the same role.
186
+ */
187
+ name?: string | undefined;
188
+ /**
189
+ * Data about a previous audio response from the model.
190
+ */
191
+ audio?: Audio | null | undefined;
192
+ /**
193
+ * The tool calls generated by the model, such as function calls.
194
+ */
195
+ toolCalls?: Array<PrefixMessagesToolCalls> | undefined;
196
+ };
197
+
198
+ /**
199
+ * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
200
+ */
201
+ export const DeploymentInvoke2DeploymentsType = {
202
+ Ephemeral: "ephemeral",
203
+ } as const;
204
+ /**
205
+ * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
206
+ */
207
+ export type DeploymentInvoke2DeploymentsType = ClosedEnum<
208
+ typeof DeploymentInvoke2DeploymentsType
209
+ >;
210
+
211
+ /**
212
+ * The time-to-live for the cache control breakpoint. This may be one of the following values:
213
+ *
214
+ * @remarks
215
+ *
216
+ * - `5m`: 5 minutes
217
+ * - `1h`: 1 hour
218
+ *
219
+ * Defaults to `5m`. Only supported by `Anthropic` Claude models.
220
+ */
221
+ export const Ttl = {
222
+ Fivem: "5m",
223
+ Oneh: "1h",
224
+ } as const;
225
+ /**
226
+ * The time-to-live for the cache control breakpoint. This may be one of the following values:
227
+ *
228
+ * @remarks
229
+ *
230
+ * - `5m`: 5 minutes
231
+ * - `1h`: 1 hour
232
+ *
233
+ * Defaults to `5m`. Only supported by `Anthropic` Claude models.
234
+ */
235
+ export type Ttl = ClosedEnum<typeof Ttl>;
236
+
237
+ export type CacheControl = {
238
+ /**
239
+ * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
240
+ */
241
+ type: DeploymentInvoke2DeploymentsType;
242
+ /**
243
+ * The time-to-live for the cache control breakpoint. This may be one of the following values:
244
+ *
245
+ * @remarks
246
+ *
247
+ * - `5m`: 5 minutes
248
+ * - `1h`: 1 hour
249
+ *
250
+ * Defaults to `5m`. Only supported by `Anthropic` Claude models.
251
+ */
252
+ ttl?: Ttl | undefined;
253
+ };
254
+
255
+ export type Four = {
256
+ /**
257
+ * The type of the content part. Always `file`.
258
+ */
259
+ type: "file";
260
+ cacheControl?: CacheControl | undefined;
261
+ /**
262
+ * File data for the content part. Must contain either file_data or uri, but not both.
263
+ */
264
+ file: components.FileContentPartSchema;
265
+ };
266
+
267
+ export type Content2 =
268
+ | (components.TextContentPartSchema & { type: "text" })
269
+ | components.ImageContentPartSchema
270
+ | components.AudioContentPartSchema
271
+ | Four;
272
+
273
+ /**
274
+ * The contents of the user message.
275
+ */
276
+ export type DeploymentInvokePrefixMessagesDeploymentsContent =
277
+ | string
278
+ | Array<
279
+ | (components.TextContentPartSchema & { type: "text" })
280
+ | components.ImageContentPartSchema
281
+ | components.AudioContentPartSchema
282
+ | Four
283
+ >;
284
+
285
+ export type UserMessage = {
286
+ /**
287
+ * The role of the messages author, in this case `user`.
288
+ */
289
+ role: "user";
290
+ /**
291
+ * An optional name for the participant. Provides the model information to differentiate between participants of the same role.
292
+ */
293
+ name?: string | undefined;
294
+ /**
295
+ * The contents of the user message.
296
+ */
297
+ content:
298
+ | string
299
+ | Array<
300
+ | (components.TextContentPartSchema & { type: "text" })
301
+ | components.ImageContentPartSchema
302
+ | components.AudioContentPartSchema
303
+ | Four
304
+ >;
305
+ };
306
+
307
+ /**
308
+ * The contents of the developer message.
309
+ */
310
+ export type DeploymentInvokePrefixMessagesContent =
311
+ | string
312
+ | Array<components.TextContentPartSchema>;
313
+
314
+ export type DeveloperMessage = {
315
+ /**
316
+ * The role of the messages author, in this case `developer`.
317
+ */
318
+ role: "developer";
319
+ /**
320
+ * The contents of the developer message.
321
+ */
322
+ content: string | Array<components.TextContentPartSchema>;
323
+ /**
324
+ * An optional name for the participant. Provides the model information to differentiate between participants of the same role.
325
+ */
326
+ name?: string | undefined;
327
+ };
328
+
329
+ /**
330
+ * The contents of the system message.
331
+ */
332
+ export type PrefixMessagesContent =
333
+ | string
334
+ | Array<components.TextContentPartSchema>;
335
+
336
+ /**
337
+ * Developer-provided instructions that the model should follow, regardless of messages sent by the user.
338
+ */
339
+ export type SystemMessage = {
340
+ /**
341
+ * The role of the messages author, in this case `system`.
342
+ */
343
+ role: "system";
344
+ /**
345
+ * The contents of the system message.
346
+ */
347
+ content: string | Array<components.TextContentPartSchema>;
348
+ /**
349
+ * An optional name for the participant. Provides the model information to differentiate between participants of the same role.
350
+ */
351
+ name?: string | undefined;
352
+ };
353
+
354
+ export type PrefixMessages =
355
+ | SystemMessage
356
+ | DeveloperMessage
357
+ | UserMessage
358
+ | AssistantMessage
359
+ | ToolMessage;
360
+
361
+ export type DeploymentInvokeContentDeploymentsRequestRequestBodyMessages2 =
362
+ components.TextContentPartSchema;
363
+
364
+ /**
365
+ * The contents of the tool message.
366
+ */
367
+ export type DeploymentInvokeMessagesDeploymentsRequestRequestBodyContent =
368
+ | string
369
+ | Array<components.TextContentPartSchema>;
370
+
371
+ /**
372
+ * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
373
+ */
374
+ export const DeploymentInvokeMessagesType = {
375
+ Ephemeral: "ephemeral",
376
+ } as const;
377
+ /**
378
+ * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
379
+ */
380
+ export type DeploymentInvokeMessagesType = ClosedEnum<
381
+ typeof DeploymentInvokeMessagesType
382
+ >;
383
+
384
+ /**
385
+ * The time-to-live for the cache control breakpoint. This may be one of the following values:
386
+ *
387
+ * @remarks
388
+ *
389
+ * - `5m`: 5 minutes
390
+ * - `1h`: 1 hour
391
+ *
392
+ * Defaults to `5m`. Only supported by `Anthropic` Claude models.
393
+ */
394
+ export const MessagesTtl = {
395
+ Fivem: "5m",
396
+ Oneh: "1h",
397
+ } as const;
398
+ /**
399
+ * The time-to-live for the cache control breakpoint. This may be one of the following values:
400
+ *
401
+ * @remarks
402
+ *
403
+ * - `5m`: 5 minutes
404
+ * - `1h`: 1 hour
405
+ *
406
+ * Defaults to `5m`. Only supported by `Anthropic` Claude models.
407
+ */
408
+ export type MessagesTtl = ClosedEnum<typeof MessagesTtl>;
409
+
410
+ export type MessagesCacheControl = {
411
+ /**
412
+ * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
413
+ */
414
+ type: DeploymentInvokeMessagesType;
415
+ /**
416
+ * The time-to-live for the cache control breakpoint. This may be one of the following values:
417
+ *
418
+ * @remarks
419
+ *
420
+ * - `5m`: 5 minutes
421
+ * - `1h`: 1 hour
422
+ *
423
+ * Defaults to `5m`. Only supported by `Anthropic` Claude models.
424
+ */
425
+ ttl?: MessagesTtl | undefined;
115
426
  };
116
427
 
117
- export type PromptTokensDetails = {
118
- cachedTokens?: number | null | undefined;
119
- };
428
+ export type MessagesToolMessage = {
429
+ /**
430
+ * The role of the messages author, in this case tool.
431
+ */
432
+ role: "tool";
433
+ /**
434
+ * The contents of the tool message.
435
+ */
436
+ content: string | Array<components.TextContentPartSchema>;
437
+ /**
438
+ * Tool call that this message is responding to.
439
+ */
440
+ toolCallId: string | null;
441
+ cacheControl?: MessagesCacheControl | undefined;
442
+ };
443
+
444
+ export type DeploymentInvokeContentDeploymentsRequestRequestBody2 =
445
+ | (components.TextContentPartSchema & { type: "text" })
446
+ | components.RefusalPartSchema
447
+ | components.ReasoningPartSchema
448
+ | components.RedactedReasoningPartSchema;
449
+
450
+ /**
451
+ * The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified.
452
+ */
453
+ export type DeploymentInvokeMessagesDeploymentsRequestContent =
454
+ | string
455
+ | Array<
456
+ | (components.TextContentPartSchema & { type: "text" })
457
+ | components.RefusalPartSchema
458
+ | components.ReasoningPartSchema
459
+ | components.RedactedReasoningPartSchema
460
+ >;
461
+
462
+ /**
463
+ * Data about a previous audio response from the model.
464
+ */
465
+ export type MessagesAudio = {
466
+ /**
467
+ * Unique identifier for a previous audio response from the model.
468
+ */
469
+ id: string;
470
+ };
471
+
472
+ /**
473
+ * The type of the tool. Currently, only `function` is supported.
474
+ */
475
+ export const MessagesType = {
476
+ Function: "function",
477
+ } as const;
478
+ /**
479
+ * The type of the tool. Currently, only `function` is supported.
480
+ */
481
+ export type MessagesType = ClosedEnum<typeof MessagesType>;
482
+
483
+ export type MessagesFunction = {
484
+ /**
485
+ * The name of the function to call.
486
+ */
487
+ name?: string | undefined;
488
+ /**
489
+ * The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.
490
+ */
491
+ arguments?: string | undefined;
492
+ };
493
+
494
+ export type MessagesToolCalls = {
495
+ /**
496
+ * The ID of the tool call.
497
+ */
498
+ id: string;
499
+ /**
500
+ * The type of the tool. Currently, only `function` is supported.
501
+ */
502
+ type: MessagesType;
503
+ function: MessagesFunction;
504
+ /**
505
+ * Encrypted representation of the model internal reasoning state during function calling. Required by Gemini 3 models when continuing a conversation after a tool call.
506
+ */
507
+ thoughtSignature?: string | undefined;
508
+ };
509
+
510
+ export type MessagesAssistantMessage = {
511
+ /**
512
+ * The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified.
513
+ */
514
+ content?:
515
+ | string
516
+ | Array<
517
+ | (components.TextContentPartSchema & { type: "text" })
518
+ | components.RefusalPartSchema
519
+ | components.ReasoningPartSchema
520
+ | components.RedactedReasoningPartSchema
521
+ >
522
+ | null
523
+ | undefined;
524
+ /**
525
+ * The refusal message by the assistant.
526
+ */
527
+ refusal?: string | null | undefined;
528
+ /**
529
+ * The role of the messages author, in this case `assistant`.
530
+ */
531
+ role: "assistant";
532
+ /**
533
+ * An optional name for the participant. Provides the model information to differentiate between participants of the same role.
534
+ */
535
+ name?: string | undefined;
536
+ /**
537
+ * Data about a previous audio response from the model.
538
+ */
539
+ audio?: MessagesAudio | null | undefined;
540
+ /**
541
+ * The tool calls generated by the model, such as function calls.
542
+ */
543
+ toolCalls?: Array<MessagesToolCalls> | undefined;
544
+ };
545
+
546
+ /**
547
+ * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
548
+ */
549
+ export const DeploymentInvoke2DeploymentsRequestRequestBodyType = {
550
+ Ephemeral: "ephemeral",
551
+ } as const;
552
+ /**
553
+ * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
554
+ */
555
+ export type DeploymentInvoke2DeploymentsRequestRequestBodyType = ClosedEnum<
556
+ typeof DeploymentInvoke2DeploymentsRequestRequestBodyType
557
+ >;
558
+
559
+ /**
560
+ * The time-to-live for the cache control breakpoint. This may be one of the following values:
561
+ *
562
+ * @remarks
563
+ *
564
+ * - `5m`: 5 minutes
565
+ * - `1h`: 1 hour
566
+ *
567
+ * Defaults to `5m`. Only supported by `Anthropic` Claude models.
568
+ */
569
+ export const TwoTtl = {
570
+ Fivem: "5m",
571
+ Oneh: "1h",
572
+ } as const;
573
+ /**
574
+ * The time-to-live for the cache control breakpoint. This may be one of the following values:
575
+ *
576
+ * @remarks
577
+ *
578
+ * - `5m`: 5 minutes
579
+ * - `1h`: 1 hour
580
+ *
581
+ * Defaults to `5m`. Only supported by `Anthropic` Claude models.
582
+ */
583
+ export type TwoTtl = ClosedEnum<typeof TwoTtl>;
584
+
585
+ export type TwoCacheControl = {
586
+ /**
587
+ * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
588
+ */
589
+ type: DeploymentInvoke2DeploymentsRequestRequestBodyType;
590
+ /**
591
+ * The time-to-live for the cache control breakpoint. This may be one of the following values:
592
+ *
593
+ * @remarks
594
+ *
595
+ * - `5m`: 5 minutes
596
+ * - `1h`: 1 hour
597
+ *
598
+ * Defaults to `5m`. Only supported by `Anthropic` Claude models.
599
+ */
600
+ ttl?: TwoTtl | undefined;
601
+ };
602
+
603
+ export type Two4 = {
604
+ /**
605
+ * The type of the content part. Always `file`.
606
+ */
607
+ type: "file";
608
+ cacheControl?: TwoCacheControl | undefined;
609
+ /**
610
+ * File data for the content part. Must contain either file_data or uri, but not both.
611
+ */
612
+ file: components.FileContentPartSchema;
613
+ };
614
+
615
+ export type DeploymentInvokeContentDeploymentsRequest2 =
616
+ | (components.TextContentPartSchema & { type: "text" })
617
+ | components.ImageContentPartSchema
618
+ | components.AudioContentPartSchema
619
+ | Two4;
620
+
621
+ /**
622
+ * The contents of the user message.
623
+ */
624
+ export type DeploymentInvokeMessagesDeploymentsContent =
625
+ | string
626
+ | Array<
627
+ | (components.TextContentPartSchema & { type: "text" })
628
+ | components.ImageContentPartSchema
629
+ | components.AudioContentPartSchema
630
+ | Two4
631
+ >;
632
+
633
+ export type MessagesUserMessage = {
634
+ /**
635
+ * The role of the messages author, in this case `user`.
636
+ */
637
+ role: "user";
638
+ /**
639
+ * An optional name for the participant. Provides the model information to differentiate between participants of the same role.
640
+ */
641
+ name?: string | undefined;
642
+ /**
643
+ * The contents of the user message.
644
+ */
645
+ content:
646
+ | string
647
+ | Array<
648
+ | (components.TextContentPartSchema & { type: "text" })
649
+ | components.ImageContentPartSchema
650
+ | components.AudioContentPartSchema
651
+ | Two4
652
+ >;
653
+ };
654
+
655
+ /**
656
+ * The contents of the developer message.
657
+ */
658
+ export type DeploymentInvokeMessagesContent =
659
+ | string
660
+ | Array<components.TextContentPartSchema>;
661
+
662
+ export type MessagesDeveloperMessage = {
663
+ /**
664
+ * The role of the messages author, in this case `developer`.
665
+ */
666
+ role: "developer";
667
+ /**
668
+ * The contents of the developer message.
669
+ */
670
+ content: string | Array<components.TextContentPartSchema>;
671
+ /**
672
+ * An optional name for the participant. Provides the model information to differentiate between participants of the same role.
673
+ */
674
+ name?: string | undefined;
675
+ };
676
+
677
+ /**
678
+ * The contents of the system message.
679
+ */
680
+ export type MessagesContent = string | Array<components.TextContentPartSchema>;
681
+
682
+ /**
683
+ * Developer-provided instructions that the model should follow, regardless of messages sent by the user.
684
+ */
685
+ export type MessagesSystemMessage = {
686
+ /**
687
+ * The role of the messages author, in this case `system`.
688
+ */
689
+ role: "system";
690
+ /**
691
+ * The contents of the system message.
692
+ */
693
+ content: string | Array<components.TextContentPartSchema>;
694
+ /**
695
+ * An optional name for the participant. Provides the model information to differentiate between participants of the same role.
696
+ */
697
+ name?: string | undefined;
698
+ };
699
+
700
+ export type DeploymentInvokeMessages =
701
+ | MessagesSystemMessage
702
+ | MessagesDeveloperMessage
703
+ | MessagesUserMessage
704
+ | MessagesAssistantMessage
705
+ | MessagesToolMessage;
706
+
707
+ /**
708
+ * Metadata about the document
709
+ */
710
+ export type Metadata = {
711
+ /**
712
+ * Name of the file the text is from.
713
+ */
714
+ fileName?: string | undefined;
715
+ /**
716
+ * Content type of the file the text is from.
717
+ */
718
+ fileType?: string | undefined;
719
+ /**
720
+ * The page number the text is from.
721
+ */
722
+ pageNumber?: number | undefined;
723
+ };
724
+
725
+ export type Documents = {
726
+ /**
727
+ * The text content of the document
728
+ */
729
+ text: string;
730
+ /**
731
+ * Metadata about the document
732
+ */
733
+ metadata?: Metadata | undefined;
734
+ };
735
+
736
+ export type InvokeOptions = {
737
+ /**
738
+ * Whether to include the retrieved knowledge chunks in the response.
739
+ */
740
+ includeRetrievals?: boolean | undefined;
741
+ /**
742
+ * Whether to include the usage metrics in the response.
743
+ */
744
+ includeUsage?: boolean | undefined;
745
+ /**
746
+ * A mock response to use instead of calling the LLM API. This is useful for testing purposes. When provided, the system will return a response object with this content as the completion, without making an actual API call to the LLM provider. This works for both streaming and non-streaming requests. Mock responses will not generate logs, traces or be counted for your plan usage.
747
+ */
748
+ mockResponse?: string | undefined;
749
+ };
750
+
751
+ export type Thread = {
752
+ /**
753
+ * Unique thread identifier to group related invocations.
754
+ */
755
+ id: string;
756
+ /**
757
+ * Optional tags to differentiate or categorize threads
758
+ */
759
+ tags?: Array<string> | undefined;
760
+ };
761
+
762
+ /**
763
+ * Exists
764
+ */
765
+ export type OrExists = {
766
+ exists: boolean;
767
+ };
768
+
769
+ export type DeploymentInvokeOrNin = string | number | boolean;
770
+
771
+ /**
772
+ * Not in
773
+ */
774
+ export type OrNin = {
775
+ nin: Array<string | number | boolean>;
776
+ };
777
+
778
+ export type DeploymentInvokeOrIn = string | number | boolean;
779
+
780
+ /**
781
+ * In
782
+ */
783
+ export type OrIn = {
784
+ in: Array<string | number | boolean>;
785
+ };
786
+
787
+ /**
788
+ * Less than or equal to
789
+ */
790
+ export type OrLte = {
791
+ lte: number;
792
+ };
793
+
794
+ /**
795
+ * Less than
796
+ */
797
+ export type OrLt = {
798
+ lt: number;
799
+ };
800
+
801
+ /**
802
+ * Greater than or equal to
803
+ */
804
+ export type OrGte = {
805
+ gte: number;
806
+ };
807
+
808
+ /**
809
+ * Greater than
810
+ */
811
+ export type OrGt = {
812
+ gt: number;
813
+ };
814
+
815
+ export type DeploymentInvokeOrNe = string | number | boolean;
816
+
817
+ /**
818
+ * Not equal to
819
+ */
820
+ export type OrNe = {
821
+ ne: string | number | boolean;
822
+ };
823
+
824
+ export type DeploymentInvokeOrEq = string | number | boolean;
825
+
826
+ /**
827
+ * Equal to
828
+ */
829
+ export type OrEq = {
830
+ eq: string | number | boolean;
831
+ };
832
+
833
+ export type KnowledgeFilterOr =
834
+ | OrEq
835
+ | OrNe
836
+ | OrGt
837
+ | OrGte
838
+ | OrLt
839
+ | OrLte
840
+ | OrIn
841
+ | OrNin
842
+ | OrExists;
843
+
844
+ /**
845
+ * Or
846
+ */
847
+ export type Or = {
848
+ or: Array<
849
+ {
850
+ [k: string]:
851
+ | OrEq
852
+ | OrNe
853
+ | OrGt
854
+ | OrGte
855
+ | OrLt
856
+ | OrLte
857
+ | OrIn
858
+ | OrNin
859
+ | OrExists;
860
+ }
861
+ >;
862
+ };
863
+
864
+ /**
865
+ * Exists
866
+ */
867
+ export type AndExists = {
868
+ exists: boolean;
869
+ };
870
+
871
+ export type DeploymentInvokeAndNin = string | number | boolean;
872
+
873
+ /**
874
+ * Not in
875
+ */
876
+ export type AndNin = {
877
+ nin: Array<string | number | boolean>;
878
+ };
879
+
880
+ export type DeploymentInvokeAndIn = string | number | boolean;
881
+
882
+ /**
883
+ * In
884
+ */
885
+ export type AndIn = {
886
+ in: Array<string | number | boolean>;
887
+ };
888
+
889
+ /**
890
+ * Less than or equal to
891
+ */
892
+ export type AndLte = {
893
+ lte: number;
894
+ };
895
+
896
+ /**
897
+ * Less than
898
+ */
899
+ export type AndLt = {
900
+ lt: number;
901
+ };
902
+
903
+ /**
904
+ * Greater than or equal to
905
+ */
906
+ export type AndGte = {
907
+ gte: number;
908
+ };
909
+
910
+ /**
911
+ * Greater than
912
+ */
913
+ export type AndGt = {
914
+ gt: number;
915
+ };
916
+
917
+ export type DeploymentInvokeAndNe = string | number | boolean;
918
+
919
+ /**
920
+ * Not equal to
921
+ */
922
+ export type AndNe = {
923
+ ne: string | number | boolean;
924
+ };
925
+
926
+ export type DeploymentInvokeAndEq = string | number | boolean;
927
+
928
+ /**
929
+ * Equal to
930
+ */
931
+ export type AndEq = {
932
+ eq: string | number | boolean;
933
+ };
934
+
935
+ export type KnowledgeFilterAnd =
936
+ | AndEq
937
+ | AndNe
938
+ | AndGt
939
+ | AndGte
940
+ | AndLt
941
+ | AndLte
942
+ | AndIn
943
+ | AndNin
944
+ | AndExists;
945
+
946
+ /**
947
+ * And
948
+ */
949
+ export type And = {
950
+ and: Array<
951
+ {
952
+ [k: string]:
953
+ | AndEq
954
+ | AndNe
955
+ | AndGt
956
+ | AndGte
957
+ | AndLt
958
+ | AndLte
959
+ | AndIn
960
+ | AndNin
961
+ | AndExists;
962
+ }
963
+ >;
964
+ };
965
+
966
+ /**
967
+ * Exists
968
+ */
969
+ export type Exists = {
970
+ exists: boolean;
971
+ };
972
+
973
+ export type OneNin = string | number | boolean;
974
+
975
+ /**
976
+ * Not in
977
+ */
978
+ export type Nin = {
979
+ nin: Array<string | number | boolean>;
980
+ };
981
+
982
+ export type OneIn = string | number | boolean;
983
+
984
+ /**
985
+ * In
986
+ */
987
+ export type In = {
988
+ in: Array<string | number | boolean>;
989
+ };
990
+
991
+ /**
992
+ * Less than or equal to
993
+ */
994
+ export type Lte = {
995
+ lte: number;
996
+ };
997
+
998
+ /**
999
+ * Less than
1000
+ */
1001
+ export type Lt = {
1002
+ lt: number;
1003
+ };
1004
+
1005
+ /**
1006
+ * Greater than or equal to
1007
+ */
1008
+ export type Gte = {
1009
+ gte: number;
1010
+ };
1011
+
1012
+ /**
1013
+ * Greater than
1014
+ */
1015
+ export type Gt = {
1016
+ gt: number;
1017
+ };
1018
+
1019
+ export type OneNe = string | number | boolean;
1020
+
1021
+ /**
1022
+ * Not equal to
1023
+ */
1024
+ export type Ne = {
1025
+ ne: string | number | boolean;
1026
+ };
1027
+
1028
+ export type OneEq = string | number | boolean;
1029
+
1030
+ /**
1031
+ * Equal to
1032
+ */
1033
+ export type Eq = {
1034
+ eq: string | number | boolean;
1035
+ };
1036
+
1037
+ export type KnowledgeFilter1 =
1038
+ | Eq
1039
+ | Ne
1040
+ | Gt
1041
+ | Gte
1042
+ | Lt
1043
+ | Lte
1044
+ | In
1045
+ | Nin
1046
+ | Exists;
1047
+
1048
+ /**
1049
+ * A filter to apply to the knowledge base chunk metadata when using knowledge bases in the deployment.
1050
+ */
1051
+ export type KnowledgeFilter = And | Or | {
1052
+ [k: string]: Eq | Ne | Gt | Gte | Lt | Lte | In | Nin | Exists;
1053
+ };
1054
+
1055
+ export type DeploymentInvokeRequestBody = {
1056
+ /**
1057
+ * The deployment key to invoke
1058
+ */
1059
+ key: string;
1060
+ /**
1061
+ * If set, partial message content will be sent. Tokens will be sent as data-only `server-sent events` as they become available, with the stream terminated by a `data: [DONE]` message.
1062
+ */
1063
+ stream?: boolean | undefined;
1064
+ /**
1065
+ * 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.
1066
+ */
1067
+ inputs?: { [k: string]: any } | undefined;
1068
+ /**
1069
+ * Key-value pairs that match your data model and fields declared in your deployment routing configuration
1070
+ */
1071
+ context?: { [k: string]: any } | undefined;
1072
+ /**
1073
+ * A list of messages to include after the `System` message, but before the `User` and `Assistant` pairs configured in your deployment.
1074
+ */
1075
+ prefixMessages?:
1076
+ | Array<
1077
+ | SystemMessage
1078
+ | DeveloperMessage
1079
+ | UserMessage
1080
+ | AssistantMessage
1081
+ | ToolMessage
1082
+ >
1083
+ | undefined;
1084
+ /**
1085
+ * A list of messages to send to the deployment.
1086
+ */
1087
+ messages?:
1088
+ | Array<
1089
+ | MessagesSystemMessage
1090
+ | MessagesDeveloperMessage
1091
+ | MessagesUserMessage
1092
+ | MessagesAssistantMessage
1093
+ | MessagesToolMessage
1094
+ >
1095
+ | undefined;
1096
+ /**
1097
+ * Information about the identity making the request. If the identity does not exist, it will be created automatically.
1098
+ */
1099
+ identity?: components.PublicIdentity | undefined;
1100
+ /**
1101
+ * A list of file IDs that are associated with the deployment request.
1102
+ */
1103
+ fileIds?: Array<string> | undefined;
1104
+ /**
1105
+ * Key-value pairs that you want to attach to the log generated by this request.
1106
+ */
1107
+ metadata?: { [k: string]: any } | undefined;
1108
+ /**
1109
+ * 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.
1110
+ */
1111
+ extraParams?: { [k: string]: any } | undefined;
1112
+ /**
1113
+ * A list of documents from your external knowledge base (e.g., chunks retrieved from your own vector database or RAG pipeline) that provide context for the model response. These documents can be used by evaluators and guardrails to assess the relevance and accuracy of the model output against the provided context.
1114
+ */
1115
+ documents?: Array<Documents> | undefined;
1116
+ invokeOptions?: InvokeOptions | undefined;
1117
+ thread?: Thread | undefined;
1118
+ /**
1119
+ * A filter to apply to the knowledge base chunk metadata when using knowledge bases in the deployment.
1120
+ */
1121
+ knowledgeFilter?: And | Or | {
1122
+ [k: string]: Eq | Ne | Gt | Gte | Lt | Lte | In | Nin | Exists;
1123
+ } | undefined;
1124
+ };
1125
+
1126
+ /**
1127
+ * Indicates the type of model used to generate the response
1128
+ */
1129
+ export const DeploymentInvokeObject = {
1130
+ Chat: "chat",
1131
+ Completion: "completion",
1132
+ Image: "image",
1133
+ } as const;
1134
+ /**
1135
+ * Indicates the type of model used to generate the response
1136
+ */
1137
+ export type DeploymentInvokeObject = ClosedEnum<typeof DeploymentInvokeObject>;
1138
+
1139
+ /**
1140
+ * The provider used to generate the response
1141
+ */
1142
+ export const Provider = {
1143
+ Openai: "openai",
1144
+ Groq: "groq",
1145
+ Cohere: "cohere",
1146
+ Azure: "azure",
1147
+ Aws: "aws",
1148
+ Google: "google",
1149
+ GoogleAi: "google-ai",
1150
+ Huggingface: "huggingface",
1151
+ Togetherai: "togetherai",
1152
+ Perplexity: "perplexity",
1153
+ Anthropic: "anthropic",
1154
+ Leonardoai: "leonardoai",
1155
+ Fal: "fal",
1156
+ Nvidia: "nvidia",
1157
+ Jina: "jina",
1158
+ Elevenlabs: "elevenlabs",
1159
+ Litellm: "litellm",
1160
+ Cerebras: "cerebras",
1161
+ Openailike: "openailike",
1162
+ Bytedance: "bytedance",
1163
+ Mistral: "mistral",
1164
+ Deepseek: "deepseek",
1165
+ Contextualai: "contextualai",
1166
+ Moonshotai: "moonshotai",
1167
+ Zai: "zai",
1168
+ Minimax: "minimax",
1169
+ Xai: "xai",
1170
+ Alibaba: "alibaba",
1171
+ Tensorix: "tensorix",
1172
+ Scaleway: "scaleway",
1173
+ Hcompany: "hcompany",
1174
+ Inceptron: "inceptron",
1175
+ Slack: "slack",
1176
+ Orq: "orq",
1177
+ } as const;
1178
+ /**
1179
+ * The provider used to generate the response
1180
+ */
1181
+ export type Provider = ClosedEnum<typeof Provider>;
1182
+
1183
+ export type Telemetry = {
1184
+ /**
1185
+ * The trace id for the request that generated this response
1186
+ */
1187
+ traceId: string;
1188
+ /**
1189
+ * The span id for the request that generated this response
1190
+ */
1191
+ spanId: string;
1192
+ };
1193
+
1194
+ /**
1195
+ * Metadata of the retrieved chunk from the knowledge base
1196
+ */
1197
+ export type DeploymentInvokeMetadata = {
1198
+ /**
1199
+ * Name of the file
1200
+ */
1201
+ fileName: string;
1202
+ /**
1203
+ * Page number of the chunk
1204
+ */
1205
+ pageNumber: number | null;
1206
+ /**
1207
+ * Type of the file
1208
+ */
1209
+ fileType: string;
1210
+ /**
1211
+ * 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
1212
+ */
1213
+ rerankScore?: number | undefined;
1214
+ /**
1215
+ * 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.
1216
+ */
1217
+ searchScore: number;
1218
+ };
1219
+
1220
+ export type Retrievals = {
1221
+ /**
1222
+ * Content of the retrieved chunk from the knowledge base
1223
+ */
1224
+ document: string;
1225
+ /**
1226
+ * Metadata of the retrieved chunk from the knowledge base
1227
+ */
1228
+ metadata: DeploymentInvokeMetadata;
1229
+ };
1230
+
1231
+ export type PromptTokensDetails = {
1232
+ cachedTokens?: number | null | undefined;
1233
+ };
1234
+
1235
+ export type CompletionTokensDetails = {
1236
+ reasoningTokens?: number | null | undefined;
1237
+ };
1238
+
1239
+ /**
1240
+ * Usage metrics for the response
1241
+ */
1242
+ export type Usage = {
1243
+ totalTokens?: number | undefined;
1244
+ promptTokens?: number | undefined;
1245
+ completionTokens?: number | undefined;
1246
+ promptTokensDetails?: PromptTokensDetails | undefined;
1247
+ completionTokensDetails?: CompletionTokensDetails | null | undefined;
1248
+ };
1249
+
1250
+ /**
1251
+ * The role of the prompt message
1252
+ */
1253
+ export const DeploymentInvokeMessageDeploymentsRole = {
1254
+ System: "system",
1255
+ Developer: "developer",
1256
+ Assistant: "assistant",
1257
+ User: "user",
1258
+ Exception: "exception",
1259
+ Tool: "tool",
1260
+ Prompt: "prompt",
1261
+ Correction: "correction",
1262
+ ExpectedOutput: "expected_output",
1263
+ } as const;
1264
+ /**
1265
+ * The role of the prompt message
1266
+ */
1267
+ export type DeploymentInvokeMessageDeploymentsRole = ClosedEnum<
1268
+ typeof DeploymentInvokeMessageDeploymentsRole
1269
+ >;
1270
+
1271
+ export type Message3 = {
1272
+ type: "image";
1273
+ /**
1274
+ * The role of the prompt message
1275
+ */
1276
+ role: DeploymentInvokeMessageDeploymentsRole;
1277
+ url: string;
1278
+ };
1279
+
1280
+ /**
1281
+ * The role of the prompt message
1282
+ */
1283
+ export const DeploymentInvokeMessageRole = {
1284
+ System: "system",
1285
+ Developer: "developer",
1286
+ Assistant: "assistant",
1287
+ User: "user",
1288
+ Exception: "exception",
1289
+ Tool: "tool",
1290
+ Prompt: "prompt",
1291
+ Correction: "correction",
1292
+ ExpectedOutput: "expected_output",
1293
+ } as const;
1294
+ /**
1295
+ * The role of the prompt message
1296
+ */
1297
+ export type DeploymentInvokeMessageRole = ClosedEnum<
1298
+ typeof DeploymentInvokeMessageRole
1299
+ >;
1300
+
1301
+ export type Message2 = {
1302
+ type: "content";
1303
+ /**
1304
+ * The role of the prompt message
1305
+ */
1306
+ role: DeploymentInvokeMessageRole;
1307
+ content: string | null;
1308
+ /**
1309
+ * Internal thought process of the model
1310
+ */
1311
+ reasoning?: string | undefined;
1312
+ /**
1313
+ * The signature holds a cryptographic token which verifies that the thinking block was generated by the model, and is verified when thinking is part of a multiturn conversation. This value should not be modified and should always be sent to the API when the reasoning is redacted. Currently only supported by `Anthropic`.
1314
+ */
1315
+ reasoningSignature?: string | undefined;
1316
+ /**
1317
+ * Occasionally the model's internal reasoning will be flagged by the safety systems of the provider. When this occurs, the provider will encrypt the reasoning. These redacted reasoning is decrypted when passed back to the API, allowing the model to continue its response without losing context.
1318
+ */
1319
+ redactedReasoning?: string | undefined;
1320
+ };
1321
+
1322
+ /**
1323
+ * The role of the prompt message
1324
+ */
1325
+ export const MessageRole = {
1326
+ System: "system",
1327
+ Developer: "developer",
1328
+ Assistant: "assistant",
1329
+ User: "user",
1330
+ Exception: "exception",
1331
+ Tool: "tool",
1332
+ Prompt: "prompt",
1333
+ Correction: "correction",
1334
+ ExpectedOutput: "expected_output",
1335
+ } as const;
1336
+ /**
1337
+ * The role of the prompt message
1338
+ */
1339
+ export type MessageRole = ClosedEnum<typeof MessageRole>;
1340
+
1341
+ export const DeploymentInvokeMessageDeploymentsResponseType = {
1342
+ Function: "function",
1343
+ } as const;
1344
+ export type DeploymentInvokeMessageDeploymentsResponseType = ClosedEnum<
1345
+ typeof DeploymentInvokeMessageDeploymentsResponseType
1346
+ >;
1347
+
1348
+ export type MessageFunction = {
1349
+ name: string;
1350
+ /**
1351
+ * JSON string arguments for the functions
1352
+ */
1353
+ arguments: string;
1354
+ };
1355
+
1356
+ export type MessageToolCalls = {
1357
+ id?: string | undefined;
1358
+ index?: number | undefined;
1359
+ type: DeploymentInvokeMessageDeploymentsResponseType;
1360
+ function: MessageFunction;
1361
+ };
1362
+
1363
+ export type Message1 = {
1364
+ type: "tool_calls";
1365
+ /**
1366
+ * The role of the prompt message
1367
+ */
1368
+ role: MessageRole;
1369
+ content?: string | null | undefined;
1370
+ toolCalls: Array<MessageToolCalls>;
1371
+ /**
1372
+ * Internal thought process of the model
1373
+ */
1374
+ reasoning?: string | undefined;
1375
+ /**
1376
+ * The signature holds a cryptographic token which verifies that the thinking block was generated by the model, and is verified when thinking is part of a multiturn conversation. This value should not be modified and should always be sent to the API when the reasoning is redacted. Currently only supported by `Anthropic`.
1377
+ */
1378
+ reasoningSignature?: string | undefined;
1379
+ /**
1380
+ * Occasionally the model's internal reasoning will be flagged by the safety systems of the provider. When this occurs, the provider will encrypt the reasoning. These redacted reasoning is decrypted when passed back to the API, allowing the model to continue its response without losing context.
1381
+ */
1382
+ redactedReasoning?: string | undefined;
1383
+ };
1384
+
1385
+ export type Message = Message1 | Message2 | Message3;
1386
+
1387
+ export type Choices = {
1388
+ index: number;
1389
+ message: Message1 | Message2 | Message3;
1390
+ finishReason?: string | null | undefined;
1391
+ };
1392
+
1393
+ /**
1394
+ * Successful operation
1395
+ */
1396
+ export type DeploymentInvokeResponseBody = {
1397
+ /**
1398
+ * A unique identifier for the response. Can be used to add metrics to the transaction.
1399
+ */
1400
+ id: string;
1401
+ /**
1402
+ * A timestamp indicating when the object was created. Usually in a standardized format like ISO 8601
1403
+ */
1404
+ created: Date;
1405
+ /**
1406
+ * Indicates the type of model used to generate the response
1407
+ */
1408
+ object: DeploymentInvokeObject;
1409
+ /**
1410
+ * The model used to generate the response
1411
+ */
1412
+ model: string;
1413
+ /**
1414
+ * The provider used to generate the response
1415
+ */
1416
+ provider: Provider;
1417
+ /**
1418
+ * Indicates if the response is the final response
1419
+ */
1420
+ isFinal: boolean;
1421
+ /**
1422
+ * Indicates integration id used to generate the response
1423
+ */
1424
+ integrationId?: string | undefined;
1425
+ telemetry: Telemetry;
1426
+ /**
1427
+ * A timestamp indicating when the object was finalized. Usually in a standardized format like ISO 8601
1428
+ */
1429
+ finalized?: Date | undefined;
1430
+ /**
1431
+ * Provider backed system fingerprint.
1432
+ */
1433
+ systemFingerprint?: string | null | undefined;
1434
+ /**
1435
+ * 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`.
1436
+ */
1437
+ retrievals?: Array<Retrievals> | undefined;
1438
+ /**
1439
+ * 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`.
1440
+ */
1441
+ providerResponse?: any | undefined;
1442
+ /**
1443
+ * Usage metrics for the response
1444
+ */
1445
+ usage?: Usage | null | undefined;
1446
+ /**
1447
+ * A list of choices generated by the model
1448
+ */
1449
+ choices: Array<Choices>;
1450
+ };
1451
+
1452
+ /** @internal */
1453
+ export type DeploymentInvokeContentDeployments2$Outbound =
1454
+ components.TextContentPartSchema$Outbound;
1455
+
1456
+ /** @internal */
1457
+ export const DeploymentInvokeContentDeployments2$outboundSchema: z.ZodType<
1458
+ DeploymentInvokeContentDeployments2$Outbound,
1459
+ z.ZodTypeDef,
1460
+ DeploymentInvokeContentDeployments2
1461
+ > = components.TextContentPartSchema$outboundSchema;
1462
+
1463
+ export function deploymentInvokeContentDeployments2ToJSON(
1464
+ deploymentInvokeContentDeployments2: DeploymentInvokeContentDeployments2,
1465
+ ): string {
1466
+ return JSON.stringify(
1467
+ DeploymentInvokeContentDeployments2$outboundSchema.parse(
1468
+ deploymentInvokeContentDeployments2,
1469
+ ),
1470
+ );
1471
+ }
1472
+
1473
+ /** @internal */
1474
+ export type DeploymentInvokePrefixMessagesDeploymentsRequestRequestBodyContent$Outbound =
1475
+ | string
1476
+ | Array<components.TextContentPartSchema$Outbound>;
1477
+
1478
+ /** @internal */
1479
+ export const DeploymentInvokePrefixMessagesDeploymentsRequestRequestBodyContent$outboundSchema:
1480
+ z.ZodType<
1481
+ DeploymentInvokePrefixMessagesDeploymentsRequestRequestBodyContent$Outbound,
1482
+ z.ZodTypeDef,
1483
+ DeploymentInvokePrefixMessagesDeploymentsRequestRequestBodyContent
1484
+ > = z.union([
1485
+ z.string(),
1486
+ z.array(components.TextContentPartSchema$outboundSchema),
1487
+ ]);
1488
+
1489
+ export function deploymentInvokePrefixMessagesDeploymentsRequestRequestBodyContentToJSON(
1490
+ deploymentInvokePrefixMessagesDeploymentsRequestRequestBodyContent:
1491
+ DeploymentInvokePrefixMessagesDeploymentsRequestRequestBodyContent,
1492
+ ): string {
1493
+ return JSON.stringify(
1494
+ DeploymentInvokePrefixMessagesDeploymentsRequestRequestBodyContent$outboundSchema
1495
+ .parse(
1496
+ deploymentInvokePrefixMessagesDeploymentsRequestRequestBodyContent,
1497
+ ),
1498
+ );
1499
+ }
1500
+
1501
+ /** @internal */
1502
+ export const DeploymentInvokePrefixMessagesType$outboundSchema: z.ZodNativeEnum<
1503
+ typeof DeploymentInvokePrefixMessagesType
1504
+ > = z.nativeEnum(DeploymentInvokePrefixMessagesType);
1505
+
1506
+ /** @internal */
1507
+ export const PrefixMessagesTtl$outboundSchema: z.ZodNativeEnum<
1508
+ typeof PrefixMessagesTtl
1509
+ > = z.nativeEnum(PrefixMessagesTtl);
1510
+
1511
+ /** @internal */
1512
+ export type PrefixMessagesCacheControl$Outbound = {
1513
+ type: string;
1514
+ ttl: string;
1515
+ };
1516
+
1517
+ /** @internal */
1518
+ export const PrefixMessagesCacheControl$outboundSchema: z.ZodType<
1519
+ PrefixMessagesCacheControl$Outbound,
1520
+ z.ZodTypeDef,
1521
+ PrefixMessagesCacheControl
1522
+ > = z.object({
1523
+ type: DeploymentInvokePrefixMessagesType$outboundSchema,
1524
+ ttl: PrefixMessagesTtl$outboundSchema.default("5m"),
1525
+ });
1526
+
1527
+ export function prefixMessagesCacheControlToJSON(
1528
+ prefixMessagesCacheControl: PrefixMessagesCacheControl,
1529
+ ): string {
1530
+ return JSON.stringify(
1531
+ PrefixMessagesCacheControl$outboundSchema.parse(prefixMessagesCacheControl),
1532
+ );
1533
+ }
1534
+
1535
+ /** @internal */
1536
+ export type ToolMessage$Outbound = {
1537
+ role: "tool";
1538
+ content: string | Array<components.TextContentPartSchema$Outbound>;
1539
+ tool_call_id: string | null;
1540
+ cache_control?: PrefixMessagesCacheControl$Outbound | undefined;
1541
+ };
1542
+
1543
+ /** @internal */
1544
+ export const ToolMessage$outboundSchema: z.ZodType<
1545
+ ToolMessage$Outbound,
1546
+ z.ZodTypeDef,
1547
+ ToolMessage
1548
+ > = z.object({
1549
+ role: z.literal("tool"),
1550
+ content: z.union([
1551
+ z.string(),
1552
+ z.array(components.TextContentPartSchema$outboundSchema),
1553
+ ]),
1554
+ toolCallId: z.nullable(z.string()),
1555
+ cacheControl: z.lazy(() => PrefixMessagesCacheControl$outboundSchema)
1556
+ .optional(),
1557
+ }).transform((v) => {
1558
+ return remap$(v, {
1559
+ toolCallId: "tool_call_id",
1560
+ cacheControl: "cache_control",
1561
+ });
1562
+ });
1563
+
1564
+ export function toolMessageToJSON(toolMessage: ToolMessage): string {
1565
+ return JSON.stringify(ToolMessage$outboundSchema.parse(toolMessage));
1566
+ }
1567
+
1568
+ /** @internal */
1569
+ export type DeploymentInvokeContent2$Outbound =
1570
+ | (components.TextContentPartSchema$Outbound & { type: "text" })
1571
+ | components.RefusalPartSchema$Outbound
1572
+ | components.ReasoningPartSchema$Outbound
1573
+ | components.RedactedReasoningPartSchema$Outbound;
1574
+
1575
+ /** @internal */
1576
+ export const DeploymentInvokeContent2$outboundSchema: z.ZodType<
1577
+ DeploymentInvokeContent2$Outbound,
1578
+ z.ZodTypeDef,
1579
+ DeploymentInvokeContent2
1580
+ > = z.union([
1581
+ components.TextContentPartSchema$outboundSchema.and(
1582
+ z.object({ type: z.literal("text") }),
1583
+ ),
1584
+ components.RefusalPartSchema$outboundSchema,
1585
+ components.ReasoningPartSchema$outboundSchema,
1586
+ components.RedactedReasoningPartSchema$outboundSchema,
1587
+ ]);
1588
+
1589
+ export function deploymentInvokeContent2ToJSON(
1590
+ deploymentInvokeContent2: DeploymentInvokeContent2,
1591
+ ): string {
1592
+ return JSON.stringify(
1593
+ DeploymentInvokeContent2$outboundSchema.parse(deploymentInvokeContent2),
1594
+ );
1595
+ }
1596
+
1597
+ /** @internal */
1598
+ export type DeploymentInvokePrefixMessagesDeploymentsRequestContent$Outbound =
1599
+ | string
1600
+ | Array<
1601
+ | (components.TextContentPartSchema$Outbound & { type: "text" })
1602
+ | components.RefusalPartSchema$Outbound
1603
+ | components.ReasoningPartSchema$Outbound
1604
+ | components.RedactedReasoningPartSchema$Outbound
1605
+ >;
1606
+
1607
+ /** @internal */
1608
+ export const DeploymentInvokePrefixMessagesDeploymentsRequestContent$outboundSchema:
1609
+ z.ZodType<
1610
+ DeploymentInvokePrefixMessagesDeploymentsRequestContent$Outbound,
1611
+ z.ZodTypeDef,
1612
+ DeploymentInvokePrefixMessagesDeploymentsRequestContent
1613
+ > = z.union([
1614
+ z.string(),
1615
+ z.array(
1616
+ z.union([
1617
+ components.TextContentPartSchema$outboundSchema.and(
1618
+ z.object({ type: z.literal("text") }),
1619
+ ),
1620
+ components.RefusalPartSchema$outboundSchema,
1621
+ components.ReasoningPartSchema$outboundSchema,
1622
+ components.RedactedReasoningPartSchema$outboundSchema,
1623
+ ]),
1624
+ ),
1625
+ ]);
1626
+
1627
+ export function deploymentInvokePrefixMessagesDeploymentsRequestContentToJSON(
1628
+ deploymentInvokePrefixMessagesDeploymentsRequestContent:
1629
+ DeploymentInvokePrefixMessagesDeploymentsRequestContent,
1630
+ ): string {
1631
+ return JSON.stringify(
1632
+ DeploymentInvokePrefixMessagesDeploymentsRequestContent$outboundSchema
1633
+ .parse(deploymentInvokePrefixMessagesDeploymentsRequestContent),
1634
+ );
1635
+ }
1636
+
1637
+ /** @internal */
1638
+ export type Audio$Outbound = {
1639
+ id: string;
1640
+ };
1641
+
1642
+ /** @internal */
1643
+ export const Audio$outboundSchema: z.ZodType<
1644
+ Audio$Outbound,
1645
+ z.ZodTypeDef,
1646
+ Audio
1647
+ > = z.object({
1648
+ id: z.string(),
1649
+ });
1650
+
1651
+ export function audioToJSON(audio: Audio): string {
1652
+ return JSON.stringify(Audio$outboundSchema.parse(audio));
1653
+ }
1654
+
1655
+ /** @internal */
1656
+ export const PrefixMessagesType$outboundSchema: z.ZodNativeEnum<
1657
+ typeof PrefixMessagesType
1658
+ > = z.nativeEnum(PrefixMessagesType);
1659
+
1660
+ /** @internal */
1661
+ export type PrefixMessagesFunction$Outbound = {
1662
+ name?: string | undefined;
1663
+ arguments?: string | undefined;
1664
+ };
1665
+
1666
+ /** @internal */
1667
+ export const PrefixMessagesFunction$outboundSchema: z.ZodType<
1668
+ PrefixMessagesFunction$Outbound,
1669
+ z.ZodTypeDef,
1670
+ PrefixMessagesFunction
1671
+ > = z.object({
1672
+ name: z.string().optional(),
1673
+ arguments: z.string().optional(),
1674
+ });
1675
+
1676
+ export function prefixMessagesFunctionToJSON(
1677
+ prefixMessagesFunction: PrefixMessagesFunction,
1678
+ ): string {
1679
+ return JSON.stringify(
1680
+ PrefixMessagesFunction$outboundSchema.parse(prefixMessagesFunction),
1681
+ );
1682
+ }
1683
+
1684
+ /** @internal */
1685
+ export type PrefixMessagesToolCalls$Outbound = {
1686
+ id: string;
1687
+ type: string;
1688
+ function: PrefixMessagesFunction$Outbound;
1689
+ thought_signature?: string | undefined;
1690
+ };
1691
+
1692
+ /** @internal */
1693
+ export const PrefixMessagesToolCalls$outboundSchema: z.ZodType<
1694
+ PrefixMessagesToolCalls$Outbound,
1695
+ z.ZodTypeDef,
1696
+ PrefixMessagesToolCalls
1697
+ > = z.object({
1698
+ id: z.string(),
1699
+ type: PrefixMessagesType$outboundSchema,
1700
+ function: z.lazy(() => PrefixMessagesFunction$outboundSchema),
1701
+ thoughtSignature: z.string().optional(),
1702
+ }).transform((v) => {
1703
+ return remap$(v, {
1704
+ thoughtSignature: "thought_signature",
1705
+ });
1706
+ });
1707
+
1708
+ export function prefixMessagesToolCallsToJSON(
1709
+ prefixMessagesToolCalls: PrefixMessagesToolCalls,
1710
+ ): string {
1711
+ return JSON.stringify(
1712
+ PrefixMessagesToolCalls$outboundSchema.parse(prefixMessagesToolCalls),
1713
+ );
1714
+ }
1715
+
1716
+ /** @internal */
1717
+ export type AssistantMessage$Outbound = {
1718
+ content?:
1719
+ | string
1720
+ | Array<
1721
+ | (components.TextContentPartSchema$Outbound & { type: "text" })
1722
+ | components.RefusalPartSchema$Outbound
1723
+ | components.ReasoningPartSchema$Outbound
1724
+ | components.RedactedReasoningPartSchema$Outbound
1725
+ >
1726
+ | null
1727
+ | undefined;
1728
+ refusal?: string | null | undefined;
1729
+ role: "assistant";
1730
+ name?: string | undefined;
1731
+ audio?: Audio$Outbound | null | undefined;
1732
+ tool_calls?: Array<PrefixMessagesToolCalls$Outbound> | undefined;
1733
+ };
1734
+
1735
+ /** @internal */
1736
+ export const AssistantMessage$outboundSchema: z.ZodType<
1737
+ AssistantMessage$Outbound,
1738
+ z.ZodTypeDef,
1739
+ AssistantMessage
1740
+ > = z.object({
1741
+ content: z.nullable(
1742
+ z.union([
1743
+ z.string(),
1744
+ z.array(
1745
+ z.union([
1746
+ components.TextContentPartSchema$outboundSchema.and(
1747
+ z.object({ type: z.literal("text") }),
1748
+ ),
1749
+ components.RefusalPartSchema$outboundSchema,
1750
+ components.ReasoningPartSchema$outboundSchema,
1751
+ components.RedactedReasoningPartSchema$outboundSchema,
1752
+ ]),
1753
+ ),
1754
+ ]),
1755
+ ).optional(),
1756
+ refusal: z.nullable(z.string()).optional(),
1757
+ role: z.literal("assistant"),
1758
+ name: z.string().optional(),
1759
+ audio: z.nullable(z.lazy(() => Audio$outboundSchema)).optional(),
1760
+ toolCalls: z.array(z.lazy(() => PrefixMessagesToolCalls$outboundSchema))
1761
+ .optional(),
1762
+ }).transform((v) => {
1763
+ return remap$(v, {
1764
+ toolCalls: "tool_calls",
1765
+ });
1766
+ });
1767
+
1768
+ export function assistantMessageToJSON(
1769
+ assistantMessage: AssistantMessage,
1770
+ ): string {
1771
+ return JSON.stringify(
1772
+ AssistantMessage$outboundSchema.parse(assistantMessage),
1773
+ );
1774
+ }
1775
+
1776
+ /** @internal */
1777
+ export const DeploymentInvoke2DeploymentsType$outboundSchema: z.ZodNativeEnum<
1778
+ typeof DeploymentInvoke2DeploymentsType
1779
+ > = z.nativeEnum(DeploymentInvoke2DeploymentsType);
1780
+
1781
+ /** @internal */
1782
+ export const Ttl$outboundSchema: z.ZodNativeEnum<typeof Ttl> = z.nativeEnum(
1783
+ Ttl,
1784
+ );
1785
+
1786
+ /** @internal */
1787
+ export type CacheControl$Outbound = {
1788
+ type: string;
1789
+ ttl: string;
1790
+ };
1791
+
1792
+ /** @internal */
1793
+ export const CacheControl$outboundSchema: z.ZodType<
1794
+ CacheControl$Outbound,
1795
+ z.ZodTypeDef,
1796
+ CacheControl
1797
+ > = z.object({
1798
+ type: DeploymentInvoke2DeploymentsType$outboundSchema,
1799
+ ttl: Ttl$outboundSchema.default("5m"),
1800
+ });
1801
+
1802
+ export function cacheControlToJSON(cacheControl: CacheControl): string {
1803
+ return JSON.stringify(CacheControl$outboundSchema.parse(cacheControl));
1804
+ }
1805
+
1806
+ /** @internal */
1807
+ export type Four$Outbound = {
1808
+ type: "file";
1809
+ cache_control?: CacheControl$Outbound | undefined;
1810
+ file: components.FileContentPartSchema$Outbound;
1811
+ };
1812
+
1813
+ /** @internal */
1814
+ export const Four$outboundSchema: z.ZodType<Four$Outbound, z.ZodTypeDef, Four> =
1815
+ z.object({
1816
+ type: z.literal("file"),
1817
+ cacheControl: z.lazy(() => CacheControl$outboundSchema).optional(),
1818
+ file: components.FileContentPartSchema$outboundSchema,
1819
+ }).transform((v) => {
1820
+ return remap$(v, {
1821
+ cacheControl: "cache_control",
1822
+ });
1823
+ });
1824
+
1825
+ export function fourToJSON(four: Four): string {
1826
+ return JSON.stringify(Four$outboundSchema.parse(four));
1827
+ }
1828
+
1829
+ /** @internal */
1830
+ export type Content2$Outbound =
1831
+ | (components.TextContentPartSchema$Outbound & { type: "text" })
1832
+ | components.ImageContentPartSchema$Outbound
1833
+ | components.AudioContentPartSchema$Outbound
1834
+ | Four$Outbound;
1835
+
1836
+ /** @internal */
1837
+ export const Content2$outboundSchema: z.ZodType<
1838
+ Content2$Outbound,
1839
+ z.ZodTypeDef,
1840
+ Content2
1841
+ > = z.union([
1842
+ components.TextContentPartSchema$outboundSchema.and(
1843
+ z.object({ type: z.literal("text") }),
1844
+ ),
1845
+ components.ImageContentPartSchema$outboundSchema,
1846
+ components.AudioContentPartSchema$outboundSchema,
1847
+ z.lazy(() => Four$outboundSchema),
1848
+ ]);
1849
+
1850
+ export function content2ToJSON(content2: Content2): string {
1851
+ return JSON.stringify(Content2$outboundSchema.parse(content2));
1852
+ }
1853
+
1854
+ /** @internal */
1855
+ export type DeploymentInvokePrefixMessagesDeploymentsContent$Outbound =
1856
+ | string
1857
+ | Array<
1858
+ | (components.TextContentPartSchema$Outbound & { type: "text" })
1859
+ | components.ImageContentPartSchema$Outbound
1860
+ | components.AudioContentPartSchema$Outbound
1861
+ | Four$Outbound
1862
+ >;
1863
+
1864
+ /** @internal */
1865
+ export const DeploymentInvokePrefixMessagesDeploymentsContent$outboundSchema:
1866
+ z.ZodType<
1867
+ DeploymentInvokePrefixMessagesDeploymentsContent$Outbound,
1868
+ z.ZodTypeDef,
1869
+ DeploymentInvokePrefixMessagesDeploymentsContent
1870
+ > = z.union([
1871
+ z.string(),
1872
+ z.array(
1873
+ z.union([
1874
+ components.TextContentPartSchema$outboundSchema.and(
1875
+ z.object({ type: z.literal("text") }),
1876
+ ),
1877
+ components.ImageContentPartSchema$outboundSchema,
1878
+ components.AudioContentPartSchema$outboundSchema,
1879
+ z.lazy(() => Four$outboundSchema),
1880
+ ]),
1881
+ ),
1882
+ ]);
1883
+
1884
+ export function deploymentInvokePrefixMessagesDeploymentsContentToJSON(
1885
+ deploymentInvokePrefixMessagesDeploymentsContent:
1886
+ DeploymentInvokePrefixMessagesDeploymentsContent,
1887
+ ): string {
1888
+ return JSON.stringify(
1889
+ DeploymentInvokePrefixMessagesDeploymentsContent$outboundSchema.parse(
1890
+ deploymentInvokePrefixMessagesDeploymentsContent,
1891
+ ),
1892
+ );
1893
+ }
1894
+
1895
+ /** @internal */
1896
+ export type UserMessage$Outbound = {
1897
+ role: "user";
1898
+ name?: string | undefined;
1899
+ content:
1900
+ | string
1901
+ | Array<
1902
+ | (components.TextContentPartSchema$Outbound & { type: "text" })
1903
+ | components.ImageContentPartSchema$Outbound
1904
+ | components.AudioContentPartSchema$Outbound
1905
+ | Four$Outbound
1906
+ >;
1907
+ };
1908
+
1909
+ /** @internal */
1910
+ export const UserMessage$outboundSchema: z.ZodType<
1911
+ UserMessage$Outbound,
1912
+ z.ZodTypeDef,
1913
+ UserMessage
1914
+ > = z.object({
1915
+ role: z.literal("user"),
1916
+ name: z.string().optional(),
1917
+ content: z.union([
1918
+ z.string(),
1919
+ z.array(
1920
+ z.union([
1921
+ components.TextContentPartSchema$outboundSchema.and(
1922
+ z.object({ type: z.literal("text") }),
1923
+ ),
1924
+ components.ImageContentPartSchema$outboundSchema,
1925
+ components.AudioContentPartSchema$outboundSchema,
1926
+ z.lazy(() => Four$outboundSchema),
1927
+ ]),
1928
+ ),
1929
+ ]),
1930
+ });
1931
+
1932
+ export function userMessageToJSON(userMessage: UserMessage): string {
1933
+ return JSON.stringify(UserMessage$outboundSchema.parse(userMessage));
1934
+ }
1935
+
1936
+ /** @internal */
1937
+ export type DeploymentInvokePrefixMessagesContent$Outbound =
1938
+ | string
1939
+ | Array<components.TextContentPartSchema$Outbound>;
1940
+
1941
+ /** @internal */
1942
+ export const DeploymentInvokePrefixMessagesContent$outboundSchema: z.ZodType<
1943
+ DeploymentInvokePrefixMessagesContent$Outbound,
1944
+ z.ZodTypeDef,
1945
+ DeploymentInvokePrefixMessagesContent
1946
+ > = z.union([
1947
+ z.string(),
1948
+ z.array(components.TextContentPartSchema$outboundSchema),
1949
+ ]);
1950
+
1951
+ export function deploymentInvokePrefixMessagesContentToJSON(
1952
+ deploymentInvokePrefixMessagesContent: DeploymentInvokePrefixMessagesContent,
1953
+ ): string {
1954
+ return JSON.stringify(
1955
+ DeploymentInvokePrefixMessagesContent$outboundSchema.parse(
1956
+ deploymentInvokePrefixMessagesContent,
1957
+ ),
1958
+ );
1959
+ }
1960
+
1961
+ /** @internal */
1962
+ export type DeveloperMessage$Outbound = {
1963
+ role: "developer";
1964
+ content: string | Array<components.TextContentPartSchema$Outbound>;
1965
+ name?: string | undefined;
1966
+ };
1967
+
1968
+ /** @internal */
1969
+ export const DeveloperMessage$outboundSchema: z.ZodType<
1970
+ DeveloperMessage$Outbound,
1971
+ z.ZodTypeDef,
1972
+ DeveloperMessage
1973
+ > = z.object({
1974
+ role: z.literal("developer"),
1975
+ content: z.union([
1976
+ z.string(),
1977
+ z.array(components.TextContentPartSchema$outboundSchema),
1978
+ ]),
1979
+ name: z.string().optional(),
1980
+ });
1981
+
1982
+ export function developerMessageToJSON(
1983
+ developerMessage: DeveloperMessage,
1984
+ ): string {
1985
+ return JSON.stringify(
1986
+ DeveloperMessage$outboundSchema.parse(developerMessage),
1987
+ );
1988
+ }
1989
+
1990
+ /** @internal */
1991
+ export type PrefixMessagesContent$Outbound =
1992
+ | string
1993
+ | Array<components.TextContentPartSchema$Outbound>;
1994
+
1995
+ /** @internal */
1996
+ export const PrefixMessagesContent$outboundSchema: z.ZodType<
1997
+ PrefixMessagesContent$Outbound,
1998
+ z.ZodTypeDef,
1999
+ PrefixMessagesContent
2000
+ > = z.union([
2001
+ z.string(),
2002
+ z.array(components.TextContentPartSchema$outboundSchema),
2003
+ ]);
2004
+
2005
+ export function prefixMessagesContentToJSON(
2006
+ prefixMessagesContent: PrefixMessagesContent,
2007
+ ): string {
2008
+ return JSON.stringify(
2009
+ PrefixMessagesContent$outboundSchema.parse(prefixMessagesContent),
2010
+ );
2011
+ }
2012
+
2013
+ /** @internal */
2014
+ export type SystemMessage$Outbound = {
2015
+ role: "system";
2016
+ content: string | Array<components.TextContentPartSchema$Outbound>;
2017
+ name?: string | undefined;
2018
+ };
2019
+
2020
+ /** @internal */
2021
+ export const SystemMessage$outboundSchema: z.ZodType<
2022
+ SystemMessage$Outbound,
2023
+ z.ZodTypeDef,
2024
+ SystemMessage
2025
+ > = z.object({
2026
+ role: z.literal("system"),
2027
+ content: z.union([
2028
+ z.string(),
2029
+ z.array(components.TextContentPartSchema$outboundSchema),
2030
+ ]),
2031
+ name: z.string().optional(),
2032
+ });
2033
+
2034
+ export function systemMessageToJSON(systemMessage: SystemMessage): string {
2035
+ return JSON.stringify(SystemMessage$outboundSchema.parse(systemMessage));
2036
+ }
2037
+
2038
+ /** @internal */
2039
+ export type PrefixMessages$Outbound =
2040
+ | SystemMessage$Outbound
2041
+ | DeveloperMessage$Outbound
2042
+ | UserMessage$Outbound
2043
+ | AssistantMessage$Outbound
2044
+ | ToolMessage$Outbound;
2045
+
2046
+ /** @internal */
2047
+ export const PrefixMessages$outboundSchema: z.ZodType<
2048
+ PrefixMessages$Outbound,
2049
+ z.ZodTypeDef,
2050
+ PrefixMessages
2051
+ > = z.union([
2052
+ z.lazy(() => SystemMessage$outboundSchema),
2053
+ z.lazy(() => DeveloperMessage$outboundSchema),
2054
+ z.lazy(() => UserMessage$outboundSchema),
2055
+ z.lazy(() => AssistantMessage$outboundSchema),
2056
+ z.lazy(() => ToolMessage$outboundSchema),
2057
+ ]);
2058
+
2059
+ export function prefixMessagesToJSON(prefixMessages: PrefixMessages): string {
2060
+ return JSON.stringify(PrefixMessages$outboundSchema.parse(prefixMessages));
2061
+ }
2062
+
2063
+ /** @internal */
2064
+ export type DeploymentInvokeContentDeploymentsRequestRequestBodyMessages2$Outbound =
2065
+ components.TextContentPartSchema$Outbound;
2066
+
2067
+ /** @internal */
2068
+ export const DeploymentInvokeContentDeploymentsRequestRequestBodyMessages2$outboundSchema:
2069
+ z.ZodType<
2070
+ DeploymentInvokeContentDeploymentsRequestRequestBodyMessages2$Outbound,
2071
+ z.ZodTypeDef,
2072
+ DeploymentInvokeContentDeploymentsRequestRequestBodyMessages2
2073
+ > = components.TextContentPartSchema$outboundSchema;
2074
+
2075
+ export function deploymentInvokeContentDeploymentsRequestRequestBodyMessages2ToJSON(
2076
+ deploymentInvokeContentDeploymentsRequestRequestBodyMessages2:
2077
+ DeploymentInvokeContentDeploymentsRequestRequestBodyMessages2,
2078
+ ): string {
2079
+ return JSON.stringify(
2080
+ DeploymentInvokeContentDeploymentsRequestRequestBodyMessages2$outboundSchema
2081
+ .parse(deploymentInvokeContentDeploymentsRequestRequestBodyMessages2),
2082
+ );
2083
+ }
2084
+
2085
+ /** @internal */
2086
+ export type DeploymentInvokeMessagesDeploymentsRequestRequestBodyContent$Outbound =
2087
+ | string
2088
+ | Array<components.TextContentPartSchema$Outbound>;
2089
+
2090
+ /** @internal */
2091
+ export const DeploymentInvokeMessagesDeploymentsRequestRequestBodyContent$outboundSchema:
2092
+ z.ZodType<
2093
+ DeploymentInvokeMessagesDeploymentsRequestRequestBodyContent$Outbound,
2094
+ z.ZodTypeDef,
2095
+ DeploymentInvokeMessagesDeploymentsRequestRequestBodyContent
2096
+ > = z.union([
2097
+ z.string(),
2098
+ z.array(components.TextContentPartSchema$outboundSchema),
2099
+ ]);
2100
+
2101
+ export function deploymentInvokeMessagesDeploymentsRequestRequestBodyContentToJSON(
2102
+ deploymentInvokeMessagesDeploymentsRequestRequestBodyContent:
2103
+ DeploymentInvokeMessagesDeploymentsRequestRequestBodyContent,
2104
+ ): string {
2105
+ return JSON.stringify(
2106
+ DeploymentInvokeMessagesDeploymentsRequestRequestBodyContent$outboundSchema
2107
+ .parse(deploymentInvokeMessagesDeploymentsRequestRequestBodyContent),
2108
+ );
2109
+ }
2110
+
2111
+ /** @internal */
2112
+ export const DeploymentInvokeMessagesType$outboundSchema: z.ZodNativeEnum<
2113
+ typeof DeploymentInvokeMessagesType
2114
+ > = z.nativeEnum(DeploymentInvokeMessagesType);
2115
+
2116
+ /** @internal */
2117
+ export const MessagesTtl$outboundSchema: z.ZodNativeEnum<typeof MessagesTtl> = z
2118
+ .nativeEnum(MessagesTtl);
2119
+
2120
+ /** @internal */
2121
+ export type MessagesCacheControl$Outbound = {
2122
+ type: string;
2123
+ ttl: string;
2124
+ };
2125
+
2126
+ /** @internal */
2127
+ export const MessagesCacheControl$outboundSchema: z.ZodType<
2128
+ MessagesCacheControl$Outbound,
2129
+ z.ZodTypeDef,
2130
+ MessagesCacheControl
2131
+ > = z.object({
2132
+ type: DeploymentInvokeMessagesType$outboundSchema,
2133
+ ttl: MessagesTtl$outboundSchema.default("5m"),
2134
+ });
2135
+
2136
+ export function messagesCacheControlToJSON(
2137
+ messagesCacheControl: MessagesCacheControl,
2138
+ ): string {
2139
+ return JSON.stringify(
2140
+ MessagesCacheControl$outboundSchema.parse(messagesCacheControl),
2141
+ );
2142
+ }
2143
+
2144
+ /** @internal */
2145
+ export type MessagesToolMessage$Outbound = {
2146
+ role: "tool";
2147
+ content: string | Array<components.TextContentPartSchema$Outbound>;
2148
+ tool_call_id: string | null;
2149
+ cache_control?: MessagesCacheControl$Outbound | undefined;
2150
+ };
2151
+
2152
+ /** @internal */
2153
+ export const MessagesToolMessage$outboundSchema: z.ZodType<
2154
+ MessagesToolMessage$Outbound,
2155
+ z.ZodTypeDef,
2156
+ MessagesToolMessage
2157
+ > = z.object({
2158
+ role: z.literal("tool"),
2159
+ content: z.union([
2160
+ z.string(),
2161
+ z.array(components.TextContentPartSchema$outboundSchema),
2162
+ ]),
2163
+ toolCallId: z.nullable(z.string()),
2164
+ cacheControl: z.lazy(() => MessagesCacheControl$outboundSchema).optional(),
2165
+ }).transform((v) => {
2166
+ return remap$(v, {
2167
+ toolCallId: "tool_call_id",
2168
+ cacheControl: "cache_control",
2169
+ });
2170
+ });
2171
+
2172
+ export function messagesToolMessageToJSON(
2173
+ messagesToolMessage: MessagesToolMessage,
2174
+ ): string {
2175
+ return JSON.stringify(
2176
+ MessagesToolMessage$outboundSchema.parse(messagesToolMessage),
2177
+ );
2178
+ }
2179
+
2180
+ /** @internal */
2181
+ export type DeploymentInvokeContentDeploymentsRequestRequestBody2$Outbound =
2182
+ | (components.TextContentPartSchema$Outbound & { type: "text" })
2183
+ | components.RefusalPartSchema$Outbound
2184
+ | components.ReasoningPartSchema$Outbound
2185
+ | components.RedactedReasoningPartSchema$Outbound;
2186
+
2187
+ /** @internal */
2188
+ export const DeploymentInvokeContentDeploymentsRequestRequestBody2$outboundSchema:
2189
+ z.ZodType<
2190
+ DeploymentInvokeContentDeploymentsRequestRequestBody2$Outbound,
2191
+ z.ZodTypeDef,
2192
+ DeploymentInvokeContentDeploymentsRequestRequestBody2
2193
+ > = z.union([
2194
+ components.TextContentPartSchema$outboundSchema.and(
2195
+ z.object({ type: z.literal("text") }),
2196
+ ),
2197
+ components.RefusalPartSchema$outboundSchema,
2198
+ components.ReasoningPartSchema$outboundSchema,
2199
+ components.RedactedReasoningPartSchema$outboundSchema,
2200
+ ]);
2201
+
2202
+ export function deploymentInvokeContentDeploymentsRequestRequestBody2ToJSON(
2203
+ deploymentInvokeContentDeploymentsRequestRequestBody2:
2204
+ DeploymentInvokeContentDeploymentsRequestRequestBody2,
2205
+ ): string {
2206
+ return JSON.stringify(
2207
+ DeploymentInvokeContentDeploymentsRequestRequestBody2$outboundSchema.parse(
2208
+ deploymentInvokeContentDeploymentsRequestRequestBody2,
2209
+ ),
2210
+ );
2211
+ }
2212
+
2213
+ /** @internal */
2214
+ export type DeploymentInvokeMessagesDeploymentsRequestContent$Outbound =
2215
+ | string
2216
+ | Array<
2217
+ | (components.TextContentPartSchema$Outbound & { type: "text" })
2218
+ | components.RefusalPartSchema$Outbound
2219
+ | components.ReasoningPartSchema$Outbound
2220
+ | components.RedactedReasoningPartSchema$Outbound
2221
+ >;
2222
+
2223
+ /** @internal */
2224
+ export const DeploymentInvokeMessagesDeploymentsRequestContent$outboundSchema:
2225
+ z.ZodType<
2226
+ DeploymentInvokeMessagesDeploymentsRequestContent$Outbound,
2227
+ z.ZodTypeDef,
2228
+ DeploymentInvokeMessagesDeploymentsRequestContent
2229
+ > = z.union([
2230
+ z.string(),
2231
+ z.array(
2232
+ z.union([
2233
+ components.TextContentPartSchema$outboundSchema.and(
2234
+ z.object({ type: z.literal("text") }),
2235
+ ),
2236
+ components.RefusalPartSchema$outboundSchema,
2237
+ components.ReasoningPartSchema$outboundSchema,
2238
+ components.RedactedReasoningPartSchema$outboundSchema,
2239
+ ]),
2240
+ ),
2241
+ ]);
2242
+
2243
+ export function deploymentInvokeMessagesDeploymentsRequestContentToJSON(
2244
+ deploymentInvokeMessagesDeploymentsRequestContent:
2245
+ DeploymentInvokeMessagesDeploymentsRequestContent,
2246
+ ): string {
2247
+ return JSON.stringify(
2248
+ DeploymentInvokeMessagesDeploymentsRequestContent$outboundSchema.parse(
2249
+ deploymentInvokeMessagesDeploymentsRequestContent,
2250
+ ),
2251
+ );
2252
+ }
2253
+
2254
+ /** @internal */
2255
+ export type MessagesAudio$Outbound = {
2256
+ id: string;
2257
+ };
2258
+
2259
+ /** @internal */
2260
+ export const MessagesAudio$outboundSchema: z.ZodType<
2261
+ MessagesAudio$Outbound,
2262
+ z.ZodTypeDef,
2263
+ MessagesAudio
2264
+ > = z.object({
2265
+ id: z.string(),
2266
+ });
2267
+
2268
+ export function messagesAudioToJSON(messagesAudio: MessagesAudio): string {
2269
+ return JSON.stringify(MessagesAudio$outboundSchema.parse(messagesAudio));
2270
+ }
2271
+
2272
+ /** @internal */
2273
+ export const MessagesType$outboundSchema: z.ZodNativeEnum<typeof MessagesType> =
2274
+ z.nativeEnum(MessagesType);
2275
+
2276
+ /** @internal */
2277
+ export type MessagesFunction$Outbound = {
2278
+ name?: string | undefined;
2279
+ arguments?: string | undefined;
2280
+ };
2281
+
2282
+ /** @internal */
2283
+ export const MessagesFunction$outboundSchema: z.ZodType<
2284
+ MessagesFunction$Outbound,
2285
+ z.ZodTypeDef,
2286
+ MessagesFunction
2287
+ > = z.object({
2288
+ name: z.string().optional(),
2289
+ arguments: z.string().optional(),
2290
+ });
2291
+
2292
+ export function messagesFunctionToJSON(
2293
+ messagesFunction: MessagesFunction,
2294
+ ): string {
2295
+ return JSON.stringify(
2296
+ MessagesFunction$outboundSchema.parse(messagesFunction),
2297
+ );
2298
+ }
2299
+
2300
+ /** @internal */
2301
+ export type MessagesToolCalls$Outbound = {
2302
+ id: string;
2303
+ type: string;
2304
+ function: MessagesFunction$Outbound;
2305
+ thought_signature?: string | undefined;
2306
+ };
2307
+
2308
+ /** @internal */
2309
+ export const MessagesToolCalls$outboundSchema: z.ZodType<
2310
+ MessagesToolCalls$Outbound,
2311
+ z.ZodTypeDef,
2312
+ MessagesToolCalls
2313
+ > = z.object({
2314
+ id: z.string(),
2315
+ type: MessagesType$outboundSchema,
2316
+ function: z.lazy(() => MessagesFunction$outboundSchema),
2317
+ thoughtSignature: z.string().optional(),
2318
+ }).transform((v) => {
2319
+ return remap$(v, {
2320
+ thoughtSignature: "thought_signature",
2321
+ });
2322
+ });
2323
+
2324
+ export function messagesToolCallsToJSON(
2325
+ messagesToolCalls: MessagesToolCalls,
2326
+ ): string {
2327
+ return JSON.stringify(
2328
+ MessagesToolCalls$outboundSchema.parse(messagesToolCalls),
2329
+ );
2330
+ }
2331
+
2332
+ /** @internal */
2333
+ export type MessagesAssistantMessage$Outbound = {
2334
+ content?:
2335
+ | string
2336
+ | Array<
2337
+ | (components.TextContentPartSchema$Outbound & { type: "text" })
2338
+ | components.RefusalPartSchema$Outbound
2339
+ | components.ReasoningPartSchema$Outbound
2340
+ | components.RedactedReasoningPartSchema$Outbound
2341
+ >
2342
+ | null
2343
+ | undefined;
2344
+ refusal?: string | null | undefined;
2345
+ role: "assistant";
2346
+ name?: string | undefined;
2347
+ audio?: MessagesAudio$Outbound | null | undefined;
2348
+ tool_calls?: Array<MessagesToolCalls$Outbound> | undefined;
2349
+ };
2350
+
2351
+ /** @internal */
2352
+ export const MessagesAssistantMessage$outboundSchema: z.ZodType<
2353
+ MessagesAssistantMessage$Outbound,
2354
+ z.ZodTypeDef,
2355
+ MessagesAssistantMessage
2356
+ > = z.object({
2357
+ content: z.nullable(
2358
+ z.union([
2359
+ z.string(),
2360
+ z.array(
2361
+ z.union([
2362
+ components.TextContentPartSchema$outboundSchema.and(
2363
+ z.object({ type: z.literal("text") }),
2364
+ ),
2365
+ components.RefusalPartSchema$outboundSchema,
2366
+ components.ReasoningPartSchema$outboundSchema,
2367
+ components.RedactedReasoningPartSchema$outboundSchema,
2368
+ ]),
2369
+ ),
2370
+ ]),
2371
+ ).optional(),
2372
+ refusal: z.nullable(z.string()).optional(),
2373
+ role: z.literal("assistant"),
2374
+ name: z.string().optional(),
2375
+ audio: z.nullable(z.lazy(() => MessagesAudio$outboundSchema)).optional(),
2376
+ toolCalls: z.array(z.lazy(() => MessagesToolCalls$outboundSchema)).optional(),
2377
+ }).transform((v) => {
2378
+ return remap$(v, {
2379
+ toolCalls: "tool_calls",
2380
+ });
2381
+ });
2382
+
2383
+ export function messagesAssistantMessageToJSON(
2384
+ messagesAssistantMessage: MessagesAssistantMessage,
2385
+ ): string {
2386
+ return JSON.stringify(
2387
+ MessagesAssistantMessage$outboundSchema.parse(messagesAssistantMessage),
2388
+ );
2389
+ }
2390
+
2391
+ /** @internal */
2392
+ export const DeploymentInvoke2DeploymentsRequestRequestBodyType$outboundSchema:
2393
+ z.ZodNativeEnum<typeof DeploymentInvoke2DeploymentsRequestRequestBodyType> = z
2394
+ .nativeEnum(DeploymentInvoke2DeploymentsRequestRequestBodyType);
2395
+
2396
+ /** @internal */
2397
+ export const TwoTtl$outboundSchema: z.ZodNativeEnum<typeof TwoTtl> = z
2398
+ .nativeEnum(TwoTtl);
2399
+
2400
+ /** @internal */
2401
+ export type TwoCacheControl$Outbound = {
2402
+ type: string;
2403
+ ttl: string;
2404
+ };
2405
+
2406
+ /** @internal */
2407
+ export const TwoCacheControl$outboundSchema: z.ZodType<
2408
+ TwoCacheControl$Outbound,
2409
+ z.ZodTypeDef,
2410
+ TwoCacheControl
2411
+ > = z.object({
2412
+ type: DeploymentInvoke2DeploymentsRequestRequestBodyType$outboundSchema,
2413
+ ttl: TwoTtl$outboundSchema.default("5m"),
2414
+ });
2415
+
2416
+ export function twoCacheControlToJSON(
2417
+ twoCacheControl: TwoCacheControl,
2418
+ ): string {
2419
+ return JSON.stringify(TwoCacheControl$outboundSchema.parse(twoCacheControl));
2420
+ }
2421
+
2422
+ /** @internal */
2423
+ export type Two4$Outbound = {
2424
+ type: "file";
2425
+ cache_control?: TwoCacheControl$Outbound | undefined;
2426
+ file: components.FileContentPartSchema$Outbound;
2427
+ };
2428
+
2429
+ /** @internal */
2430
+ export const Two4$outboundSchema: z.ZodType<Two4$Outbound, z.ZodTypeDef, Two4> =
2431
+ z.object({
2432
+ type: z.literal("file"),
2433
+ cacheControl: z.lazy(() => TwoCacheControl$outboundSchema).optional(),
2434
+ file: components.FileContentPartSchema$outboundSchema,
2435
+ }).transform((v) => {
2436
+ return remap$(v, {
2437
+ cacheControl: "cache_control",
2438
+ });
2439
+ });
2440
+
2441
+ export function two4ToJSON(two4: Two4): string {
2442
+ return JSON.stringify(Two4$outboundSchema.parse(two4));
2443
+ }
2444
+
2445
+ /** @internal */
2446
+ export type DeploymentInvokeContentDeploymentsRequest2$Outbound =
2447
+ | (components.TextContentPartSchema$Outbound & { type: "text" })
2448
+ | components.ImageContentPartSchema$Outbound
2449
+ | components.AudioContentPartSchema$Outbound
2450
+ | Two4$Outbound;
2451
+
2452
+ /** @internal */
2453
+ export const DeploymentInvokeContentDeploymentsRequest2$outboundSchema:
2454
+ z.ZodType<
2455
+ DeploymentInvokeContentDeploymentsRequest2$Outbound,
2456
+ z.ZodTypeDef,
2457
+ DeploymentInvokeContentDeploymentsRequest2
2458
+ > = z.union([
2459
+ components.TextContentPartSchema$outboundSchema.and(
2460
+ z.object({ type: z.literal("text") }),
2461
+ ),
2462
+ components.ImageContentPartSchema$outboundSchema,
2463
+ components.AudioContentPartSchema$outboundSchema,
2464
+ z.lazy(() => Two4$outboundSchema),
2465
+ ]);
2466
+
2467
+ export function deploymentInvokeContentDeploymentsRequest2ToJSON(
2468
+ deploymentInvokeContentDeploymentsRequest2:
2469
+ DeploymentInvokeContentDeploymentsRequest2,
2470
+ ): string {
2471
+ return JSON.stringify(
2472
+ DeploymentInvokeContentDeploymentsRequest2$outboundSchema.parse(
2473
+ deploymentInvokeContentDeploymentsRequest2,
2474
+ ),
2475
+ );
2476
+ }
2477
+
2478
+ /** @internal */
2479
+ export type DeploymentInvokeMessagesDeploymentsContent$Outbound =
2480
+ | string
2481
+ | Array<
2482
+ | (components.TextContentPartSchema$Outbound & { type: "text" })
2483
+ | components.ImageContentPartSchema$Outbound
2484
+ | components.AudioContentPartSchema$Outbound
2485
+ | Two4$Outbound
2486
+ >;
2487
+
2488
+ /** @internal */
2489
+ export const DeploymentInvokeMessagesDeploymentsContent$outboundSchema:
2490
+ z.ZodType<
2491
+ DeploymentInvokeMessagesDeploymentsContent$Outbound,
2492
+ z.ZodTypeDef,
2493
+ DeploymentInvokeMessagesDeploymentsContent
2494
+ > = z.union([
2495
+ z.string(),
2496
+ z.array(
2497
+ z.union([
2498
+ components.TextContentPartSchema$outboundSchema.and(
2499
+ z.object({ type: z.literal("text") }),
2500
+ ),
2501
+ components.ImageContentPartSchema$outboundSchema,
2502
+ components.AudioContentPartSchema$outboundSchema,
2503
+ z.lazy(() => Two4$outboundSchema),
2504
+ ]),
2505
+ ),
2506
+ ]);
2507
+
2508
+ export function deploymentInvokeMessagesDeploymentsContentToJSON(
2509
+ deploymentInvokeMessagesDeploymentsContent:
2510
+ DeploymentInvokeMessagesDeploymentsContent,
2511
+ ): string {
2512
+ return JSON.stringify(
2513
+ DeploymentInvokeMessagesDeploymentsContent$outboundSchema.parse(
2514
+ deploymentInvokeMessagesDeploymentsContent,
2515
+ ),
2516
+ );
2517
+ }
2518
+
2519
+ /** @internal */
2520
+ export type MessagesUserMessage$Outbound = {
2521
+ role: "user";
2522
+ name?: string | undefined;
2523
+ content:
2524
+ | string
2525
+ | Array<
2526
+ | (components.TextContentPartSchema$Outbound & { type: "text" })
2527
+ | components.ImageContentPartSchema$Outbound
2528
+ | components.AudioContentPartSchema$Outbound
2529
+ | Two4$Outbound
2530
+ >;
2531
+ };
2532
+
2533
+ /** @internal */
2534
+ export const MessagesUserMessage$outboundSchema: z.ZodType<
2535
+ MessagesUserMessage$Outbound,
2536
+ z.ZodTypeDef,
2537
+ MessagesUserMessage
2538
+ > = z.object({
2539
+ role: z.literal("user"),
2540
+ name: z.string().optional(),
2541
+ content: z.union([
2542
+ z.string(),
2543
+ z.array(
2544
+ z.union([
2545
+ components.TextContentPartSchema$outboundSchema.and(
2546
+ z.object({ type: z.literal("text") }),
2547
+ ),
2548
+ components.ImageContentPartSchema$outboundSchema,
2549
+ components.AudioContentPartSchema$outboundSchema,
2550
+ z.lazy(() => Two4$outboundSchema),
2551
+ ]),
2552
+ ),
2553
+ ]),
2554
+ });
2555
+
2556
+ export function messagesUserMessageToJSON(
2557
+ messagesUserMessage: MessagesUserMessage,
2558
+ ): string {
2559
+ return JSON.stringify(
2560
+ MessagesUserMessage$outboundSchema.parse(messagesUserMessage),
2561
+ );
2562
+ }
2563
+
2564
+ /** @internal */
2565
+ export type DeploymentInvokeMessagesContent$Outbound =
2566
+ | string
2567
+ | Array<components.TextContentPartSchema$Outbound>;
2568
+
2569
+ /** @internal */
2570
+ export const DeploymentInvokeMessagesContent$outboundSchema: z.ZodType<
2571
+ DeploymentInvokeMessagesContent$Outbound,
2572
+ z.ZodTypeDef,
2573
+ DeploymentInvokeMessagesContent
2574
+ > = z.union([
2575
+ z.string(),
2576
+ z.array(components.TextContentPartSchema$outboundSchema),
2577
+ ]);
2578
+
2579
+ export function deploymentInvokeMessagesContentToJSON(
2580
+ deploymentInvokeMessagesContent: DeploymentInvokeMessagesContent,
2581
+ ): string {
2582
+ return JSON.stringify(
2583
+ DeploymentInvokeMessagesContent$outboundSchema.parse(
2584
+ deploymentInvokeMessagesContent,
2585
+ ),
2586
+ );
2587
+ }
2588
+
2589
+ /** @internal */
2590
+ export type MessagesDeveloperMessage$Outbound = {
2591
+ role: "developer";
2592
+ content: string | Array<components.TextContentPartSchema$Outbound>;
2593
+ name?: string | undefined;
2594
+ };
2595
+
2596
+ /** @internal */
2597
+ export const MessagesDeveloperMessage$outboundSchema: z.ZodType<
2598
+ MessagesDeveloperMessage$Outbound,
2599
+ z.ZodTypeDef,
2600
+ MessagesDeveloperMessage
2601
+ > = z.object({
2602
+ role: z.literal("developer"),
2603
+ content: z.union([
2604
+ z.string(),
2605
+ z.array(components.TextContentPartSchema$outboundSchema),
2606
+ ]),
2607
+ name: z.string().optional(),
2608
+ });
2609
+
2610
+ export function messagesDeveloperMessageToJSON(
2611
+ messagesDeveloperMessage: MessagesDeveloperMessage,
2612
+ ): string {
2613
+ return JSON.stringify(
2614
+ MessagesDeveloperMessage$outboundSchema.parse(messagesDeveloperMessage),
2615
+ );
2616
+ }
2617
+
2618
+ /** @internal */
2619
+ export type MessagesContent$Outbound =
2620
+ | string
2621
+ | Array<components.TextContentPartSchema$Outbound>;
2622
+
2623
+ /** @internal */
2624
+ export const MessagesContent$outboundSchema: z.ZodType<
2625
+ MessagesContent$Outbound,
2626
+ z.ZodTypeDef,
2627
+ MessagesContent
2628
+ > = z.union([
2629
+ z.string(),
2630
+ z.array(components.TextContentPartSchema$outboundSchema),
2631
+ ]);
2632
+
2633
+ export function messagesContentToJSON(
2634
+ messagesContent: MessagesContent,
2635
+ ): string {
2636
+ return JSON.stringify(MessagesContent$outboundSchema.parse(messagesContent));
2637
+ }
2638
+
2639
+ /** @internal */
2640
+ export type MessagesSystemMessage$Outbound = {
2641
+ role: "system";
2642
+ content: string | Array<components.TextContentPartSchema$Outbound>;
2643
+ name?: string | undefined;
2644
+ };
2645
+
2646
+ /** @internal */
2647
+ export const MessagesSystemMessage$outboundSchema: z.ZodType<
2648
+ MessagesSystemMessage$Outbound,
2649
+ z.ZodTypeDef,
2650
+ MessagesSystemMessage
2651
+ > = z.object({
2652
+ role: z.literal("system"),
2653
+ content: z.union([
2654
+ z.string(),
2655
+ z.array(components.TextContentPartSchema$outboundSchema),
2656
+ ]),
2657
+ name: z.string().optional(),
2658
+ });
2659
+
2660
+ export function messagesSystemMessageToJSON(
2661
+ messagesSystemMessage: MessagesSystemMessage,
2662
+ ): string {
2663
+ return JSON.stringify(
2664
+ MessagesSystemMessage$outboundSchema.parse(messagesSystemMessage),
2665
+ );
2666
+ }
2667
+
2668
+ /** @internal */
2669
+ export type DeploymentInvokeMessages$Outbound =
2670
+ | MessagesSystemMessage$Outbound
2671
+ | MessagesDeveloperMessage$Outbound
2672
+ | MessagesUserMessage$Outbound
2673
+ | MessagesAssistantMessage$Outbound
2674
+ | MessagesToolMessage$Outbound;
2675
+
2676
+ /** @internal */
2677
+ export const DeploymentInvokeMessages$outboundSchema: z.ZodType<
2678
+ DeploymentInvokeMessages$Outbound,
2679
+ z.ZodTypeDef,
2680
+ DeploymentInvokeMessages
2681
+ > = z.union([
2682
+ z.lazy(() => MessagesSystemMessage$outboundSchema),
2683
+ z.lazy(() => MessagesDeveloperMessage$outboundSchema),
2684
+ z.lazy(() => MessagesUserMessage$outboundSchema),
2685
+ z.lazy(() => MessagesAssistantMessage$outboundSchema),
2686
+ z.lazy(() => MessagesToolMessage$outboundSchema),
2687
+ ]);
2688
+
2689
+ export function deploymentInvokeMessagesToJSON(
2690
+ deploymentInvokeMessages: DeploymentInvokeMessages,
2691
+ ): string {
2692
+ return JSON.stringify(
2693
+ DeploymentInvokeMessages$outboundSchema.parse(deploymentInvokeMessages),
2694
+ );
2695
+ }
2696
+
2697
+ /** @internal */
2698
+ export type Metadata$Outbound = {
2699
+ file_name?: string | undefined;
2700
+ file_type?: string | undefined;
2701
+ page_number?: number | undefined;
2702
+ };
2703
+
2704
+ /** @internal */
2705
+ export const Metadata$outboundSchema: z.ZodType<
2706
+ Metadata$Outbound,
2707
+ z.ZodTypeDef,
2708
+ Metadata
2709
+ > = z.object({
2710
+ fileName: z.string().optional(),
2711
+ fileType: z.string().optional(),
2712
+ pageNumber: z.number().optional(),
2713
+ }).transform((v) => {
2714
+ return remap$(v, {
2715
+ fileName: "file_name",
2716
+ fileType: "file_type",
2717
+ pageNumber: "page_number",
2718
+ });
2719
+ });
2720
+
2721
+ export function metadataToJSON(metadata: Metadata): string {
2722
+ return JSON.stringify(Metadata$outboundSchema.parse(metadata));
2723
+ }
2724
+
2725
+ /** @internal */
2726
+ export type Documents$Outbound = {
2727
+ text: string;
2728
+ metadata?: Metadata$Outbound | undefined;
2729
+ };
2730
+
2731
+ /** @internal */
2732
+ export const Documents$outboundSchema: z.ZodType<
2733
+ Documents$Outbound,
2734
+ z.ZodTypeDef,
2735
+ Documents
2736
+ > = z.object({
2737
+ text: z.string(),
2738
+ metadata: z.lazy(() => Metadata$outboundSchema).optional(),
2739
+ });
2740
+
2741
+ export function documentsToJSON(documents: Documents): string {
2742
+ return JSON.stringify(Documents$outboundSchema.parse(documents));
2743
+ }
2744
+
2745
+ /** @internal */
2746
+ export type InvokeOptions$Outbound = {
2747
+ include_retrievals: boolean;
2748
+ include_usage: boolean;
2749
+ mock_response?: string | undefined;
2750
+ };
2751
+
2752
+ /** @internal */
2753
+ export const InvokeOptions$outboundSchema: z.ZodType<
2754
+ InvokeOptions$Outbound,
2755
+ z.ZodTypeDef,
2756
+ InvokeOptions
2757
+ > = z.object({
2758
+ includeRetrievals: z.boolean().default(false),
2759
+ includeUsage: z.boolean().default(false),
2760
+ mockResponse: z.string().optional(),
2761
+ }).transform((v) => {
2762
+ return remap$(v, {
2763
+ includeRetrievals: "include_retrievals",
2764
+ includeUsage: "include_usage",
2765
+ mockResponse: "mock_response",
2766
+ });
2767
+ });
2768
+
2769
+ export function invokeOptionsToJSON(invokeOptions: InvokeOptions): string {
2770
+ return JSON.stringify(InvokeOptions$outboundSchema.parse(invokeOptions));
2771
+ }
2772
+
2773
+ /** @internal */
2774
+ export type Thread$Outbound = {
2775
+ id: string;
2776
+ tags?: Array<string> | undefined;
2777
+ };
2778
+
2779
+ /** @internal */
2780
+ export const Thread$outboundSchema: z.ZodType<
2781
+ Thread$Outbound,
2782
+ z.ZodTypeDef,
2783
+ Thread
2784
+ > = z.object({
2785
+ id: z.string(),
2786
+ tags: z.array(z.string()).optional(),
2787
+ });
2788
+
2789
+ export function threadToJSON(thread: Thread): string {
2790
+ return JSON.stringify(Thread$outboundSchema.parse(thread));
2791
+ }
2792
+
2793
+ /** @internal */
2794
+ export type OrExists$Outbound = {
2795
+ exists: boolean;
2796
+ };
2797
+
2798
+ /** @internal */
2799
+ export const OrExists$outboundSchema: z.ZodType<
2800
+ OrExists$Outbound,
2801
+ z.ZodTypeDef,
2802
+ OrExists
2803
+ > = z.object({
2804
+ exists: z.boolean(),
2805
+ });
2806
+
2807
+ export function orExistsToJSON(orExists: OrExists): string {
2808
+ return JSON.stringify(OrExists$outboundSchema.parse(orExists));
2809
+ }
2810
+
2811
+ /** @internal */
2812
+ export type DeploymentInvokeOrNin$Outbound = string | number | boolean;
2813
+
2814
+ /** @internal */
2815
+ export const DeploymentInvokeOrNin$outboundSchema: z.ZodType<
2816
+ DeploymentInvokeOrNin$Outbound,
2817
+ z.ZodTypeDef,
2818
+ DeploymentInvokeOrNin
2819
+ > = z.union([z.string(), z.number(), z.boolean()]);
2820
+
2821
+ export function deploymentInvokeOrNinToJSON(
2822
+ deploymentInvokeOrNin: DeploymentInvokeOrNin,
2823
+ ): string {
2824
+ return JSON.stringify(
2825
+ DeploymentInvokeOrNin$outboundSchema.parse(deploymentInvokeOrNin),
2826
+ );
2827
+ }
2828
+
2829
+ /** @internal */
2830
+ export type OrNin$Outbound = {
2831
+ nin: Array<string | number | boolean>;
2832
+ };
2833
+
2834
+ /** @internal */
2835
+ export const OrNin$outboundSchema: z.ZodType<
2836
+ OrNin$Outbound,
2837
+ z.ZodTypeDef,
2838
+ OrNin
2839
+ > = z.object({
2840
+ nin: z.array(z.union([z.string(), z.number(), z.boolean()])),
2841
+ });
2842
+
2843
+ export function orNinToJSON(orNin: OrNin): string {
2844
+ return JSON.stringify(OrNin$outboundSchema.parse(orNin));
2845
+ }
2846
+
2847
+ /** @internal */
2848
+ export type DeploymentInvokeOrIn$Outbound = string | number | boolean;
2849
+
2850
+ /** @internal */
2851
+ export const DeploymentInvokeOrIn$outboundSchema: z.ZodType<
2852
+ DeploymentInvokeOrIn$Outbound,
2853
+ z.ZodTypeDef,
2854
+ DeploymentInvokeOrIn
2855
+ > = z.union([z.string(), z.number(), z.boolean()]);
2856
+
2857
+ export function deploymentInvokeOrInToJSON(
2858
+ deploymentInvokeOrIn: DeploymentInvokeOrIn,
2859
+ ): string {
2860
+ return JSON.stringify(
2861
+ DeploymentInvokeOrIn$outboundSchema.parse(deploymentInvokeOrIn),
2862
+ );
2863
+ }
2864
+
2865
+ /** @internal */
2866
+ export type OrIn$Outbound = {
2867
+ in: Array<string | number | boolean>;
2868
+ };
2869
+
2870
+ /** @internal */
2871
+ export const OrIn$outboundSchema: z.ZodType<OrIn$Outbound, z.ZodTypeDef, OrIn> =
2872
+ z.object({
2873
+ in: z.array(z.union([z.string(), z.number(), z.boolean()])),
2874
+ });
2875
+
2876
+ export function orInToJSON(orIn: OrIn): string {
2877
+ return JSON.stringify(OrIn$outboundSchema.parse(orIn));
2878
+ }
2879
+
2880
+ /** @internal */
2881
+ export type OrLte$Outbound = {
2882
+ lte: number;
2883
+ };
2884
+
2885
+ /** @internal */
2886
+ export const OrLte$outboundSchema: z.ZodType<
2887
+ OrLte$Outbound,
2888
+ z.ZodTypeDef,
2889
+ OrLte
2890
+ > = z.object({
2891
+ lte: z.number(),
2892
+ });
2893
+
2894
+ export function orLteToJSON(orLte: OrLte): string {
2895
+ return JSON.stringify(OrLte$outboundSchema.parse(orLte));
2896
+ }
2897
+
2898
+ /** @internal */
2899
+ export type OrLt$Outbound = {
2900
+ lt: number;
2901
+ };
2902
+
2903
+ /** @internal */
2904
+ export const OrLt$outboundSchema: z.ZodType<OrLt$Outbound, z.ZodTypeDef, OrLt> =
2905
+ z.object({
2906
+ lt: z.number(),
2907
+ });
2908
+
2909
+ export function orLtToJSON(orLt: OrLt): string {
2910
+ return JSON.stringify(OrLt$outboundSchema.parse(orLt));
2911
+ }
2912
+
2913
+ /** @internal */
2914
+ export type OrGte$Outbound = {
2915
+ gte: number;
2916
+ };
2917
+
2918
+ /** @internal */
2919
+ export const OrGte$outboundSchema: z.ZodType<
2920
+ OrGte$Outbound,
2921
+ z.ZodTypeDef,
2922
+ OrGte
2923
+ > = z.object({
2924
+ gte: z.number(),
2925
+ });
2926
+
2927
+ export function orGteToJSON(orGte: OrGte): string {
2928
+ return JSON.stringify(OrGte$outboundSchema.parse(orGte));
2929
+ }
2930
+
2931
+ /** @internal */
2932
+ export type OrGt$Outbound = {
2933
+ gt: number;
2934
+ };
2935
+
2936
+ /** @internal */
2937
+ export const OrGt$outboundSchema: z.ZodType<OrGt$Outbound, z.ZodTypeDef, OrGt> =
2938
+ z.object({
2939
+ gt: z.number(),
2940
+ });
2941
+
2942
+ export function orGtToJSON(orGt: OrGt): string {
2943
+ return JSON.stringify(OrGt$outboundSchema.parse(orGt));
2944
+ }
2945
+
2946
+ /** @internal */
2947
+ export type DeploymentInvokeOrNe$Outbound = string | number | boolean;
2948
+
2949
+ /** @internal */
2950
+ export const DeploymentInvokeOrNe$outboundSchema: z.ZodType<
2951
+ DeploymentInvokeOrNe$Outbound,
2952
+ z.ZodTypeDef,
2953
+ DeploymentInvokeOrNe
2954
+ > = z.union([z.string(), z.number(), z.boolean()]);
2955
+
2956
+ export function deploymentInvokeOrNeToJSON(
2957
+ deploymentInvokeOrNe: DeploymentInvokeOrNe,
2958
+ ): string {
2959
+ return JSON.stringify(
2960
+ DeploymentInvokeOrNe$outboundSchema.parse(deploymentInvokeOrNe),
2961
+ );
2962
+ }
2963
+
2964
+ /** @internal */
2965
+ export type OrNe$Outbound = {
2966
+ ne: string | number | boolean;
2967
+ };
2968
+
2969
+ /** @internal */
2970
+ export const OrNe$outboundSchema: z.ZodType<OrNe$Outbound, z.ZodTypeDef, OrNe> =
2971
+ z.object({
2972
+ ne: z.union([z.string(), z.number(), z.boolean()]),
2973
+ });
2974
+
2975
+ export function orNeToJSON(orNe: OrNe): string {
2976
+ return JSON.stringify(OrNe$outboundSchema.parse(orNe));
2977
+ }
2978
+
2979
+ /** @internal */
2980
+ export type DeploymentInvokeOrEq$Outbound = string | number | boolean;
2981
+
2982
+ /** @internal */
2983
+ export const DeploymentInvokeOrEq$outboundSchema: z.ZodType<
2984
+ DeploymentInvokeOrEq$Outbound,
2985
+ z.ZodTypeDef,
2986
+ DeploymentInvokeOrEq
2987
+ > = z.union([z.string(), z.number(), z.boolean()]);
2988
+
2989
+ export function deploymentInvokeOrEqToJSON(
2990
+ deploymentInvokeOrEq: DeploymentInvokeOrEq,
2991
+ ): string {
2992
+ return JSON.stringify(
2993
+ DeploymentInvokeOrEq$outboundSchema.parse(deploymentInvokeOrEq),
2994
+ );
2995
+ }
2996
+
2997
+ /** @internal */
2998
+ export type OrEq$Outbound = {
2999
+ eq: string | number | boolean;
3000
+ };
3001
+
3002
+ /** @internal */
3003
+ export const OrEq$outboundSchema: z.ZodType<OrEq$Outbound, z.ZodTypeDef, OrEq> =
3004
+ z.object({
3005
+ eq: z.union([z.string(), z.number(), z.boolean()]),
3006
+ });
3007
+
3008
+ export function orEqToJSON(orEq: OrEq): string {
3009
+ return JSON.stringify(OrEq$outboundSchema.parse(orEq));
3010
+ }
3011
+
3012
+ /** @internal */
3013
+ export type KnowledgeFilterOr$Outbound =
3014
+ | OrEq$Outbound
3015
+ | OrNe$Outbound
3016
+ | OrGt$Outbound
3017
+ | OrGte$Outbound
3018
+ | OrLt$Outbound
3019
+ | OrLte$Outbound
3020
+ | OrIn$Outbound
3021
+ | OrNin$Outbound
3022
+ | OrExists$Outbound;
3023
+
3024
+ /** @internal */
3025
+ export const KnowledgeFilterOr$outboundSchema: z.ZodType<
3026
+ KnowledgeFilterOr$Outbound,
3027
+ z.ZodTypeDef,
3028
+ KnowledgeFilterOr
3029
+ > = z.union([
3030
+ z.lazy(() => OrEq$outboundSchema),
3031
+ z.lazy(() => OrNe$outboundSchema),
3032
+ z.lazy(() => OrGt$outboundSchema),
3033
+ z.lazy(() => OrGte$outboundSchema),
3034
+ z.lazy(() => OrLt$outboundSchema),
3035
+ z.lazy(() => OrLte$outboundSchema),
3036
+ z.lazy(() => OrIn$outboundSchema),
3037
+ z.lazy(() => OrNin$outboundSchema),
3038
+ z.lazy(() => OrExists$outboundSchema),
3039
+ ]);
3040
+
3041
+ export function knowledgeFilterOrToJSON(
3042
+ knowledgeFilterOr: KnowledgeFilterOr,
3043
+ ): string {
3044
+ return JSON.stringify(
3045
+ KnowledgeFilterOr$outboundSchema.parse(knowledgeFilterOr),
3046
+ );
3047
+ }
3048
+
3049
+ /** @internal */
3050
+ export type Or$Outbound = {
3051
+ or: Array<
3052
+ {
3053
+ [k: string]:
3054
+ | OrEq$Outbound
3055
+ | OrNe$Outbound
3056
+ | OrGt$Outbound
3057
+ | OrGte$Outbound
3058
+ | OrLt$Outbound
3059
+ | OrLte$Outbound
3060
+ | OrIn$Outbound
3061
+ | OrNin$Outbound
3062
+ | OrExists$Outbound;
3063
+ }
3064
+ >;
3065
+ };
3066
+
3067
+ /** @internal */
3068
+ export const Or$outboundSchema: z.ZodType<Or$Outbound, z.ZodTypeDef, Or> = z
3069
+ .object({
3070
+ or: z.array(
3071
+ z.record(z.union([
3072
+ z.lazy(() => OrEq$outboundSchema),
3073
+ z.lazy(() =>
3074
+ OrNe$outboundSchema
3075
+ ),
3076
+ z.lazy(() => OrGt$outboundSchema),
3077
+ z.lazy(() => OrGte$outboundSchema),
3078
+ z.lazy(() => OrLt$outboundSchema),
3079
+ z.lazy(() => OrLte$outboundSchema),
3080
+ z.lazy(() => OrIn$outboundSchema),
3081
+ z.lazy(() => OrNin$outboundSchema),
3082
+ z.lazy(() => OrExists$outboundSchema),
3083
+ ])),
3084
+ ),
3085
+ });
3086
+
3087
+ export function orToJSON(or: Or): string {
3088
+ return JSON.stringify(Or$outboundSchema.parse(or));
3089
+ }
3090
+
3091
+ /** @internal */
3092
+ export type AndExists$Outbound = {
3093
+ exists: boolean;
3094
+ };
3095
+
3096
+ /** @internal */
3097
+ export const AndExists$outboundSchema: z.ZodType<
3098
+ AndExists$Outbound,
3099
+ z.ZodTypeDef,
3100
+ AndExists
3101
+ > = z.object({
3102
+ exists: z.boolean(),
3103
+ });
3104
+
3105
+ export function andExistsToJSON(andExists: AndExists): string {
3106
+ return JSON.stringify(AndExists$outboundSchema.parse(andExists));
3107
+ }
3108
+
3109
+ /** @internal */
3110
+ export type DeploymentInvokeAndNin$Outbound = string | number | boolean;
3111
+
3112
+ /** @internal */
3113
+ export const DeploymentInvokeAndNin$outboundSchema: z.ZodType<
3114
+ DeploymentInvokeAndNin$Outbound,
3115
+ z.ZodTypeDef,
3116
+ DeploymentInvokeAndNin
3117
+ > = z.union([z.string(), z.number(), z.boolean()]);
3118
+
3119
+ export function deploymentInvokeAndNinToJSON(
3120
+ deploymentInvokeAndNin: DeploymentInvokeAndNin,
3121
+ ): string {
3122
+ return JSON.stringify(
3123
+ DeploymentInvokeAndNin$outboundSchema.parse(deploymentInvokeAndNin),
3124
+ );
3125
+ }
3126
+
3127
+ /** @internal */
3128
+ export type AndNin$Outbound = {
3129
+ nin: Array<string | number | boolean>;
3130
+ };
3131
+
3132
+ /** @internal */
3133
+ export const AndNin$outboundSchema: z.ZodType<
3134
+ AndNin$Outbound,
3135
+ z.ZodTypeDef,
3136
+ AndNin
3137
+ > = z.object({
3138
+ nin: z.array(z.union([z.string(), z.number(), z.boolean()])),
3139
+ });
3140
+
3141
+ export function andNinToJSON(andNin: AndNin): string {
3142
+ return JSON.stringify(AndNin$outboundSchema.parse(andNin));
3143
+ }
3144
+
3145
+ /** @internal */
3146
+ export type DeploymentInvokeAndIn$Outbound = string | number | boolean;
3147
+
3148
+ /** @internal */
3149
+ export const DeploymentInvokeAndIn$outboundSchema: z.ZodType<
3150
+ DeploymentInvokeAndIn$Outbound,
3151
+ z.ZodTypeDef,
3152
+ DeploymentInvokeAndIn
3153
+ > = z.union([z.string(), z.number(), z.boolean()]);
3154
+
3155
+ export function deploymentInvokeAndInToJSON(
3156
+ deploymentInvokeAndIn: DeploymentInvokeAndIn,
3157
+ ): string {
3158
+ return JSON.stringify(
3159
+ DeploymentInvokeAndIn$outboundSchema.parse(deploymentInvokeAndIn),
3160
+ );
3161
+ }
3162
+
3163
+ /** @internal */
3164
+ export type AndIn$Outbound = {
3165
+ in: Array<string | number | boolean>;
3166
+ };
3167
+
3168
+ /** @internal */
3169
+ export const AndIn$outboundSchema: z.ZodType<
3170
+ AndIn$Outbound,
3171
+ z.ZodTypeDef,
3172
+ AndIn
3173
+ > = z.object({
3174
+ in: z.array(z.union([z.string(), z.number(), z.boolean()])),
3175
+ });
3176
+
3177
+ export function andInToJSON(andIn: AndIn): string {
3178
+ return JSON.stringify(AndIn$outboundSchema.parse(andIn));
3179
+ }
3180
+
3181
+ /** @internal */
3182
+ export type AndLte$Outbound = {
3183
+ lte: number;
3184
+ };
3185
+
3186
+ /** @internal */
3187
+ export const AndLte$outboundSchema: z.ZodType<
3188
+ AndLte$Outbound,
3189
+ z.ZodTypeDef,
3190
+ AndLte
3191
+ > = z.object({
3192
+ lte: z.number(),
3193
+ });
3194
+
3195
+ export function andLteToJSON(andLte: AndLte): string {
3196
+ return JSON.stringify(AndLte$outboundSchema.parse(andLte));
3197
+ }
3198
+
3199
+ /** @internal */
3200
+ export type AndLt$Outbound = {
3201
+ lt: number;
3202
+ };
3203
+
3204
+ /** @internal */
3205
+ export const AndLt$outboundSchema: z.ZodType<
3206
+ AndLt$Outbound,
3207
+ z.ZodTypeDef,
3208
+ AndLt
3209
+ > = z.object({
3210
+ lt: z.number(),
3211
+ });
3212
+
3213
+ export function andLtToJSON(andLt: AndLt): string {
3214
+ return JSON.stringify(AndLt$outboundSchema.parse(andLt));
3215
+ }
3216
+
3217
+ /** @internal */
3218
+ export type AndGte$Outbound = {
3219
+ gte: number;
3220
+ };
3221
+
3222
+ /** @internal */
3223
+ export const AndGte$outboundSchema: z.ZodType<
3224
+ AndGte$Outbound,
3225
+ z.ZodTypeDef,
3226
+ AndGte
3227
+ > = z.object({
3228
+ gte: z.number(),
3229
+ });
3230
+
3231
+ export function andGteToJSON(andGte: AndGte): string {
3232
+ return JSON.stringify(AndGte$outboundSchema.parse(andGte));
3233
+ }
3234
+
3235
+ /** @internal */
3236
+ export type AndGt$Outbound = {
3237
+ gt: number;
3238
+ };
3239
+
3240
+ /** @internal */
3241
+ export const AndGt$outboundSchema: z.ZodType<
3242
+ AndGt$Outbound,
3243
+ z.ZodTypeDef,
3244
+ AndGt
3245
+ > = z.object({
3246
+ gt: z.number(),
3247
+ });
3248
+
3249
+ export function andGtToJSON(andGt: AndGt): string {
3250
+ return JSON.stringify(AndGt$outboundSchema.parse(andGt));
3251
+ }
3252
+
3253
+ /** @internal */
3254
+ export type DeploymentInvokeAndNe$Outbound = string | number | boolean;
3255
+
3256
+ /** @internal */
3257
+ export const DeploymentInvokeAndNe$outboundSchema: z.ZodType<
3258
+ DeploymentInvokeAndNe$Outbound,
3259
+ z.ZodTypeDef,
3260
+ DeploymentInvokeAndNe
3261
+ > = z.union([z.string(), z.number(), z.boolean()]);
3262
+
3263
+ export function deploymentInvokeAndNeToJSON(
3264
+ deploymentInvokeAndNe: DeploymentInvokeAndNe,
3265
+ ): string {
3266
+ return JSON.stringify(
3267
+ DeploymentInvokeAndNe$outboundSchema.parse(deploymentInvokeAndNe),
3268
+ );
3269
+ }
3270
+
3271
+ /** @internal */
3272
+ export type AndNe$Outbound = {
3273
+ ne: string | number | boolean;
3274
+ };
3275
+
3276
+ /** @internal */
3277
+ export const AndNe$outboundSchema: z.ZodType<
3278
+ AndNe$Outbound,
3279
+ z.ZodTypeDef,
3280
+ AndNe
3281
+ > = z.object({
3282
+ ne: z.union([z.string(), z.number(), z.boolean()]),
3283
+ });
3284
+
3285
+ export function andNeToJSON(andNe: AndNe): string {
3286
+ return JSON.stringify(AndNe$outboundSchema.parse(andNe));
3287
+ }
3288
+
3289
+ /** @internal */
3290
+ export type DeploymentInvokeAndEq$Outbound = string | number | boolean;
3291
+
3292
+ /** @internal */
3293
+ export const DeploymentInvokeAndEq$outboundSchema: z.ZodType<
3294
+ DeploymentInvokeAndEq$Outbound,
3295
+ z.ZodTypeDef,
3296
+ DeploymentInvokeAndEq
3297
+ > = z.union([z.string(), z.number(), z.boolean()]);
3298
+
3299
+ export function deploymentInvokeAndEqToJSON(
3300
+ deploymentInvokeAndEq: DeploymentInvokeAndEq,
3301
+ ): string {
3302
+ return JSON.stringify(
3303
+ DeploymentInvokeAndEq$outboundSchema.parse(deploymentInvokeAndEq),
3304
+ );
3305
+ }
3306
+
3307
+ /** @internal */
3308
+ export type AndEq$Outbound = {
3309
+ eq: string | number | boolean;
3310
+ };
3311
+
3312
+ /** @internal */
3313
+ export const AndEq$outboundSchema: z.ZodType<
3314
+ AndEq$Outbound,
3315
+ z.ZodTypeDef,
3316
+ AndEq
3317
+ > = z.object({
3318
+ eq: z.union([z.string(), z.number(), z.boolean()]),
3319
+ });
3320
+
3321
+ export function andEqToJSON(andEq: AndEq): string {
3322
+ return JSON.stringify(AndEq$outboundSchema.parse(andEq));
3323
+ }
3324
+
3325
+ /** @internal */
3326
+ export type KnowledgeFilterAnd$Outbound =
3327
+ | AndEq$Outbound
3328
+ | AndNe$Outbound
3329
+ | AndGt$Outbound
3330
+ | AndGte$Outbound
3331
+ | AndLt$Outbound
3332
+ | AndLte$Outbound
3333
+ | AndIn$Outbound
3334
+ | AndNin$Outbound
3335
+ | AndExists$Outbound;
3336
+
3337
+ /** @internal */
3338
+ export const KnowledgeFilterAnd$outboundSchema: z.ZodType<
3339
+ KnowledgeFilterAnd$Outbound,
3340
+ z.ZodTypeDef,
3341
+ KnowledgeFilterAnd
3342
+ > = z.union([
3343
+ z.lazy(() => AndEq$outboundSchema),
3344
+ z.lazy(() => AndNe$outboundSchema),
3345
+ z.lazy(() => AndGt$outboundSchema),
3346
+ z.lazy(() => AndGte$outboundSchema),
3347
+ z.lazy(() => AndLt$outboundSchema),
3348
+ z.lazy(() => AndLte$outboundSchema),
3349
+ z.lazy(() => AndIn$outboundSchema),
3350
+ z.lazy(() => AndNin$outboundSchema),
3351
+ z.lazy(() => AndExists$outboundSchema),
3352
+ ]);
3353
+
3354
+ export function knowledgeFilterAndToJSON(
3355
+ knowledgeFilterAnd: KnowledgeFilterAnd,
3356
+ ): string {
3357
+ return JSON.stringify(
3358
+ KnowledgeFilterAnd$outboundSchema.parse(knowledgeFilterAnd),
3359
+ );
3360
+ }
3361
+
3362
+ /** @internal */
3363
+ export type And$Outbound = {
3364
+ and: Array<
3365
+ {
3366
+ [k: string]:
3367
+ | AndEq$Outbound
3368
+ | AndNe$Outbound
3369
+ | AndGt$Outbound
3370
+ | AndGte$Outbound
3371
+ | AndLt$Outbound
3372
+ | AndLte$Outbound
3373
+ | AndIn$Outbound
3374
+ | AndNin$Outbound
3375
+ | AndExists$Outbound;
3376
+ }
3377
+ >;
3378
+ };
3379
+
3380
+ /** @internal */
3381
+ export const And$outboundSchema: z.ZodType<And$Outbound, z.ZodTypeDef, And> = z
3382
+ .object({
3383
+ and: z.array(
3384
+ z.record(z.union([
3385
+ z.lazy(() => AndEq$outboundSchema),
3386
+ z.lazy(() =>
3387
+ AndNe$outboundSchema
3388
+ ),
3389
+ z.lazy(() => AndGt$outboundSchema),
3390
+ z.lazy(() => AndGte$outboundSchema),
3391
+ z.lazy(() => AndLt$outboundSchema),
3392
+ z.lazy(() => AndLte$outboundSchema),
3393
+ z.lazy(() => AndIn$outboundSchema),
3394
+ z.lazy(() => AndNin$outboundSchema),
3395
+ z.lazy(() => AndExists$outboundSchema),
3396
+ ])),
3397
+ ),
3398
+ });
3399
+
3400
+ export function andToJSON(and: And): string {
3401
+ return JSON.stringify(And$outboundSchema.parse(and));
3402
+ }
3403
+
3404
+ /** @internal */
3405
+ export type Exists$Outbound = {
3406
+ exists: boolean;
3407
+ };
3408
+
3409
+ /** @internal */
3410
+ export const Exists$outboundSchema: z.ZodType<
3411
+ Exists$Outbound,
3412
+ z.ZodTypeDef,
3413
+ Exists
3414
+ > = z.object({
3415
+ exists: z.boolean(),
3416
+ });
3417
+
3418
+ export function existsToJSON(exists: Exists): string {
3419
+ return JSON.stringify(Exists$outboundSchema.parse(exists));
3420
+ }
3421
+
3422
+ /** @internal */
3423
+ export type OneNin$Outbound = string | number | boolean;
3424
+
3425
+ /** @internal */
3426
+ export const OneNin$outboundSchema: z.ZodType<
3427
+ OneNin$Outbound,
3428
+ z.ZodTypeDef,
3429
+ OneNin
3430
+ > = z.union([z.string(), z.number(), z.boolean()]);
3431
+
3432
+ export function oneNinToJSON(oneNin: OneNin): string {
3433
+ return JSON.stringify(OneNin$outboundSchema.parse(oneNin));
3434
+ }
3435
+
3436
+ /** @internal */
3437
+ export type Nin$Outbound = {
3438
+ nin: Array<string | number | boolean>;
3439
+ };
3440
+
3441
+ /** @internal */
3442
+ export const Nin$outboundSchema: z.ZodType<Nin$Outbound, z.ZodTypeDef, Nin> = z
3443
+ .object({
3444
+ nin: z.array(z.union([z.string(), z.number(), z.boolean()])),
3445
+ });
3446
+
3447
+ export function ninToJSON(nin: Nin): string {
3448
+ return JSON.stringify(Nin$outboundSchema.parse(nin));
3449
+ }
3450
+
3451
+ /** @internal */
3452
+ export type OneIn$Outbound = string | number | boolean;
3453
+
3454
+ /** @internal */
3455
+ export const OneIn$outboundSchema: z.ZodType<
3456
+ OneIn$Outbound,
3457
+ z.ZodTypeDef,
3458
+ OneIn
3459
+ > = z.union([z.string(), z.number(), z.boolean()]);
3460
+
3461
+ export function oneInToJSON(oneIn: OneIn): string {
3462
+ return JSON.stringify(OneIn$outboundSchema.parse(oneIn));
3463
+ }
3464
+
3465
+ /** @internal */
3466
+ export type In$Outbound = {
3467
+ in: Array<string | number | boolean>;
3468
+ };
3469
+
3470
+ /** @internal */
3471
+ export const In$outboundSchema: z.ZodType<In$Outbound, z.ZodTypeDef, In> = z
3472
+ .object({
3473
+ in: z.array(z.union([z.string(), z.number(), z.boolean()])),
3474
+ });
3475
+
3476
+ export function inToJSON(value: In): string {
3477
+ return JSON.stringify(In$outboundSchema.parse(value));
3478
+ }
3479
+
3480
+ /** @internal */
3481
+ export type Lte$Outbound = {
3482
+ lte: number;
3483
+ };
3484
+
3485
+ /** @internal */
3486
+ export const Lte$outboundSchema: z.ZodType<Lte$Outbound, z.ZodTypeDef, Lte> = z
3487
+ .object({
3488
+ lte: z.number(),
3489
+ });
3490
+
3491
+ export function lteToJSON(lte: Lte): string {
3492
+ return JSON.stringify(Lte$outboundSchema.parse(lte));
3493
+ }
3494
+
3495
+ /** @internal */
3496
+ export type Lt$Outbound = {
3497
+ lt: number;
3498
+ };
3499
+
3500
+ /** @internal */
3501
+ export const Lt$outboundSchema: z.ZodType<Lt$Outbound, z.ZodTypeDef, Lt> = z
3502
+ .object({
3503
+ lt: z.number(),
3504
+ });
3505
+
3506
+ export function ltToJSON(lt: Lt): string {
3507
+ return JSON.stringify(Lt$outboundSchema.parse(lt));
3508
+ }
3509
+
3510
+ /** @internal */
3511
+ export type Gte$Outbound = {
3512
+ gte: number;
3513
+ };
3514
+
3515
+ /** @internal */
3516
+ export const Gte$outboundSchema: z.ZodType<Gte$Outbound, z.ZodTypeDef, Gte> = z
3517
+ .object({
3518
+ gte: z.number(),
3519
+ });
3520
+
3521
+ export function gteToJSON(gte: Gte): string {
3522
+ return JSON.stringify(Gte$outboundSchema.parse(gte));
3523
+ }
3524
+
3525
+ /** @internal */
3526
+ export type Gt$Outbound = {
3527
+ gt: number;
3528
+ };
3529
+
3530
+ /** @internal */
3531
+ export const Gt$outboundSchema: z.ZodType<Gt$Outbound, z.ZodTypeDef, Gt> = z
3532
+ .object({
3533
+ gt: z.number(),
3534
+ });
3535
+
3536
+ export function gtToJSON(gt: Gt): string {
3537
+ return JSON.stringify(Gt$outboundSchema.parse(gt));
3538
+ }
3539
+
3540
+ /** @internal */
3541
+ export type OneNe$Outbound = string | number | boolean;
3542
+
3543
+ /** @internal */
3544
+ export const OneNe$outboundSchema: z.ZodType<
3545
+ OneNe$Outbound,
3546
+ z.ZodTypeDef,
3547
+ OneNe
3548
+ > = z.union([z.string(), z.number(), z.boolean()]);
3549
+
3550
+ export function oneNeToJSON(oneNe: OneNe): string {
3551
+ return JSON.stringify(OneNe$outboundSchema.parse(oneNe));
3552
+ }
120
3553
 
121
- export type CompletionTokensDetails = {
122
- reasoningTokens?: number | null | undefined;
3554
+ /** @internal */
3555
+ export type Ne$Outbound = {
3556
+ ne: string | number | boolean;
123
3557
  };
124
3558
 
125
- /**
126
- * Usage metrics for the response
127
- */
128
- export type DeploymentInvokeUsage = {
129
- totalTokens?: number | undefined;
130
- promptTokens?: number | undefined;
131
- completionTokens?: number | undefined;
132
- promptTokensDetails?: PromptTokensDetails | undefined;
133
- completionTokensDetails?: CompletionTokensDetails | null | undefined;
134
- };
3559
+ /** @internal */
3560
+ export const Ne$outboundSchema: z.ZodType<Ne$Outbound, z.ZodTypeDef, Ne> = z
3561
+ .object({
3562
+ ne: z.union([z.string(), z.number(), z.boolean()]),
3563
+ });
135
3564
 
136
- /**
137
- * The role of the prompt message
138
- */
139
- export const DeploymentInvokeMessageDeploymentsRole = {
140
- System: "system",
141
- Developer: "developer",
142
- Assistant: "assistant",
143
- User: "user",
144
- Exception: "exception",
145
- Tool: "tool",
146
- Prompt: "prompt",
147
- Correction: "correction",
148
- ExpectedOutput: "expected_output",
149
- } as const;
150
- /**
151
- * The role of the prompt message
152
- */
153
- export type DeploymentInvokeMessageDeploymentsRole = ClosedEnum<
154
- typeof DeploymentInvokeMessageDeploymentsRole
155
- >;
3565
+ export function neToJSON(ne: Ne): string {
3566
+ return JSON.stringify(Ne$outboundSchema.parse(ne));
3567
+ }
156
3568
 
157
- export type Message3 = {
158
- type: "image";
159
- /**
160
- * The role of the prompt message
161
- */
162
- role: DeploymentInvokeMessageDeploymentsRole;
163
- url: string;
164
- };
3569
+ /** @internal */
3570
+ export type OneEq$Outbound = string | number | boolean;
165
3571
 
166
- /**
167
- * The role of the prompt message
168
- */
169
- export const DeploymentInvokeMessageRole = {
170
- System: "system",
171
- Developer: "developer",
172
- Assistant: "assistant",
173
- User: "user",
174
- Exception: "exception",
175
- Tool: "tool",
176
- Prompt: "prompt",
177
- Correction: "correction",
178
- ExpectedOutput: "expected_output",
179
- } as const;
180
- /**
181
- * The role of the prompt message
182
- */
183
- export type DeploymentInvokeMessageRole = ClosedEnum<
184
- typeof DeploymentInvokeMessageRole
185
- >;
3572
+ /** @internal */
3573
+ export const OneEq$outboundSchema: z.ZodType<
3574
+ OneEq$Outbound,
3575
+ z.ZodTypeDef,
3576
+ OneEq
3577
+ > = z.union([z.string(), z.number(), z.boolean()]);
186
3578
 
187
- export type Message2 = {
188
- type: "content";
189
- /**
190
- * The role of the prompt message
191
- */
192
- role: DeploymentInvokeMessageRole;
193
- content: string | null;
194
- /**
195
- * Internal thought process of the model
196
- */
197
- reasoning?: string | undefined;
198
- /**
199
- * The signature holds a cryptographic token which verifies that the thinking block was generated by the model, and is verified when thinking is part of a multiturn conversation. This value should not be modified and should always be sent to the API when the reasoning is redacted. Currently only supported by `Anthropic`.
200
- */
201
- reasoningSignature?: string | undefined;
202
- /**
203
- * Occasionally the model's internal reasoning will be flagged by the safety systems of the provider. When this occurs, the provider will encrypt the reasoning. These redacted reasoning is decrypted when passed back to the API, allowing the model to continue its response without losing context.
204
- */
205
- redactedReasoning?: string | undefined;
3579
+ export function oneEqToJSON(oneEq: OneEq): string {
3580
+ return JSON.stringify(OneEq$outboundSchema.parse(oneEq));
3581
+ }
3582
+
3583
+ /** @internal */
3584
+ export type Eq$Outbound = {
3585
+ eq: string | number | boolean;
206
3586
  };
207
3587
 
208
- /**
209
- * The role of the prompt message
210
- */
211
- export const MessageRole = {
212
- System: "system",
213
- Developer: "developer",
214
- Assistant: "assistant",
215
- User: "user",
216
- Exception: "exception",
217
- Tool: "tool",
218
- Prompt: "prompt",
219
- Correction: "correction",
220
- ExpectedOutput: "expected_output",
221
- } as const;
222
- /**
223
- * The role of the prompt message
224
- */
225
- export type MessageRole = ClosedEnum<typeof MessageRole>;
3588
+ /** @internal */
3589
+ export const Eq$outboundSchema: z.ZodType<Eq$Outbound, z.ZodTypeDef, Eq> = z
3590
+ .object({
3591
+ eq: z.union([z.string(), z.number(), z.boolean()]),
3592
+ });
226
3593
 
227
- export const DeploymentInvokeMessageDeploymentsResponseType = {
228
- Function: "function",
229
- } as const;
230
- export type DeploymentInvokeMessageDeploymentsResponseType = ClosedEnum<
231
- typeof DeploymentInvokeMessageDeploymentsResponseType
232
- >;
3594
+ export function eqToJSON(eq: Eq): string {
3595
+ return JSON.stringify(Eq$outboundSchema.parse(eq));
3596
+ }
233
3597
 
234
- export type MessageFunction = {
235
- name: string;
236
- /**
237
- * JSON string arguments for the functions
238
- */
239
- arguments: string;
240
- };
3598
+ /** @internal */
3599
+ export type KnowledgeFilter1$Outbound =
3600
+ | Eq$Outbound
3601
+ | Ne$Outbound
3602
+ | Gt$Outbound
3603
+ | Gte$Outbound
3604
+ | Lt$Outbound
3605
+ | Lte$Outbound
3606
+ | In$Outbound
3607
+ | Nin$Outbound
3608
+ | Exists$Outbound;
241
3609
 
242
- export type MessageToolCalls = {
243
- id?: string | undefined;
244
- index?: number | undefined;
245
- type: DeploymentInvokeMessageDeploymentsResponseType;
246
- function: MessageFunction;
247
- };
3610
+ /** @internal */
3611
+ export const KnowledgeFilter1$outboundSchema: z.ZodType<
3612
+ KnowledgeFilter1$Outbound,
3613
+ z.ZodTypeDef,
3614
+ KnowledgeFilter1
3615
+ > = z.union([
3616
+ z.lazy(() => Eq$outboundSchema),
3617
+ z.lazy(() => Ne$outboundSchema),
3618
+ z.lazy(() => Gt$outboundSchema),
3619
+ z.lazy(() => Gte$outboundSchema),
3620
+ z.lazy(() => Lt$outboundSchema),
3621
+ z.lazy(() => Lte$outboundSchema),
3622
+ z.lazy(() => In$outboundSchema),
3623
+ z.lazy(() => Nin$outboundSchema),
3624
+ z.lazy(() => Exists$outboundSchema),
3625
+ ]);
248
3626
 
249
- export type Message1 = {
250
- type: "tool_calls";
251
- /**
252
- * The role of the prompt message
253
- */
254
- role: MessageRole;
255
- content?: string | null | undefined;
256
- toolCalls: Array<MessageToolCalls>;
257
- /**
258
- * Internal thought process of the model
259
- */
260
- reasoning?: string | undefined;
261
- /**
262
- * The signature holds a cryptographic token which verifies that the thinking block was generated by the model, and is verified when thinking is part of a multiturn conversation. This value should not be modified and should always be sent to the API when the reasoning is redacted. Currently only supported by `Anthropic`.
263
- */
264
- reasoningSignature?: string | undefined;
265
- /**
266
- * Occasionally the model's internal reasoning will be flagged by the safety systems of the provider. When this occurs, the provider will encrypt the reasoning. These redacted reasoning is decrypted when passed back to the API, allowing the model to continue its response without losing context.
267
- */
268
- redactedReasoning?: string | undefined;
3627
+ export function knowledgeFilter1ToJSON(
3628
+ knowledgeFilter1: KnowledgeFilter1,
3629
+ ): string {
3630
+ return JSON.stringify(
3631
+ KnowledgeFilter1$outboundSchema.parse(knowledgeFilter1),
3632
+ );
3633
+ }
3634
+
3635
+ /** @internal */
3636
+ export type KnowledgeFilter$Outbound = And$Outbound | Or$Outbound | {
3637
+ [k: string]:
3638
+ | Eq$Outbound
3639
+ | Ne$Outbound
3640
+ | Gt$Outbound
3641
+ | Gte$Outbound
3642
+ | Lt$Outbound
3643
+ | Lte$Outbound
3644
+ | In$Outbound
3645
+ | Nin$Outbound
3646
+ | Exists$Outbound;
269
3647
  };
270
3648
 
271
- export type Message = Message1 | Message2 | Message3;
3649
+ /** @internal */
3650
+ export const KnowledgeFilter$outboundSchema: z.ZodType<
3651
+ KnowledgeFilter$Outbound,
3652
+ z.ZodTypeDef,
3653
+ KnowledgeFilter
3654
+ > = z.union([
3655
+ z.lazy(() => And$outboundSchema),
3656
+ z.lazy(() => Or$outboundSchema),
3657
+ z.record(z.union([
3658
+ z.lazy(() => Eq$outboundSchema),
3659
+ z.lazy(() => Ne$outboundSchema),
3660
+ z.lazy(() => Gt$outboundSchema),
3661
+ z.lazy(() => Gte$outboundSchema),
3662
+ z.lazy(() => Lt$outboundSchema),
3663
+ z.lazy(() => Lte$outboundSchema),
3664
+ z.lazy(() => In$outboundSchema),
3665
+ z.lazy(() => Nin$outboundSchema),
3666
+ z.lazy(() => Exists$outboundSchema),
3667
+ ])),
3668
+ ]);
272
3669
 
273
- export type DeploymentInvokeChoices = {
274
- index: number;
275
- message: Message1 | Message2 | Message3;
276
- finishReason?: string | null | undefined;
277
- };
3670
+ export function knowledgeFilterToJSON(
3671
+ knowledgeFilter: KnowledgeFilter,
3672
+ ): string {
3673
+ return JSON.stringify(KnowledgeFilter$outboundSchema.parse(knowledgeFilter));
3674
+ }
278
3675
 
279
- /**
280
- * Successful operation
281
- */
282
- export type DeploymentInvokeResponseBody = {
283
- /**
284
- * A unique identifier for the response. Can be used to add metrics to the transaction.
285
- */
286
- id: string;
287
- /**
288
- * A timestamp indicating when the object was created. Usually in a standardized format like ISO 8601
289
- */
290
- created: Date;
291
- /**
292
- * Indicates the type of model used to generate the response
293
- */
294
- object: DeploymentInvokeObject;
295
- /**
296
- * The model used to generate the response
297
- */
298
- model: string;
299
- /**
300
- * The provider used to generate the response
301
- */
302
- provider: Provider;
303
- /**
304
- * Indicates if the response is the final response
305
- */
306
- isFinal: boolean;
307
- /**
308
- * Indicates integration id used to generate the response
309
- */
310
- integrationId?: string | undefined;
311
- telemetry: Telemetry;
312
- /**
313
- * A timestamp indicating when the object was finalized. Usually in a standardized format like ISO 8601
314
- */
315
- finalized?: Date | undefined;
316
- /**
317
- * Provider backed system fingerprint.
318
- */
319
- systemFingerprint?: string | null | undefined;
320
- /**
321
- * 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`.
322
- */
323
- retrievals?: Array<Retrievals> | undefined;
324
- /**
325
- * 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`.
326
- */
327
- providerResponse?: any | undefined;
328
- /**
329
- * Usage metrics for the response
330
- */
331
- usage?: DeploymentInvokeUsage | null | undefined;
332
- /**
333
- * A list of choices generated by the model
334
- */
335
- choices: Array<DeploymentInvokeChoices>;
3676
+ /** @internal */
3677
+ export type DeploymentInvokeRequestBody$Outbound = {
3678
+ key: string;
3679
+ stream: boolean;
3680
+ inputs?: { [k: string]: any } | undefined;
3681
+ context?: { [k: string]: any } | undefined;
3682
+ prefix_messages?:
3683
+ | Array<
3684
+ | SystemMessage$Outbound
3685
+ | DeveloperMessage$Outbound
3686
+ | UserMessage$Outbound
3687
+ | AssistantMessage$Outbound
3688
+ | ToolMessage$Outbound
3689
+ >
3690
+ | undefined;
3691
+ messages?:
3692
+ | Array<
3693
+ | MessagesSystemMessage$Outbound
3694
+ | MessagesDeveloperMessage$Outbound
3695
+ | MessagesUserMessage$Outbound
3696
+ | MessagesAssistantMessage$Outbound
3697
+ | MessagesToolMessage$Outbound
3698
+ >
3699
+ | undefined;
3700
+ identity?: components.PublicIdentity$Outbound | undefined;
3701
+ file_ids?: Array<string> | undefined;
3702
+ metadata?: { [k: string]: any } | undefined;
3703
+ extra_params?: { [k: string]: any } | undefined;
3704
+ documents?: Array<Documents$Outbound> | undefined;
3705
+ invoke_options?: InvokeOptions$Outbound | undefined;
3706
+ thread?: Thread$Outbound | undefined;
3707
+ knowledge_filter?: And$Outbound | Or$Outbound | {
3708
+ [k: string]:
3709
+ | Eq$Outbound
3710
+ | Ne$Outbound
3711
+ | Gt$Outbound
3712
+ | Gte$Outbound
3713
+ | Lt$Outbound
3714
+ | Lte$Outbound
3715
+ | In$Outbound
3716
+ | Nin$Outbound
3717
+ | Exists$Outbound;
3718
+ } | undefined;
336
3719
  };
337
3720
 
3721
+ /** @internal */
3722
+ export const DeploymentInvokeRequestBody$outboundSchema: z.ZodType<
3723
+ DeploymentInvokeRequestBody$Outbound,
3724
+ z.ZodTypeDef,
3725
+ DeploymentInvokeRequestBody
3726
+ > = z.object({
3727
+ key: z.string(),
3728
+ stream: z.boolean().default(false),
3729
+ inputs: z.record(z.any()).optional(),
3730
+ context: z.record(z.any()).optional(),
3731
+ prefixMessages: z.array(
3732
+ z.union([
3733
+ z.lazy(() => SystemMessage$outboundSchema),
3734
+ z.lazy(() => DeveloperMessage$outboundSchema),
3735
+ z.lazy(() => UserMessage$outboundSchema),
3736
+ z.lazy(() => AssistantMessage$outboundSchema),
3737
+ z.lazy(() => ToolMessage$outboundSchema),
3738
+ ]),
3739
+ ).optional(),
3740
+ messages: z.array(
3741
+ z.union([
3742
+ z.lazy(() => MessagesSystemMessage$outboundSchema),
3743
+ z.lazy(() => MessagesDeveloperMessage$outboundSchema),
3744
+ z.lazy(() => MessagesUserMessage$outboundSchema),
3745
+ z.lazy(() => MessagesAssistantMessage$outboundSchema),
3746
+ z.lazy(() => MessagesToolMessage$outboundSchema),
3747
+ ]),
3748
+ ).optional(),
3749
+ identity: components.PublicIdentity$outboundSchema.optional(),
3750
+ fileIds: z.array(z.string()).optional(),
3751
+ metadata: z.record(z.any()).optional(),
3752
+ extraParams: z.record(z.any()).optional(),
3753
+ documents: z.array(z.lazy(() => Documents$outboundSchema)).optional(),
3754
+ invokeOptions: z.lazy(() => InvokeOptions$outboundSchema).optional(),
3755
+ thread: z.lazy(() => Thread$outboundSchema).optional(),
3756
+ knowledgeFilter: z.union([
3757
+ z.lazy(() => And$outboundSchema),
3758
+ z.lazy(() => Or$outboundSchema),
3759
+ z.record(z.union([
3760
+ z.lazy(() => Eq$outboundSchema),
3761
+ z.lazy(() => Ne$outboundSchema),
3762
+ z.lazy(() => Gt$outboundSchema),
3763
+ z.lazy(() => Gte$outboundSchema),
3764
+ z.lazy(() => Lt$outboundSchema),
3765
+ z.lazy(() => Lte$outboundSchema),
3766
+ z.lazy(() => In$outboundSchema),
3767
+ z.lazy(() => Nin$outboundSchema),
3768
+ z.lazy(() => Exists$outboundSchema),
3769
+ ])),
3770
+ ]).optional(),
3771
+ }).transform((v) => {
3772
+ return remap$(v, {
3773
+ prefixMessages: "prefix_messages",
3774
+ fileIds: "file_ids",
3775
+ extraParams: "extra_params",
3776
+ invokeOptions: "invoke_options",
3777
+ knowledgeFilter: "knowledge_filter",
3778
+ });
3779
+ });
3780
+
3781
+ export function deploymentInvokeRequestBodyToJSON(
3782
+ deploymentInvokeRequestBody: DeploymentInvokeRequestBody,
3783
+ ): string {
3784
+ return JSON.stringify(
3785
+ DeploymentInvokeRequestBody$outboundSchema.parse(
3786
+ deploymentInvokeRequestBody,
3787
+ ),
3788
+ );
3789
+ }
3790
+
338
3791
  /** @internal */
339
3792
  export const DeploymentInvokeObject$inboundSchema: z.ZodNativeEnum<
340
3793
  typeof DeploymentInvokeObject
@@ -467,36 +3920,33 @@ export function completionTokensDetailsFromJSON(
467
3920
  }
468
3921
 
469
3922
  /** @internal */
470
- export const DeploymentInvokeUsage$inboundSchema: z.ZodType<
471
- DeploymentInvokeUsage,
472
- z.ZodTypeDef,
473
- unknown
474
- > = z.object({
475
- total_tokens: z.number().optional(),
476
- prompt_tokens: z.number().optional(),
477
- completion_tokens: z.number().optional(),
478
- prompt_tokens_details: z.lazy(() => PromptTokensDetails$inboundSchema)
479
- .optional(),
480
- completion_tokens_details: z.nullable(
481
- z.lazy(() => CompletionTokensDetails$inboundSchema),
482
- ).optional(),
483
- }).transform((v) => {
484
- return remap$(v, {
485
- "total_tokens": "totalTokens",
486
- "prompt_tokens": "promptTokens",
487
- "completion_tokens": "completionTokens",
488
- "prompt_tokens_details": "promptTokensDetails",
489
- "completion_tokens_details": "completionTokensDetails",
3923
+ export const Usage$inboundSchema: z.ZodType<Usage, z.ZodTypeDef, unknown> = z
3924
+ .object({
3925
+ total_tokens: z.number().optional(),
3926
+ prompt_tokens: z.number().optional(),
3927
+ completion_tokens: z.number().optional(),
3928
+ prompt_tokens_details: z.lazy(() => PromptTokensDetails$inboundSchema)
3929
+ .optional(),
3930
+ completion_tokens_details: z.nullable(
3931
+ z.lazy(() => CompletionTokensDetails$inboundSchema),
3932
+ ).optional(),
3933
+ }).transform((v) => {
3934
+ return remap$(v, {
3935
+ "total_tokens": "totalTokens",
3936
+ "prompt_tokens": "promptTokens",
3937
+ "completion_tokens": "completionTokens",
3938
+ "prompt_tokens_details": "promptTokensDetails",
3939
+ "completion_tokens_details": "completionTokensDetails",
3940
+ });
490
3941
  });
491
- });
492
3942
 
493
- export function deploymentInvokeUsageFromJSON(
3943
+ export function usageFromJSON(
494
3944
  jsonString: string,
495
- ): SafeParseResult<DeploymentInvokeUsage, SDKValidationError> {
3945
+ ): SafeParseResult<Usage, SDKValidationError> {
496
3946
  return safeParse(
497
3947
  jsonString,
498
- (x) => DeploymentInvokeUsage$inboundSchema.parse(JSON.parse(x)),
499
- `Failed to parse 'DeploymentInvokeUsage' from JSON`,
3948
+ (x) => Usage$inboundSchema.parse(JSON.parse(x)),
3949
+ `Failed to parse 'Usage' from JSON`,
500
3950
  );
501
3951
  }
502
3952
 
@@ -662,31 +4112,28 @@ export function messageFromJSON(
662
4112
  }
663
4113
 
664
4114
  /** @internal */
665
- export const DeploymentInvokeChoices$inboundSchema: z.ZodType<
666
- DeploymentInvokeChoices,
667
- z.ZodTypeDef,
668
- unknown
669
- > = z.object({
670
- index: z.number(),
671
- message: z.union([
672
- z.lazy(() => Message1$inboundSchema),
673
- z.lazy(() => Message2$inboundSchema),
674
- z.lazy(() => Message3$inboundSchema),
675
- ]),
676
- finish_reason: z.nullable(z.string()).optional(),
677
- }).transform((v) => {
678
- return remap$(v, {
679
- "finish_reason": "finishReason",
4115
+ export const Choices$inboundSchema: z.ZodType<Choices, z.ZodTypeDef, unknown> =
4116
+ z.object({
4117
+ index: z.number(),
4118
+ message: z.union([
4119
+ z.lazy(() => Message1$inboundSchema),
4120
+ z.lazy(() => Message2$inboundSchema),
4121
+ z.lazy(() => Message3$inboundSchema),
4122
+ ]),
4123
+ finish_reason: z.nullable(z.string()).optional(),
4124
+ }).transform((v) => {
4125
+ return remap$(v, {
4126
+ "finish_reason": "finishReason",
4127
+ });
680
4128
  });
681
- });
682
4129
 
683
- export function deploymentInvokeChoicesFromJSON(
4130
+ export function choicesFromJSON(
684
4131
  jsonString: string,
685
- ): SafeParseResult<DeploymentInvokeChoices, SDKValidationError> {
4132
+ ): SafeParseResult<Choices, SDKValidationError> {
686
4133
  return safeParse(
687
4134
  jsonString,
688
- (x) => DeploymentInvokeChoices$inboundSchema.parse(JSON.parse(x)),
689
- `Failed to parse 'DeploymentInvokeChoices' from JSON`,
4135
+ (x) => Choices$inboundSchema.parse(JSON.parse(x)),
4136
+ `Failed to parse 'Choices' from JSON`,
690
4137
  );
691
4138
  }
692
4139
 
@@ -709,9 +4156,8 @@ export const DeploymentInvokeResponseBody$inboundSchema: z.ZodType<
709
4156
  system_fingerprint: z.nullable(z.string()).optional(),
710
4157
  retrievals: z.array(z.lazy(() => Retrievals$inboundSchema)).optional(),
711
4158
  provider_response: z.any().optional(),
712
- usage: z.nullable(z.lazy(() => DeploymentInvokeUsage$inboundSchema))
713
- .optional(),
714
- choices: z.array(z.lazy(() => DeploymentInvokeChoices$inboundSchema)),
4159
+ usage: z.nullable(z.lazy(() => Usage$inboundSchema)).optional(),
4160
+ choices: z.array(z.lazy(() => Choices$inboundSchema)),
715
4161
  }).transform((v) => {
716
4162
  return remap$(v, {
717
4163
  "is_final": "isFinal",