@orq-ai/node 4.0.0-rc.20 → 4.0.0-rc.21

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 (161) hide show
  1. package/README.md +25 -21
  2. package/bin/mcp-server.js +4356 -3411
  3. package/bin/mcp-server.js.map +54 -50
  4. package/docs/sdks/agents/README.md +83 -3
  5. package/examples/package-lock.json +1 -1
  6. package/funcs/agentsDuplicate.d.ts +18 -0
  7. package/funcs/agentsDuplicate.d.ts.map +1 -0
  8. package/funcs/agentsDuplicate.js +123 -0
  9. package/funcs/agentsDuplicate.js.map +1 -0
  10. package/funcs/agentsList.d.ts +1 -1
  11. package/funcs/agentsList.js +1 -1
  12. package/jsr.json +1 -1
  13. package/lib/config.d.ts +3 -3
  14. package/lib/config.js +3 -3
  15. package/mcp-server/mcp-server.js +1 -1
  16. package/mcp-server/server.d.ts.map +1 -1
  17. package/mcp-server/server.js +3 -1
  18. package/mcp-server/server.js.map +1 -1
  19. package/mcp-server/tools/agentsDuplicate.d.ts +8 -0
  20. package/mcp-server/tools/agentsDuplicate.d.ts.map +1 -0
  21. package/mcp-server/tools/agentsDuplicate.js +64 -0
  22. package/mcp-server/tools/agentsDuplicate.js.map +1 -0
  23. package/mcp-server/tools/agentsList.js +1 -1
  24. package/mcp-server/tools/agentsList.js.map +1 -1
  25. package/models/errors/duplicateagent.d.ts +55 -0
  26. package/models/errors/duplicateagent.d.ts.map +1 -0
  27. package/models/errors/duplicateagent.js +106 -0
  28. package/models/errors/duplicateagent.js.map +1 -0
  29. package/models/errors/index.d.ts +1 -0
  30. package/models/errors/index.d.ts.map +1 -1
  31. package/models/errors/index.js +1 -0
  32. package/models/errors/index.js.map +1 -1
  33. package/models/operations/createagent.d.ts +19 -10
  34. package/models/operations/createagent.d.ts.map +1 -1
  35. package/models/operations/createagent.js +14 -11
  36. package/models/operations/createagent.js.map +1 -1
  37. package/models/operations/createbudget.js +2 -2
  38. package/models/operations/createcontact.js +2 -2
  39. package/models/operations/createdataset.js +2 -2
  40. package/models/operations/createdatasetitem.js +8 -8
  41. package/models/operations/createdatasource.js +2 -2
  42. package/models/operations/createeval.js +28 -28
  43. package/models/operations/createtool.js +10 -10
  44. package/models/operations/duplicateagent.d.ts +1267 -0
  45. package/models/operations/duplicateagent.d.ts.map +1 -0
  46. package/models/operations/duplicateagent.js +1278 -0
  47. package/models/operations/duplicateagent.js.map +1 -0
  48. package/models/operations/duplicatetool.js +10 -10
  49. package/models/operations/fileget.js +2 -2
  50. package/models/operations/filelist.js +2 -2
  51. package/models/operations/fileupload.js +2 -2
  52. package/models/operations/getagent.d.ts +12 -9
  53. package/models/operations/getagent.d.ts.map +1 -1
  54. package/models/operations/getagent.js +11 -11
  55. package/models/operations/getagent.js.map +1 -1
  56. package/models/operations/getagenttask.d.ts +321 -4
  57. package/models/operations/getagenttask.d.ts.map +1 -1
  58. package/models/operations/getagenttask.js +351 -5
  59. package/models/operations/getagenttask.js.map +1 -1
  60. package/models/operations/getalltools.js +10 -10
  61. package/models/operations/getbudget.js +2 -2
  62. package/models/operations/getevals.js +28 -28
  63. package/models/operations/index.d.ts +1 -0
  64. package/models/operations/index.d.ts.map +1 -1
  65. package/models/operations/index.js +1 -0
  66. package/models/operations/index.js.map +1 -1
  67. package/models/operations/invokeagent.d.ts +231 -2
  68. package/models/operations/invokeagent.d.ts.map +1 -1
  69. package/models/operations/invokeagent.js +261 -4
  70. package/models/operations/invokeagent.js.map +1 -1
  71. package/models/operations/listagents.d.ts +14 -11
  72. package/models/operations/listagents.d.ts.map +1 -1
  73. package/models/operations/listagents.js +14 -13
  74. package/models/operations/listagents.js.map +1 -1
  75. package/models/operations/listagenttasks.d.ts +250 -1094
  76. package/models/operations/listagenttasks.d.ts.map +1 -1
  77. package/models/operations/listagenttasks.js +276 -1117
  78. package/models/operations/listagenttasks.js.map +1 -1
  79. package/models/operations/listbudgets.js +2 -2
  80. package/models/operations/listcontacts.js +2 -2
  81. package/models/operations/listdatasetdatapoints.js +8 -8
  82. package/models/operations/listdatasets.js +2 -2
  83. package/models/operations/listdatasources.js +2 -2
  84. package/models/operations/retrievecontact.js +2 -2
  85. package/models/operations/retrievedatapoint.js +8 -8
  86. package/models/operations/retrievedataset.js +2 -2
  87. package/models/operations/retrievedatasource.js +2 -2
  88. package/models/operations/retrievetool.js +10 -10
  89. package/models/operations/runagent.d.ts +232 -3
  90. package/models/operations/runagent.d.ts.map +1 -1
  91. package/models/operations/runagent.js +267 -8
  92. package/models/operations/runagent.js.map +1 -1
  93. package/models/operations/streamrunagent.d.ts +1 -1
  94. package/models/operations/updateagent.d.ts +41 -9
  95. package/models/operations/updateagent.d.ts.map +1 -1
  96. package/models/operations/updateagent.js +34 -16
  97. package/models/operations/updateagent.js.map +1 -1
  98. package/models/operations/updatebudget.js +2 -2
  99. package/models/operations/updatecontact.js +2 -2
  100. package/models/operations/updatedatapoint.js +8 -8
  101. package/models/operations/updatedataset.js +2 -2
  102. package/models/operations/updatedatasource.js +2 -2
  103. package/models/operations/updateeval.js +28 -28
  104. package/models/operations/updatetool.js +10 -10
  105. package/package.json +1 -1
  106. package/sdk/agents.d.ts +8 -1
  107. package/sdk/agents.d.ts.map +1 -1
  108. package/sdk/agents.js +11 -1
  109. package/sdk/agents.js.map +1 -1
  110. package/src/funcs/agentsDuplicate.ts +179 -0
  111. package/src/funcs/agentsList.ts +1 -1
  112. package/src/lib/config.ts +3 -3
  113. package/src/mcp-server/mcp-server.ts +1 -1
  114. package/src/mcp-server/server.ts +3 -1
  115. package/src/mcp-server/tools/agentsDuplicate.ts +37 -0
  116. package/src/mcp-server/tools/agentsList.ts +1 -1
  117. package/src/models/errors/duplicateagent.ts +128 -0
  118. package/src/models/errors/index.ts +1 -0
  119. package/src/models/operations/createagent.ts +33 -16
  120. package/src/models/operations/createbudget.ts +2 -2
  121. package/src/models/operations/createcontact.ts +2 -2
  122. package/src/models/operations/createdataset.ts +2 -2
  123. package/src/models/operations/createdatasetitem.ts +8 -8
  124. package/src/models/operations/createdatasource.ts +2 -2
  125. package/src/models/operations/createeval.ts +28 -28
  126. package/src/models/operations/createtool.ts +10 -10
  127. package/src/models/operations/duplicateagent.ts +3280 -0
  128. package/src/models/operations/duplicatetool.ts +10 -10
  129. package/src/models/operations/fileget.ts +2 -2
  130. package/src/models/operations/filelist.ts +2 -2
  131. package/src/models/operations/fileupload.ts +2 -2
  132. package/src/models/operations/getagent.ts +29 -17
  133. package/src/models/operations/getagenttask.ts +750 -8
  134. package/src/models/operations/getalltools.ts +10 -10
  135. package/src/models/operations/getbudget.ts +2 -2
  136. package/src/models/operations/getevals.ts +28 -28
  137. package/src/models/operations/index.ts +1 -0
  138. package/src/models/operations/invokeagent.ts +632 -4
  139. package/src/models/operations/listagents.ts +32 -21
  140. package/src/models/operations/listagenttasks.ts +640 -2908
  141. package/src/models/operations/listbudgets.ts +2 -2
  142. package/src/models/operations/listcontacts.ts +2 -2
  143. package/src/models/operations/listdatasetdatapoints.ts +8 -8
  144. package/src/models/operations/listdatasets.ts +2 -2
  145. package/src/models/operations/listdatasources.ts +2 -2
  146. package/src/models/operations/retrievecontact.ts +2 -2
  147. package/src/models/operations/retrievedatapoint.ts +8 -8
  148. package/src/models/operations/retrievedataset.ts +2 -2
  149. package/src/models/operations/retrievedatasource.ts +2 -2
  150. package/src/models/operations/retrievetool.ts +10 -10
  151. package/src/models/operations/runagent.ts +606 -5
  152. package/src/models/operations/streamrunagent.ts +1 -1
  153. package/src/models/operations/updateagent.ts +72 -18
  154. package/src/models/operations/updatebudget.ts +2 -2
  155. package/src/models/operations/updatecontact.ts +2 -2
  156. package/src/models/operations/updatedatapoint.ts +8 -8
  157. package/src/models/operations/updatedataset.ts +2 -2
  158. package/src/models/operations/updatedatasource.ts +2 -2
  159. package/src/models/operations/updateeval.ts +28 -28
  160. package/src/models/operations/updatetool.ts +10 -10
  161. package/src/sdk/agents.ts +19 -1
@@ -0,0 +1,3280 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { ClosedEnum } from "../../types/enums.js";
9
+ import { Result as SafeParseResult } from "../../types/fp.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+
12
+ export type DuplicateAgentRequest = {
13
+ /**
14
+ * The ID of the agent to duplicate
15
+ */
16
+ id: string;
17
+ };
18
+
19
+ /**
20
+ * The status of the agent. `Live` is the latest version of the agent. `Draft` is a version that is not yet published. `Pending` is a version that is pending approval. `Published` is a version that was live and has been replaced by a new version.
21
+ */
22
+ export const DuplicateAgentStatus = {
23
+ Live: "live",
24
+ Draft: "draft",
25
+ Pending: "pending",
26
+ Published: "published",
27
+ } as const;
28
+ /**
29
+ * The status of the agent. `Live` is the latest version of the agent. `Draft` is a version that is not yet published. `Pending` is a version that is pending approval. `Published` is a version that was live and has been replaced by a new version.
30
+ */
31
+ export type DuplicateAgentStatus = ClosedEnum<typeof DuplicateAgentStatus>;
32
+
33
+ /**
34
+ * If all, the agent will require approval for all tools. If respect_tool, the agent will require approval for tools that have the requires_approval flag set to true. If none, the agent will not require approval for any tools.
35
+ */
36
+ export const DuplicateAgentToolApprovalRequired = {
37
+ All: "all",
38
+ RespectTool: "respect_tool",
39
+ None: "none",
40
+ } as const;
41
+ /**
42
+ * If all, the agent will require approval for all tools. If respect_tool, the agent will require approval for tools that have the requires_approval flag set to true. If none, the agent will not require approval for any tools.
43
+ */
44
+ export type DuplicateAgentToolApprovalRequired = ClosedEnum<
45
+ typeof DuplicateAgentToolApprovalRequired
46
+ >;
47
+
48
+ export type DuplicateAgentConditions = {
49
+ /**
50
+ * The argument of the tool call to evaluate
51
+ */
52
+ condition: string;
53
+ /**
54
+ * The operator to use
55
+ */
56
+ operator: string;
57
+ /**
58
+ * The value to compare against
59
+ */
60
+ value: string;
61
+ };
62
+
63
+ export type DuplicateAgentTools = {
64
+ /**
65
+ * The id of the resource
66
+ */
67
+ id: string;
68
+ /**
69
+ * Optional tool key for custom tools
70
+ */
71
+ key?: string | undefined;
72
+ actionType: string;
73
+ displayName?: string | undefined;
74
+ requiresApproval?: boolean | undefined;
75
+ conditions?: Array<DuplicateAgentConditions> | undefined;
76
+ /**
77
+ * Optional MCP server reference for tools from MCP servers
78
+ */
79
+ mcpServer?: string | undefined;
80
+ /**
81
+ * Tool execution timeout in seconds (default: 2 minutes, max: 10 minutes)
82
+ */
83
+ timeout?: number | undefined;
84
+ };
85
+
86
+ export type DuplicateAgentSettings = {
87
+ /**
88
+ * Maximum iterations(llm calls) before the agent will stop executing.
89
+ */
90
+ maxIterations?: number | undefined;
91
+ /**
92
+ * Maximum time (in seconds) for the agent thinking process. This does not include the time for tool calls and sub agent calls. It will be loosely enforced, the in progress LLM calls will not be terminated and the last assistant message will be returned.
93
+ */
94
+ maxExecutionTime?: number | undefined;
95
+ /**
96
+ * If all, the agent will require approval for all tools. If respect_tool, the agent will require approval for tools that have the requires_approval flag set to true. If none, the agent will not require approval for any tools.
97
+ */
98
+ toolApprovalRequired?: DuplicateAgentToolApprovalRequired | undefined;
99
+ tools?: Array<DuplicateAgentTools> | undefined;
100
+ };
101
+
102
+ /**
103
+ * The voice the model uses to respond. Supported voices are alloy, echo, fable, onyx, nova, and shimmer.
104
+ */
105
+ export const DuplicateAgentVoice = {
106
+ Alloy: "alloy",
107
+ Echo: "echo",
108
+ Fable: "fable",
109
+ Onyx: "onyx",
110
+ Nova: "nova",
111
+ Shimmer: "shimmer",
112
+ } as const;
113
+ /**
114
+ * The voice the model uses to respond. Supported voices are alloy, echo, fable, onyx, nova, and shimmer.
115
+ */
116
+ export type DuplicateAgentVoice = ClosedEnum<typeof DuplicateAgentVoice>;
117
+
118
+ /**
119
+ * Specifies the output audio format. Must be one of wav, mp3, flac, opus, or pcm16.
120
+ */
121
+ export const DuplicateAgentFormat = {
122
+ Wav: "wav",
123
+ Mp3: "mp3",
124
+ Flac: "flac",
125
+ Opus: "opus",
126
+ Pcm16: "pcm16",
127
+ } as const;
128
+ /**
129
+ * Specifies the output audio format. Must be one of wav, mp3, flac, opus, or pcm16.
130
+ */
131
+ export type DuplicateAgentFormat = ClosedEnum<typeof DuplicateAgentFormat>;
132
+
133
+ /**
134
+ * Parameters for audio output. Required when audio output is requested with modalities: ["audio"]. Learn more.
135
+ */
136
+ export type DuplicateAgentAudio = {
137
+ /**
138
+ * The voice the model uses to respond. Supported voices are alloy, echo, fable, onyx, nova, and shimmer.
139
+ */
140
+ voice: DuplicateAgentVoice;
141
+ /**
142
+ * Specifies the output audio format. Must be one of wav, mp3, flac, opus, or pcm16.
143
+ */
144
+ format: DuplicateAgentFormat;
145
+ };
146
+
147
+ export const DuplicateAgentResponseFormatAgentsResponseType = {
148
+ JsonSchema: "json_schema",
149
+ } as const;
150
+ export type DuplicateAgentResponseFormatAgentsResponseType = ClosedEnum<
151
+ typeof DuplicateAgentResponseFormatAgentsResponseType
152
+ >;
153
+
154
+ export type DuplicateAgentResponseFormatJsonSchema = {
155
+ /**
156
+ * A description of what the response format is for, used by the model to determine how to respond in the format.
157
+ */
158
+ description?: string | undefined;
159
+ /**
160
+ * The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
161
+ */
162
+ name: string;
163
+ /**
164
+ * The schema for the response format, described as a JSON Schema object.
165
+ */
166
+ schema?: any | undefined;
167
+ /**
168
+ * Whether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is true.
169
+ */
170
+ strict?: boolean | undefined;
171
+ };
172
+
173
+ /**
174
+ * @remarks
175
+ *
176
+ * JSON Schema response format. Used to generate structured JSON responses
177
+ */
178
+ export type DuplicateAgentResponseFormatAgentsJSONSchema = {
179
+ type: DuplicateAgentResponseFormatAgentsResponseType;
180
+ jsonSchema: DuplicateAgentResponseFormatJsonSchema;
181
+ };
182
+
183
+ export const DuplicateAgentResponseFormatAgentsType = {
184
+ JsonObject: "json_object",
185
+ } as const;
186
+ export type DuplicateAgentResponseFormatAgentsType = ClosedEnum<
187
+ typeof DuplicateAgentResponseFormatAgentsType
188
+ >;
189
+
190
+ /**
191
+ * @remarks
192
+ *
193
+ * JSON object response format. An older method of generating JSON responses. Using `json_schema` is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so.
194
+ */
195
+ export type DuplicateAgentResponseFormatJSONObject = {
196
+ type: DuplicateAgentResponseFormatAgentsType;
197
+ };
198
+
199
+ export const DuplicateAgentResponseFormatType = {
200
+ Text: "text",
201
+ } as const;
202
+ export type DuplicateAgentResponseFormatType = ClosedEnum<
203
+ typeof DuplicateAgentResponseFormatType
204
+ >;
205
+
206
+ /**
207
+ * @remarks
208
+ *
209
+ * Default response format. Used to generate text responses
210
+ */
211
+ export type DuplicateAgentResponseFormatText = {
212
+ type: DuplicateAgentResponseFormatType;
213
+ };
214
+
215
+ /**
216
+ * An object specifying the format that the model must output
217
+ */
218
+ export type DuplicateAgentResponseFormat =
219
+ | DuplicateAgentResponseFormatAgentsJSONSchema
220
+ | DuplicateAgentResponseFormatText
221
+ | DuplicateAgentResponseFormatJSONObject;
222
+
223
+ /**
224
+ * Up to 4 sequences where the API will stop generating further tokens.
225
+ */
226
+ export type DuplicateAgentStop = string | Array<string>;
227
+
228
+ /**
229
+ * Options for streaming response. Only set this when you set stream: true.
230
+ */
231
+ export type DuplicateAgentStreamOptions = {
232
+ /**
233
+ * If set, an additional chunk will be streamed before the data: [DONE] message. The usage field on this chunk shows the token usage statistics for the entire request, and the choices field will always be an empty array. All other chunks will also include a usage field, but with a null value.
234
+ */
235
+ includeUsage?: boolean | undefined;
236
+ };
237
+
238
+ /**
239
+ * Enables or disables the thinking mode capability
240
+ */
241
+ export const DuplicateAgentType = {
242
+ Enabled: "enabled",
243
+ Disabled: "disabled",
244
+ } as const;
245
+ /**
246
+ * Enables or disables the thinking mode capability
247
+ */
248
+ export type DuplicateAgentType = ClosedEnum<typeof DuplicateAgentType>;
249
+
250
+ export type DuplicateAgentThinking = {
251
+ /**
252
+ * Enables or disables the thinking mode capability
253
+ */
254
+ type: DuplicateAgentType;
255
+ /**
256
+ * Determines how many tokens the model can use for its internal reasoning process. Larger budgets can enable more thorough analysis for complex problems, improving response quality. Must be ≥1024 and less than `max_tokens`.
257
+ */
258
+ budgetTokens: number;
259
+ };
260
+
261
+ /**
262
+ * The type of the tool. Currently, only function is supported.
263
+ */
264
+ export const DuplicateAgentToolChoiceType = {
265
+ Function: "function",
266
+ } as const;
267
+ /**
268
+ * The type of the tool. Currently, only function is supported.
269
+ */
270
+ export type DuplicateAgentToolChoiceType = ClosedEnum<
271
+ typeof DuplicateAgentToolChoiceType
272
+ >;
273
+
274
+ export type DuplicateAgentToolChoiceFunction = {
275
+ /**
276
+ * The name of the function to call.
277
+ */
278
+ name?: string | undefined;
279
+ };
280
+
281
+ export type DuplicateAgentToolChoice2 = {
282
+ /**
283
+ * The type of the tool. Currently, only function is supported.
284
+ */
285
+ type?: DuplicateAgentToolChoiceType | undefined;
286
+ function: DuplicateAgentToolChoiceFunction;
287
+ };
288
+
289
+ export const DuplicateAgentToolChoice1 = {
290
+ None: "none",
291
+ Auto: "auto",
292
+ Required: "required",
293
+ } as const;
294
+ export type DuplicateAgentToolChoice1 = ClosedEnum<
295
+ typeof DuplicateAgentToolChoice1
296
+ >;
297
+
298
+ /**
299
+ * Controls which (if any) tool is called by the model.
300
+ */
301
+ export type DuplicateAgentToolChoice =
302
+ | DuplicateAgentToolChoice2
303
+ | DuplicateAgentToolChoice1;
304
+
305
+ export const DuplicateAgentModalities = {
306
+ Text: "text",
307
+ Audio: "audio",
308
+ } as const;
309
+ export type DuplicateAgentModalities = ClosedEnum<
310
+ typeof DuplicateAgentModalities
311
+ >;
312
+
313
+ /**
314
+ * Model behavior parameters (snake_case) stored as part of the agent configuration. These become the default parameters used when the agent is executed. Commonly used: temperature (0-1, controls randomness), max_completion_tokens (response length), top_p (nucleus sampling). Advanced: frequency_penalty, presence_penalty, response_format (JSON/structured output), reasoning_effort (for o1/thinking models), seed (reproducibility), stop sequences. Model-specific support varies. Runtime parameters in agent execution requests can override these defaults.
315
+ */
316
+ export type DuplicateAgentParameters = {
317
+ /**
318
+ * Parameters for audio output. Required when audio output is requested with modalities: ["audio"]. Learn more.
319
+ */
320
+ audio?: DuplicateAgentAudio | null | undefined;
321
+ /**
322
+ * Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.
323
+ */
324
+ frequencyPenalty?: number | null | undefined;
325
+ /**
326
+ * `[Deprecated]`. The maximum number of tokens that can be generated in the chat completion. This value can be used to control costs for text generated via API.
327
+ *
328
+ * @remarks
329
+ *
330
+ * This value is now `deprecated` in favor of `max_completion_tokens`, and is not compatible with o1 series models.
331
+ */
332
+ maxTokens?: number | null | undefined;
333
+ /**
334
+ * An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens
335
+ */
336
+ maxCompletionTokens?: number | null | undefined;
337
+ /**
338
+ * Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the content of message.
339
+ */
340
+ logprobs?: boolean | null | undefined;
341
+ /**
342
+ * An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to true if this parameter is used.
343
+ */
344
+ topLogprobs?: number | null | undefined;
345
+ /**
346
+ * How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs.
347
+ */
348
+ n?: number | null | undefined;
349
+ /**
350
+ * Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
351
+ */
352
+ presencePenalty?: number | null | undefined;
353
+ /**
354
+ * An object specifying the format that the model must output
355
+ */
356
+ responseFormat?:
357
+ | DuplicateAgentResponseFormatAgentsJSONSchema
358
+ | DuplicateAgentResponseFormatText
359
+ | DuplicateAgentResponseFormatJSONObject
360
+ | undefined;
361
+ /**
362
+ * Constrains effort on reasoning for reasoning models. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
363
+ */
364
+ reasoningEffort?: string | undefined;
365
+ /**
366
+ * Adjusts response verbosity. Lower levels yield shorter answers.
367
+ */
368
+ verbosity?: string | undefined;
369
+ /**
370
+ * If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result.
371
+ */
372
+ seed?: number | null | undefined;
373
+ /**
374
+ * Up to 4 sequences where the API will stop generating further tokens.
375
+ */
376
+ stop?: string | Array<string> | null | undefined;
377
+ /**
378
+ * Options for streaming response. Only set this when you set stream: true.
379
+ */
380
+ streamOptions?: DuplicateAgentStreamOptions | null | undefined;
381
+ thinking?: DuplicateAgentThinking | undefined;
382
+ /**
383
+ * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
384
+ */
385
+ temperature?: number | null | undefined;
386
+ /**
387
+ * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass.
388
+ */
389
+ topP?: number | null | undefined;
390
+ /**
391
+ * Limits the model to consider only the top k most likely tokens at each step.
392
+ */
393
+ topK?: number | null | undefined;
394
+ /**
395
+ * Controls which (if any) tool is called by the model.
396
+ */
397
+ toolChoice?:
398
+ | DuplicateAgentToolChoice2
399
+ | DuplicateAgentToolChoice1
400
+ | undefined;
401
+ /**
402
+ * Whether to enable parallel function calling during tool use.
403
+ */
404
+ parallelToolCalls?: boolean | undefined;
405
+ /**
406
+ * Output types that you would like the model to generate. Most models are capable of generating text, which is the default: ["text"]. The gpt-4o-audio-preview model can also be used to generate audio. To request that this model generate both text and audio responses, you can use: ["text", "audio"].
407
+ */
408
+ modalities?: Array<DuplicateAgentModalities> | null | undefined;
409
+ };
410
+
411
+ /**
412
+ * The voice the model uses to respond. Supported voices are alloy, echo, fable, onyx, nova, and shimmer.
413
+ */
414
+ export const DuplicateAgentFallbackModelConfigurationVoice = {
415
+ Alloy: "alloy",
416
+ Echo: "echo",
417
+ Fable: "fable",
418
+ Onyx: "onyx",
419
+ Nova: "nova",
420
+ Shimmer: "shimmer",
421
+ } as const;
422
+ /**
423
+ * The voice the model uses to respond. Supported voices are alloy, echo, fable, onyx, nova, and shimmer.
424
+ */
425
+ export type DuplicateAgentFallbackModelConfigurationVoice = ClosedEnum<
426
+ typeof DuplicateAgentFallbackModelConfigurationVoice
427
+ >;
428
+
429
+ /**
430
+ * Specifies the output audio format. Must be one of wav, mp3, flac, opus, or pcm16.
431
+ */
432
+ export const DuplicateAgentFallbackModelConfigurationFormat = {
433
+ Wav: "wav",
434
+ Mp3: "mp3",
435
+ Flac: "flac",
436
+ Opus: "opus",
437
+ Pcm16: "pcm16",
438
+ } as const;
439
+ /**
440
+ * Specifies the output audio format. Must be one of wav, mp3, flac, opus, or pcm16.
441
+ */
442
+ export type DuplicateAgentFallbackModelConfigurationFormat = ClosedEnum<
443
+ typeof DuplicateAgentFallbackModelConfigurationFormat
444
+ >;
445
+
446
+ /**
447
+ * Parameters for audio output. Required when audio output is requested with modalities: ["audio"]. Learn more.
448
+ */
449
+ export type DuplicateAgentFallbackModelConfigurationAudio = {
450
+ /**
451
+ * The voice the model uses to respond. Supported voices are alloy, echo, fable, onyx, nova, and shimmer.
452
+ */
453
+ voice: DuplicateAgentFallbackModelConfigurationVoice;
454
+ /**
455
+ * Specifies the output audio format. Must be one of wav, mp3, flac, opus, or pcm16.
456
+ */
457
+ format: DuplicateAgentFallbackModelConfigurationFormat;
458
+ };
459
+
460
+ export const DuplicateAgentResponseFormatAgentsResponse201ApplicationJSONResponseBodyType =
461
+ {
462
+ JsonSchema: "json_schema",
463
+ } as const;
464
+ export type DuplicateAgentResponseFormatAgentsResponse201ApplicationJSONResponseBodyType =
465
+ ClosedEnum<
466
+ typeof DuplicateAgentResponseFormatAgentsResponse201ApplicationJSONResponseBodyType
467
+ >;
468
+
469
+ export type DuplicateAgentResponseFormatAgentsResponseJsonSchema = {
470
+ /**
471
+ * A description of what the response format is for, used by the model to determine how to respond in the format.
472
+ */
473
+ description?: string | undefined;
474
+ /**
475
+ * The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
476
+ */
477
+ name: string;
478
+ /**
479
+ * The schema for the response format, described as a JSON Schema object.
480
+ */
481
+ schema?: any | undefined;
482
+ /**
483
+ * Whether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is true.
484
+ */
485
+ strict?: boolean | undefined;
486
+ };
487
+
488
+ /**
489
+ * @remarks
490
+ *
491
+ * JSON Schema response format. Used to generate structured JSON responses
492
+ */
493
+ export type DuplicateAgentResponseFormatAgentsResponse201JSONSchema = {
494
+ type:
495
+ DuplicateAgentResponseFormatAgentsResponse201ApplicationJSONResponseBodyType;
496
+ jsonSchema: DuplicateAgentResponseFormatAgentsResponseJsonSchema;
497
+ };
498
+
499
+ export const DuplicateAgentResponseFormatAgentsResponse201ApplicationJSONType =
500
+ {
501
+ JsonObject: "json_object",
502
+ } as const;
503
+ export type DuplicateAgentResponseFormatAgentsResponse201ApplicationJSONType =
504
+ ClosedEnum<
505
+ typeof DuplicateAgentResponseFormatAgentsResponse201ApplicationJSONType
506
+ >;
507
+
508
+ /**
509
+ * @remarks
510
+ *
511
+ * JSON object response format. An older method of generating JSON responses. Using `json_schema` is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so.
512
+ */
513
+ export type DuplicateAgentResponseFormatAgentsJSONObject = {
514
+ type: DuplicateAgentResponseFormatAgentsResponse201ApplicationJSONType;
515
+ };
516
+
517
+ export const DuplicateAgentResponseFormatAgentsResponse201Type = {
518
+ Text: "text",
519
+ } as const;
520
+ export type DuplicateAgentResponseFormatAgentsResponse201Type = ClosedEnum<
521
+ typeof DuplicateAgentResponseFormatAgentsResponse201Type
522
+ >;
523
+
524
+ /**
525
+ * @remarks
526
+ *
527
+ * Default response format. Used to generate text responses
528
+ */
529
+ export type DuplicateAgentResponseFormatAgentsText = {
530
+ type: DuplicateAgentResponseFormatAgentsResponse201Type;
531
+ };
532
+
533
+ /**
534
+ * An object specifying the format that the model must output
535
+ */
536
+ export type DuplicateAgentFallbackModelConfigurationResponseFormat =
537
+ | DuplicateAgentResponseFormatAgentsResponse201JSONSchema
538
+ | DuplicateAgentResponseFormatAgentsText
539
+ | DuplicateAgentResponseFormatAgentsJSONObject;
540
+
541
+ /**
542
+ * Up to 4 sequences where the API will stop generating further tokens.
543
+ */
544
+ export type DuplicateAgentFallbackModelConfigurationStop =
545
+ | string
546
+ | Array<string>;
547
+
548
+ /**
549
+ * Options for streaming response. Only set this when you set stream: true.
550
+ */
551
+ export type DuplicateAgentFallbackModelConfigurationStreamOptions = {
552
+ /**
553
+ * If set, an additional chunk will be streamed before the data: [DONE] message. The usage field on this chunk shows the token usage statistics for the entire request, and the choices field will always be an empty array. All other chunks will also include a usage field, but with a null value.
554
+ */
555
+ includeUsage?: boolean | undefined;
556
+ };
557
+
558
+ /**
559
+ * Enables or disables the thinking mode capability
560
+ */
561
+ export const DuplicateAgentFallbackModelConfigurationType = {
562
+ Enabled: "enabled",
563
+ Disabled: "disabled",
564
+ } as const;
565
+ /**
566
+ * Enables or disables the thinking mode capability
567
+ */
568
+ export type DuplicateAgentFallbackModelConfigurationType = ClosedEnum<
569
+ typeof DuplicateAgentFallbackModelConfigurationType
570
+ >;
571
+
572
+ export type DuplicateAgentFallbackModelConfigurationThinking = {
573
+ /**
574
+ * Enables or disables the thinking mode capability
575
+ */
576
+ type: DuplicateAgentFallbackModelConfigurationType;
577
+ /**
578
+ * Determines how many tokens the model can use for its internal reasoning process. Larger budgets can enable more thorough analysis for complex problems, improving response quality. Must be ≥1024 and less than `max_tokens`.
579
+ */
580
+ budgetTokens: number;
581
+ };
582
+
583
+ /**
584
+ * The type of the tool. Currently, only function is supported.
585
+ */
586
+ export const DuplicateAgentToolChoiceAgentsType = {
587
+ Function: "function",
588
+ } as const;
589
+ /**
590
+ * The type of the tool. Currently, only function is supported.
591
+ */
592
+ export type DuplicateAgentToolChoiceAgentsType = ClosedEnum<
593
+ typeof DuplicateAgentToolChoiceAgentsType
594
+ >;
595
+
596
+ export type DuplicateAgentToolChoiceAgentsFunction = {
597
+ /**
598
+ * The name of the function to call.
599
+ */
600
+ name?: string | undefined;
601
+ };
602
+
603
+ export type DuplicateAgentToolChoiceAgents2 = {
604
+ /**
605
+ * The type of the tool. Currently, only function is supported.
606
+ */
607
+ type?: DuplicateAgentToolChoiceAgentsType | undefined;
608
+ function: DuplicateAgentToolChoiceAgentsFunction;
609
+ };
610
+
611
+ export const DuplicateAgentToolChoiceAgents1 = {
612
+ None: "none",
613
+ Auto: "auto",
614
+ Required: "required",
615
+ } as const;
616
+ export type DuplicateAgentToolChoiceAgents1 = ClosedEnum<
617
+ typeof DuplicateAgentToolChoiceAgents1
618
+ >;
619
+
620
+ /**
621
+ * Controls which (if any) tool is called by the model.
622
+ */
623
+ export type DuplicateAgentFallbackModelConfigurationToolChoice =
624
+ | DuplicateAgentToolChoiceAgents2
625
+ | DuplicateAgentToolChoiceAgents1;
626
+
627
+ export const DuplicateAgentFallbackModelConfigurationModalities = {
628
+ Text: "text",
629
+ Audio: "audio",
630
+ } as const;
631
+ export type DuplicateAgentFallbackModelConfigurationModalities = ClosedEnum<
632
+ typeof DuplicateAgentFallbackModelConfigurationModalities
633
+ >;
634
+
635
+ /**
636
+ * Optional model parameters specific to this fallback model. Overrides primary model parameters if this fallback is used.
637
+ */
638
+ export type DuplicateAgentFallbackModelConfigurationParameters = {
639
+ /**
640
+ * Parameters for audio output. Required when audio output is requested with modalities: ["audio"]. Learn more.
641
+ */
642
+ audio?: DuplicateAgentFallbackModelConfigurationAudio | null | undefined;
643
+ /**
644
+ * Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.
645
+ */
646
+ frequencyPenalty?: number | null | undefined;
647
+ /**
648
+ * `[Deprecated]`. The maximum number of tokens that can be generated in the chat completion. This value can be used to control costs for text generated via API.
649
+ *
650
+ * @remarks
651
+ *
652
+ * This value is now `deprecated` in favor of `max_completion_tokens`, and is not compatible with o1 series models.
653
+ */
654
+ maxTokens?: number | null | undefined;
655
+ /**
656
+ * An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens
657
+ */
658
+ maxCompletionTokens?: number | null | undefined;
659
+ /**
660
+ * Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the content of message.
661
+ */
662
+ logprobs?: boolean | null | undefined;
663
+ /**
664
+ * An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to true if this parameter is used.
665
+ */
666
+ topLogprobs?: number | null | undefined;
667
+ /**
668
+ * How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs.
669
+ */
670
+ n?: number | null | undefined;
671
+ /**
672
+ * Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
673
+ */
674
+ presencePenalty?: number | null | undefined;
675
+ /**
676
+ * An object specifying the format that the model must output
677
+ */
678
+ responseFormat?:
679
+ | DuplicateAgentResponseFormatAgentsResponse201JSONSchema
680
+ | DuplicateAgentResponseFormatAgentsText
681
+ | DuplicateAgentResponseFormatAgentsJSONObject
682
+ | undefined;
683
+ /**
684
+ * Constrains effort on reasoning for reasoning models. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
685
+ */
686
+ reasoningEffort?: string | undefined;
687
+ /**
688
+ * Adjusts response verbosity. Lower levels yield shorter answers.
689
+ */
690
+ verbosity?: string | undefined;
691
+ /**
692
+ * If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result.
693
+ */
694
+ seed?: number | null | undefined;
695
+ /**
696
+ * Up to 4 sequences where the API will stop generating further tokens.
697
+ */
698
+ stop?: string | Array<string> | null | undefined;
699
+ /**
700
+ * Options for streaming response. Only set this when you set stream: true.
701
+ */
702
+ streamOptions?:
703
+ | DuplicateAgentFallbackModelConfigurationStreamOptions
704
+ | null
705
+ | undefined;
706
+ thinking?: DuplicateAgentFallbackModelConfigurationThinking | undefined;
707
+ /**
708
+ * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
709
+ */
710
+ temperature?: number | null | undefined;
711
+ /**
712
+ * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass.
713
+ */
714
+ topP?: number | null | undefined;
715
+ /**
716
+ * Limits the model to consider only the top k most likely tokens at each step.
717
+ */
718
+ topK?: number | null | undefined;
719
+ /**
720
+ * Controls which (if any) tool is called by the model.
721
+ */
722
+ toolChoice?:
723
+ | DuplicateAgentToolChoiceAgents2
724
+ | DuplicateAgentToolChoiceAgents1
725
+ | undefined;
726
+ /**
727
+ * Whether to enable parallel function calling during tool use.
728
+ */
729
+ parallelToolCalls?: boolean | undefined;
730
+ /**
731
+ * Output types that you would like the model to generate. Most models are capable of generating text, which is the default: ["text"]. The gpt-4o-audio-preview model can also be used to generate audio. To request that this model generate both text and audio responses, you can use: ["text", "audio"].
732
+ */
733
+ modalities?:
734
+ | Array<DuplicateAgentFallbackModelConfigurationModalities>
735
+ | null
736
+ | undefined;
737
+ };
738
+
739
+ /**
740
+ * Fallback model configuration with optional parameters.
741
+ */
742
+ export type DuplicateAgentFallbackModelConfiguration2 = {
743
+ /**
744
+ * A fallback model ID string. Must support tool calling.
745
+ */
746
+ id: string;
747
+ /**
748
+ * Optional model parameters specific to this fallback model. Overrides primary model parameters if this fallback is used.
749
+ */
750
+ parameters?: DuplicateAgentFallbackModelConfigurationParameters | undefined;
751
+ };
752
+
753
+ /**
754
+ * Fallback model for automatic failover when primary model request fails. Supports optional parameter overrides. Can be a simple model ID string or a configuration object with model-specific parameters. Fallbacks are tried in order.
755
+ */
756
+ export type DuplicateAgentFallbackModelConfiguration =
757
+ | DuplicateAgentFallbackModelConfiguration2
758
+ | string;
759
+
760
+ export type DuplicateAgentModel = {
761
+ /**
762
+ * The database ID of the primary model
763
+ */
764
+ id: string;
765
+ /**
766
+ * Optional integration ID for custom model configurations
767
+ */
768
+ integrationId?: string | null | undefined;
769
+ /**
770
+ * Model behavior parameters (snake_case) stored as part of the agent configuration. These become the default parameters used when the agent is executed. Commonly used: temperature (0-1, controls randomness), max_completion_tokens (response length), top_p (nucleus sampling). Advanced: frequency_penalty, presence_penalty, response_format (JSON/structured output), reasoning_effort (for o1/thinking models), seed (reproducibility), stop sequences. Model-specific support varies. Runtime parameters in agent execution requests can override these defaults.
771
+ */
772
+ parameters?: DuplicateAgentParameters | undefined;
773
+ /**
774
+ * Optional array of fallback models (string IDs or config objects) that will be used automatically in order if the primary model fails
775
+ */
776
+ fallbackModels?:
777
+ | Array<DuplicateAgentFallbackModelConfiguration2 | string>
778
+ | null
779
+ | undefined;
780
+ };
781
+
782
+ export type DuplicateAgentTeamOfAgents = {
783
+ /**
784
+ * The unique key of the agent within the workspace
785
+ */
786
+ key: string;
787
+ /**
788
+ * The role of the agent in this context. This is used to give extra information to the leader to help it decide which agent to hand off to.
789
+ */
790
+ role?: string | undefined;
791
+ };
792
+
793
+ export type DuplicateAgentMetrics = {
794
+ totalCost?: number | undefined;
795
+ };
796
+
797
+ export type DuplicateAgentKnowledgeBases = {
798
+ /**
799
+ * Unique identifier of the knowledge base to search
800
+ */
801
+ knowledgeId: string;
802
+ };
803
+
804
+ export const DuplicateAgentCollapsedConfigurationSections = {
805
+ Information: "information",
806
+ Model: "model",
807
+ Tools: "tools",
808
+ Context: "context",
809
+ RuntimeConstraints: "runtime_constraints",
810
+ } as const;
811
+ export type DuplicateAgentCollapsedConfigurationSections = ClosedEnum<
812
+ typeof DuplicateAgentCollapsedConfigurationSections
813
+ >;
814
+
815
+ /**
816
+ * Agent duplicated successfully
817
+ */
818
+ export type DuplicateAgentResponseBody = {
819
+ id: string;
820
+ key: string;
821
+ workspaceId: string;
822
+ projectId: string;
823
+ createdById?: string | null | undefined;
824
+ updatedById?: string | null | undefined;
825
+ created?: string | undefined;
826
+ updated?: string | undefined;
827
+ role: string;
828
+ description: string;
829
+ systemPrompt?: string | undefined;
830
+ instructions: string;
831
+ /**
832
+ * The status of the agent. `Live` is the latest version of the agent. `Draft` is a version that is not yet published. `Pending` is a version that is pending approval. `Published` is a version that was live and has been replaced by a new version.
833
+ */
834
+ status: DuplicateAgentStatus;
835
+ settings?: DuplicateAgentSettings | undefined;
836
+ model: DuplicateAgentModel;
837
+ versionHash?: string | undefined;
838
+ /**
839
+ * Entity storage path in the format: `project/folder/subfolder/...`
840
+ *
841
+ * @remarks
842
+ *
843
+ * The first element identifies the project, followed by nested folders (auto-created as needed).
844
+ *
845
+ * With project-based API keys, the first element is treated as a folder name, as the project is predetermined by the API key.
846
+ */
847
+ path: string;
848
+ /**
849
+ * Array of memory store identifiers. Accepts both memory store IDs and keys.
850
+ */
851
+ memoryStores: Array<string>;
852
+ /**
853
+ * The agents that are accessible to this orchestrator. The main agent can hand off to these agents to perform tasks.
854
+ */
855
+ teamOfAgents: Array<DuplicateAgentTeamOfAgents>;
856
+ metrics?: DuplicateAgentMetrics | undefined;
857
+ /**
858
+ * Extracted variables from agent instructions
859
+ */
860
+ variables?: { [k: string]: any } | undefined;
861
+ /**
862
+ * Agent knowledge bases reference
863
+ */
864
+ knowledgeBases?: Array<DuplicateAgentKnowledgeBases> | undefined;
865
+ /**
866
+ * List of collapsed sections in configuration. Duplicates are not allowed.
867
+ */
868
+ collapsedConfigurationSections?:
869
+ | Array<DuplicateAgentCollapsedConfigurationSections>
870
+ | undefined;
871
+ };
872
+
873
+ /** @internal */
874
+ export const DuplicateAgentRequest$inboundSchema: z.ZodType<
875
+ DuplicateAgentRequest,
876
+ z.ZodTypeDef,
877
+ unknown
878
+ > = z.object({
879
+ id: z.string(),
880
+ });
881
+ /** @internal */
882
+ export type DuplicateAgentRequest$Outbound = {
883
+ id: string;
884
+ };
885
+
886
+ /** @internal */
887
+ export const DuplicateAgentRequest$outboundSchema: z.ZodType<
888
+ DuplicateAgentRequest$Outbound,
889
+ z.ZodTypeDef,
890
+ DuplicateAgentRequest
891
+ > = z.object({
892
+ id: z.string(),
893
+ });
894
+
895
+ export function duplicateAgentRequestToJSON(
896
+ duplicateAgentRequest: DuplicateAgentRequest,
897
+ ): string {
898
+ return JSON.stringify(
899
+ DuplicateAgentRequest$outboundSchema.parse(duplicateAgentRequest),
900
+ );
901
+ }
902
+ export function duplicateAgentRequestFromJSON(
903
+ jsonString: string,
904
+ ): SafeParseResult<DuplicateAgentRequest, SDKValidationError> {
905
+ return safeParse(
906
+ jsonString,
907
+ (x) => DuplicateAgentRequest$inboundSchema.parse(JSON.parse(x)),
908
+ `Failed to parse 'DuplicateAgentRequest' from JSON`,
909
+ );
910
+ }
911
+
912
+ /** @internal */
913
+ export const DuplicateAgentStatus$inboundSchema: z.ZodNativeEnum<
914
+ typeof DuplicateAgentStatus
915
+ > = z.nativeEnum(DuplicateAgentStatus);
916
+ /** @internal */
917
+ export const DuplicateAgentStatus$outboundSchema: z.ZodNativeEnum<
918
+ typeof DuplicateAgentStatus
919
+ > = DuplicateAgentStatus$inboundSchema;
920
+
921
+ /** @internal */
922
+ export const DuplicateAgentToolApprovalRequired$inboundSchema: z.ZodNativeEnum<
923
+ typeof DuplicateAgentToolApprovalRequired
924
+ > = z.nativeEnum(DuplicateAgentToolApprovalRequired);
925
+ /** @internal */
926
+ export const DuplicateAgentToolApprovalRequired$outboundSchema: z.ZodNativeEnum<
927
+ typeof DuplicateAgentToolApprovalRequired
928
+ > = DuplicateAgentToolApprovalRequired$inboundSchema;
929
+
930
+ /** @internal */
931
+ export const DuplicateAgentConditions$inboundSchema: z.ZodType<
932
+ DuplicateAgentConditions,
933
+ z.ZodTypeDef,
934
+ unknown
935
+ > = z.object({
936
+ condition: z.string(),
937
+ operator: z.string(),
938
+ value: z.string(),
939
+ });
940
+ /** @internal */
941
+ export type DuplicateAgentConditions$Outbound = {
942
+ condition: string;
943
+ operator: string;
944
+ value: string;
945
+ };
946
+
947
+ /** @internal */
948
+ export const DuplicateAgentConditions$outboundSchema: z.ZodType<
949
+ DuplicateAgentConditions$Outbound,
950
+ z.ZodTypeDef,
951
+ DuplicateAgentConditions
952
+ > = z.object({
953
+ condition: z.string(),
954
+ operator: z.string(),
955
+ value: z.string(),
956
+ });
957
+
958
+ export function duplicateAgentConditionsToJSON(
959
+ duplicateAgentConditions: DuplicateAgentConditions,
960
+ ): string {
961
+ return JSON.stringify(
962
+ DuplicateAgentConditions$outboundSchema.parse(duplicateAgentConditions),
963
+ );
964
+ }
965
+ export function duplicateAgentConditionsFromJSON(
966
+ jsonString: string,
967
+ ): SafeParseResult<DuplicateAgentConditions, SDKValidationError> {
968
+ return safeParse(
969
+ jsonString,
970
+ (x) => DuplicateAgentConditions$inboundSchema.parse(JSON.parse(x)),
971
+ `Failed to parse 'DuplicateAgentConditions' from JSON`,
972
+ );
973
+ }
974
+
975
+ /** @internal */
976
+ export const DuplicateAgentTools$inboundSchema: z.ZodType<
977
+ DuplicateAgentTools,
978
+ z.ZodTypeDef,
979
+ unknown
980
+ > = z.object({
981
+ id: z.string(),
982
+ key: z.string().optional(),
983
+ action_type: z.string(),
984
+ display_name: z.string().optional(),
985
+ requires_approval: z.boolean().default(false),
986
+ conditions: z.array(z.lazy(() => DuplicateAgentConditions$inboundSchema))
987
+ .optional(),
988
+ mcpServer: z.string().optional(),
989
+ timeout: z.number().default(120),
990
+ }).transform((v) => {
991
+ return remap$(v, {
992
+ "action_type": "actionType",
993
+ "display_name": "displayName",
994
+ "requires_approval": "requiresApproval",
995
+ });
996
+ });
997
+ /** @internal */
998
+ export type DuplicateAgentTools$Outbound = {
999
+ id: string;
1000
+ key?: string | undefined;
1001
+ action_type: string;
1002
+ display_name?: string | undefined;
1003
+ requires_approval: boolean;
1004
+ conditions?: Array<DuplicateAgentConditions$Outbound> | undefined;
1005
+ mcpServer?: string | undefined;
1006
+ timeout: number;
1007
+ };
1008
+
1009
+ /** @internal */
1010
+ export const DuplicateAgentTools$outboundSchema: z.ZodType<
1011
+ DuplicateAgentTools$Outbound,
1012
+ z.ZodTypeDef,
1013
+ DuplicateAgentTools
1014
+ > = z.object({
1015
+ id: z.string(),
1016
+ key: z.string().optional(),
1017
+ actionType: z.string(),
1018
+ displayName: z.string().optional(),
1019
+ requiresApproval: z.boolean().default(false),
1020
+ conditions: z.array(z.lazy(() => DuplicateAgentConditions$outboundSchema))
1021
+ .optional(),
1022
+ mcpServer: z.string().optional(),
1023
+ timeout: z.number().default(120),
1024
+ }).transform((v) => {
1025
+ return remap$(v, {
1026
+ actionType: "action_type",
1027
+ displayName: "display_name",
1028
+ requiresApproval: "requires_approval",
1029
+ });
1030
+ });
1031
+
1032
+ export function duplicateAgentToolsToJSON(
1033
+ duplicateAgentTools: DuplicateAgentTools,
1034
+ ): string {
1035
+ return JSON.stringify(
1036
+ DuplicateAgentTools$outboundSchema.parse(duplicateAgentTools),
1037
+ );
1038
+ }
1039
+ export function duplicateAgentToolsFromJSON(
1040
+ jsonString: string,
1041
+ ): SafeParseResult<DuplicateAgentTools, SDKValidationError> {
1042
+ return safeParse(
1043
+ jsonString,
1044
+ (x) => DuplicateAgentTools$inboundSchema.parse(JSON.parse(x)),
1045
+ `Failed to parse 'DuplicateAgentTools' from JSON`,
1046
+ );
1047
+ }
1048
+
1049
+ /** @internal */
1050
+ export const DuplicateAgentSettings$inboundSchema: z.ZodType<
1051
+ DuplicateAgentSettings,
1052
+ z.ZodTypeDef,
1053
+ unknown
1054
+ > = z.object({
1055
+ max_iterations: z.number().int().default(15),
1056
+ max_execution_time: z.number().int().default(300),
1057
+ tool_approval_required: DuplicateAgentToolApprovalRequired$inboundSchema
1058
+ .default("respect_tool"),
1059
+ tools: z.array(z.lazy(() => DuplicateAgentTools$inboundSchema)).optional(),
1060
+ }).transform((v) => {
1061
+ return remap$(v, {
1062
+ "max_iterations": "maxIterations",
1063
+ "max_execution_time": "maxExecutionTime",
1064
+ "tool_approval_required": "toolApprovalRequired",
1065
+ });
1066
+ });
1067
+ /** @internal */
1068
+ export type DuplicateAgentSettings$Outbound = {
1069
+ max_iterations: number;
1070
+ max_execution_time: number;
1071
+ tool_approval_required: string;
1072
+ tools?: Array<DuplicateAgentTools$Outbound> | undefined;
1073
+ };
1074
+
1075
+ /** @internal */
1076
+ export const DuplicateAgentSettings$outboundSchema: z.ZodType<
1077
+ DuplicateAgentSettings$Outbound,
1078
+ z.ZodTypeDef,
1079
+ DuplicateAgentSettings
1080
+ > = z.object({
1081
+ maxIterations: z.number().int().default(15),
1082
+ maxExecutionTime: z.number().int().default(300),
1083
+ toolApprovalRequired: DuplicateAgentToolApprovalRequired$outboundSchema
1084
+ .default("respect_tool"),
1085
+ tools: z.array(z.lazy(() => DuplicateAgentTools$outboundSchema)).optional(),
1086
+ }).transform((v) => {
1087
+ return remap$(v, {
1088
+ maxIterations: "max_iterations",
1089
+ maxExecutionTime: "max_execution_time",
1090
+ toolApprovalRequired: "tool_approval_required",
1091
+ });
1092
+ });
1093
+
1094
+ export function duplicateAgentSettingsToJSON(
1095
+ duplicateAgentSettings: DuplicateAgentSettings,
1096
+ ): string {
1097
+ return JSON.stringify(
1098
+ DuplicateAgentSettings$outboundSchema.parse(duplicateAgentSettings),
1099
+ );
1100
+ }
1101
+ export function duplicateAgentSettingsFromJSON(
1102
+ jsonString: string,
1103
+ ): SafeParseResult<DuplicateAgentSettings, SDKValidationError> {
1104
+ return safeParse(
1105
+ jsonString,
1106
+ (x) => DuplicateAgentSettings$inboundSchema.parse(JSON.parse(x)),
1107
+ `Failed to parse 'DuplicateAgentSettings' from JSON`,
1108
+ );
1109
+ }
1110
+
1111
+ /** @internal */
1112
+ export const DuplicateAgentVoice$inboundSchema: z.ZodNativeEnum<
1113
+ typeof DuplicateAgentVoice
1114
+ > = z.nativeEnum(DuplicateAgentVoice);
1115
+ /** @internal */
1116
+ export const DuplicateAgentVoice$outboundSchema: z.ZodNativeEnum<
1117
+ typeof DuplicateAgentVoice
1118
+ > = DuplicateAgentVoice$inboundSchema;
1119
+
1120
+ /** @internal */
1121
+ export const DuplicateAgentFormat$inboundSchema: z.ZodNativeEnum<
1122
+ typeof DuplicateAgentFormat
1123
+ > = z.nativeEnum(DuplicateAgentFormat);
1124
+ /** @internal */
1125
+ export const DuplicateAgentFormat$outboundSchema: z.ZodNativeEnum<
1126
+ typeof DuplicateAgentFormat
1127
+ > = DuplicateAgentFormat$inboundSchema;
1128
+
1129
+ /** @internal */
1130
+ export const DuplicateAgentAudio$inboundSchema: z.ZodType<
1131
+ DuplicateAgentAudio,
1132
+ z.ZodTypeDef,
1133
+ unknown
1134
+ > = z.object({
1135
+ voice: DuplicateAgentVoice$inboundSchema,
1136
+ format: DuplicateAgentFormat$inboundSchema,
1137
+ });
1138
+ /** @internal */
1139
+ export type DuplicateAgentAudio$Outbound = {
1140
+ voice: string;
1141
+ format: string;
1142
+ };
1143
+
1144
+ /** @internal */
1145
+ export const DuplicateAgentAudio$outboundSchema: z.ZodType<
1146
+ DuplicateAgentAudio$Outbound,
1147
+ z.ZodTypeDef,
1148
+ DuplicateAgentAudio
1149
+ > = z.object({
1150
+ voice: DuplicateAgentVoice$outboundSchema,
1151
+ format: DuplicateAgentFormat$outboundSchema,
1152
+ });
1153
+
1154
+ export function duplicateAgentAudioToJSON(
1155
+ duplicateAgentAudio: DuplicateAgentAudio,
1156
+ ): string {
1157
+ return JSON.stringify(
1158
+ DuplicateAgentAudio$outboundSchema.parse(duplicateAgentAudio),
1159
+ );
1160
+ }
1161
+ export function duplicateAgentAudioFromJSON(
1162
+ jsonString: string,
1163
+ ): SafeParseResult<DuplicateAgentAudio, SDKValidationError> {
1164
+ return safeParse(
1165
+ jsonString,
1166
+ (x) => DuplicateAgentAudio$inboundSchema.parse(JSON.parse(x)),
1167
+ `Failed to parse 'DuplicateAgentAudio' from JSON`,
1168
+ );
1169
+ }
1170
+
1171
+ /** @internal */
1172
+ export const DuplicateAgentResponseFormatAgentsResponseType$inboundSchema:
1173
+ z.ZodNativeEnum<typeof DuplicateAgentResponseFormatAgentsResponseType> = z
1174
+ .nativeEnum(DuplicateAgentResponseFormatAgentsResponseType);
1175
+ /** @internal */
1176
+ export const DuplicateAgentResponseFormatAgentsResponseType$outboundSchema:
1177
+ z.ZodNativeEnum<typeof DuplicateAgentResponseFormatAgentsResponseType> =
1178
+ DuplicateAgentResponseFormatAgentsResponseType$inboundSchema;
1179
+
1180
+ /** @internal */
1181
+ export const DuplicateAgentResponseFormatJsonSchema$inboundSchema: z.ZodType<
1182
+ DuplicateAgentResponseFormatJsonSchema,
1183
+ z.ZodTypeDef,
1184
+ unknown
1185
+ > = z.object({
1186
+ description: z.string().optional(),
1187
+ name: z.string(),
1188
+ schema: z.any().optional(),
1189
+ strict: z.boolean().optional(),
1190
+ });
1191
+ /** @internal */
1192
+ export type DuplicateAgentResponseFormatJsonSchema$Outbound = {
1193
+ description?: string | undefined;
1194
+ name: string;
1195
+ schema?: any | undefined;
1196
+ strict?: boolean | undefined;
1197
+ };
1198
+
1199
+ /** @internal */
1200
+ export const DuplicateAgentResponseFormatJsonSchema$outboundSchema: z.ZodType<
1201
+ DuplicateAgentResponseFormatJsonSchema$Outbound,
1202
+ z.ZodTypeDef,
1203
+ DuplicateAgentResponseFormatJsonSchema
1204
+ > = z.object({
1205
+ description: z.string().optional(),
1206
+ name: z.string(),
1207
+ schema: z.any().optional(),
1208
+ strict: z.boolean().optional(),
1209
+ });
1210
+
1211
+ export function duplicateAgentResponseFormatJsonSchemaToJSON(
1212
+ duplicateAgentResponseFormatJsonSchema:
1213
+ DuplicateAgentResponseFormatJsonSchema,
1214
+ ): string {
1215
+ return JSON.stringify(
1216
+ DuplicateAgentResponseFormatJsonSchema$outboundSchema.parse(
1217
+ duplicateAgentResponseFormatJsonSchema,
1218
+ ),
1219
+ );
1220
+ }
1221
+ export function duplicateAgentResponseFormatJsonSchemaFromJSON(
1222
+ jsonString: string,
1223
+ ): SafeParseResult<DuplicateAgentResponseFormatJsonSchema, SDKValidationError> {
1224
+ return safeParse(
1225
+ jsonString,
1226
+ (x) =>
1227
+ DuplicateAgentResponseFormatJsonSchema$inboundSchema.parse(JSON.parse(x)),
1228
+ `Failed to parse 'DuplicateAgentResponseFormatJsonSchema' from JSON`,
1229
+ );
1230
+ }
1231
+
1232
+ /** @internal */
1233
+ export const DuplicateAgentResponseFormatAgentsJSONSchema$inboundSchema:
1234
+ z.ZodType<
1235
+ DuplicateAgentResponseFormatAgentsJSONSchema,
1236
+ z.ZodTypeDef,
1237
+ unknown
1238
+ > = z.object({
1239
+ type: DuplicateAgentResponseFormatAgentsResponseType$inboundSchema,
1240
+ json_schema: z.lazy(() =>
1241
+ DuplicateAgentResponseFormatJsonSchema$inboundSchema
1242
+ ),
1243
+ }).transform((v) => {
1244
+ return remap$(v, {
1245
+ "json_schema": "jsonSchema",
1246
+ });
1247
+ });
1248
+ /** @internal */
1249
+ export type DuplicateAgentResponseFormatAgentsJSONSchema$Outbound = {
1250
+ type: string;
1251
+ json_schema: DuplicateAgentResponseFormatJsonSchema$Outbound;
1252
+ };
1253
+
1254
+ /** @internal */
1255
+ export const DuplicateAgentResponseFormatAgentsJSONSchema$outboundSchema:
1256
+ z.ZodType<
1257
+ DuplicateAgentResponseFormatAgentsJSONSchema$Outbound,
1258
+ z.ZodTypeDef,
1259
+ DuplicateAgentResponseFormatAgentsJSONSchema
1260
+ > = z.object({
1261
+ type: DuplicateAgentResponseFormatAgentsResponseType$outboundSchema,
1262
+ jsonSchema: z.lazy(() =>
1263
+ DuplicateAgentResponseFormatJsonSchema$outboundSchema
1264
+ ),
1265
+ }).transform((v) => {
1266
+ return remap$(v, {
1267
+ jsonSchema: "json_schema",
1268
+ });
1269
+ });
1270
+
1271
+ export function duplicateAgentResponseFormatAgentsJSONSchemaToJSON(
1272
+ duplicateAgentResponseFormatAgentsJSONSchema:
1273
+ DuplicateAgentResponseFormatAgentsJSONSchema,
1274
+ ): string {
1275
+ return JSON.stringify(
1276
+ DuplicateAgentResponseFormatAgentsJSONSchema$outboundSchema.parse(
1277
+ duplicateAgentResponseFormatAgentsJSONSchema,
1278
+ ),
1279
+ );
1280
+ }
1281
+ export function duplicateAgentResponseFormatAgentsJSONSchemaFromJSON(
1282
+ jsonString: string,
1283
+ ): SafeParseResult<
1284
+ DuplicateAgentResponseFormatAgentsJSONSchema,
1285
+ SDKValidationError
1286
+ > {
1287
+ return safeParse(
1288
+ jsonString,
1289
+ (x) =>
1290
+ DuplicateAgentResponseFormatAgentsJSONSchema$inboundSchema.parse(
1291
+ JSON.parse(x),
1292
+ ),
1293
+ `Failed to parse 'DuplicateAgentResponseFormatAgentsJSONSchema' from JSON`,
1294
+ );
1295
+ }
1296
+
1297
+ /** @internal */
1298
+ export const DuplicateAgentResponseFormatAgentsType$inboundSchema:
1299
+ z.ZodNativeEnum<typeof DuplicateAgentResponseFormatAgentsType> = z.nativeEnum(
1300
+ DuplicateAgentResponseFormatAgentsType,
1301
+ );
1302
+ /** @internal */
1303
+ export const DuplicateAgentResponseFormatAgentsType$outboundSchema:
1304
+ z.ZodNativeEnum<typeof DuplicateAgentResponseFormatAgentsType> =
1305
+ DuplicateAgentResponseFormatAgentsType$inboundSchema;
1306
+
1307
+ /** @internal */
1308
+ export const DuplicateAgentResponseFormatJSONObject$inboundSchema: z.ZodType<
1309
+ DuplicateAgentResponseFormatJSONObject,
1310
+ z.ZodTypeDef,
1311
+ unknown
1312
+ > = z.object({
1313
+ type: DuplicateAgentResponseFormatAgentsType$inboundSchema,
1314
+ });
1315
+ /** @internal */
1316
+ export type DuplicateAgentResponseFormatJSONObject$Outbound = {
1317
+ type: string;
1318
+ };
1319
+
1320
+ /** @internal */
1321
+ export const DuplicateAgentResponseFormatJSONObject$outboundSchema: z.ZodType<
1322
+ DuplicateAgentResponseFormatJSONObject$Outbound,
1323
+ z.ZodTypeDef,
1324
+ DuplicateAgentResponseFormatJSONObject
1325
+ > = z.object({
1326
+ type: DuplicateAgentResponseFormatAgentsType$outboundSchema,
1327
+ });
1328
+
1329
+ export function duplicateAgentResponseFormatJSONObjectToJSON(
1330
+ duplicateAgentResponseFormatJSONObject:
1331
+ DuplicateAgentResponseFormatJSONObject,
1332
+ ): string {
1333
+ return JSON.stringify(
1334
+ DuplicateAgentResponseFormatJSONObject$outboundSchema.parse(
1335
+ duplicateAgentResponseFormatJSONObject,
1336
+ ),
1337
+ );
1338
+ }
1339
+ export function duplicateAgentResponseFormatJSONObjectFromJSON(
1340
+ jsonString: string,
1341
+ ): SafeParseResult<DuplicateAgentResponseFormatJSONObject, SDKValidationError> {
1342
+ return safeParse(
1343
+ jsonString,
1344
+ (x) =>
1345
+ DuplicateAgentResponseFormatJSONObject$inboundSchema.parse(JSON.parse(x)),
1346
+ `Failed to parse 'DuplicateAgentResponseFormatJSONObject' from JSON`,
1347
+ );
1348
+ }
1349
+
1350
+ /** @internal */
1351
+ export const DuplicateAgentResponseFormatType$inboundSchema: z.ZodNativeEnum<
1352
+ typeof DuplicateAgentResponseFormatType
1353
+ > = z.nativeEnum(DuplicateAgentResponseFormatType);
1354
+ /** @internal */
1355
+ export const DuplicateAgentResponseFormatType$outboundSchema: z.ZodNativeEnum<
1356
+ typeof DuplicateAgentResponseFormatType
1357
+ > = DuplicateAgentResponseFormatType$inboundSchema;
1358
+
1359
+ /** @internal */
1360
+ export const DuplicateAgentResponseFormatText$inboundSchema: z.ZodType<
1361
+ DuplicateAgentResponseFormatText,
1362
+ z.ZodTypeDef,
1363
+ unknown
1364
+ > = z.object({
1365
+ type: DuplicateAgentResponseFormatType$inboundSchema,
1366
+ });
1367
+ /** @internal */
1368
+ export type DuplicateAgentResponseFormatText$Outbound = {
1369
+ type: string;
1370
+ };
1371
+
1372
+ /** @internal */
1373
+ export const DuplicateAgentResponseFormatText$outboundSchema: z.ZodType<
1374
+ DuplicateAgentResponseFormatText$Outbound,
1375
+ z.ZodTypeDef,
1376
+ DuplicateAgentResponseFormatText
1377
+ > = z.object({
1378
+ type: DuplicateAgentResponseFormatType$outboundSchema,
1379
+ });
1380
+
1381
+ export function duplicateAgentResponseFormatTextToJSON(
1382
+ duplicateAgentResponseFormatText: DuplicateAgentResponseFormatText,
1383
+ ): string {
1384
+ return JSON.stringify(
1385
+ DuplicateAgentResponseFormatText$outboundSchema.parse(
1386
+ duplicateAgentResponseFormatText,
1387
+ ),
1388
+ );
1389
+ }
1390
+ export function duplicateAgentResponseFormatTextFromJSON(
1391
+ jsonString: string,
1392
+ ): SafeParseResult<DuplicateAgentResponseFormatText, SDKValidationError> {
1393
+ return safeParse(
1394
+ jsonString,
1395
+ (x) => DuplicateAgentResponseFormatText$inboundSchema.parse(JSON.parse(x)),
1396
+ `Failed to parse 'DuplicateAgentResponseFormatText' from JSON`,
1397
+ );
1398
+ }
1399
+
1400
+ /** @internal */
1401
+ export const DuplicateAgentResponseFormat$inboundSchema: z.ZodType<
1402
+ DuplicateAgentResponseFormat,
1403
+ z.ZodTypeDef,
1404
+ unknown
1405
+ > = z.union([
1406
+ z.lazy(() => DuplicateAgentResponseFormatAgentsJSONSchema$inboundSchema),
1407
+ z.lazy(() => DuplicateAgentResponseFormatText$inboundSchema),
1408
+ z.lazy(() => DuplicateAgentResponseFormatJSONObject$inboundSchema),
1409
+ ]);
1410
+ /** @internal */
1411
+ export type DuplicateAgentResponseFormat$Outbound =
1412
+ | DuplicateAgentResponseFormatAgentsJSONSchema$Outbound
1413
+ | DuplicateAgentResponseFormatText$Outbound
1414
+ | DuplicateAgentResponseFormatJSONObject$Outbound;
1415
+
1416
+ /** @internal */
1417
+ export const DuplicateAgentResponseFormat$outboundSchema: z.ZodType<
1418
+ DuplicateAgentResponseFormat$Outbound,
1419
+ z.ZodTypeDef,
1420
+ DuplicateAgentResponseFormat
1421
+ > = z.union([
1422
+ z.lazy(() => DuplicateAgentResponseFormatAgentsJSONSchema$outboundSchema),
1423
+ z.lazy(() => DuplicateAgentResponseFormatText$outboundSchema),
1424
+ z.lazy(() => DuplicateAgentResponseFormatJSONObject$outboundSchema),
1425
+ ]);
1426
+
1427
+ export function duplicateAgentResponseFormatToJSON(
1428
+ duplicateAgentResponseFormat: DuplicateAgentResponseFormat,
1429
+ ): string {
1430
+ return JSON.stringify(
1431
+ DuplicateAgentResponseFormat$outboundSchema.parse(
1432
+ duplicateAgentResponseFormat,
1433
+ ),
1434
+ );
1435
+ }
1436
+ export function duplicateAgentResponseFormatFromJSON(
1437
+ jsonString: string,
1438
+ ): SafeParseResult<DuplicateAgentResponseFormat, SDKValidationError> {
1439
+ return safeParse(
1440
+ jsonString,
1441
+ (x) => DuplicateAgentResponseFormat$inboundSchema.parse(JSON.parse(x)),
1442
+ `Failed to parse 'DuplicateAgentResponseFormat' from JSON`,
1443
+ );
1444
+ }
1445
+
1446
+ /** @internal */
1447
+ export const DuplicateAgentStop$inboundSchema: z.ZodType<
1448
+ DuplicateAgentStop,
1449
+ z.ZodTypeDef,
1450
+ unknown
1451
+ > = z.union([z.string(), z.array(z.string())]);
1452
+ /** @internal */
1453
+ export type DuplicateAgentStop$Outbound = string | Array<string>;
1454
+
1455
+ /** @internal */
1456
+ export const DuplicateAgentStop$outboundSchema: z.ZodType<
1457
+ DuplicateAgentStop$Outbound,
1458
+ z.ZodTypeDef,
1459
+ DuplicateAgentStop
1460
+ > = z.union([z.string(), z.array(z.string())]);
1461
+
1462
+ export function duplicateAgentStopToJSON(
1463
+ duplicateAgentStop: DuplicateAgentStop,
1464
+ ): string {
1465
+ return JSON.stringify(
1466
+ DuplicateAgentStop$outboundSchema.parse(duplicateAgentStop),
1467
+ );
1468
+ }
1469
+ export function duplicateAgentStopFromJSON(
1470
+ jsonString: string,
1471
+ ): SafeParseResult<DuplicateAgentStop, SDKValidationError> {
1472
+ return safeParse(
1473
+ jsonString,
1474
+ (x) => DuplicateAgentStop$inboundSchema.parse(JSON.parse(x)),
1475
+ `Failed to parse 'DuplicateAgentStop' from JSON`,
1476
+ );
1477
+ }
1478
+
1479
+ /** @internal */
1480
+ export const DuplicateAgentStreamOptions$inboundSchema: z.ZodType<
1481
+ DuplicateAgentStreamOptions,
1482
+ z.ZodTypeDef,
1483
+ unknown
1484
+ > = z.object({
1485
+ include_usage: z.boolean().optional(),
1486
+ }).transform((v) => {
1487
+ return remap$(v, {
1488
+ "include_usage": "includeUsage",
1489
+ });
1490
+ });
1491
+ /** @internal */
1492
+ export type DuplicateAgentStreamOptions$Outbound = {
1493
+ include_usage?: boolean | undefined;
1494
+ };
1495
+
1496
+ /** @internal */
1497
+ export const DuplicateAgentStreamOptions$outboundSchema: z.ZodType<
1498
+ DuplicateAgentStreamOptions$Outbound,
1499
+ z.ZodTypeDef,
1500
+ DuplicateAgentStreamOptions
1501
+ > = z.object({
1502
+ includeUsage: z.boolean().optional(),
1503
+ }).transform((v) => {
1504
+ return remap$(v, {
1505
+ includeUsage: "include_usage",
1506
+ });
1507
+ });
1508
+
1509
+ export function duplicateAgentStreamOptionsToJSON(
1510
+ duplicateAgentStreamOptions: DuplicateAgentStreamOptions,
1511
+ ): string {
1512
+ return JSON.stringify(
1513
+ DuplicateAgentStreamOptions$outboundSchema.parse(
1514
+ duplicateAgentStreamOptions,
1515
+ ),
1516
+ );
1517
+ }
1518
+ export function duplicateAgentStreamOptionsFromJSON(
1519
+ jsonString: string,
1520
+ ): SafeParseResult<DuplicateAgentStreamOptions, SDKValidationError> {
1521
+ return safeParse(
1522
+ jsonString,
1523
+ (x) => DuplicateAgentStreamOptions$inboundSchema.parse(JSON.parse(x)),
1524
+ `Failed to parse 'DuplicateAgentStreamOptions' from JSON`,
1525
+ );
1526
+ }
1527
+
1528
+ /** @internal */
1529
+ export const DuplicateAgentType$inboundSchema: z.ZodNativeEnum<
1530
+ typeof DuplicateAgentType
1531
+ > = z.nativeEnum(DuplicateAgentType);
1532
+ /** @internal */
1533
+ export const DuplicateAgentType$outboundSchema: z.ZodNativeEnum<
1534
+ typeof DuplicateAgentType
1535
+ > = DuplicateAgentType$inboundSchema;
1536
+
1537
+ /** @internal */
1538
+ export const DuplicateAgentThinking$inboundSchema: z.ZodType<
1539
+ DuplicateAgentThinking,
1540
+ z.ZodTypeDef,
1541
+ unknown
1542
+ > = z.object({
1543
+ type: DuplicateAgentType$inboundSchema,
1544
+ budget_tokens: z.number(),
1545
+ }).transform((v) => {
1546
+ return remap$(v, {
1547
+ "budget_tokens": "budgetTokens",
1548
+ });
1549
+ });
1550
+ /** @internal */
1551
+ export type DuplicateAgentThinking$Outbound = {
1552
+ type: string;
1553
+ budget_tokens: number;
1554
+ };
1555
+
1556
+ /** @internal */
1557
+ export const DuplicateAgentThinking$outboundSchema: z.ZodType<
1558
+ DuplicateAgentThinking$Outbound,
1559
+ z.ZodTypeDef,
1560
+ DuplicateAgentThinking
1561
+ > = z.object({
1562
+ type: DuplicateAgentType$outboundSchema,
1563
+ budgetTokens: z.number(),
1564
+ }).transform((v) => {
1565
+ return remap$(v, {
1566
+ budgetTokens: "budget_tokens",
1567
+ });
1568
+ });
1569
+
1570
+ export function duplicateAgentThinkingToJSON(
1571
+ duplicateAgentThinking: DuplicateAgentThinking,
1572
+ ): string {
1573
+ return JSON.stringify(
1574
+ DuplicateAgentThinking$outboundSchema.parse(duplicateAgentThinking),
1575
+ );
1576
+ }
1577
+ export function duplicateAgentThinkingFromJSON(
1578
+ jsonString: string,
1579
+ ): SafeParseResult<DuplicateAgentThinking, SDKValidationError> {
1580
+ return safeParse(
1581
+ jsonString,
1582
+ (x) => DuplicateAgentThinking$inboundSchema.parse(JSON.parse(x)),
1583
+ `Failed to parse 'DuplicateAgentThinking' from JSON`,
1584
+ );
1585
+ }
1586
+
1587
+ /** @internal */
1588
+ export const DuplicateAgentToolChoiceType$inboundSchema: z.ZodNativeEnum<
1589
+ typeof DuplicateAgentToolChoiceType
1590
+ > = z.nativeEnum(DuplicateAgentToolChoiceType);
1591
+ /** @internal */
1592
+ export const DuplicateAgentToolChoiceType$outboundSchema: z.ZodNativeEnum<
1593
+ typeof DuplicateAgentToolChoiceType
1594
+ > = DuplicateAgentToolChoiceType$inboundSchema;
1595
+
1596
+ /** @internal */
1597
+ export const DuplicateAgentToolChoiceFunction$inboundSchema: z.ZodType<
1598
+ DuplicateAgentToolChoiceFunction,
1599
+ z.ZodTypeDef,
1600
+ unknown
1601
+ > = z.object({
1602
+ name: z.string().optional(),
1603
+ });
1604
+ /** @internal */
1605
+ export type DuplicateAgentToolChoiceFunction$Outbound = {
1606
+ name?: string | undefined;
1607
+ };
1608
+
1609
+ /** @internal */
1610
+ export const DuplicateAgentToolChoiceFunction$outboundSchema: z.ZodType<
1611
+ DuplicateAgentToolChoiceFunction$Outbound,
1612
+ z.ZodTypeDef,
1613
+ DuplicateAgentToolChoiceFunction
1614
+ > = z.object({
1615
+ name: z.string().optional(),
1616
+ });
1617
+
1618
+ export function duplicateAgentToolChoiceFunctionToJSON(
1619
+ duplicateAgentToolChoiceFunction: DuplicateAgentToolChoiceFunction,
1620
+ ): string {
1621
+ return JSON.stringify(
1622
+ DuplicateAgentToolChoiceFunction$outboundSchema.parse(
1623
+ duplicateAgentToolChoiceFunction,
1624
+ ),
1625
+ );
1626
+ }
1627
+ export function duplicateAgentToolChoiceFunctionFromJSON(
1628
+ jsonString: string,
1629
+ ): SafeParseResult<DuplicateAgentToolChoiceFunction, SDKValidationError> {
1630
+ return safeParse(
1631
+ jsonString,
1632
+ (x) => DuplicateAgentToolChoiceFunction$inboundSchema.parse(JSON.parse(x)),
1633
+ `Failed to parse 'DuplicateAgentToolChoiceFunction' from JSON`,
1634
+ );
1635
+ }
1636
+
1637
+ /** @internal */
1638
+ export const DuplicateAgentToolChoice2$inboundSchema: z.ZodType<
1639
+ DuplicateAgentToolChoice2,
1640
+ z.ZodTypeDef,
1641
+ unknown
1642
+ > = z.object({
1643
+ type: DuplicateAgentToolChoiceType$inboundSchema.optional(),
1644
+ function: z.lazy(() => DuplicateAgentToolChoiceFunction$inboundSchema),
1645
+ });
1646
+ /** @internal */
1647
+ export type DuplicateAgentToolChoice2$Outbound = {
1648
+ type?: string | undefined;
1649
+ function: DuplicateAgentToolChoiceFunction$Outbound;
1650
+ };
1651
+
1652
+ /** @internal */
1653
+ export const DuplicateAgentToolChoice2$outboundSchema: z.ZodType<
1654
+ DuplicateAgentToolChoice2$Outbound,
1655
+ z.ZodTypeDef,
1656
+ DuplicateAgentToolChoice2
1657
+ > = z.object({
1658
+ type: DuplicateAgentToolChoiceType$outboundSchema.optional(),
1659
+ function: z.lazy(() => DuplicateAgentToolChoiceFunction$outboundSchema),
1660
+ });
1661
+
1662
+ export function duplicateAgentToolChoice2ToJSON(
1663
+ duplicateAgentToolChoice2: DuplicateAgentToolChoice2,
1664
+ ): string {
1665
+ return JSON.stringify(
1666
+ DuplicateAgentToolChoice2$outboundSchema.parse(duplicateAgentToolChoice2),
1667
+ );
1668
+ }
1669
+ export function duplicateAgentToolChoice2FromJSON(
1670
+ jsonString: string,
1671
+ ): SafeParseResult<DuplicateAgentToolChoice2, SDKValidationError> {
1672
+ return safeParse(
1673
+ jsonString,
1674
+ (x) => DuplicateAgentToolChoice2$inboundSchema.parse(JSON.parse(x)),
1675
+ `Failed to parse 'DuplicateAgentToolChoice2' from JSON`,
1676
+ );
1677
+ }
1678
+
1679
+ /** @internal */
1680
+ export const DuplicateAgentToolChoice1$inboundSchema: z.ZodNativeEnum<
1681
+ typeof DuplicateAgentToolChoice1
1682
+ > = z.nativeEnum(DuplicateAgentToolChoice1);
1683
+ /** @internal */
1684
+ export const DuplicateAgentToolChoice1$outboundSchema: z.ZodNativeEnum<
1685
+ typeof DuplicateAgentToolChoice1
1686
+ > = DuplicateAgentToolChoice1$inboundSchema;
1687
+
1688
+ /** @internal */
1689
+ export const DuplicateAgentToolChoice$inboundSchema: z.ZodType<
1690
+ DuplicateAgentToolChoice,
1691
+ z.ZodTypeDef,
1692
+ unknown
1693
+ > = z.union([
1694
+ z.lazy(() => DuplicateAgentToolChoice2$inboundSchema),
1695
+ DuplicateAgentToolChoice1$inboundSchema,
1696
+ ]);
1697
+ /** @internal */
1698
+ export type DuplicateAgentToolChoice$Outbound =
1699
+ | DuplicateAgentToolChoice2$Outbound
1700
+ | string;
1701
+
1702
+ /** @internal */
1703
+ export const DuplicateAgentToolChoice$outboundSchema: z.ZodType<
1704
+ DuplicateAgentToolChoice$Outbound,
1705
+ z.ZodTypeDef,
1706
+ DuplicateAgentToolChoice
1707
+ > = z.union([
1708
+ z.lazy(() => DuplicateAgentToolChoice2$outboundSchema),
1709
+ DuplicateAgentToolChoice1$outboundSchema,
1710
+ ]);
1711
+
1712
+ export function duplicateAgentToolChoiceToJSON(
1713
+ duplicateAgentToolChoice: DuplicateAgentToolChoice,
1714
+ ): string {
1715
+ return JSON.stringify(
1716
+ DuplicateAgentToolChoice$outboundSchema.parse(duplicateAgentToolChoice),
1717
+ );
1718
+ }
1719
+ export function duplicateAgentToolChoiceFromJSON(
1720
+ jsonString: string,
1721
+ ): SafeParseResult<DuplicateAgentToolChoice, SDKValidationError> {
1722
+ return safeParse(
1723
+ jsonString,
1724
+ (x) => DuplicateAgentToolChoice$inboundSchema.parse(JSON.parse(x)),
1725
+ `Failed to parse 'DuplicateAgentToolChoice' from JSON`,
1726
+ );
1727
+ }
1728
+
1729
+ /** @internal */
1730
+ export const DuplicateAgentModalities$inboundSchema: z.ZodNativeEnum<
1731
+ typeof DuplicateAgentModalities
1732
+ > = z.nativeEnum(DuplicateAgentModalities);
1733
+ /** @internal */
1734
+ export const DuplicateAgentModalities$outboundSchema: z.ZodNativeEnum<
1735
+ typeof DuplicateAgentModalities
1736
+ > = DuplicateAgentModalities$inboundSchema;
1737
+
1738
+ /** @internal */
1739
+ export const DuplicateAgentParameters$inboundSchema: z.ZodType<
1740
+ DuplicateAgentParameters,
1741
+ z.ZodTypeDef,
1742
+ unknown
1743
+ > = z.object({
1744
+ audio: z.nullable(z.lazy(() => DuplicateAgentAudio$inboundSchema)).optional(),
1745
+ frequency_penalty: z.nullable(z.number()).optional(),
1746
+ max_tokens: z.nullable(z.number().int()).optional(),
1747
+ max_completion_tokens: z.nullable(z.number().int()).optional(),
1748
+ logprobs: z.nullable(z.boolean()).optional(),
1749
+ top_logprobs: z.nullable(z.number().int()).optional(),
1750
+ n: z.nullable(z.number().int()).optional(),
1751
+ presence_penalty: z.nullable(z.number()).optional(),
1752
+ response_format: z.union([
1753
+ z.lazy(() => DuplicateAgentResponseFormatAgentsJSONSchema$inboundSchema),
1754
+ z.lazy(() => DuplicateAgentResponseFormatText$inboundSchema),
1755
+ z.lazy(() => DuplicateAgentResponseFormatJSONObject$inboundSchema),
1756
+ ]).optional(),
1757
+ reasoning_effort: z.string().optional(),
1758
+ verbosity: z.string().optional(),
1759
+ seed: z.nullable(z.number()).optional(),
1760
+ stop: z.nullable(z.union([z.string(), z.array(z.string())])).optional(),
1761
+ stream_options: z.nullable(
1762
+ z.lazy(() => DuplicateAgentStreamOptions$inboundSchema),
1763
+ ).optional(),
1764
+ thinking: z.lazy(() => DuplicateAgentThinking$inboundSchema).optional(),
1765
+ temperature: z.nullable(z.number()).optional(),
1766
+ top_p: z.nullable(z.number()).optional(),
1767
+ top_k: z.nullable(z.number()).optional(),
1768
+ tool_choice: z.union([
1769
+ z.lazy(() => DuplicateAgentToolChoice2$inboundSchema),
1770
+ DuplicateAgentToolChoice1$inboundSchema,
1771
+ ]).optional(),
1772
+ parallel_tool_calls: z.boolean().optional(),
1773
+ modalities: z.nullable(z.array(DuplicateAgentModalities$inboundSchema))
1774
+ .optional(),
1775
+ }).transform((v) => {
1776
+ return remap$(v, {
1777
+ "frequency_penalty": "frequencyPenalty",
1778
+ "max_tokens": "maxTokens",
1779
+ "max_completion_tokens": "maxCompletionTokens",
1780
+ "top_logprobs": "topLogprobs",
1781
+ "presence_penalty": "presencePenalty",
1782
+ "response_format": "responseFormat",
1783
+ "reasoning_effort": "reasoningEffort",
1784
+ "stream_options": "streamOptions",
1785
+ "top_p": "topP",
1786
+ "top_k": "topK",
1787
+ "tool_choice": "toolChoice",
1788
+ "parallel_tool_calls": "parallelToolCalls",
1789
+ });
1790
+ });
1791
+ /** @internal */
1792
+ export type DuplicateAgentParameters$Outbound = {
1793
+ audio?: DuplicateAgentAudio$Outbound | null | undefined;
1794
+ frequency_penalty?: number | null | undefined;
1795
+ max_tokens?: number | null | undefined;
1796
+ max_completion_tokens?: number | null | undefined;
1797
+ logprobs?: boolean | null | undefined;
1798
+ top_logprobs?: number | null | undefined;
1799
+ n?: number | null | undefined;
1800
+ presence_penalty?: number | null | undefined;
1801
+ response_format?:
1802
+ | DuplicateAgentResponseFormatAgentsJSONSchema$Outbound
1803
+ | DuplicateAgentResponseFormatText$Outbound
1804
+ | DuplicateAgentResponseFormatJSONObject$Outbound
1805
+ | undefined;
1806
+ reasoning_effort?: string | undefined;
1807
+ verbosity?: string | undefined;
1808
+ seed?: number | null | undefined;
1809
+ stop?: string | Array<string> | null | undefined;
1810
+ stream_options?: DuplicateAgentStreamOptions$Outbound | null | undefined;
1811
+ thinking?: DuplicateAgentThinking$Outbound | undefined;
1812
+ temperature?: number | null | undefined;
1813
+ top_p?: number | null | undefined;
1814
+ top_k?: number | null | undefined;
1815
+ tool_choice?: DuplicateAgentToolChoice2$Outbound | string | undefined;
1816
+ parallel_tool_calls?: boolean | undefined;
1817
+ modalities?: Array<string> | null | undefined;
1818
+ };
1819
+
1820
+ /** @internal */
1821
+ export const DuplicateAgentParameters$outboundSchema: z.ZodType<
1822
+ DuplicateAgentParameters$Outbound,
1823
+ z.ZodTypeDef,
1824
+ DuplicateAgentParameters
1825
+ > = z.object({
1826
+ audio: z.nullable(z.lazy(() => DuplicateAgentAudio$outboundSchema))
1827
+ .optional(),
1828
+ frequencyPenalty: z.nullable(z.number()).optional(),
1829
+ maxTokens: z.nullable(z.number().int()).optional(),
1830
+ maxCompletionTokens: z.nullable(z.number().int()).optional(),
1831
+ logprobs: z.nullable(z.boolean()).optional(),
1832
+ topLogprobs: z.nullable(z.number().int()).optional(),
1833
+ n: z.nullable(z.number().int()).optional(),
1834
+ presencePenalty: z.nullable(z.number()).optional(),
1835
+ responseFormat: z.union([
1836
+ z.lazy(() => DuplicateAgentResponseFormatAgentsJSONSchema$outboundSchema),
1837
+ z.lazy(() => DuplicateAgentResponseFormatText$outboundSchema),
1838
+ z.lazy(() => DuplicateAgentResponseFormatJSONObject$outboundSchema),
1839
+ ]).optional(),
1840
+ reasoningEffort: z.string().optional(),
1841
+ verbosity: z.string().optional(),
1842
+ seed: z.nullable(z.number()).optional(),
1843
+ stop: z.nullable(z.union([z.string(), z.array(z.string())])).optional(),
1844
+ streamOptions: z.nullable(
1845
+ z.lazy(() => DuplicateAgentStreamOptions$outboundSchema),
1846
+ ).optional(),
1847
+ thinking: z.lazy(() => DuplicateAgentThinking$outboundSchema).optional(),
1848
+ temperature: z.nullable(z.number()).optional(),
1849
+ topP: z.nullable(z.number()).optional(),
1850
+ topK: z.nullable(z.number()).optional(),
1851
+ toolChoice: z.union([
1852
+ z.lazy(() => DuplicateAgentToolChoice2$outboundSchema),
1853
+ DuplicateAgentToolChoice1$outboundSchema,
1854
+ ]).optional(),
1855
+ parallelToolCalls: z.boolean().optional(),
1856
+ modalities: z.nullable(z.array(DuplicateAgentModalities$outboundSchema))
1857
+ .optional(),
1858
+ }).transform((v) => {
1859
+ return remap$(v, {
1860
+ frequencyPenalty: "frequency_penalty",
1861
+ maxTokens: "max_tokens",
1862
+ maxCompletionTokens: "max_completion_tokens",
1863
+ topLogprobs: "top_logprobs",
1864
+ presencePenalty: "presence_penalty",
1865
+ responseFormat: "response_format",
1866
+ reasoningEffort: "reasoning_effort",
1867
+ streamOptions: "stream_options",
1868
+ topP: "top_p",
1869
+ topK: "top_k",
1870
+ toolChoice: "tool_choice",
1871
+ parallelToolCalls: "parallel_tool_calls",
1872
+ });
1873
+ });
1874
+
1875
+ export function duplicateAgentParametersToJSON(
1876
+ duplicateAgentParameters: DuplicateAgentParameters,
1877
+ ): string {
1878
+ return JSON.stringify(
1879
+ DuplicateAgentParameters$outboundSchema.parse(duplicateAgentParameters),
1880
+ );
1881
+ }
1882
+ export function duplicateAgentParametersFromJSON(
1883
+ jsonString: string,
1884
+ ): SafeParseResult<DuplicateAgentParameters, SDKValidationError> {
1885
+ return safeParse(
1886
+ jsonString,
1887
+ (x) => DuplicateAgentParameters$inboundSchema.parse(JSON.parse(x)),
1888
+ `Failed to parse 'DuplicateAgentParameters' from JSON`,
1889
+ );
1890
+ }
1891
+
1892
+ /** @internal */
1893
+ export const DuplicateAgentFallbackModelConfigurationVoice$inboundSchema:
1894
+ z.ZodNativeEnum<typeof DuplicateAgentFallbackModelConfigurationVoice> = z
1895
+ .nativeEnum(DuplicateAgentFallbackModelConfigurationVoice);
1896
+ /** @internal */
1897
+ export const DuplicateAgentFallbackModelConfigurationVoice$outboundSchema:
1898
+ z.ZodNativeEnum<typeof DuplicateAgentFallbackModelConfigurationVoice> =
1899
+ DuplicateAgentFallbackModelConfigurationVoice$inboundSchema;
1900
+
1901
+ /** @internal */
1902
+ export const DuplicateAgentFallbackModelConfigurationFormat$inboundSchema:
1903
+ z.ZodNativeEnum<typeof DuplicateAgentFallbackModelConfigurationFormat> = z
1904
+ .nativeEnum(DuplicateAgentFallbackModelConfigurationFormat);
1905
+ /** @internal */
1906
+ export const DuplicateAgentFallbackModelConfigurationFormat$outboundSchema:
1907
+ z.ZodNativeEnum<typeof DuplicateAgentFallbackModelConfigurationFormat> =
1908
+ DuplicateAgentFallbackModelConfigurationFormat$inboundSchema;
1909
+
1910
+ /** @internal */
1911
+ export const DuplicateAgentFallbackModelConfigurationAudio$inboundSchema:
1912
+ z.ZodType<
1913
+ DuplicateAgentFallbackModelConfigurationAudio,
1914
+ z.ZodTypeDef,
1915
+ unknown
1916
+ > = z.object({
1917
+ voice: DuplicateAgentFallbackModelConfigurationVoice$inboundSchema,
1918
+ format: DuplicateAgentFallbackModelConfigurationFormat$inboundSchema,
1919
+ });
1920
+ /** @internal */
1921
+ export type DuplicateAgentFallbackModelConfigurationAudio$Outbound = {
1922
+ voice: string;
1923
+ format: string;
1924
+ };
1925
+
1926
+ /** @internal */
1927
+ export const DuplicateAgentFallbackModelConfigurationAudio$outboundSchema:
1928
+ z.ZodType<
1929
+ DuplicateAgentFallbackModelConfigurationAudio$Outbound,
1930
+ z.ZodTypeDef,
1931
+ DuplicateAgentFallbackModelConfigurationAudio
1932
+ > = z.object({
1933
+ voice: DuplicateAgentFallbackModelConfigurationVoice$outboundSchema,
1934
+ format: DuplicateAgentFallbackModelConfigurationFormat$outboundSchema,
1935
+ });
1936
+
1937
+ export function duplicateAgentFallbackModelConfigurationAudioToJSON(
1938
+ duplicateAgentFallbackModelConfigurationAudio:
1939
+ DuplicateAgentFallbackModelConfigurationAudio,
1940
+ ): string {
1941
+ return JSON.stringify(
1942
+ DuplicateAgentFallbackModelConfigurationAudio$outboundSchema.parse(
1943
+ duplicateAgentFallbackModelConfigurationAudio,
1944
+ ),
1945
+ );
1946
+ }
1947
+ export function duplicateAgentFallbackModelConfigurationAudioFromJSON(
1948
+ jsonString: string,
1949
+ ): SafeParseResult<
1950
+ DuplicateAgentFallbackModelConfigurationAudio,
1951
+ SDKValidationError
1952
+ > {
1953
+ return safeParse(
1954
+ jsonString,
1955
+ (x) =>
1956
+ DuplicateAgentFallbackModelConfigurationAudio$inboundSchema.parse(
1957
+ JSON.parse(x),
1958
+ ),
1959
+ `Failed to parse 'DuplicateAgentFallbackModelConfigurationAudio' from JSON`,
1960
+ );
1961
+ }
1962
+
1963
+ /** @internal */
1964
+ export const DuplicateAgentResponseFormatAgentsResponse201ApplicationJSONResponseBodyType$inboundSchema:
1965
+ z.ZodNativeEnum<
1966
+ typeof DuplicateAgentResponseFormatAgentsResponse201ApplicationJSONResponseBodyType
1967
+ > = z.nativeEnum(
1968
+ DuplicateAgentResponseFormatAgentsResponse201ApplicationJSONResponseBodyType,
1969
+ );
1970
+ /** @internal */
1971
+ export const DuplicateAgentResponseFormatAgentsResponse201ApplicationJSONResponseBodyType$outboundSchema:
1972
+ z.ZodNativeEnum<
1973
+ typeof DuplicateAgentResponseFormatAgentsResponse201ApplicationJSONResponseBodyType
1974
+ > =
1975
+ DuplicateAgentResponseFormatAgentsResponse201ApplicationJSONResponseBodyType$inboundSchema;
1976
+
1977
+ /** @internal */
1978
+ export const DuplicateAgentResponseFormatAgentsResponseJsonSchema$inboundSchema:
1979
+ z.ZodType<
1980
+ DuplicateAgentResponseFormatAgentsResponseJsonSchema,
1981
+ z.ZodTypeDef,
1982
+ unknown
1983
+ > = z.object({
1984
+ description: z.string().optional(),
1985
+ name: z.string(),
1986
+ schema: z.any().optional(),
1987
+ strict: z.boolean().optional(),
1988
+ });
1989
+ /** @internal */
1990
+ export type DuplicateAgentResponseFormatAgentsResponseJsonSchema$Outbound = {
1991
+ description?: string | undefined;
1992
+ name: string;
1993
+ schema?: any | undefined;
1994
+ strict?: boolean | undefined;
1995
+ };
1996
+
1997
+ /** @internal */
1998
+ export const DuplicateAgentResponseFormatAgentsResponseJsonSchema$outboundSchema:
1999
+ z.ZodType<
2000
+ DuplicateAgentResponseFormatAgentsResponseJsonSchema$Outbound,
2001
+ z.ZodTypeDef,
2002
+ DuplicateAgentResponseFormatAgentsResponseJsonSchema
2003
+ > = z.object({
2004
+ description: z.string().optional(),
2005
+ name: z.string(),
2006
+ schema: z.any().optional(),
2007
+ strict: z.boolean().optional(),
2008
+ });
2009
+
2010
+ export function duplicateAgentResponseFormatAgentsResponseJsonSchemaToJSON(
2011
+ duplicateAgentResponseFormatAgentsResponseJsonSchema:
2012
+ DuplicateAgentResponseFormatAgentsResponseJsonSchema,
2013
+ ): string {
2014
+ return JSON.stringify(
2015
+ DuplicateAgentResponseFormatAgentsResponseJsonSchema$outboundSchema.parse(
2016
+ duplicateAgentResponseFormatAgentsResponseJsonSchema,
2017
+ ),
2018
+ );
2019
+ }
2020
+ export function duplicateAgentResponseFormatAgentsResponseJsonSchemaFromJSON(
2021
+ jsonString: string,
2022
+ ): SafeParseResult<
2023
+ DuplicateAgentResponseFormatAgentsResponseJsonSchema,
2024
+ SDKValidationError
2025
+ > {
2026
+ return safeParse(
2027
+ jsonString,
2028
+ (x) =>
2029
+ DuplicateAgentResponseFormatAgentsResponseJsonSchema$inboundSchema.parse(
2030
+ JSON.parse(x),
2031
+ ),
2032
+ `Failed to parse 'DuplicateAgentResponseFormatAgentsResponseJsonSchema' from JSON`,
2033
+ );
2034
+ }
2035
+
2036
+ /** @internal */
2037
+ export const DuplicateAgentResponseFormatAgentsResponse201JSONSchema$inboundSchema:
2038
+ z.ZodType<
2039
+ DuplicateAgentResponseFormatAgentsResponse201JSONSchema,
2040
+ z.ZodTypeDef,
2041
+ unknown
2042
+ > = z.object({
2043
+ type:
2044
+ DuplicateAgentResponseFormatAgentsResponse201ApplicationJSONResponseBodyType$inboundSchema,
2045
+ json_schema: z.lazy(() =>
2046
+ DuplicateAgentResponseFormatAgentsResponseJsonSchema$inboundSchema
2047
+ ),
2048
+ }).transform((v) => {
2049
+ return remap$(v, {
2050
+ "json_schema": "jsonSchema",
2051
+ });
2052
+ });
2053
+ /** @internal */
2054
+ export type DuplicateAgentResponseFormatAgentsResponse201JSONSchema$Outbound = {
2055
+ type: string;
2056
+ json_schema: DuplicateAgentResponseFormatAgentsResponseJsonSchema$Outbound;
2057
+ };
2058
+
2059
+ /** @internal */
2060
+ export const DuplicateAgentResponseFormatAgentsResponse201JSONSchema$outboundSchema:
2061
+ z.ZodType<
2062
+ DuplicateAgentResponseFormatAgentsResponse201JSONSchema$Outbound,
2063
+ z.ZodTypeDef,
2064
+ DuplicateAgentResponseFormatAgentsResponse201JSONSchema
2065
+ > = z.object({
2066
+ type:
2067
+ DuplicateAgentResponseFormatAgentsResponse201ApplicationJSONResponseBodyType$outboundSchema,
2068
+ jsonSchema: z.lazy(() =>
2069
+ DuplicateAgentResponseFormatAgentsResponseJsonSchema$outboundSchema
2070
+ ),
2071
+ }).transform((v) => {
2072
+ return remap$(v, {
2073
+ jsonSchema: "json_schema",
2074
+ });
2075
+ });
2076
+
2077
+ export function duplicateAgentResponseFormatAgentsResponse201JSONSchemaToJSON(
2078
+ duplicateAgentResponseFormatAgentsResponse201JSONSchema:
2079
+ DuplicateAgentResponseFormatAgentsResponse201JSONSchema,
2080
+ ): string {
2081
+ return JSON.stringify(
2082
+ DuplicateAgentResponseFormatAgentsResponse201JSONSchema$outboundSchema
2083
+ .parse(duplicateAgentResponseFormatAgentsResponse201JSONSchema),
2084
+ );
2085
+ }
2086
+ export function duplicateAgentResponseFormatAgentsResponse201JSONSchemaFromJSON(
2087
+ jsonString: string,
2088
+ ): SafeParseResult<
2089
+ DuplicateAgentResponseFormatAgentsResponse201JSONSchema,
2090
+ SDKValidationError
2091
+ > {
2092
+ return safeParse(
2093
+ jsonString,
2094
+ (x) =>
2095
+ DuplicateAgentResponseFormatAgentsResponse201JSONSchema$inboundSchema
2096
+ .parse(JSON.parse(x)),
2097
+ `Failed to parse 'DuplicateAgentResponseFormatAgentsResponse201JSONSchema' from JSON`,
2098
+ );
2099
+ }
2100
+
2101
+ /** @internal */
2102
+ export const DuplicateAgentResponseFormatAgentsResponse201ApplicationJSONType$inboundSchema:
2103
+ z.ZodNativeEnum<
2104
+ typeof DuplicateAgentResponseFormatAgentsResponse201ApplicationJSONType
2105
+ > = z.nativeEnum(
2106
+ DuplicateAgentResponseFormatAgentsResponse201ApplicationJSONType,
2107
+ );
2108
+ /** @internal */
2109
+ export const DuplicateAgentResponseFormatAgentsResponse201ApplicationJSONType$outboundSchema:
2110
+ z.ZodNativeEnum<
2111
+ typeof DuplicateAgentResponseFormatAgentsResponse201ApplicationJSONType
2112
+ > =
2113
+ DuplicateAgentResponseFormatAgentsResponse201ApplicationJSONType$inboundSchema;
2114
+
2115
+ /** @internal */
2116
+ export const DuplicateAgentResponseFormatAgentsJSONObject$inboundSchema:
2117
+ z.ZodType<
2118
+ DuplicateAgentResponseFormatAgentsJSONObject,
2119
+ z.ZodTypeDef,
2120
+ unknown
2121
+ > = z.object({
2122
+ type:
2123
+ DuplicateAgentResponseFormatAgentsResponse201ApplicationJSONType$inboundSchema,
2124
+ });
2125
+ /** @internal */
2126
+ export type DuplicateAgentResponseFormatAgentsJSONObject$Outbound = {
2127
+ type: string;
2128
+ };
2129
+
2130
+ /** @internal */
2131
+ export const DuplicateAgentResponseFormatAgentsJSONObject$outboundSchema:
2132
+ z.ZodType<
2133
+ DuplicateAgentResponseFormatAgentsJSONObject$Outbound,
2134
+ z.ZodTypeDef,
2135
+ DuplicateAgentResponseFormatAgentsJSONObject
2136
+ > = z.object({
2137
+ type:
2138
+ DuplicateAgentResponseFormatAgentsResponse201ApplicationJSONType$outboundSchema,
2139
+ });
2140
+
2141
+ export function duplicateAgentResponseFormatAgentsJSONObjectToJSON(
2142
+ duplicateAgentResponseFormatAgentsJSONObject:
2143
+ DuplicateAgentResponseFormatAgentsJSONObject,
2144
+ ): string {
2145
+ return JSON.stringify(
2146
+ DuplicateAgentResponseFormatAgentsJSONObject$outboundSchema.parse(
2147
+ duplicateAgentResponseFormatAgentsJSONObject,
2148
+ ),
2149
+ );
2150
+ }
2151
+ export function duplicateAgentResponseFormatAgentsJSONObjectFromJSON(
2152
+ jsonString: string,
2153
+ ): SafeParseResult<
2154
+ DuplicateAgentResponseFormatAgentsJSONObject,
2155
+ SDKValidationError
2156
+ > {
2157
+ return safeParse(
2158
+ jsonString,
2159
+ (x) =>
2160
+ DuplicateAgentResponseFormatAgentsJSONObject$inboundSchema.parse(
2161
+ JSON.parse(x),
2162
+ ),
2163
+ `Failed to parse 'DuplicateAgentResponseFormatAgentsJSONObject' from JSON`,
2164
+ );
2165
+ }
2166
+
2167
+ /** @internal */
2168
+ export const DuplicateAgentResponseFormatAgentsResponse201Type$inboundSchema:
2169
+ z.ZodNativeEnum<typeof DuplicateAgentResponseFormatAgentsResponse201Type> = z
2170
+ .nativeEnum(DuplicateAgentResponseFormatAgentsResponse201Type);
2171
+ /** @internal */
2172
+ export const DuplicateAgentResponseFormatAgentsResponse201Type$outboundSchema:
2173
+ z.ZodNativeEnum<typeof DuplicateAgentResponseFormatAgentsResponse201Type> =
2174
+ DuplicateAgentResponseFormatAgentsResponse201Type$inboundSchema;
2175
+
2176
+ /** @internal */
2177
+ export const DuplicateAgentResponseFormatAgentsText$inboundSchema: z.ZodType<
2178
+ DuplicateAgentResponseFormatAgentsText,
2179
+ z.ZodTypeDef,
2180
+ unknown
2181
+ > = z.object({
2182
+ type: DuplicateAgentResponseFormatAgentsResponse201Type$inboundSchema,
2183
+ });
2184
+ /** @internal */
2185
+ export type DuplicateAgentResponseFormatAgentsText$Outbound = {
2186
+ type: string;
2187
+ };
2188
+
2189
+ /** @internal */
2190
+ export const DuplicateAgentResponseFormatAgentsText$outboundSchema: z.ZodType<
2191
+ DuplicateAgentResponseFormatAgentsText$Outbound,
2192
+ z.ZodTypeDef,
2193
+ DuplicateAgentResponseFormatAgentsText
2194
+ > = z.object({
2195
+ type: DuplicateAgentResponseFormatAgentsResponse201Type$outboundSchema,
2196
+ });
2197
+
2198
+ export function duplicateAgentResponseFormatAgentsTextToJSON(
2199
+ duplicateAgentResponseFormatAgentsText:
2200
+ DuplicateAgentResponseFormatAgentsText,
2201
+ ): string {
2202
+ return JSON.stringify(
2203
+ DuplicateAgentResponseFormatAgentsText$outboundSchema.parse(
2204
+ duplicateAgentResponseFormatAgentsText,
2205
+ ),
2206
+ );
2207
+ }
2208
+ export function duplicateAgentResponseFormatAgentsTextFromJSON(
2209
+ jsonString: string,
2210
+ ): SafeParseResult<DuplicateAgentResponseFormatAgentsText, SDKValidationError> {
2211
+ return safeParse(
2212
+ jsonString,
2213
+ (x) =>
2214
+ DuplicateAgentResponseFormatAgentsText$inboundSchema.parse(JSON.parse(x)),
2215
+ `Failed to parse 'DuplicateAgentResponseFormatAgentsText' from JSON`,
2216
+ );
2217
+ }
2218
+
2219
+ /** @internal */
2220
+ export const DuplicateAgentFallbackModelConfigurationResponseFormat$inboundSchema:
2221
+ z.ZodType<
2222
+ DuplicateAgentFallbackModelConfigurationResponseFormat,
2223
+ z.ZodTypeDef,
2224
+ unknown
2225
+ > = z.union([
2226
+ z.lazy(() =>
2227
+ DuplicateAgentResponseFormatAgentsResponse201JSONSchema$inboundSchema
2228
+ ),
2229
+ z.lazy(() => DuplicateAgentResponseFormatAgentsText$inboundSchema),
2230
+ z.lazy(() => DuplicateAgentResponseFormatAgentsJSONObject$inboundSchema),
2231
+ ]);
2232
+ /** @internal */
2233
+ export type DuplicateAgentFallbackModelConfigurationResponseFormat$Outbound =
2234
+ | DuplicateAgentResponseFormatAgentsResponse201JSONSchema$Outbound
2235
+ | DuplicateAgentResponseFormatAgentsText$Outbound
2236
+ | DuplicateAgentResponseFormatAgentsJSONObject$Outbound;
2237
+
2238
+ /** @internal */
2239
+ export const DuplicateAgentFallbackModelConfigurationResponseFormat$outboundSchema:
2240
+ z.ZodType<
2241
+ DuplicateAgentFallbackModelConfigurationResponseFormat$Outbound,
2242
+ z.ZodTypeDef,
2243
+ DuplicateAgentFallbackModelConfigurationResponseFormat
2244
+ > = z.union([
2245
+ z.lazy(() =>
2246
+ DuplicateAgentResponseFormatAgentsResponse201JSONSchema$outboundSchema
2247
+ ),
2248
+ z.lazy(() => DuplicateAgentResponseFormatAgentsText$outboundSchema),
2249
+ z.lazy(() => DuplicateAgentResponseFormatAgentsJSONObject$outboundSchema),
2250
+ ]);
2251
+
2252
+ export function duplicateAgentFallbackModelConfigurationResponseFormatToJSON(
2253
+ duplicateAgentFallbackModelConfigurationResponseFormat:
2254
+ DuplicateAgentFallbackModelConfigurationResponseFormat,
2255
+ ): string {
2256
+ return JSON.stringify(
2257
+ DuplicateAgentFallbackModelConfigurationResponseFormat$outboundSchema.parse(
2258
+ duplicateAgentFallbackModelConfigurationResponseFormat,
2259
+ ),
2260
+ );
2261
+ }
2262
+ export function duplicateAgentFallbackModelConfigurationResponseFormatFromJSON(
2263
+ jsonString: string,
2264
+ ): SafeParseResult<
2265
+ DuplicateAgentFallbackModelConfigurationResponseFormat,
2266
+ SDKValidationError
2267
+ > {
2268
+ return safeParse(
2269
+ jsonString,
2270
+ (x) =>
2271
+ DuplicateAgentFallbackModelConfigurationResponseFormat$inboundSchema
2272
+ .parse(JSON.parse(x)),
2273
+ `Failed to parse 'DuplicateAgentFallbackModelConfigurationResponseFormat' from JSON`,
2274
+ );
2275
+ }
2276
+
2277
+ /** @internal */
2278
+ export const DuplicateAgentFallbackModelConfigurationStop$inboundSchema:
2279
+ z.ZodType<
2280
+ DuplicateAgentFallbackModelConfigurationStop,
2281
+ z.ZodTypeDef,
2282
+ unknown
2283
+ > = z.union([z.string(), z.array(z.string())]);
2284
+ /** @internal */
2285
+ export type DuplicateAgentFallbackModelConfigurationStop$Outbound =
2286
+ | string
2287
+ | Array<string>;
2288
+
2289
+ /** @internal */
2290
+ export const DuplicateAgentFallbackModelConfigurationStop$outboundSchema:
2291
+ z.ZodType<
2292
+ DuplicateAgentFallbackModelConfigurationStop$Outbound,
2293
+ z.ZodTypeDef,
2294
+ DuplicateAgentFallbackModelConfigurationStop
2295
+ > = z.union([z.string(), z.array(z.string())]);
2296
+
2297
+ export function duplicateAgentFallbackModelConfigurationStopToJSON(
2298
+ duplicateAgentFallbackModelConfigurationStop:
2299
+ DuplicateAgentFallbackModelConfigurationStop,
2300
+ ): string {
2301
+ return JSON.stringify(
2302
+ DuplicateAgentFallbackModelConfigurationStop$outboundSchema.parse(
2303
+ duplicateAgentFallbackModelConfigurationStop,
2304
+ ),
2305
+ );
2306
+ }
2307
+ export function duplicateAgentFallbackModelConfigurationStopFromJSON(
2308
+ jsonString: string,
2309
+ ): SafeParseResult<
2310
+ DuplicateAgentFallbackModelConfigurationStop,
2311
+ SDKValidationError
2312
+ > {
2313
+ return safeParse(
2314
+ jsonString,
2315
+ (x) =>
2316
+ DuplicateAgentFallbackModelConfigurationStop$inboundSchema.parse(
2317
+ JSON.parse(x),
2318
+ ),
2319
+ `Failed to parse 'DuplicateAgentFallbackModelConfigurationStop' from JSON`,
2320
+ );
2321
+ }
2322
+
2323
+ /** @internal */
2324
+ export const DuplicateAgentFallbackModelConfigurationStreamOptions$inboundSchema:
2325
+ z.ZodType<
2326
+ DuplicateAgentFallbackModelConfigurationStreamOptions,
2327
+ z.ZodTypeDef,
2328
+ unknown
2329
+ > = z.object({
2330
+ include_usage: z.boolean().optional(),
2331
+ }).transform((v) => {
2332
+ return remap$(v, {
2333
+ "include_usage": "includeUsage",
2334
+ });
2335
+ });
2336
+ /** @internal */
2337
+ export type DuplicateAgentFallbackModelConfigurationStreamOptions$Outbound = {
2338
+ include_usage?: boolean | undefined;
2339
+ };
2340
+
2341
+ /** @internal */
2342
+ export const DuplicateAgentFallbackModelConfigurationStreamOptions$outboundSchema:
2343
+ z.ZodType<
2344
+ DuplicateAgentFallbackModelConfigurationStreamOptions$Outbound,
2345
+ z.ZodTypeDef,
2346
+ DuplicateAgentFallbackModelConfigurationStreamOptions
2347
+ > = z.object({
2348
+ includeUsage: z.boolean().optional(),
2349
+ }).transform((v) => {
2350
+ return remap$(v, {
2351
+ includeUsage: "include_usage",
2352
+ });
2353
+ });
2354
+
2355
+ export function duplicateAgentFallbackModelConfigurationStreamOptionsToJSON(
2356
+ duplicateAgentFallbackModelConfigurationStreamOptions:
2357
+ DuplicateAgentFallbackModelConfigurationStreamOptions,
2358
+ ): string {
2359
+ return JSON.stringify(
2360
+ DuplicateAgentFallbackModelConfigurationStreamOptions$outboundSchema.parse(
2361
+ duplicateAgentFallbackModelConfigurationStreamOptions,
2362
+ ),
2363
+ );
2364
+ }
2365
+ export function duplicateAgentFallbackModelConfigurationStreamOptionsFromJSON(
2366
+ jsonString: string,
2367
+ ): SafeParseResult<
2368
+ DuplicateAgentFallbackModelConfigurationStreamOptions,
2369
+ SDKValidationError
2370
+ > {
2371
+ return safeParse(
2372
+ jsonString,
2373
+ (x) =>
2374
+ DuplicateAgentFallbackModelConfigurationStreamOptions$inboundSchema.parse(
2375
+ JSON.parse(x),
2376
+ ),
2377
+ `Failed to parse 'DuplicateAgentFallbackModelConfigurationStreamOptions' from JSON`,
2378
+ );
2379
+ }
2380
+
2381
+ /** @internal */
2382
+ export const DuplicateAgentFallbackModelConfigurationType$inboundSchema:
2383
+ z.ZodNativeEnum<typeof DuplicateAgentFallbackModelConfigurationType> = z
2384
+ .nativeEnum(DuplicateAgentFallbackModelConfigurationType);
2385
+ /** @internal */
2386
+ export const DuplicateAgentFallbackModelConfigurationType$outboundSchema:
2387
+ z.ZodNativeEnum<typeof DuplicateAgentFallbackModelConfigurationType> =
2388
+ DuplicateAgentFallbackModelConfigurationType$inboundSchema;
2389
+
2390
+ /** @internal */
2391
+ export const DuplicateAgentFallbackModelConfigurationThinking$inboundSchema:
2392
+ z.ZodType<
2393
+ DuplicateAgentFallbackModelConfigurationThinking,
2394
+ z.ZodTypeDef,
2395
+ unknown
2396
+ > = z.object({
2397
+ type: DuplicateAgentFallbackModelConfigurationType$inboundSchema,
2398
+ budget_tokens: z.number(),
2399
+ }).transform((v) => {
2400
+ return remap$(v, {
2401
+ "budget_tokens": "budgetTokens",
2402
+ });
2403
+ });
2404
+ /** @internal */
2405
+ export type DuplicateAgentFallbackModelConfigurationThinking$Outbound = {
2406
+ type: string;
2407
+ budget_tokens: number;
2408
+ };
2409
+
2410
+ /** @internal */
2411
+ export const DuplicateAgentFallbackModelConfigurationThinking$outboundSchema:
2412
+ z.ZodType<
2413
+ DuplicateAgentFallbackModelConfigurationThinking$Outbound,
2414
+ z.ZodTypeDef,
2415
+ DuplicateAgentFallbackModelConfigurationThinking
2416
+ > = z.object({
2417
+ type: DuplicateAgentFallbackModelConfigurationType$outboundSchema,
2418
+ budgetTokens: z.number(),
2419
+ }).transform((v) => {
2420
+ return remap$(v, {
2421
+ budgetTokens: "budget_tokens",
2422
+ });
2423
+ });
2424
+
2425
+ export function duplicateAgentFallbackModelConfigurationThinkingToJSON(
2426
+ duplicateAgentFallbackModelConfigurationThinking:
2427
+ DuplicateAgentFallbackModelConfigurationThinking,
2428
+ ): string {
2429
+ return JSON.stringify(
2430
+ DuplicateAgentFallbackModelConfigurationThinking$outboundSchema.parse(
2431
+ duplicateAgentFallbackModelConfigurationThinking,
2432
+ ),
2433
+ );
2434
+ }
2435
+ export function duplicateAgentFallbackModelConfigurationThinkingFromJSON(
2436
+ jsonString: string,
2437
+ ): SafeParseResult<
2438
+ DuplicateAgentFallbackModelConfigurationThinking,
2439
+ SDKValidationError
2440
+ > {
2441
+ return safeParse(
2442
+ jsonString,
2443
+ (x) =>
2444
+ DuplicateAgentFallbackModelConfigurationThinking$inboundSchema.parse(
2445
+ JSON.parse(x),
2446
+ ),
2447
+ `Failed to parse 'DuplicateAgentFallbackModelConfigurationThinking' from JSON`,
2448
+ );
2449
+ }
2450
+
2451
+ /** @internal */
2452
+ export const DuplicateAgentToolChoiceAgentsType$inboundSchema: z.ZodNativeEnum<
2453
+ typeof DuplicateAgentToolChoiceAgentsType
2454
+ > = z.nativeEnum(DuplicateAgentToolChoiceAgentsType);
2455
+ /** @internal */
2456
+ export const DuplicateAgentToolChoiceAgentsType$outboundSchema: z.ZodNativeEnum<
2457
+ typeof DuplicateAgentToolChoiceAgentsType
2458
+ > = DuplicateAgentToolChoiceAgentsType$inboundSchema;
2459
+
2460
+ /** @internal */
2461
+ export const DuplicateAgentToolChoiceAgentsFunction$inboundSchema: z.ZodType<
2462
+ DuplicateAgentToolChoiceAgentsFunction,
2463
+ z.ZodTypeDef,
2464
+ unknown
2465
+ > = z.object({
2466
+ name: z.string().optional(),
2467
+ });
2468
+ /** @internal */
2469
+ export type DuplicateAgentToolChoiceAgentsFunction$Outbound = {
2470
+ name?: string | undefined;
2471
+ };
2472
+
2473
+ /** @internal */
2474
+ export const DuplicateAgentToolChoiceAgentsFunction$outboundSchema: z.ZodType<
2475
+ DuplicateAgentToolChoiceAgentsFunction$Outbound,
2476
+ z.ZodTypeDef,
2477
+ DuplicateAgentToolChoiceAgentsFunction
2478
+ > = z.object({
2479
+ name: z.string().optional(),
2480
+ });
2481
+
2482
+ export function duplicateAgentToolChoiceAgentsFunctionToJSON(
2483
+ duplicateAgentToolChoiceAgentsFunction:
2484
+ DuplicateAgentToolChoiceAgentsFunction,
2485
+ ): string {
2486
+ return JSON.stringify(
2487
+ DuplicateAgentToolChoiceAgentsFunction$outboundSchema.parse(
2488
+ duplicateAgentToolChoiceAgentsFunction,
2489
+ ),
2490
+ );
2491
+ }
2492
+ export function duplicateAgentToolChoiceAgentsFunctionFromJSON(
2493
+ jsonString: string,
2494
+ ): SafeParseResult<DuplicateAgentToolChoiceAgentsFunction, SDKValidationError> {
2495
+ return safeParse(
2496
+ jsonString,
2497
+ (x) =>
2498
+ DuplicateAgentToolChoiceAgentsFunction$inboundSchema.parse(JSON.parse(x)),
2499
+ `Failed to parse 'DuplicateAgentToolChoiceAgentsFunction' from JSON`,
2500
+ );
2501
+ }
2502
+
2503
+ /** @internal */
2504
+ export const DuplicateAgentToolChoiceAgents2$inboundSchema: z.ZodType<
2505
+ DuplicateAgentToolChoiceAgents2,
2506
+ z.ZodTypeDef,
2507
+ unknown
2508
+ > = z.object({
2509
+ type: DuplicateAgentToolChoiceAgentsType$inboundSchema.optional(),
2510
+ function: z.lazy(() => DuplicateAgentToolChoiceAgentsFunction$inboundSchema),
2511
+ });
2512
+ /** @internal */
2513
+ export type DuplicateAgentToolChoiceAgents2$Outbound = {
2514
+ type?: string | undefined;
2515
+ function: DuplicateAgentToolChoiceAgentsFunction$Outbound;
2516
+ };
2517
+
2518
+ /** @internal */
2519
+ export const DuplicateAgentToolChoiceAgents2$outboundSchema: z.ZodType<
2520
+ DuplicateAgentToolChoiceAgents2$Outbound,
2521
+ z.ZodTypeDef,
2522
+ DuplicateAgentToolChoiceAgents2
2523
+ > = z.object({
2524
+ type: DuplicateAgentToolChoiceAgentsType$outboundSchema.optional(),
2525
+ function: z.lazy(() => DuplicateAgentToolChoiceAgentsFunction$outboundSchema),
2526
+ });
2527
+
2528
+ export function duplicateAgentToolChoiceAgents2ToJSON(
2529
+ duplicateAgentToolChoiceAgents2: DuplicateAgentToolChoiceAgents2,
2530
+ ): string {
2531
+ return JSON.stringify(
2532
+ DuplicateAgentToolChoiceAgents2$outboundSchema.parse(
2533
+ duplicateAgentToolChoiceAgents2,
2534
+ ),
2535
+ );
2536
+ }
2537
+ export function duplicateAgentToolChoiceAgents2FromJSON(
2538
+ jsonString: string,
2539
+ ): SafeParseResult<DuplicateAgentToolChoiceAgents2, SDKValidationError> {
2540
+ return safeParse(
2541
+ jsonString,
2542
+ (x) => DuplicateAgentToolChoiceAgents2$inboundSchema.parse(JSON.parse(x)),
2543
+ `Failed to parse 'DuplicateAgentToolChoiceAgents2' from JSON`,
2544
+ );
2545
+ }
2546
+
2547
+ /** @internal */
2548
+ export const DuplicateAgentToolChoiceAgents1$inboundSchema: z.ZodNativeEnum<
2549
+ typeof DuplicateAgentToolChoiceAgents1
2550
+ > = z.nativeEnum(DuplicateAgentToolChoiceAgents1);
2551
+ /** @internal */
2552
+ export const DuplicateAgentToolChoiceAgents1$outboundSchema: z.ZodNativeEnum<
2553
+ typeof DuplicateAgentToolChoiceAgents1
2554
+ > = DuplicateAgentToolChoiceAgents1$inboundSchema;
2555
+
2556
+ /** @internal */
2557
+ export const DuplicateAgentFallbackModelConfigurationToolChoice$inboundSchema:
2558
+ z.ZodType<
2559
+ DuplicateAgentFallbackModelConfigurationToolChoice,
2560
+ z.ZodTypeDef,
2561
+ unknown
2562
+ > = z.union([
2563
+ z.lazy(() => DuplicateAgentToolChoiceAgents2$inboundSchema),
2564
+ DuplicateAgentToolChoiceAgents1$inboundSchema,
2565
+ ]);
2566
+ /** @internal */
2567
+ export type DuplicateAgentFallbackModelConfigurationToolChoice$Outbound =
2568
+ | DuplicateAgentToolChoiceAgents2$Outbound
2569
+ | string;
2570
+
2571
+ /** @internal */
2572
+ export const DuplicateAgentFallbackModelConfigurationToolChoice$outboundSchema:
2573
+ z.ZodType<
2574
+ DuplicateAgentFallbackModelConfigurationToolChoice$Outbound,
2575
+ z.ZodTypeDef,
2576
+ DuplicateAgentFallbackModelConfigurationToolChoice
2577
+ > = z.union([
2578
+ z.lazy(() => DuplicateAgentToolChoiceAgents2$outboundSchema),
2579
+ DuplicateAgentToolChoiceAgents1$outboundSchema,
2580
+ ]);
2581
+
2582
+ export function duplicateAgentFallbackModelConfigurationToolChoiceToJSON(
2583
+ duplicateAgentFallbackModelConfigurationToolChoice:
2584
+ DuplicateAgentFallbackModelConfigurationToolChoice,
2585
+ ): string {
2586
+ return JSON.stringify(
2587
+ DuplicateAgentFallbackModelConfigurationToolChoice$outboundSchema.parse(
2588
+ duplicateAgentFallbackModelConfigurationToolChoice,
2589
+ ),
2590
+ );
2591
+ }
2592
+ export function duplicateAgentFallbackModelConfigurationToolChoiceFromJSON(
2593
+ jsonString: string,
2594
+ ): SafeParseResult<
2595
+ DuplicateAgentFallbackModelConfigurationToolChoice,
2596
+ SDKValidationError
2597
+ > {
2598
+ return safeParse(
2599
+ jsonString,
2600
+ (x) =>
2601
+ DuplicateAgentFallbackModelConfigurationToolChoice$inboundSchema.parse(
2602
+ JSON.parse(x),
2603
+ ),
2604
+ `Failed to parse 'DuplicateAgentFallbackModelConfigurationToolChoice' from JSON`,
2605
+ );
2606
+ }
2607
+
2608
+ /** @internal */
2609
+ export const DuplicateAgentFallbackModelConfigurationModalities$inboundSchema:
2610
+ z.ZodNativeEnum<typeof DuplicateAgentFallbackModelConfigurationModalities> = z
2611
+ .nativeEnum(DuplicateAgentFallbackModelConfigurationModalities);
2612
+ /** @internal */
2613
+ export const DuplicateAgentFallbackModelConfigurationModalities$outboundSchema:
2614
+ z.ZodNativeEnum<typeof DuplicateAgentFallbackModelConfigurationModalities> =
2615
+ DuplicateAgentFallbackModelConfigurationModalities$inboundSchema;
2616
+
2617
+ /** @internal */
2618
+ export const DuplicateAgentFallbackModelConfigurationParameters$inboundSchema:
2619
+ z.ZodType<
2620
+ DuplicateAgentFallbackModelConfigurationParameters,
2621
+ z.ZodTypeDef,
2622
+ unknown
2623
+ > = z.object({
2624
+ audio: z.nullable(
2625
+ z.lazy(() => DuplicateAgentFallbackModelConfigurationAudio$inboundSchema),
2626
+ ).optional(),
2627
+ frequency_penalty: z.nullable(z.number()).optional(),
2628
+ max_tokens: z.nullable(z.number().int()).optional(),
2629
+ max_completion_tokens: z.nullable(z.number().int()).optional(),
2630
+ logprobs: z.nullable(z.boolean()).optional(),
2631
+ top_logprobs: z.nullable(z.number().int()).optional(),
2632
+ n: z.nullable(z.number().int()).optional(),
2633
+ presence_penalty: z.nullable(z.number()).optional(),
2634
+ response_format: z.union([
2635
+ z.lazy(() =>
2636
+ DuplicateAgentResponseFormatAgentsResponse201JSONSchema$inboundSchema
2637
+ ),
2638
+ z.lazy(() => DuplicateAgentResponseFormatAgentsText$inboundSchema),
2639
+ z.lazy(() => DuplicateAgentResponseFormatAgentsJSONObject$inboundSchema),
2640
+ ]).optional(),
2641
+ reasoning_effort: z.string().optional(),
2642
+ verbosity: z.string().optional(),
2643
+ seed: z.nullable(z.number()).optional(),
2644
+ stop: z.nullable(z.union([z.string(), z.array(z.string())])).optional(),
2645
+ stream_options: z.nullable(
2646
+ z.lazy(() =>
2647
+ DuplicateAgentFallbackModelConfigurationStreamOptions$inboundSchema
2648
+ ),
2649
+ ).optional(),
2650
+ thinking: z.lazy(() =>
2651
+ DuplicateAgentFallbackModelConfigurationThinking$inboundSchema
2652
+ ).optional(),
2653
+ temperature: z.nullable(z.number()).optional(),
2654
+ top_p: z.nullable(z.number()).optional(),
2655
+ top_k: z.nullable(z.number()).optional(),
2656
+ tool_choice: z.union([
2657
+ z.lazy(() => DuplicateAgentToolChoiceAgents2$inboundSchema),
2658
+ DuplicateAgentToolChoiceAgents1$inboundSchema,
2659
+ ]).optional(),
2660
+ parallel_tool_calls: z.boolean().optional(),
2661
+ modalities: z.nullable(
2662
+ z.array(DuplicateAgentFallbackModelConfigurationModalities$inboundSchema),
2663
+ ).optional(),
2664
+ }).transform((v) => {
2665
+ return remap$(v, {
2666
+ "frequency_penalty": "frequencyPenalty",
2667
+ "max_tokens": "maxTokens",
2668
+ "max_completion_tokens": "maxCompletionTokens",
2669
+ "top_logprobs": "topLogprobs",
2670
+ "presence_penalty": "presencePenalty",
2671
+ "response_format": "responseFormat",
2672
+ "reasoning_effort": "reasoningEffort",
2673
+ "stream_options": "streamOptions",
2674
+ "top_p": "topP",
2675
+ "top_k": "topK",
2676
+ "tool_choice": "toolChoice",
2677
+ "parallel_tool_calls": "parallelToolCalls",
2678
+ });
2679
+ });
2680
+ /** @internal */
2681
+ export type DuplicateAgentFallbackModelConfigurationParameters$Outbound = {
2682
+ audio?:
2683
+ | DuplicateAgentFallbackModelConfigurationAudio$Outbound
2684
+ | null
2685
+ | undefined;
2686
+ frequency_penalty?: number | null | undefined;
2687
+ max_tokens?: number | null | undefined;
2688
+ max_completion_tokens?: number | null | undefined;
2689
+ logprobs?: boolean | null | undefined;
2690
+ top_logprobs?: number | null | undefined;
2691
+ n?: number | null | undefined;
2692
+ presence_penalty?: number | null | undefined;
2693
+ response_format?:
2694
+ | DuplicateAgentResponseFormatAgentsResponse201JSONSchema$Outbound
2695
+ | DuplicateAgentResponseFormatAgentsText$Outbound
2696
+ | DuplicateAgentResponseFormatAgentsJSONObject$Outbound
2697
+ | undefined;
2698
+ reasoning_effort?: string | undefined;
2699
+ verbosity?: string | undefined;
2700
+ seed?: number | null | undefined;
2701
+ stop?: string | Array<string> | null | undefined;
2702
+ stream_options?:
2703
+ | DuplicateAgentFallbackModelConfigurationStreamOptions$Outbound
2704
+ | null
2705
+ | undefined;
2706
+ thinking?:
2707
+ | DuplicateAgentFallbackModelConfigurationThinking$Outbound
2708
+ | undefined;
2709
+ temperature?: number | null | undefined;
2710
+ top_p?: number | null | undefined;
2711
+ top_k?: number | null | undefined;
2712
+ tool_choice?: DuplicateAgentToolChoiceAgents2$Outbound | string | undefined;
2713
+ parallel_tool_calls?: boolean | undefined;
2714
+ modalities?: Array<string> | null | undefined;
2715
+ };
2716
+
2717
+ /** @internal */
2718
+ export const DuplicateAgentFallbackModelConfigurationParameters$outboundSchema:
2719
+ z.ZodType<
2720
+ DuplicateAgentFallbackModelConfigurationParameters$Outbound,
2721
+ z.ZodTypeDef,
2722
+ DuplicateAgentFallbackModelConfigurationParameters
2723
+ > = z.object({
2724
+ audio: z.nullable(
2725
+ z.lazy(() =>
2726
+ DuplicateAgentFallbackModelConfigurationAudio$outboundSchema
2727
+ ),
2728
+ ).optional(),
2729
+ frequencyPenalty: z.nullable(z.number()).optional(),
2730
+ maxTokens: z.nullable(z.number().int()).optional(),
2731
+ maxCompletionTokens: z.nullable(z.number().int()).optional(),
2732
+ logprobs: z.nullable(z.boolean()).optional(),
2733
+ topLogprobs: z.nullable(z.number().int()).optional(),
2734
+ n: z.nullable(z.number().int()).optional(),
2735
+ presencePenalty: z.nullable(z.number()).optional(),
2736
+ responseFormat: z.union([
2737
+ z.lazy(() =>
2738
+ DuplicateAgentResponseFormatAgentsResponse201JSONSchema$outboundSchema
2739
+ ),
2740
+ z.lazy(() => DuplicateAgentResponseFormatAgentsText$outboundSchema),
2741
+ z.lazy(() => DuplicateAgentResponseFormatAgentsJSONObject$outboundSchema),
2742
+ ]).optional(),
2743
+ reasoningEffort: z.string().optional(),
2744
+ verbosity: z.string().optional(),
2745
+ seed: z.nullable(z.number()).optional(),
2746
+ stop: z.nullable(z.union([z.string(), z.array(z.string())])).optional(),
2747
+ streamOptions: z.nullable(
2748
+ z.lazy(() =>
2749
+ DuplicateAgentFallbackModelConfigurationStreamOptions$outboundSchema
2750
+ ),
2751
+ ).optional(),
2752
+ thinking: z.lazy(() =>
2753
+ DuplicateAgentFallbackModelConfigurationThinking$outboundSchema
2754
+ ).optional(),
2755
+ temperature: z.nullable(z.number()).optional(),
2756
+ topP: z.nullable(z.number()).optional(),
2757
+ topK: z.nullable(z.number()).optional(),
2758
+ toolChoice: z.union([
2759
+ z.lazy(() => DuplicateAgentToolChoiceAgents2$outboundSchema),
2760
+ DuplicateAgentToolChoiceAgents1$outboundSchema,
2761
+ ]).optional(),
2762
+ parallelToolCalls: z.boolean().optional(),
2763
+ modalities: z.nullable(
2764
+ z.array(
2765
+ DuplicateAgentFallbackModelConfigurationModalities$outboundSchema,
2766
+ ),
2767
+ ).optional(),
2768
+ }).transform((v) => {
2769
+ return remap$(v, {
2770
+ frequencyPenalty: "frequency_penalty",
2771
+ maxTokens: "max_tokens",
2772
+ maxCompletionTokens: "max_completion_tokens",
2773
+ topLogprobs: "top_logprobs",
2774
+ presencePenalty: "presence_penalty",
2775
+ responseFormat: "response_format",
2776
+ reasoningEffort: "reasoning_effort",
2777
+ streamOptions: "stream_options",
2778
+ topP: "top_p",
2779
+ topK: "top_k",
2780
+ toolChoice: "tool_choice",
2781
+ parallelToolCalls: "parallel_tool_calls",
2782
+ });
2783
+ });
2784
+
2785
+ export function duplicateAgentFallbackModelConfigurationParametersToJSON(
2786
+ duplicateAgentFallbackModelConfigurationParameters:
2787
+ DuplicateAgentFallbackModelConfigurationParameters,
2788
+ ): string {
2789
+ return JSON.stringify(
2790
+ DuplicateAgentFallbackModelConfigurationParameters$outboundSchema.parse(
2791
+ duplicateAgentFallbackModelConfigurationParameters,
2792
+ ),
2793
+ );
2794
+ }
2795
+ export function duplicateAgentFallbackModelConfigurationParametersFromJSON(
2796
+ jsonString: string,
2797
+ ): SafeParseResult<
2798
+ DuplicateAgentFallbackModelConfigurationParameters,
2799
+ SDKValidationError
2800
+ > {
2801
+ return safeParse(
2802
+ jsonString,
2803
+ (x) =>
2804
+ DuplicateAgentFallbackModelConfigurationParameters$inboundSchema.parse(
2805
+ JSON.parse(x),
2806
+ ),
2807
+ `Failed to parse 'DuplicateAgentFallbackModelConfigurationParameters' from JSON`,
2808
+ );
2809
+ }
2810
+
2811
+ /** @internal */
2812
+ export const DuplicateAgentFallbackModelConfiguration2$inboundSchema: z.ZodType<
2813
+ DuplicateAgentFallbackModelConfiguration2,
2814
+ z.ZodTypeDef,
2815
+ unknown
2816
+ > = z.object({
2817
+ id: z.string(),
2818
+ parameters: z.lazy(() =>
2819
+ DuplicateAgentFallbackModelConfigurationParameters$inboundSchema
2820
+ ).optional(),
2821
+ });
2822
+ /** @internal */
2823
+ export type DuplicateAgentFallbackModelConfiguration2$Outbound = {
2824
+ id: string;
2825
+ parameters?:
2826
+ | DuplicateAgentFallbackModelConfigurationParameters$Outbound
2827
+ | undefined;
2828
+ };
2829
+
2830
+ /** @internal */
2831
+ export const DuplicateAgentFallbackModelConfiguration2$outboundSchema:
2832
+ z.ZodType<
2833
+ DuplicateAgentFallbackModelConfiguration2$Outbound,
2834
+ z.ZodTypeDef,
2835
+ DuplicateAgentFallbackModelConfiguration2
2836
+ > = z.object({
2837
+ id: z.string(),
2838
+ parameters: z.lazy(() =>
2839
+ DuplicateAgentFallbackModelConfigurationParameters$outboundSchema
2840
+ ).optional(),
2841
+ });
2842
+
2843
+ export function duplicateAgentFallbackModelConfiguration2ToJSON(
2844
+ duplicateAgentFallbackModelConfiguration2:
2845
+ DuplicateAgentFallbackModelConfiguration2,
2846
+ ): string {
2847
+ return JSON.stringify(
2848
+ DuplicateAgentFallbackModelConfiguration2$outboundSchema.parse(
2849
+ duplicateAgentFallbackModelConfiguration2,
2850
+ ),
2851
+ );
2852
+ }
2853
+ export function duplicateAgentFallbackModelConfiguration2FromJSON(
2854
+ jsonString: string,
2855
+ ): SafeParseResult<
2856
+ DuplicateAgentFallbackModelConfiguration2,
2857
+ SDKValidationError
2858
+ > {
2859
+ return safeParse(
2860
+ jsonString,
2861
+ (x) =>
2862
+ DuplicateAgentFallbackModelConfiguration2$inboundSchema.parse(
2863
+ JSON.parse(x),
2864
+ ),
2865
+ `Failed to parse 'DuplicateAgentFallbackModelConfiguration2' from JSON`,
2866
+ );
2867
+ }
2868
+
2869
+ /** @internal */
2870
+ export const DuplicateAgentFallbackModelConfiguration$inboundSchema: z.ZodType<
2871
+ DuplicateAgentFallbackModelConfiguration,
2872
+ z.ZodTypeDef,
2873
+ unknown
2874
+ > = z.union([
2875
+ z.lazy(() => DuplicateAgentFallbackModelConfiguration2$inboundSchema),
2876
+ z.string(),
2877
+ ]);
2878
+ /** @internal */
2879
+ export type DuplicateAgentFallbackModelConfiguration$Outbound =
2880
+ | DuplicateAgentFallbackModelConfiguration2$Outbound
2881
+ | string;
2882
+
2883
+ /** @internal */
2884
+ export const DuplicateAgentFallbackModelConfiguration$outboundSchema: z.ZodType<
2885
+ DuplicateAgentFallbackModelConfiguration$Outbound,
2886
+ z.ZodTypeDef,
2887
+ DuplicateAgentFallbackModelConfiguration
2888
+ > = z.union([
2889
+ z.lazy(() => DuplicateAgentFallbackModelConfiguration2$outboundSchema),
2890
+ z.string(),
2891
+ ]);
2892
+
2893
+ export function duplicateAgentFallbackModelConfigurationToJSON(
2894
+ duplicateAgentFallbackModelConfiguration:
2895
+ DuplicateAgentFallbackModelConfiguration,
2896
+ ): string {
2897
+ return JSON.stringify(
2898
+ DuplicateAgentFallbackModelConfiguration$outboundSchema.parse(
2899
+ duplicateAgentFallbackModelConfiguration,
2900
+ ),
2901
+ );
2902
+ }
2903
+ export function duplicateAgentFallbackModelConfigurationFromJSON(
2904
+ jsonString: string,
2905
+ ): SafeParseResult<
2906
+ DuplicateAgentFallbackModelConfiguration,
2907
+ SDKValidationError
2908
+ > {
2909
+ return safeParse(
2910
+ jsonString,
2911
+ (x) =>
2912
+ DuplicateAgentFallbackModelConfiguration$inboundSchema.parse(
2913
+ JSON.parse(x),
2914
+ ),
2915
+ `Failed to parse 'DuplicateAgentFallbackModelConfiguration' from JSON`,
2916
+ );
2917
+ }
2918
+
2919
+ /** @internal */
2920
+ export const DuplicateAgentModel$inboundSchema: z.ZodType<
2921
+ DuplicateAgentModel,
2922
+ z.ZodTypeDef,
2923
+ unknown
2924
+ > = z.object({
2925
+ id: z.string(),
2926
+ integration_id: z.nullable(z.string()).optional(),
2927
+ parameters: z.lazy(() => DuplicateAgentParameters$inboundSchema).optional(),
2928
+ fallback_models: z.nullable(
2929
+ z.array(z.union([
2930
+ z.lazy(() => DuplicateAgentFallbackModelConfiguration2$inboundSchema),
2931
+ z.string(),
2932
+ ])),
2933
+ ).optional(),
2934
+ }).transform((v) => {
2935
+ return remap$(v, {
2936
+ "integration_id": "integrationId",
2937
+ "fallback_models": "fallbackModels",
2938
+ });
2939
+ });
2940
+ /** @internal */
2941
+ export type DuplicateAgentModel$Outbound = {
2942
+ id: string;
2943
+ integration_id?: string | null | undefined;
2944
+ parameters?: DuplicateAgentParameters$Outbound | undefined;
2945
+ fallback_models?:
2946
+ | Array<DuplicateAgentFallbackModelConfiguration2$Outbound | string>
2947
+ | null
2948
+ | undefined;
2949
+ };
2950
+
2951
+ /** @internal */
2952
+ export const DuplicateAgentModel$outboundSchema: z.ZodType<
2953
+ DuplicateAgentModel$Outbound,
2954
+ z.ZodTypeDef,
2955
+ DuplicateAgentModel
2956
+ > = z.object({
2957
+ id: z.string(),
2958
+ integrationId: z.nullable(z.string()).optional(),
2959
+ parameters: z.lazy(() => DuplicateAgentParameters$outboundSchema).optional(),
2960
+ fallbackModels: z.nullable(
2961
+ z.array(z.union([
2962
+ z.lazy(() => DuplicateAgentFallbackModelConfiguration2$outboundSchema),
2963
+ z.string(),
2964
+ ])),
2965
+ ).optional(),
2966
+ }).transform((v) => {
2967
+ return remap$(v, {
2968
+ integrationId: "integration_id",
2969
+ fallbackModels: "fallback_models",
2970
+ });
2971
+ });
2972
+
2973
+ export function duplicateAgentModelToJSON(
2974
+ duplicateAgentModel: DuplicateAgentModel,
2975
+ ): string {
2976
+ return JSON.stringify(
2977
+ DuplicateAgentModel$outboundSchema.parse(duplicateAgentModel),
2978
+ );
2979
+ }
2980
+ export function duplicateAgentModelFromJSON(
2981
+ jsonString: string,
2982
+ ): SafeParseResult<DuplicateAgentModel, SDKValidationError> {
2983
+ return safeParse(
2984
+ jsonString,
2985
+ (x) => DuplicateAgentModel$inboundSchema.parse(JSON.parse(x)),
2986
+ `Failed to parse 'DuplicateAgentModel' from JSON`,
2987
+ );
2988
+ }
2989
+
2990
+ /** @internal */
2991
+ export const DuplicateAgentTeamOfAgents$inboundSchema: z.ZodType<
2992
+ DuplicateAgentTeamOfAgents,
2993
+ z.ZodTypeDef,
2994
+ unknown
2995
+ > = z.object({
2996
+ key: z.string(),
2997
+ role: z.string().optional(),
2998
+ });
2999
+ /** @internal */
3000
+ export type DuplicateAgentTeamOfAgents$Outbound = {
3001
+ key: string;
3002
+ role?: string | undefined;
3003
+ };
3004
+
3005
+ /** @internal */
3006
+ export const DuplicateAgentTeamOfAgents$outboundSchema: z.ZodType<
3007
+ DuplicateAgentTeamOfAgents$Outbound,
3008
+ z.ZodTypeDef,
3009
+ DuplicateAgentTeamOfAgents
3010
+ > = z.object({
3011
+ key: z.string(),
3012
+ role: z.string().optional(),
3013
+ });
3014
+
3015
+ export function duplicateAgentTeamOfAgentsToJSON(
3016
+ duplicateAgentTeamOfAgents: DuplicateAgentTeamOfAgents,
3017
+ ): string {
3018
+ return JSON.stringify(
3019
+ DuplicateAgentTeamOfAgents$outboundSchema.parse(duplicateAgentTeamOfAgents),
3020
+ );
3021
+ }
3022
+ export function duplicateAgentTeamOfAgentsFromJSON(
3023
+ jsonString: string,
3024
+ ): SafeParseResult<DuplicateAgentTeamOfAgents, SDKValidationError> {
3025
+ return safeParse(
3026
+ jsonString,
3027
+ (x) => DuplicateAgentTeamOfAgents$inboundSchema.parse(JSON.parse(x)),
3028
+ `Failed to parse 'DuplicateAgentTeamOfAgents' from JSON`,
3029
+ );
3030
+ }
3031
+
3032
+ /** @internal */
3033
+ export const DuplicateAgentMetrics$inboundSchema: z.ZodType<
3034
+ DuplicateAgentMetrics,
3035
+ z.ZodTypeDef,
3036
+ unknown
3037
+ > = z.object({
3038
+ total_cost: z.number().default(0),
3039
+ }).transform((v) => {
3040
+ return remap$(v, {
3041
+ "total_cost": "totalCost",
3042
+ });
3043
+ });
3044
+ /** @internal */
3045
+ export type DuplicateAgentMetrics$Outbound = {
3046
+ total_cost: number;
3047
+ };
3048
+
3049
+ /** @internal */
3050
+ export const DuplicateAgentMetrics$outboundSchema: z.ZodType<
3051
+ DuplicateAgentMetrics$Outbound,
3052
+ z.ZodTypeDef,
3053
+ DuplicateAgentMetrics
3054
+ > = z.object({
3055
+ totalCost: z.number().default(0),
3056
+ }).transform((v) => {
3057
+ return remap$(v, {
3058
+ totalCost: "total_cost",
3059
+ });
3060
+ });
3061
+
3062
+ export function duplicateAgentMetricsToJSON(
3063
+ duplicateAgentMetrics: DuplicateAgentMetrics,
3064
+ ): string {
3065
+ return JSON.stringify(
3066
+ DuplicateAgentMetrics$outboundSchema.parse(duplicateAgentMetrics),
3067
+ );
3068
+ }
3069
+ export function duplicateAgentMetricsFromJSON(
3070
+ jsonString: string,
3071
+ ): SafeParseResult<DuplicateAgentMetrics, SDKValidationError> {
3072
+ return safeParse(
3073
+ jsonString,
3074
+ (x) => DuplicateAgentMetrics$inboundSchema.parse(JSON.parse(x)),
3075
+ `Failed to parse 'DuplicateAgentMetrics' from JSON`,
3076
+ );
3077
+ }
3078
+
3079
+ /** @internal */
3080
+ export const DuplicateAgentKnowledgeBases$inboundSchema: z.ZodType<
3081
+ DuplicateAgentKnowledgeBases,
3082
+ z.ZodTypeDef,
3083
+ unknown
3084
+ > = z.object({
3085
+ knowledge_id: z.string(),
3086
+ }).transform((v) => {
3087
+ return remap$(v, {
3088
+ "knowledge_id": "knowledgeId",
3089
+ });
3090
+ });
3091
+ /** @internal */
3092
+ export type DuplicateAgentKnowledgeBases$Outbound = {
3093
+ knowledge_id: string;
3094
+ };
3095
+
3096
+ /** @internal */
3097
+ export const DuplicateAgentKnowledgeBases$outboundSchema: z.ZodType<
3098
+ DuplicateAgentKnowledgeBases$Outbound,
3099
+ z.ZodTypeDef,
3100
+ DuplicateAgentKnowledgeBases
3101
+ > = z.object({
3102
+ knowledgeId: z.string(),
3103
+ }).transform((v) => {
3104
+ return remap$(v, {
3105
+ knowledgeId: "knowledge_id",
3106
+ });
3107
+ });
3108
+
3109
+ export function duplicateAgentKnowledgeBasesToJSON(
3110
+ duplicateAgentKnowledgeBases: DuplicateAgentKnowledgeBases,
3111
+ ): string {
3112
+ return JSON.stringify(
3113
+ DuplicateAgentKnowledgeBases$outboundSchema.parse(
3114
+ duplicateAgentKnowledgeBases,
3115
+ ),
3116
+ );
3117
+ }
3118
+ export function duplicateAgentKnowledgeBasesFromJSON(
3119
+ jsonString: string,
3120
+ ): SafeParseResult<DuplicateAgentKnowledgeBases, SDKValidationError> {
3121
+ return safeParse(
3122
+ jsonString,
3123
+ (x) => DuplicateAgentKnowledgeBases$inboundSchema.parse(JSON.parse(x)),
3124
+ `Failed to parse 'DuplicateAgentKnowledgeBases' from JSON`,
3125
+ );
3126
+ }
3127
+
3128
+ /** @internal */
3129
+ export const DuplicateAgentCollapsedConfigurationSections$inboundSchema:
3130
+ z.ZodNativeEnum<typeof DuplicateAgentCollapsedConfigurationSections> = z
3131
+ .nativeEnum(DuplicateAgentCollapsedConfigurationSections);
3132
+ /** @internal */
3133
+ export const DuplicateAgentCollapsedConfigurationSections$outboundSchema:
3134
+ z.ZodNativeEnum<typeof DuplicateAgentCollapsedConfigurationSections> =
3135
+ DuplicateAgentCollapsedConfigurationSections$inboundSchema;
3136
+
3137
+ /** @internal */
3138
+ export const DuplicateAgentResponseBody$inboundSchema: z.ZodType<
3139
+ DuplicateAgentResponseBody,
3140
+ z.ZodTypeDef,
3141
+ unknown
3142
+ > = z.object({
3143
+ _id: z.string(),
3144
+ key: z.string(),
3145
+ workspace_id: z.string(),
3146
+ project_id: z.string(),
3147
+ created_by_id: z.nullable(z.string()).optional(),
3148
+ updated_by_id: z.nullable(z.string()).optional(),
3149
+ created: z.string().optional(),
3150
+ updated: z.string().optional(),
3151
+ role: z.string(),
3152
+ description: z.string(),
3153
+ system_prompt: z.string().optional(),
3154
+ instructions: z.string(),
3155
+ status: DuplicateAgentStatus$inboundSchema,
3156
+ settings: z.lazy(() => DuplicateAgentSettings$inboundSchema).optional(),
3157
+ model: z.lazy(() => DuplicateAgentModel$inboundSchema),
3158
+ version_hash: z.string().optional(),
3159
+ path: z.string(),
3160
+ memory_stores: z.array(z.string()),
3161
+ team_of_agents: z.array(
3162
+ z.lazy(() => DuplicateAgentTeamOfAgents$inboundSchema),
3163
+ ),
3164
+ metrics: z.lazy(() => DuplicateAgentMetrics$inboundSchema).optional(),
3165
+ variables: z.record(z.any()).optional(),
3166
+ knowledge_bases: z.array(
3167
+ z.lazy(() => DuplicateAgentKnowledgeBases$inboundSchema),
3168
+ ).optional(),
3169
+ collapsed_configuration_sections: z.array(
3170
+ DuplicateAgentCollapsedConfigurationSections$inboundSchema,
3171
+ ).optional(),
3172
+ }).transform((v) => {
3173
+ return remap$(v, {
3174
+ "_id": "id",
3175
+ "workspace_id": "workspaceId",
3176
+ "project_id": "projectId",
3177
+ "created_by_id": "createdById",
3178
+ "updated_by_id": "updatedById",
3179
+ "system_prompt": "systemPrompt",
3180
+ "version_hash": "versionHash",
3181
+ "memory_stores": "memoryStores",
3182
+ "team_of_agents": "teamOfAgents",
3183
+ "knowledge_bases": "knowledgeBases",
3184
+ "collapsed_configuration_sections": "collapsedConfigurationSections",
3185
+ });
3186
+ });
3187
+ /** @internal */
3188
+ export type DuplicateAgentResponseBody$Outbound = {
3189
+ _id: string;
3190
+ key: string;
3191
+ workspace_id: string;
3192
+ project_id: string;
3193
+ created_by_id?: string | null | undefined;
3194
+ updated_by_id?: string | null | undefined;
3195
+ created?: string | undefined;
3196
+ updated?: string | undefined;
3197
+ role: string;
3198
+ description: string;
3199
+ system_prompt?: string | undefined;
3200
+ instructions: string;
3201
+ status: string;
3202
+ settings?: DuplicateAgentSettings$Outbound | undefined;
3203
+ model: DuplicateAgentModel$Outbound;
3204
+ version_hash?: string | undefined;
3205
+ path: string;
3206
+ memory_stores: Array<string>;
3207
+ team_of_agents: Array<DuplicateAgentTeamOfAgents$Outbound>;
3208
+ metrics?: DuplicateAgentMetrics$Outbound | undefined;
3209
+ variables?: { [k: string]: any } | undefined;
3210
+ knowledge_bases?: Array<DuplicateAgentKnowledgeBases$Outbound> | undefined;
3211
+ collapsed_configuration_sections?: Array<string> | undefined;
3212
+ };
3213
+
3214
+ /** @internal */
3215
+ export const DuplicateAgentResponseBody$outboundSchema: z.ZodType<
3216
+ DuplicateAgentResponseBody$Outbound,
3217
+ z.ZodTypeDef,
3218
+ DuplicateAgentResponseBody
3219
+ > = z.object({
3220
+ id: z.string(),
3221
+ key: z.string(),
3222
+ workspaceId: z.string(),
3223
+ projectId: z.string(),
3224
+ createdById: z.nullable(z.string()).optional(),
3225
+ updatedById: z.nullable(z.string()).optional(),
3226
+ created: z.string().optional(),
3227
+ updated: z.string().optional(),
3228
+ role: z.string(),
3229
+ description: z.string(),
3230
+ systemPrompt: z.string().optional(),
3231
+ instructions: z.string(),
3232
+ status: DuplicateAgentStatus$outboundSchema,
3233
+ settings: z.lazy(() => DuplicateAgentSettings$outboundSchema).optional(),
3234
+ model: z.lazy(() => DuplicateAgentModel$outboundSchema),
3235
+ versionHash: z.string().optional(),
3236
+ path: z.string(),
3237
+ memoryStores: z.array(z.string()),
3238
+ teamOfAgents: z.array(
3239
+ z.lazy(() => DuplicateAgentTeamOfAgents$outboundSchema),
3240
+ ),
3241
+ metrics: z.lazy(() => DuplicateAgentMetrics$outboundSchema).optional(),
3242
+ variables: z.record(z.any()).optional(),
3243
+ knowledgeBases: z.array(
3244
+ z.lazy(() => DuplicateAgentKnowledgeBases$outboundSchema),
3245
+ ).optional(),
3246
+ collapsedConfigurationSections: z.array(
3247
+ DuplicateAgentCollapsedConfigurationSections$outboundSchema,
3248
+ ).optional(),
3249
+ }).transform((v) => {
3250
+ return remap$(v, {
3251
+ id: "_id",
3252
+ workspaceId: "workspace_id",
3253
+ projectId: "project_id",
3254
+ createdById: "created_by_id",
3255
+ updatedById: "updated_by_id",
3256
+ systemPrompt: "system_prompt",
3257
+ versionHash: "version_hash",
3258
+ memoryStores: "memory_stores",
3259
+ teamOfAgents: "team_of_agents",
3260
+ knowledgeBases: "knowledge_bases",
3261
+ collapsedConfigurationSections: "collapsed_configuration_sections",
3262
+ });
3263
+ });
3264
+
3265
+ export function duplicateAgentResponseBodyToJSON(
3266
+ duplicateAgentResponseBody: DuplicateAgentResponseBody,
3267
+ ): string {
3268
+ return JSON.stringify(
3269
+ DuplicateAgentResponseBody$outboundSchema.parse(duplicateAgentResponseBody),
3270
+ );
3271
+ }
3272
+ export function duplicateAgentResponseBodyFromJSON(
3273
+ jsonString: string,
3274
+ ): SafeParseResult<DuplicateAgentResponseBody, SDKValidationError> {
3275
+ return safeParse(
3276
+ jsonString,
3277
+ (x) => DuplicateAgentResponseBody$inboundSchema.parse(JSON.parse(x)),
3278
+ `Failed to parse 'DuplicateAgentResponseBody' from JSON`,
3279
+ );
3280
+ }