@orq-ai/node 1.31.1 → 1.31.11

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 +17 -45
  2. package/lib/config.d.ts +3 -3
  3. package/lib/config.js +3 -3
  4. package/lib/config.js.map +1 -1
  5. package/models/errors/index.d.ts +0 -1
  6. package/models/errors/index.d.ts.map +1 -1
  7. package/models/errors/index.js +0 -1
  8. package/models/errors/index.js.map +1 -1
  9. package/models/operations/bulkfileupload.js +2 -2
  10. package/models/operations/createcontact.js +2 -2
  11. package/models/operations/deploymentgetconfig.d.ts +96 -96
  12. package/models/operations/deploymentgetconfig.d.ts.map +1 -1
  13. package/models/operations/deploymentgetconfig.js +135 -136
  14. package/models/operations/deploymentgetconfig.js.map +1 -1
  15. package/models/operations/deploymentinvoke.d.ts +49 -46
  16. package/models/operations/deploymentinvoke.d.ts.map +1 -1
  17. package/models/operations/deploymentinvoke.js +63 -61
  18. package/models/operations/deploymentinvoke.js.map +1 -1
  19. package/models/operations/deployments.d.ts +53 -53
  20. package/models/operations/deployments.d.ts.map +1 -1
  21. package/models/operations/deployments.js +67 -66
  22. package/models/operations/deployments.js.map +1 -1
  23. package/models/operations/fileupload.js +2 -2
  24. package/models/operations/index.d.ts +0 -9
  25. package/models/operations/index.d.ts.map +1 -1
  26. package/models/operations/index.js +0 -9
  27. package/models/operations/index.js.map +1 -1
  28. package/package.json +1 -1
  29. package/sdk/sdk.d.ts +0 -6
  30. package/sdk/sdk.d.ts.map +1 -1
  31. package/sdk/sdk.js +0 -10
  32. package/sdk/sdk.js.map +1 -1
  33. package/src/lib/config.ts +3 -3
  34. package/src/models/errors/index.ts +0 -1
  35. package/src/models/operations/bulkfileupload.ts +2 -2
  36. package/src/models/operations/createcontact.ts +2 -2
  37. package/src/models/operations/deploymentgetconfig.ts +188 -255
  38. package/src/models/operations/deploymentinvoke.ts +81 -95
  39. package/src/models/operations/deployments.ts +88 -101
  40. package/src/models/operations/fileupload.ts +2 -2
  41. package/src/models/operations/index.ts +0 -9
  42. package/src/sdk/sdk.ts +0 -12
  43. package/docs/sdks/prompt/README.md +0 -6
  44. package/docs/sdks/prompts/README.md +0 -533
  45. package/docs/sdks/snippets/README.md +0 -84
  46. package/docs/sdks/templates/README.md +0 -80
  47. package/funcs/promptSnippetsFindOne.d.ts +0 -12
  48. package/funcs/promptSnippetsFindOne.d.ts.map +0 -1
  49. package/funcs/promptSnippetsFindOne.js +0 -107
  50. package/funcs/promptSnippetsFindOne.js.map +0 -1
  51. package/funcs/promptTemplatesGetAll.d.ts +0 -12
  52. package/funcs/promptTemplatesGetAll.d.ts.map +0 -1
  53. package/funcs/promptTemplatesGetAll.js +0 -107
  54. package/funcs/promptTemplatesGetAll.js.map +0 -1
  55. package/funcs/promptsCreate.d.ts +0 -12
  56. package/funcs/promptsCreate.d.ts.map +0 -1
  57. package/funcs/promptsCreate.js +0 -104
  58. package/funcs/promptsCreate.js.map +0 -1
  59. package/funcs/promptsCreateVersion.d.ts +0 -12
  60. package/funcs/promptsCreateVersion.d.ts.map +0 -1
  61. package/funcs/promptsCreateVersion.js +0 -108
  62. package/funcs/promptsCreateVersion.js.map +0 -1
  63. package/funcs/promptsDelete.d.ts +0 -12
  64. package/funcs/promptsDelete.d.ts.map +0 -1
  65. package/funcs/promptsDelete.js +0 -108
  66. package/funcs/promptsDelete.js.map +0 -1
  67. package/funcs/promptsDuplicate.d.ts +0 -12
  68. package/funcs/promptsDuplicate.d.ts.map +0 -1
  69. package/funcs/promptsDuplicate.js +0 -108
  70. package/funcs/promptsDuplicate.js.map +0 -1
  71. package/funcs/promptsGetAll.d.ts +0 -12
  72. package/funcs/promptsGetAll.d.ts.map +0 -1
  73. package/funcs/promptsGetAll.js +0 -107
  74. package/funcs/promptsGetAll.js.map +0 -1
  75. package/funcs/promptsGetOne.d.ts +0 -12
  76. package/funcs/promptsGetOne.d.ts.map +0 -1
  77. package/funcs/promptsGetOne.js +0 -108
  78. package/funcs/promptsGetOne.js.map +0 -1
  79. package/funcs/promptsUpdate.d.ts +0 -13
  80. package/funcs/promptsUpdate.d.ts.map +0 -1
  81. package/funcs/promptsUpdate.js +0 -112
  82. package/funcs/promptsUpdate.js.map +0 -1
  83. package/models/errors/updateprompt.d.ts +0 -36
  84. package/models/errors/updateprompt.d.ts.map +0 -1
  85. package/models/errors/updateprompt.js +0 -79
  86. package/models/errors/updateprompt.js.map +0 -1
  87. package/models/operations/createprompt.d.ts +0 -2035
  88. package/models/operations/createprompt.d.ts.map +0 -1
  89. package/models/operations/createprompt.js +0 -1853
  90. package/models/operations/createprompt.js.map +0 -1
  91. package/models/operations/createpromptversion.d.ts +0 -2001
  92. package/models/operations/createpromptversion.d.ts.map +0 -1
  93. package/models/operations/createpromptversion.js +0 -1848
  94. package/models/operations/createpromptversion.js.map +0 -1
  95. package/models/operations/deleteprompt.d.ts +0 -32
  96. package/models/operations/deleteprompt.d.ts.map +0 -1
  97. package/models/operations/deleteprompt.js +0 -69
  98. package/models/operations/deleteprompt.js.map +0 -1
  99. package/models/operations/duplicateprompt.d.ts +0 -32
  100. package/models/operations/duplicateprompt.d.ts.map +0 -1
  101. package/models/operations/duplicateprompt.js +0 -69
  102. package/models/operations/duplicateprompt.js.map +0 -1
  103. package/models/operations/findonepromptsnippet.d.ts +0 -6278
  104. package/models/operations/findonepromptsnippet.d.ts.map +0 -1
  105. package/models/operations/findonepromptsnippet.js +0 -5891
  106. package/models/operations/findonepromptsnippet.js.map +0 -1
  107. package/models/operations/getallprompts.d.ts +0 -6613
  108. package/models/operations/getallprompts.d.ts.map +0 -1
  109. package/models/operations/getallprompts.js +0 -6161
  110. package/models/operations/getallprompts.js.map +0 -1
  111. package/models/operations/getallprompttemplates.d.ts +0 -6607
  112. package/models/operations/getallprompttemplates.d.ts.map +0 -1
  113. package/models/operations/getallprompttemplates.js +0 -6225
  114. package/models/operations/getallprompttemplates.js.map +0 -1
  115. package/models/operations/getoneprompt.d.ts +0 -32
  116. package/models/operations/getoneprompt.d.ts.map +0 -1
  117. package/models/operations/getoneprompt.js +0 -69
  118. package/models/operations/getoneprompt.js.map +0 -1
  119. package/models/operations/updateprompt.d.ts +0 -7251
  120. package/models/operations/updateprompt.d.ts.map +0 -1
  121. package/models/operations/updateprompt.js +0 -6678
  122. package/models/operations/updateprompt.js.map +0 -1
  123. package/sdk/prompt.d.ts +0 -10
  124. package/sdk/prompt.d.ts.map +0 -1
  125. package/sdk/prompt.js +0 -21
  126. package/sdk/prompt.js.map +0 -1
  127. package/sdk/prompts.d.ts +0 -33
  128. package/sdk/prompts.d.ts.map +0 -1
  129. package/sdk/prompts.js +0 -61
  130. package/sdk/prompts.js.map +0 -1
  131. package/sdk/snippets.d.ts +0 -9
  132. package/sdk/snippets.d.ts.map +0 -1
  133. package/sdk/snippets.js +0 -19
  134. package/sdk/snippets.js.map +0 -1
  135. package/sdk/templates.d.ts +0 -9
  136. package/sdk/templates.d.ts.map +0 -1
  137. package/sdk/templates.js +0 -19
  138. package/sdk/templates.js.map +0 -1
  139. package/src/funcs/promptSnippetsFindOne.ts +0 -127
  140. package/src/funcs/promptTemplatesGetAll.ts +0 -129
  141. package/src/funcs/promptsCreate.ts +0 -123
  142. package/src/funcs/promptsCreateVersion.ts +0 -128
  143. package/src/funcs/promptsDelete.ts +0 -127
  144. package/src/funcs/promptsDuplicate.ts +0 -127
  145. package/src/funcs/promptsGetAll.ts +0 -127
  146. package/src/funcs/promptsGetOne.ts +0 -127
  147. package/src/funcs/promptsUpdate.ts +0 -135
  148. package/src/models/errors/updateprompt.ts +0 -71
  149. package/src/models/operations/createprompt.ts +0 -3455
  150. package/src/models/operations/createpromptversion.ts +0 -3697
  151. package/src/models/operations/deleteprompt.ts +0 -69
  152. package/src/models/operations/duplicateprompt.ts +0 -69
  153. package/src/models/operations/findonepromptsnippet.ts +0 -13629
  154. package/src/models/operations/getallprompts.ts +0 -13390
  155. package/src/models/operations/getallprompttemplates.ts +0 -13690
  156. package/src/models/operations/getoneprompt.ts +0 -69
  157. package/src/models/operations/updateprompt.ts +0 -14407
  158. package/src/sdk/prompt.ts +0 -19
  159. package/src/sdk/prompts.ts +0 -114
  160. package/src/sdk/snippets.ts +0 -24
  161. package/src/sdk/templates.ts +0 -24
@@ -1,3455 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- */
4
-
5
- import * as z from "zod";
6
- import { remap as remap$ } from "../../lib/primitives.js";
7
- import { safeParse } from "../../lib/schemas.js";
8
- import { ClosedEnum } from "../../types/enums.js";
9
- import { Result as SafeParseResult } from "../../types/fp.js";
10
- import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
-
12
- /**
13
- * The type of the model
14
- */
15
- export const ModelType = {
16
- Chat: "chat",
17
- Completion: "completion",
18
- Embedding: "embedding",
19
- Vision: "vision",
20
- Image: "image",
21
- Tts: "tts",
22
- Stt: "stt",
23
- Rerank: "rerank",
24
- Moderations: "moderations",
25
- } as const;
26
- /**
27
- * The type of the model
28
- */
29
- export type ModelType = ClosedEnum<typeof ModelType>;
30
-
31
- /**
32
- * Only supported on `image` models.
33
- */
34
- export const Format = {
35
- Url: "url",
36
- B64Json: "b64_json",
37
- Text: "text",
38
- JsonObject: "json_object",
39
- } as const;
40
- /**
41
- * Only supported on `image` models.
42
- */
43
- export type Format = ClosedEnum<typeof Format>;
44
-
45
- /**
46
- * Only supported on `image` models.
47
- */
48
- export const Quality = {
49
- Standard: "standard",
50
- Hd: "hd",
51
- } as const;
52
- /**
53
- * Only supported on `image` models.
54
- */
55
- export type Quality = ClosedEnum<typeof Quality>;
56
-
57
- export const CreatePromptResponseFormatType = {
58
- JsonObject: "json_object",
59
- } as const;
60
- export type CreatePromptResponseFormatType = ClosedEnum<
61
- typeof CreatePromptResponseFormatType
62
- >;
63
-
64
- export type ResponseFormat2 = {
65
- type: CreatePromptResponseFormatType;
66
- };
67
-
68
- export const ResponseFormatType = {
69
- JsonSchema: "json_schema",
70
- } as const;
71
- export type ResponseFormatType = ClosedEnum<typeof ResponseFormatType>;
72
-
73
- export type JsonSchema = {
74
- name: string;
75
- strict: boolean;
76
- schema: { [k: string]: any };
77
- };
78
-
79
- export type ResponseFormat1 = {
80
- type: ResponseFormatType;
81
- jsonSchema: JsonSchema;
82
- };
83
-
84
- /**
85
- * An object specifying the format that the model must output.
86
- *
87
- * @remarks
88
- *
89
- * Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema
90
- *
91
- * Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON.
92
- *
93
- * Important: when using JSON mode, you must also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if finish_reason="length", which indicates the generation exceeded max_tokens or the conversation exceeded the max context length.
94
- */
95
- export type ResponseFormat = ResponseFormat2 | ResponseFormat1;
96
-
97
- /**
98
- * The version of photoReal to use. Must be v1 or v2. Only available for `leonardoai` provider
99
- */
100
- export const PhotoRealVersion = {
101
- V1: "v1",
102
- V2: "v2",
103
- } as const;
104
- /**
105
- * The version of photoReal to use. Must be v1 or v2. Only available for `leonardoai` provider
106
- */
107
- export type PhotoRealVersion = ClosedEnum<typeof PhotoRealVersion>;
108
-
109
- /**
110
- * The format to return the embeddings
111
- */
112
- export const EncodingFormat = {
113
- Float: "float",
114
- Base64: "base64",
115
- } as const;
116
- /**
117
- * The format to return the embeddings
118
- */
119
- export type EncodingFormat = ClosedEnum<typeof EncodingFormat>;
120
-
121
- /**
122
- * Model Parameters: Not all parameters apply to every model
123
- */
124
- export type ModelParameters = {
125
- /**
126
- * Only supported on `chat` and `completion` models.
127
- */
128
- temperature?: number | undefined;
129
- /**
130
- * Only supported on `chat` and `completion` models.
131
- */
132
- maxTokens?: number | undefined;
133
- /**
134
- * Only supported on `chat` and `completion` models.
135
- */
136
- topK?: number | undefined;
137
- /**
138
- * Only supported on `chat` and `completion` models.
139
- */
140
- topP?: number | undefined;
141
- /**
142
- * Only supported on `chat` and `completion` models.
143
- */
144
- frequencyPenalty?: number | undefined;
145
- /**
146
- * Only supported on `chat` and `completion` models.
147
- */
148
- presencePenalty?: number | undefined;
149
- /**
150
- * Only supported on `image` models.
151
- */
152
- numImages?: number | undefined;
153
- /**
154
- * Best effort deterministic seed for the model. Currently only OpenAI models support these
155
- */
156
- seed?: number | undefined;
157
- /**
158
- * Only supported on `image` models.
159
- */
160
- format?: Format | undefined;
161
- /**
162
- * Only supported on `image` models.
163
- */
164
- dimensions?: string | undefined;
165
- /**
166
- * Only supported on `image` models.
167
- */
168
- quality?: Quality | undefined;
169
- /**
170
- * Only supported on `image` models.
171
- */
172
- style?: string | undefined;
173
- /**
174
- * An object specifying the format that the model must output.
175
- *
176
- * @remarks
177
- *
178
- * Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema
179
- *
180
- * Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON.
181
- *
182
- * Important: when using JSON mode, you must also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if finish_reason="length", which indicates the generation exceeded max_tokens or the conversation exceeded the max context length.
183
- */
184
- responseFormat?: ResponseFormat2 | ResponseFormat1 | null | undefined;
185
- /**
186
- * The version of photoReal to use. Must be v1 or v2. Only available for `leonardoai` provider
187
- */
188
- photoRealVersion?: PhotoRealVersion | undefined;
189
- /**
190
- * The format to return the embeddings
191
- */
192
- encodingFormat?: EncodingFormat | undefined;
193
- };
194
-
195
- export const Provider = {
196
- Cohere: "cohere",
197
- Openai: "openai",
198
- Anthropic: "anthropic",
199
- Huggingface: "huggingface",
200
- Replicate: "replicate",
201
- Google: "google",
202
- GoogleAi: "google-ai",
203
- Azure: "azure",
204
- Aws: "aws",
205
- Anyscale: "anyscale",
206
- Perplexity: "perplexity",
207
- Groq: "groq",
208
- Fal: "fal",
209
- Leonardoai: "leonardoai",
210
- Nvidia: "nvidia",
211
- Jina: "jina",
212
- } as const;
213
- export type Provider = ClosedEnum<typeof Provider>;
214
-
215
- /**
216
- * The role of the prompt message
217
- */
218
- export const CreatePromptRole = {
219
- System: "system",
220
- Assistant: "assistant",
221
- User: "user",
222
- Exception: "exception",
223
- Tool: "tool",
224
- Prompt: "prompt",
225
- Correction: "correction",
226
- ExpectedOutput: "expected_output",
227
- } as const;
228
- /**
229
- * The role of the prompt message
230
- */
231
- export type CreatePromptRole = ClosedEnum<typeof CreatePromptRole>;
232
-
233
- export const CreatePrompt2PromptsType = {
234
- ImageUrl: "image_url",
235
- } as const;
236
- export type CreatePrompt2PromptsType = ClosedEnum<
237
- typeof CreatePrompt2PromptsType
238
- >;
239
-
240
- export type CreatePrompt2ImageUrl = {
241
- /**
242
- * Either a URL of the image or the base64 encoded data URI.
243
- */
244
- url: string;
245
- /**
246
- * Specifies the detail level of the image. Currently only supported with OpenAI models
247
- */
248
- detail?: string | undefined;
249
- };
250
-
251
- /**
252
- * The image part of the prompt message. Only supported with vision models.
253
- */
254
- export type CreatePrompt22 = {
255
- type: CreatePrompt2PromptsType;
256
- imageUrl: CreatePrompt2ImageUrl;
257
- };
258
-
259
- export const CreatePrompt2Type = {
260
- Text: "text",
261
- } as const;
262
- export type CreatePrompt2Type = ClosedEnum<typeof CreatePrompt2Type>;
263
-
264
- /**
265
- * Text content part of a prompt message
266
- */
267
- export type CreatePrompt21 = {
268
- type: CreatePrompt2Type;
269
- text: string;
270
- };
271
-
272
- export type CreatePromptContent2 = CreatePrompt21 | CreatePrompt22;
273
-
274
- /**
275
- * The contents of the user message. Either the text content of the message or an array of content parts with a defined type, each can be of type `text` or `image_url` when passing in images. You can pass multiple images by adding multiple `image_url` content parts.
276
- */
277
- export type CreatePromptContent =
278
- | string
279
- | Array<CreatePrompt21 | CreatePrompt22>;
280
-
281
- export const CreatePromptType = {
282
- Function: "function",
283
- } as const;
284
- export type CreatePromptType = ClosedEnum<typeof CreatePromptType>;
285
-
286
- export type CreatePromptFunction = {
287
- name: string;
288
- /**
289
- * JSON string arguments for the functions
290
- */
291
- arguments: string;
292
- };
293
-
294
- export type CreatePromptToolCalls = {
295
- id?: string | undefined;
296
- index?: number | undefined;
297
- type: CreatePromptType;
298
- function: CreatePromptFunction;
299
- };
300
-
301
- export type CreatePromptMessages = {
302
- /**
303
- * The role of the prompt message
304
- */
305
- role: CreatePromptRole;
306
- /**
307
- * The contents of the user message. Either the text content of the message or an array of content parts with a defined type, each can be of type `text` or `image_url` when passing in images. You can pass multiple images by adding multiple `image_url` content parts.
308
- */
309
- content: string | Array<CreatePrompt21 | CreatePrompt22>;
310
- toolCalls?: Array<CreatePromptToolCalls> | undefined;
311
- };
312
-
313
- export type PromptConfig = {
314
- stream?: boolean | undefined;
315
- model?: string | undefined;
316
- /**
317
- * The type of the model
318
- */
319
- modelType?: ModelType | undefined;
320
- /**
321
- * Model Parameters: Not all parameters apply to every model
322
- */
323
- modelParameters?: ModelParameters | undefined;
324
- provider?: Provider | undefined;
325
- version?: string | undefined;
326
- messages: Array<CreatePromptMessages>;
327
- };
328
-
329
- export type Metadata = {
330
- useCases?: Array<string> | undefined;
331
- language?: string | undefined;
332
- };
333
-
334
- export const CreatePromptPromptsType = {
335
- Prompt: "prompt",
336
- Snippet: "snippet",
337
- Template: "template",
338
- } as const;
339
- export type CreatePromptPromptsType = ClosedEnum<
340
- typeof CreatePromptPromptsType
341
- >;
342
-
343
- export type CreatePromptRequestBody = {
344
- displayName: string;
345
- description?: string | null | undefined;
346
- promptConfig?: PromptConfig | undefined;
347
- metadata?: Metadata | undefined;
348
- key?: string | undefined;
349
- type: CreatePromptPromptsType;
350
- };
351
-
352
- /**
353
- * The type of the model
354
- */
355
- export const CreatePromptModelType = {
356
- Chat: "chat",
357
- Completion: "completion",
358
- Embedding: "embedding",
359
- Vision: "vision",
360
- Image: "image",
361
- Tts: "tts",
362
- Stt: "stt",
363
- Rerank: "rerank",
364
- Moderations: "moderations",
365
- } as const;
366
- /**
367
- * The type of the model
368
- */
369
- export type CreatePromptModelType = ClosedEnum<typeof CreatePromptModelType>;
370
-
371
- /**
372
- * Only supported on `image` models.
373
- */
374
- export const CreatePromptFormat = {
375
- Url: "url",
376
- B64Json: "b64_json",
377
- Text: "text",
378
- JsonObject: "json_object",
379
- } as const;
380
- /**
381
- * Only supported on `image` models.
382
- */
383
- export type CreatePromptFormat = ClosedEnum<typeof CreatePromptFormat>;
384
-
385
- /**
386
- * Only supported on `image` models.
387
- */
388
- export const CreatePromptQuality = {
389
- Standard: "standard",
390
- Hd: "hd",
391
- } as const;
392
- /**
393
- * Only supported on `image` models.
394
- */
395
- export type CreatePromptQuality = ClosedEnum<typeof CreatePromptQuality>;
396
-
397
- export const CreatePromptResponseFormatPromptsResponseType = {
398
- JsonObject: "json_object",
399
- } as const;
400
- export type CreatePromptResponseFormatPromptsResponseType = ClosedEnum<
401
- typeof CreatePromptResponseFormatPromptsResponseType
402
- >;
403
-
404
- export type CreatePromptResponseFormat2 = {
405
- type: CreatePromptResponseFormatPromptsResponseType;
406
- };
407
-
408
- export const CreatePromptResponseFormatPromptsType = {
409
- JsonSchema: "json_schema",
410
- } as const;
411
- export type CreatePromptResponseFormatPromptsType = ClosedEnum<
412
- typeof CreatePromptResponseFormatPromptsType
413
- >;
414
-
415
- export type CreatePromptResponseFormatJsonSchema = {
416
- name: string;
417
- strict: boolean;
418
- schema: { [k: string]: any };
419
- };
420
-
421
- export type CreatePromptResponseFormat1 = {
422
- type: CreatePromptResponseFormatPromptsType;
423
- jsonSchema: CreatePromptResponseFormatJsonSchema;
424
- };
425
-
426
- /**
427
- * An object specifying the format that the model must output.
428
- *
429
- * @remarks
430
- *
431
- * Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema
432
- *
433
- * Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON.
434
- *
435
- * Important: when using JSON mode, you must also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if finish_reason="length", which indicates the generation exceeded max_tokens or the conversation exceeded the max context length.
436
- */
437
- export type CreatePromptResponseFormat =
438
- | CreatePromptResponseFormat2
439
- | CreatePromptResponseFormat1;
440
-
441
- /**
442
- * The version of photoReal to use. Must be v1 or v2. Only available for `leonardoai` provider
443
- */
444
- export const CreatePromptPhotoRealVersion = {
445
- V1: "v1",
446
- V2: "v2",
447
- } as const;
448
- /**
449
- * The version of photoReal to use. Must be v1 or v2. Only available for `leonardoai` provider
450
- */
451
- export type CreatePromptPhotoRealVersion = ClosedEnum<
452
- typeof CreatePromptPhotoRealVersion
453
- >;
454
-
455
- /**
456
- * The format to return the embeddings
457
- */
458
- export const CreatePromptEncodingFormat = {
459
- Float: "float",
460
- Base64: "base64",
461
- } as const;
462
- /**
463
- * The format to return the embeddings
464
- */
465
- export type CreatePromptEncodingFormat = ClosedEnum<
466
- typeof CreatePromptEncodingFormat
467
- >;
468
-
469
- /**
470
- * Model Parameters: Not all parameters apply to every model
471
- */
472
- export type CreatePromptModelParameters = {
473
- /**
474
- * Only supported on `chat` and `completion` models.
475
- */
476
- temperature?: number | undefined;
477
- /**
478
- * Only supported on `chat` and `completion` models.
479
- */
480
- maxTokens?: number | undefined;
481
- /**
482
- * Only supported on `chat` and `completion` models.
483
- */
484
- topK?: number | undefined;
485
- /**
486
- * Only supported on `chat` and `completion` models.
487
- */
488
- topP?: number | undefined;
489
- /**
490
- * Only supported on `chat` and `completion` models.
491
- */
492
- frequencyPenalty?: number | undefined;
493
- /**
494
- * Only supported on `chat` and `completion` models.
495
- */
496
- presencePenalty?: number | undefined;
497
- /**
498
- * Only supported on `image` models.
499
- */
500
- numImages?: number | undefined;
501
- /**
502
- * Best effort deterministic seed for the model. Currently only OpenAI models support these
503
- */
504
- seed?: number | undefined;
505
- /**
506
- * Only supported on `image` models.
507
- */
508
- format?: CreatePromptFormat | undefined;
509
- /**
510
- * Only supported on `image` models.
511
- */
512
- dimensions?: string | undefined;
513
- /**
514
- * Only supported on `image` models.
515
- */
516
- quality?: CreatePromptQuality | undefined;
517
- /**
518
- * Only supported on `image` models.
519
- */
520
- style?: string | undefined;
521
- /**
522
- * An object specifying the format that the model must output.
523
- *
524
- * @remarks
525
- *
526
- * Setting to `{ "type": "json_schema", "json_schema": {...} }` enables Structured Outputs which ensures the model will match your supplied JSON schema
527
- *
528
- * Setting to `{ "type": "json_object" }` enables JSON mode, which ensures the message the model generates is valid JSON.
529
- *
530
- * Important: when using JSON mode, you must also instruct the model to produce JSON yourself via a system or user message. Without this, the model may generate an unending stream of whitespace until the generation reaches the token limit, resulting in a long-running and seemingly "stuck" request. Also note that the message content may be partially cut off if finish_reason="length", which indicates the generation exceeded max_tokens or the conversation exceeded the max context length.
531
- */
532
- responseFormat?:
533
- | CreatePromptResponseFormat2
534
- | CreatePromptResponseFormat1
535
- | null
536
- | undefined;
537
- /**
538
- * The version of photoReal to use. Must be v1 or v2. Only available for `leonardoai` provider
539
- */
540
- photoRealVersion?: CreatePromptPhotoRealVersion | undefined;
541
- /**
542
- * The format to return the embeddings
543
- */
544
- encodingFormat?: CreatePromptEncodingFormat | undefined;
545
- };
546
-
547
- export const CreatePromptProvider = {
548
- Cohere: "cohere",
549
- Openai: "openai",
550
- Anthropic: "anthropic",
551
- Huggingface: "huggingface",
552
- Replicate: "replicate",
553
- Google: "google",
554
- GoogleAi: "google-ai",
555
- Azure: "azure",
556
- Aws: "aws",
557
- Anyscale: "anyscale",
558
- Perplexity: "perplexity",
559
- Groq: "groq",
560
- Fal: "fal",
561
- Leonardoai: "leonardoai",
562
- Nvidia: "nvidia",
563
- Jina: "jina",
564
- } as const;
565
- export type CreatePromptProvider = ClosedEnum<typeof CreatePromptProvider>;
566
-
567
- /**
568
- * The role of the prompt message
569
- */
570
- export const CreatePromptPromptsRole = {
571
- System: "system",
572
- Assistant: "assistant",
573
- User: "user",
574
- Exception: "exception",
575
- Tool: "tool",
576
- Prompt: "prompt",
577
- Correction: "correction",
578
- ExpectedOutput: "expected_output",
579
- } as const;
580
- /**
581
- * The role of the prompt message
582
- */
583
- export type CreatePromptPromptsRole = ClosedEnum<
584
- typeof CreatePromptPromptsRole
585
- >;
586
-
587
- export const CreatePrompt2PromptsResponse200Type = {
588
- ImageUrl: "image_url",
589
- } as const;
590
- export type CreatePrompt2PromptsResponse200Type = ClosedEnum<
591
- typeof CreatePrompt2PromptsResponse200Type
592
- >;
593
-
594
- export type CreatePrompt2PromptsImageUrl = {
595
- /**
596
- * The orq.ai id of the image
597
- */
598
- id?: string | undefined;
599
- /**
600
- * Either a URL of the image or the base64 encoded data URI.
601
- */
602
- url: string;
603
- /**
604
- * Specifies the detail level of the image. Currently only supported with OpenAI models
605
- */
606
- detail?: string | undefined;
607
- };
608
-
609
- /**
610
- * The image part of the prompt message. Only supported with vision models.
611
- */
612
- export type CreatePrompt2Prompts2 = {
613
- type: CreatePrompt2PromptsResponse200Type;
614
- imageUrl: CreatePrompt2PromptsImageUrl;
615
- };
616
-
617
- export const CreatePrompt2PromptsResponseType = {
618
- Text: "text",
619
- } as const;
620
- export type CreatePrompt2PromptsResponseType = ClosedEnum<
621
- typeof CreatePrompt2PromptsResponseType
622
- >;
623
-
624
- /**
625
- * Text content part of a prompt message
626
- */
627
- export type CreatePrompt2Prompts1 = {
628
- type: CreatePrompt2PromptsResponseType;
629
- text: string;
630
- };
631
-
632
- export type CreatePromptContentPrompts2 =
633
- | CreatePrompt2Prompts1
634
- | CreatePrompt2Prompts2;
635
-
636
- /**
637
- * The contents of the user message. Either the text content of the message or an array of content parts with a defined type, each can be of type `text` or `image_url` when passing in images. You can pass multiple images by adding multiple `image_url` content parts.
638
- */
639
- export type CreatePromptPromptsContent =
640
- | string
641
- | Array<CreatePrompt2Prompts1 | CreatePrompt2Prompts2>;
642
-
643
- export const CreatePromptPromptsResponse200Type = {
644
- Function: "function",
645
- } as const;
646
- export type CreatePromptPromptsResponse200Type = ClosedEnum<
647
- typeof CreatePromptPromptsResponse200Type
648
- >;
649
-
650
- export type CreatePromptPromptsFunction = {
651
- name: string;
652
- /**
653
- * JSON string arguments for the functions
654
- */
655
- arguments: string;
656
- };
657
-
658
- export type CreatePromptPromptsToolCalls = {
659
- id?: string | undefined;
660
- index?: number | undefined;
661
- type: CreatePromptPromptsResponse200Type;
662
- function: CreatePromptPromptsFunction;
663
- };
664
-
665
- export type CreatePromptPromptsMessages = {
666
- /**
667
- * The role of the prompt message
668
- */
669
- role: CreatePromptPromptsRole;
670
- /**
671
- * The contents of the user message. Either the text content of the message or an array of content parts with a defined type, each can be of type `text` or `image_url` when passing in images. You can pass multiple images by adding multiple `image_url` content parts.
672
- */
673
- content: string | Array<CreatePrompt2Prompts1 | CreatePrompt2Prompts2>;
674
- toolCalls?: Array<CreatePromptPromptsToolCalls> | undefined;
675
- };
676
-
677
- export type CreatePromptPromptConfig = {
678
- stream?: boolean | undefined;
679
- model?: string | undefined;
680
- /**
681
- * The id of the resource
682
- */
683
- modelDbId?: string | undefined;
684
- /**
685
- * The type of the model
686
- */
687
- modelType?: CreatePromptModelType | undefined;
688
- /**
689
- * Model Parameters: Not all parameters apply to every model
690
- */
691
- modelParameters?: CreatePromptModelParameters | undefined;
692
- provider?: CreatePromptProvider | undefined;
693
- /**
694
- * The id of the resource
695
- */
696
- integrationId?: string | null | undefined;
697
- version?: string | undefined;
698
- messages: Array<CreatePromptPromptsMessages>;
699
- };
700
-
701
- export type CreatePromptMetadata = {
702
- useCases?: Array<string> | undefined;
703
- language?: string | undefined;
704
- };
705
-
706
- export const CreatePromptPromptsResponseType = {
707
- Prompt: "prompt",
708
- Snippet: "snippet",
709
- Template: "template",
710
- } as const;
711
- export type CreatePromptPromptsResponseType = ClosedEnum<
712
- typeof CreatePromptPromptsResponseType
713
- >;
714
-
715
- /**
716
- * Prompt created.
717
- */
718
- export type CreatePromptResponseBody = {
719
- /**
720
- * The id of the resource
721
- */
722
- id: string;
723
- displayName: string;
724
- /**
725
- * The id of the resource
726
- */
727
- domainId: string;
728
- description?: string | null | undefined;
729
- promptConfig?: CreatePromptPromptConfig | undefined;
730
- metadata?: CreatePromptMetadata | undefined;
731
- key?: string | undefined;
732
- type: CreatePromptPromptsResponseType;
733
- };
734
-
735
- /** @internal */
736
- export const ModelType$inboundSchema: z.ZodNativeEnum<typeof ModelType> = z
737
- .nativeEnum(ModelType);
738
-
739
- /** @internal */
740
- export const ModelType$outboundSchema: z.ZodNativeEnum<typeof ModelType> =
741
- ModelType$inboundSchema;
742
-
743
- /**
744
- * @internal
745
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
746
- */
747
- export namespace ModelType$ {
748
- /** @deprecated use `ModelType$inboundSchema` instead. */
749
- export const inboundSchema = ModelType$inboundSchema;
750
- /** @deprecated use `ModelType$outboundSchema` instead. */
751
- export const outboundSchema = ModelType$outboundSchema;
752
- }
753
-
754
- /** @internal */
755
- export const Format$inboundSchema: z.ZodNativeEnum<typeof Format> = z
756
- .nativeEnum(Format);
757
-
758
- /** @internal */
759
- export const Format$outboundSchema: z.ZodNativeEnum<typeof Format> =
760
- Format$inboundSchema;
761
-
762
- /**
763
- * @internal
764
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
765
- */
766
- export namespace Format$ {
767
- /** @deprecated use `Format$inboundSchema` instead. */
768
- export const inboundSchema = Format$inboundSchema;
769
- /** @deprecated use `Format$outboundSchema` instead. */
770
- export const outboundSchema = Format$outboundSchema;
771
- }
772
-
773
- /** @internal */
774
- export const Quality$inboundSchema: z.ZodNativeEnum<typeof Quality> = z
775
- .nativeEnum(Quality);
776
-
777
- /** @internal */
778
- export const Quality$outboundSchema: z.ZodNativeEnum<typeof Quality> =
779
- Quality$inboundSchema;
780
-
781
- /**
782
- * @internal
783
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
784
- */
785
- export namespace Quality$ {
786
- /** @deprecated use `Quality$inboundSchema` instead. */
787
- export const inboundSchema = Quality$inboundSchema;
788
- /** @deprecated use `Quality$outboundSchema` instead. */
789
- export const outboundSchema = Quality$outboundSchema;
790
- }
791
-
792
- /** @internal */
793
- export const CreatePromptResponseFormatType$inboundSchema: z.ZodNativeEnum<
794
- typeof CreatePromptResponseFormatType
795
- > = z.nativeEnum(CreatePromptResponseFormatType);
796
-
797
- /** @internal */
798
- export const CreatePromptResponseFormatType$outboundSchema: z.ZodNativeEnum<
799
- typeof CreatePromptResponseFormatType
800
- > = CreatePromptResponseFormatType$inboundSchema;
801
-
802
- /**
803
- * @internal
804
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
805
- */
806
- export namespace CreatePromptResponseFormatType$ {
807
- /** @deprecated use `CreatePromptResponseFormatType$inboundSchema` instead. */
808
- export const inboundSchema = CreatePromptResponseFormatType$inboundSchema;
809
- /** @deprecated use `CreatePromptResponseFormatType$outboundSchema` instead. */
810
- export const outboundSchema = CreatePromptResponseFormatType$outboundSchema;
811
- }
812
-
813
- /** @internal */
814
- export const ResponseFormat2$inboundSchema: z.ZodType<
815
- ResponseFormat2,
816
- z.ZodTypeDef,
817
- unknown
818
- > = z.object({
819
- type: CreatePromptResponseFormatType$inboundSchema,
820
- });
821
-
822
- /** @internal */
823
- export type ResponseFormat2$Outbound = {
824
- type: string;
825
- };
826
-
827
- /** @internal */
828
- export const ResponseFormat2$outboundSchema: z.ZodType<
829
- ResponseFormat2$Outbound,
830
- z.ZodTypeDef,
831
- ResponseFormat2
832
- > = z.object({
833
- type: CreatePromptResponseFormatType$outboundSchema,
834
- });
835
-
836
- /**
837
- * @internal
838
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
839
- */
840
- export namespace ResponseFormat2$ {
841
- /** @deprecated use `ResponseFormat2$inboundSchema` instead. */
842
- export const inboundSchema = ResponseFormat2$inboundSchema;
843
- /** @deprecated use `ResponseFormat2$outboundSchema` instead. */
844
- export const outboundSchema = ResponseFormat2$outboundSchema;
845
- /** @deprecated use `ResponseFormat2$Outbound` instead. */
846
- export type Outbound = ResponseFormat2$Outbound;
847
- }
848
-
849
- export function responseFormat2ToJSON(
850
- responseFormat2: ResponseFormat2,
851
- ): string {
852
- return JSON.stringify(ResponseFormat2$outboundSchema.parse(responseFormat2));
853
- }
854
-
855
- export function responseFormat2FromJSON(
856
- jsonString: string,
857
- ): SafeParseResult<ResponseFormat2, SDKValidationError> {
858
- return safeParse(
859
- jsonString,
860
- (x) => ResponseFormat2$inboundSchema.parse(JSON.parse(x)),
861
- `Failed to parse 'ResponseFormat2' from JSON`,
862
- );
863
- }
864
-
865
- /** @internal */
866
- export const ResponseFormatType$inboundSchema: z.ZodNativeEnum<
867
- typeof ResponseFormatType
868
- > = z.nativeEnum(ResponseFormatType);
869
-
870
- /** @internal */
871
- export const ResponseFormatType$outboundSchema: z.ZodNativeEnum<
872
- typeof ResponseFormatType
873
- > = ResponseFormatType$inboundSchema;
874
-
875
- /**
876
- * @internal
877
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
878
- */
879
- export namespace ResponseFormatType$ {
880
- /** @deprecated use `ResponseFormatType$inboundSchema` instead. */
881
- export const inboundSchema = ResponseFormatType$inboundSchema;
882
- /** @deprecated use `ResponseFormatType$outboundSchema` instead. */
883
- export const outboundSchema = ResponseFormatType$outboundSchema;
884
- }
885
-
886
- /** @internal */
887
- export const JsonSchema$inboundSchema: z.ZodType<
888
- JsonSchema,
889
- z.ZodTypeDef,
890
- unknown
891
- > = z.object({
892
- name: z.string(),
893
- strict: z.boolean(),
894
- schema: z.record(z.any()),
895
- });
896
-
897
- /** @internal */
898
- export type JsonSchema$Outbound = {
899
- name: string;
900
- strict: boolean;
901
- schema: { [k: string]: any };
902
- };
903
-
904
- /** @internal */
905
- export const JsonSchema$outboundSchema: z.ZodType<
906
- JsonSchema$Outbound,
907
- z.ZodTypeDef,
908
- JsonSchema
909
- > = z.object({
910
- name: z.string(),
911
- strict: z.boolean(),
912
- schema: z.record(z.any()),
913
- });
914
-
915
- /**
916
- * @internal
917
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
918
- */
919
- export namespace JsonSchema$ {
920
- /** @deprecated use `JsonSchema$inboundSchema` instead. */
921
- export const inboundSchema = JsonSchema$inboundSchema;
922
- /** @deprecated use `JsonSchema$outboundSchema` instead. */
923
- export const outboundSchema = JsonSchema$outboundSchema;
924
- /** @deprecated use `JsonSchema$Outbound` instead. */
925
- export type Outbound = JsonSchema$Outbound;
926
- }
927
-
928
- export function jsonSchemaToJSON(jsonSchema: JsonSchema): string {
929
- return JSON.stringify(JsonSchema$outboundSchema.parse(jsonSchema));
930
- }
931
-
932
- export function jsonSchemaFromJSON(
933
- jsonString: string,
934
- ): SafeParseResult<JsonSchema, SDKValidationError> {
935
- return safeParse(
936
- jsonString,
937
- (x) => JsonSchema$inboundSchema.parse(JSON.parse(x)),
938
- `Failed to parse 'JsonSchema' from JSON`,
939
- );
940
- }
941
-
942
- /** @internal */
943
- export const ResponseFormat1$inboundSchema: z.ZodType<
944
- ResponseFormat1,
945
- z.ZodTypeDef,
946
- unknown
947
- > = z.object({
948
- type: ResponseFormatType$inboundSchema,
949
- json_schema: z.lazy(() => JsonSchema$inboundSchema),
950
- }).transform((v) => {
951
- return remap$(v, {
952
- "json_schema": "jsonSchema",
953
- });
954
- });
955
-
956
- /** @internal */
957
- export type ResponseFormat1$Outbound = {
958
- type: string;
959
- json_schema: JsonSchema$Outbound;
960
- };
961
-
962
- /** @internal */
963
- export const ResponseFormat1$outboundSchema: z.ZodType<
964
- ResponseFormat1$Outbound,
965
- z.ZodTypeDef,
966
- ResponseFormat1
967
- > = z.object({
968
- type: ResponseFormatType$outboundSchema,
969
- jsonSchema: z.lazy(() => JsonSchema$outboundSchema),
970
- }).transform((v) => {
971
- return remap$(v, {
972
- jsonSchema: "json_schema",
973
- });
974
- });
975
-
976
- /**
977
- * @internal
978
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
979
- */
980
- export namespace ResponseFormat1$ {
981
- /** @deprecated use `ResponseFormat1$inboundSchema` instead. */
982
- export const inboundSchema = ResponseFormat1$inboundSchema;
983
- /** @deprecated use `ResponseFormat1$outboundSchema` instead. */
984
- export const outboundSchema = ResponseFormat1$outboundSchema;
985
- /** @deprecated use `ResponseFormat1$Outbound` instead. */
986
- export type Outbound = ResponseFormat1$Outbound;
987
- }
988
-
989
- export function responseFormat1ToJSON(
990
- responseFormat1: ResponseFormat1,
991
- ): string {
992
- return JSON.stringify(ResponseFormat1$outboundSchema.parse(responseFormat1));
993
- }
994
-
995
- export function responseFormat1FromJSON(
996
- jsonString: string,
997
- ): SafeParseResult<ResponseFormat1, SDKValidationError> {
998
- return safeParse(
999
- jsonString,
1000
- (x) => ResponseFormat1$inboundSchema.parse(JSON.parse(x)),
1001
- `Failed to parse 'ResponseFormat1' from JSON`,
1002
- );
1003
- }
1004
-
1005
- /** @internal */
1006
- export const ResponseFormat$inboundSchema: z.ZodType<
1007
- ResponseFormat,
1008
- z.ZodTypeDef,
1009
- unknown
1010
- > = z.union([
1011
- z.lazy(() => ResponseFormat2$inboundSchema),
1012
- z.lazy(() => ResponseFormat1$inboundSchema),
1013
- ]);
1014
-
1015
- /** @internal */
1016
- export type ResponseFormat$Outbound =
1017
- | ResponseFormat2$Outbound
1018
- | ResponseFormat1$Outbound;
1019
-
1020
- /** @internal */
1021
- export const ResponseFormat$outboundSchema: z.ZodType<
1022
- ResponseFormat$Outbound,
1023
- z.ZodTypeDef,
1024
- ResponseFormat
1025
- > = z.union([
1026
- z.lazy(() => ResponseFormat2$outboundSchema),
1027
- z.lazy(() => ResponseFormat1$outboundSchema),
1028
- ]);
1029
-
1030
- /**
1031
- * @internal
1032
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1033
- */
1034
- export namespace ResponseFormat$ {
1035
- /** @deprecated use `ResponseFormat$inboundSchema` instead. */
1036
- export const inboundSchema = ResponseFormat$inboundSchema;
1037
- /** @deprecated use `ResponseFormat$outboundSchema` instead. */
1038
- export const outboundSchema = ResponseFormat$outboundSchema;
1039
- /** @deprecated use `ResponseFormat$Outbound` instead. */
1040
- export type Outbound = ResponseFormat$Outbound;
1041
- }
1042
-
1043
- export function responseFormatToJSON(responseFormat: ResponseFormat): string {
1044
- return JSON.stringify(ResponseFormat$outboundSchema.parse(responseFormat));
1045
- }
1046
-
1047
- export function responseFormatFromJSON(
1048
- jsonString: string,
1049
- ): SafeParseResult<ResponseFormat, SDKValidationError> {
1050
- return safeParse(
1051
- jsonString,
1052
- (x) => ResponseFormat$inboundSchema.parse(JSON.parse(x)),
1053
- `Failed to parse 'ResponseFormat' from JSON`,
1054
- );
1055
- }
1056
-
1057
- /** @internal */
1058
- export const PhotoRealVersion$inboundSchema: z.ZodNativeEnum<
1059
- typeof PhotoRealVersion
1060
- > = z.nativeEnum(PhotoRealVersion);
1061
-
1062
- /** @internal */
1063
- export const PhotoRealVersion$outboundSchema: z.ZodNativeEnum<
1064
- typeof PhotoRealVersion
1065
- > = PhotoRealVersion$inboundSchema;
1066
-
1067
- /**
1068
- * @internal
1069
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1070
- */
1071
- export namespace PhotoRealVersion$ {
1072
- /** @deprecated use `PhotoRealVersion$inboundSchema` instead. */
1073
- export const inboundSchema = PhotoRealVersion$inboundSchema;
1074
- /** @deprecated use `PhotoRealVersion$outboundSchema` instead. */
1075
- export const outboundSchema = PhotoRealVersion$outboundSchema;
1076
- }
1077
-
1078
- /** @internal */
1079
- export const EncodingFormat$inboundSchema: z.ZodNativeEnum<
1080
- typeof EncodingFormat
1081
- > = z.nativeEnum(EncodingFormat);
1082
-
1083
- /** @internal */
1084
- export const EncodingFormat$outboundSchema: z.ZodNativeEnum<
1085
- typeof EncodingFormat
1086
- > = EncodingFormat$inboundSchema;
1087
-
1088
- /**
1089
- * @internal
1090
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1091
- */
1092
- export namespace EncodingFormat$ {
1093
- /** @deprecated use `EncodingFormat$inboundSchema` instead. */
1094
- export const inboundSchema = EncodingFormat$inboundSchema;
1095
- /** @deprecated use `EncodingFormat$outboundSchema` instead. */
1096
- export const outboundSchema = EncodingFormat$outboundSchema;
1097
- }
1098
-
1099
- /** @internal */
1100
- export const ModelParameters$inboundSchema: z.ZodType<
1101
- ModelParameters,
1102
- z.ZodTypeDef,
1103
- unknown
1104
- > = z.object({
1105
- temperature: z.number().optional(),
1106
- maxTokens: z.number().optional(),
1107
- topK: z.number().optional(),
1108
- topP: z.number().optional(),
1109
- frequencyPenalty: z.number().optional(),
1110
- presencePenalty: z.number().optional(),
1111
- numImages: z.number().optional(),
1112
- seed: z.number().optional(),
1113
- format: Format$inboundSchema.optional(),
1114
- dimensions: z.string().optional(),
1115
- quality: Quality$inboundSchema.optional(),
1116
- style: z.string().optional(),
1117
- responseFormat: z.nullable(
1118
- z.union([
1119
- z.lazy(() => ResponseFormat2$inboundSchema),
1120
- z.lazy(() => ResponseFormat1$inboundSchema),
1121
- ]),
1122
- ).optional(),
1123
- photoRealVersion: PhotoRealVersion$inboundSchema.optional(),
1124
- encoding_format: EncodingFormat$inboundSchema.optional(),
1125
- }).transform((v) => {
1126
- return remap$(v, {
1127
- "encoding_format": "encodingFormat",
1128
- });
1129
- });
1130
-
1131
- /** @internal */
1132
- export type ModelParameters$Outbound = {
1133
- temperature?: number | undefined;
1134
- maxTokens?: number | undefined;
1135
- topK?: number | undefined;
1136
- topP?: number | undefined;
1137
- frequencyPenalty?: number | undefined;
1138
- presencePenalty?: number | undefined;
1139
- numImages?: number | undefined;
1140
- seed?: number | undefined;
1141
- format?: string | undefined;
1142
- dimensions?: string | undefined;
1143
- quality?: string | undefined;
1144
- style?: string | undefined;
1145
- responseFormat?:
1146
- | ResponseFormat2$Outbound
1147
- | ResponseFormat1$Outbound
1148
- | null
1149
- | undefined;
1150
- photoRealVersion?: string | undefined;
1151
- encoding_format?: string | undefined;
1152
- };
1153
-
1154
- /** @internal */
1155
- export const ModelParameters$outboundSchema: z.ZodType<
1156
- ModelParameters$Outbound,
1157
- z.ZodTypeDef,
1158
- ModelParameters
1159
- > = z.object({
1160
- temperature: z.number().optional(),
1161
- maxTokens: z.number().optional(),
1162
- topK: z.number().optional(),
1163
- topP: z.number().optional(),
1164
- frequencyPenalty: z.number().optional(),
1165
- presencePenalty: z.number().optional(),
1166
- numImages: z.number().optional(),
1167
- seed: z.number().optional(),
1168
- format: Format$outboundSchema.optional(),
1169
- dimensions: z.string().optional(),
1170
- quality: Quality$outboundSchema.optional(),
1171
- style: z.string().optional(),
1172
- responseFormat: z.nullable(
1173
- z.union([
1174
- z.lazy(() => ResponseFormat2$outboundSchema),
1175
- z.lazy(() => ResponseFormat1$outboundSchema),
1176
- ]),
1177
- ).optional(),
1178
- photoRealVersion: PhotoRealVersion$outboundSchema.optional(),
1179
- encodingFormat: EncodingFormat$outboundSchema.optional(),
1180
- }).transform((v) => {
1181
- return remap$(v, {
1182
- encodingFormat: "encoding_format",
1183
- });
1184
- });
1185
-
1186
- /**
1187
- * @internal
1188
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1189
- */
1190
- export namespace ModelParameters$ {
1191
- /** @deprecated use `ModelParameters$inboundSchema` instead. */
1192
- export const inboundSchema = ModelParameters$inboundSchema;
1193
- /** @deprecated use `ModelParameters$outboundSchema` instead. */
1194
- export const outboundSchema = ModelParameters$outboundSchema;
1195
- /** @deprecated use `ModelParameters$Outbound` instead. */
1196
- export type Outbound = ModelParameters$Outbound;
1197
- }
1198
-
1199
- export function modelParametersToJSON(
1200
- modelParameters: ModelParameters,
1201
- ): string {
1202
- return JSON.stringify(ModelParameters$outboundSchema.parse(modelParameters));
1203
- }
1204
-
1205
- export function modelParametersFromJSON(
1206
- jsonString: string,
1207
- ): SafeParseResult<ModelParameters, SDKValidationError> {
1208
- return safeParse(
1209
- jsonString,
1210
- (x) => ModelParameters$inboundSchema.parse(JSON.parse(x)),
1211
- `Failed to parse 'ModelParameters' from JSON`,
1212
- );
1213
- }
1214
-
1215
- /** @internal */
1216
- export const Provider$inboundSchema: z.ZodNativeEnum<typeof Provider> = z
1217
- .nativeEnum(Provider);
1218
-
1219
- /** @internal */
1220
- export const Provider$outboundSchema: z.ZodNativeEnum<typeof Provider> =
1221
- Provider$inboundSchema;
1222
-
1223
- /**
1224
- * @internal
1225
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1226
- */
1227
- export namespace Provider$ {
1228
- /** @deprecated use `Provider$inboundSchema` instead. */
1229
- export const inboundSchema = Provider$inboundSchema;
1230
- /** @deprecated use `Provider$outboundSchema` instead. */
1231
- export const outboundSchema = Provider$outboundSchema;
1232
- }
1233
-
1234
- /** @internal */
1235
- export const CreatePromptRole$inboundSchema: z.ZodNativeEnum<
1236
- typeof CreatePromptRole
1237
- > = z.nativeEnum(CreatePromptRole);
1238
-
1239
- /** @internal */
1240
- export const CreatePromptRole$outboundSchema: z.ZodNativeEnum<
1241
- typeof CreatePromptRole
1242
- > = CreatePromptRole$inboundSchema;
1243
-
1244
- /**
1245
- * @internal
1246
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1247
- */
1248
- export namespace CreatePromptRole$ {
1249
- /** @deprecated use `CreatePromptRole$inboundSchema` instead. */
1250
- export const inboundSchema = CreatePromptRole$inboundSchema;
1251
- /** @deprecated use `CreatePromptRole$outboundSchema` instead. */
1252
- export const outboundSchema = CreatePromptRole$outboundSchema;
1253
- }
1254
-
1255
- /** @internal */
1256
- export const CreatePrompt2PromptsType$inboundSchema: z.ZodNativeEnum<
1257
- typeof CreatePrompt2PromptsType
1258
- > = z.nativeEnum(CreatePrompt2PromptsType);
1259
-
1260
- /** @internal */
1261
- export const CreatePrompt2PromptsType$outboundSchema: z.ZodNativeEnum<
1262
- typeof CreatePrompt2PromptsType
1263
- > = CreatePrompt2PromptsType$inboundSchema;
1264
-
1265
- /**
1266
- * @internal
1267
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1268
- */
1269
- export namespace CreatePrompt2PromptsType$ {
1270
- /** @deprecated use `CreatePrompt2PromptsType$inboundSchema` instead. */
1271
- export const inboundSchema = CreatePrompt2PromptsType$inboundSchema;
1272
- /** @deprecated use `CreatePrompt2PromptsType$outboundSchema` instead. */
1273
- export const outboundSchema = CreatePrompt2PromptsType$outboundSchema;
1274
- }
1275
-
1276
- /** @internal */
1277
- export const CreatePrompt2ImageUrl$inboundSchema: z.ZodType<
1278
- CreatePrompt2ImageUrl,
1279
- z.ZodTypeDef,
1280
- unknown
1281
- > = z.object({
1282
- url: z.string(),
1283
- detail: z.string().optional(),
1284
- });
1285
-
1286
- /** @internal */
1287
- export type CreatePrompt2ImageUrl$Outbound = {
1288
- url: string;
1289
- detail?: string | undefined;
1290
- };
1291
-
1292
- /** @internal */
1293
- export const CreatePrompt2ImageUrl$outboundSchema: z.ZodType<
1294
- CreatePrompt2ImageUrl$Outbound,
1295
- z.ZodTypeDef,
1296
- CreatePrompt2ImageUrl
1297
- > = z.object({
1298
- url: z.string(),
1299
- detail: z.string().optional(),
1300
- });
1301
-
1302
- /**
1303
- * @internal
1304
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1305
- */
1306
- export namespace CreatePrompt2ImageUrl$ {
1307
- /** @deprecated use `CreatePrompt2ImageUrl$inboundSchema` instead. */
1308
- export const inboundSchema = CreatePrompt2ImageUrl$inboundSchema;
1309
- /** @deprecated use `CreatePrompt2ImageUrl$outboundSchema` instead. */
1310
- export const outboundSchema = CreatePrompt2ImageUrl$outboundSchema;
1311
- /** @deprecated use `CreatePrompt2ImageUrl$Outbound` instead. */
1312
- export type Outbound = CreatePrompt2ImageUrl$Outbound;
1313
- }
1314
-
1315
- export function createPrompt2ImageUrlToJSON(
1316
- createPrompt2ImageUrl: CreatePrompt2ImageUrl,
1317
- ): string {
1318
- return JSON.stringify(
1319
- CreatePrompt2ImageUrl$outboundSchema.parse(createPrompt2ImageUrl),
1320
- );
1321
- }
1322
-
1323
- export function createPrompt2ImageUrlFromJSON(
1324
- jsonString: string,
1325
- ): SafeParseResult<CreatePrompt2ImageUrl, SDKValidationError> {
1326
- return safeParse(
1327
- jsonString,
1328
- (x) => CreatePrompt2ImageUrl$inboundSchema.parse(JSON.parse(x)),
1329
- `Failed to parse 'CreatePrompt2ImageUrl' from JSON`,
1330
- );
1331
- }
1332
-
1333
- /** @internal */
1334
- export const CreatePrompt22$inboundSchema: z.ZodType<
1335
- CreatePrompt22,
1336
- z.ZodTypeDef,
1337
- unknown
1338
- > = z.object({
1339
- type: CreatePrompt2PromptsType$inboundSchema,
1340
- image_url: z.lazy(() => CreatePrompt2ImageUrl$inboundSchema),
1341
- }).transform((v) => {
1342
- return remap$(v, {
1343
- "image_url": "imageUrl",
1344
- });
1345
- });
1346
-
1347
- /** @internal */
1348
- export type CreatePrompt22$Outbound = {
1349
- type: string;
1350
- image_url: CreatePrompt2ImageUrl$Outbound;
1351
- };
1352
-
1353
- /** @internal */
1354
- export const CreatePrompt22$outboundSchema: z.ZodType<
1355
- CreatePrompt22$Outbound,
1356
- z.ZodTypeDef,
1357
- CreatePrompt22
1358
- > = z.object({
1359
- type: CreatePrompt2PromptsType$outboundSchema,
1360
- imageUrl: z.lazy(() => CreatePrompt2ImageUrl$outboundSchema),
1361
- }).transform((v) => {
1362
- return remap$(v, {
1363
- imageUrl: "image_url",
1364
- });
1365
- });
1366
-
1367
- /**
1368
- * @internal
1369
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1370
- */
1371
- export namespace CreatePrompt22$ {
1372
- /** @deprecated use `CreatePrompt22$inboundSchema` instead. */
1373
- export const inboundSchema = CreatePrompt22$inboundSchema;
1374
- /** @deprecated use `CreatePrompt22$outboundSchema` instead. */
1375
- export const outboundSchema = CreatePrompt22$outboundSchema;
1376
- /** @deprecated use `CreatePrompt22$Outbound` instead. */
1377
- export type Outbound = CreatePrompt22$Outbound;
1378
- }
1379
-
1380
- export function createPrompt22ToJSON(createPrompt22: CreatePrompt22): string {
1381
- return JSON.stringify(CreatePrompt22$outboundSchema.parse(createPrompt22));
1382
- }
1383
-
1384
- export function createPrompt22FromJSON(
1385
- jsonString: string,
1386
- ): SafeParseResult<CreatePrompt22, SDKValidationError> {
1387
- return safeParse(
1388
- jsonString,
1389
- (x) => CreatePrompt22$inboundSchema.parse(JSON.parse(x)),
1390
- `Failed to parse 'CreatePrompt22' from JSON`,
1391
- );
1392
- }
1393
-
1394
- /** @internal */
1395
- export const CreatePrompt2Type$inboundSchema: z.ZodNativeEnum<
1396
- typeof CreatePrompt2Type
1397
- > = z.nativeEnum(CreatePrompt2Type);
1398
-
1399
- /** @internal */
1400
- export const CreatePrompt2Type$outboundSchema: z.ZodNativeEnum<
1401
- typeof CreatePrompt2Type
1402
- > = CreatePrompt2Type$inboundSchema;
1403
-
1404
- /**
1405
- * @internal
1406
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1407
- */
1408
- export namespace CreatePrompt2Type$ {
1409
- /** @deprecated use `CreatePrompt2Type$inboundSchema` instead. */
1410
- export const inboundSchema = CreatePrompt2Type$inboundSchema;
1411
- /** @deprecated use `CreatePrompt2Type$outboundSchema` instead. */
1412
- export const outboundSchema = CreatePrompt2Type$outboundSchema;
1413
- }
1414
-
1415
- /** @internal */
1416
- export const CreatePrompt21$inboundSchema: z.ZodType<
1417
- CreatePrompt21,
1418
- z.ZodTypeDef,
1419
- unknown
1420
- > = z.object({
1421
- type: CreatePrompt2Type$inboundSchema,
1422
- text: z.string(),
1423
- });
1424
-
1425
- /** @internal */
1426
- export type CreatePrompt21$Outbound = {
1427
- type: string;
1428
- text: string;
1429
- };
1430
-
1431
- /** @internal */
1432
- export const CreatePrompt21$outboundSchema: z.ZodType<
1433
- CreatePrompt21$Outbound,
1434
- z.ZodTypeDef,
1435
- CreatePrompt21
1436
- > = z.object({
1437
- type: CreatePrompt2Type$outboundSchema,
1438
- text: z.string(),
1439
- });
1440
-
1441
- /**
1442
- * @internal
1443
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1444
- */
1445
- export namespace CreatePrompt21$ {
1446
- /** @deprecated use `CreatePrompt21$inboundSchema` instead. */
1447
- export const inboundSchema = CreatePrompt21$inboundSchema;
1448
- /** @deprecated use `CreatePrompt21$outboundSchema` instead. */
1449
- export const outboundSchema = CreatePrompt21$outboundSchema;
1450
- /** @deprecated use `CreatePrompt21$Outbound` instead. */
1451
- export type Outbound = CreatePrompt21$Outbound;
1452
- }
1453
-
1454
- export function createPrompt21ToJSON(createPrompt21: CreatePrompt21): string {
1455
- return JSON.stringify(CreatePrompt21$outboundSchema.parse(createPrompt21));
1456
- }
1457
-
1458
- export function createPrompt21FromJSON(
1459
- jsonString: string,
1460
- ): SafeParseResult<CreatePrompt21, SDKValidationError> {
1461
- return safeParse(
1462
- jsonString,
1463
- (x) => CreatePrompt21$inboundSchema.parse(JSON.parse(x)),
1464
- `Failed to parse 'CreatePrompt21' from JSON`,
1465
- );
1466
- }
1467
-
1468
- /** @internal */
1469
- export const CreatePromptContent2$inboundSchema: z.ZodType<
1470
- CreatePromptContent2,
1471
- z.ZodTypeDef,
1472
- unknown
1473
- > = z.union([
1474
- z.lazy(() => CreatePrompt21$inboundSchema),
1475
- z.lazy(() => CreatePrompt22$inboundSchema),
1476
- ]);
1477
-
1478
- /** @internal */
1479
- export type CreatePromptContent2$Outbound =
1480
- | CreatePrompt21$Outbound
1481
- | CreatePrompt22$Outbound;
1482
-
1483
- /** @internal */
1484
- export const CreatePromptContent2$outboundSchema: z.ZodType<
1485
- CreatePromptContent2$Outbound,
1486
- z.ZodTypeDef,
1487
- CreatePromptContent2
1488
- > = z.union([
1489
- z.lazy(() => CreatePrompt21$outboundSchema),
1490
- z.lazy(() => CreatePrompt22$outboundSchema),
1491
- ]);
1492
-
1493
- /**
1494
- * @internal
1495
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1496
- */
1497
- export namespace CreatePromptContent2$ {
1498
- /** @deprecated use `CreatePromptContent2$inboundSchema` instead. */
1499
- export const inboundSchema = CreatePromptContent2$inboundSchema;
1500
- /** @deprecated use `CreatePromptContent2$outboundSchema` instead. */
1501
- export const outboundSchema = CreatePromptContent2$outboundSchema;
1502
- /** @deprecated use `CreatePromptContent2$Outbound` instead. */
1503
- export type Outbound = CreatePromptContent2$Outbound;
1504
- }
1505
-
1506
- export function createPromptContent2ToJSON(
1507
- createPromptContent2: CreatePromptContent2,
1508
- ): string {
1509
- return JSON.stringify(
1510
- CreatePromptContent2$outboundSchema.parse(createPromptContent2),
1511
- );
1512
- }
1513
-
1514
- export function createPromptContent2FromJSON(
1515
- jsonString: string,
1516
- ): SafeParseResult<CreatePromptContent2, SDKValidationError> {
1517
- return safeParse(
1518
- jsonString,
1519
- (x) => CreatePromptContent2$inboundSchema.parse(JSON.parse(x)),
1520
- `Failed to parse 'CreatePromptContent2' from JSON`,
1521
- );
1522
- }
1523
-
1524
- /** @internal */
1525
- export const CreatePromptContent$inboundSchema: z.ZodType<
1526
- CreatePromptContent,
1527
- z.ZodTypeDef,
1528
- unknown
1529
- > = z.union([
1530
- z.string(),
1531
- z.array(z.union([
1532
- z.lazy(() => CreatePrompt21$inboundSchema),
1533
- z.lazy(() => CreatePrompt22$inboundSchema),
1534
- ])),
1535
- ]);
1536
-
1537
- /** @internal */
1538
- export type CreatePromptContent$Outbound =
1539
- | string
1540
- | Array<CreatePrompt21$Outbound | CreatePrompt22$Outbound>;
1541
-
1542
- /** @internal */
1543
- export const CreatePromptContent$outboundSchema: z.ZodType<
1544
- CreatePromptContent$Outbound,
1545
- z.ZodTypeDef,
1546
- CreatePromptContent
1547
- > = z.union([
1548
- z.string(),
1549
- z.array(z.union([
1550
- z.lazy(() => CreatePrompt21$outboundSchema),
1551
- z.lazy(() => CreatePrompt22$outboundSchema),
1552
- ])),
1553
- ]);
1554
-
1555
- /**
1556
- * @internal
1557
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1558
- */
1559
- export namespace CreatePromptContent$ {
1560
- /** @deprecated use `CreatePromptContent$inboundSchema` instead. */
1561
- export const inboundSchema = CreatePromptContent$inboundSchema;
1562
- /** @deprecated use `CreatePromptContent$outboundSchema` instead. */
1563
- export const outboundSchema = CreatePromptContent$outboundSchema;
1564
- /** @deprecated use `CreatePromptContent$Outbound` instead. */
1565
- export type Outbound = CreatePromptContent$Outbound;
1566
- }
1567
-
1568
- export function createPromptContentToJSON(
1569
- createPromptContent: CreatePromptContent,
1570
- ): string {
1571
- return JSON.stringify(
1572
- CreatePromptContent$outboundSchema.parse(createPromptContent),
1573
- );
1574
- }
1575
-
1576
- export function createPromptContentFromJSON(
1577
- jsonString: string,
1578
- ): SafeParseResult<CreatePromptContent, SDKValidationError> {
1579
- return safeParse(
1580
- jsonString,
1581
- (x) => CreatePromptContent$inboundSchema.parse(JSON.parse(x)),
1582
- `Failed to parse 'CreatePromptContent' from JSON`,
1583
- );
1584
- }
1585
-
1586
- /** @internal */
1587
- export const CreatePromptType$inboundSchema: z.ZodNativeEnum<
1588
- typeof CreatePromptType
1589
- > = z.nativeEnum(CreatePromptType);
1590
-
1591
- /** @internal */
1592
- export const CreatePromptType$outboundSchema: z.ZodNativeEnum<
1593
- typeof CreatePromptType
1594
- > = CreatePromptType$inboundSchema;
1595
-
1596
- /**
1597
- * @internal
1598
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1599
- */
1600
- export namespace CreatePromptType$ {
1601
- /** @deprecated use `CreatePromptType$inboundSchema` instead. */
1602
- export const inboundSchema = CreatePromptType$inboundSchema;
1603
- /** @deprecated use `CreatePromptType$outboundSchema` instead. */
1604
- export const outboundSchema = CreatePromptType$outboundSchema;
1605
- }
1606
-
1607
- /** @internal */
1608
- export const CreatePromptFunction$inboundSchema: z.ZodType<
1609
- CreatePromptFunction,
1610
- z.ZodTypeDef,
1611
- unknown
1612
- > = z.object({
1613
- name: z.string(),
1614
- arguments: z.string(),
1615
- });
1616
-
1617
- /** @internal */
1618
- export type CreatePromptFunction$Outbound = {
1619
- name: string;
1620
- arguments: string;
1621
- };
1622
-
1623
- /** @internal */
1624
- export const CreatePromptFunction$outboundSchema: z.ZodType<
1625
- CreatePromptFunction$Outbound,
1626
- z.ZodTypeDef,
1627
- CreatePromptFunction
1628
- > = z.object({
1629
- name: z.string(),
1630
- arguments: z.string(),
1631
- });
1632
-
1633
- /**
1634
- * @internal
1635
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1636
- */
1637
- export namespace CreatePromptFunction$ {
1638
- /** @deprecated use `CreatePromptFunction$inboundSchema` instead. */
1639
- export const inboundSchema = CreatePromptFunction$inboundSchema;
1640
- /** @deprecated use `CreatePromptFunction$outboundSchema` instead. */
1641
- export const outboundSchema = CreatePromptFunction$outboundSchema;
1642
- /** @deprecated use `CreatePromptFunction$Outbound` instead. */
1643
- export type Outbound = CreatePromptFunction$Outbound;
1644
- }
1645
-
1646
- export function createPromptFunctionToJSON(
1647
- createPromptFunction: CreatePromptFunction,
1648
- ): string {
1649
- return JSON.stringify(
1650
- CreatePromptFunction$outboundSchema.parse(createPromptFunction),
1651
- );
1652
- }
1653
-
1654
- export function createPromptFunctionFromJSON(
1655
- jsonString: string,
1656
- ): SafeParseResult<CreatePromptFunction, SDKValidationError> {
1657
- return safeParse(
1658
- jsonString,
1659
- (x) => CreatePromptFunction$inboundSchema.parse(JSON.parse(x)),
1660
- `Failed to parse 'CreatePromptFunction' from JSON`,
1661
- );
1662
- }
1663
-
1664
- /** @internal */
1665
- export const CreatePromptToolCalls$inboundSchema: z.ZodType<
1666
- CreatePromptToolCalls,
1667
- z.ZodTypeDef,
1668
- unknown
1669
- > = z.object({
1670
- id: z.string().optional(),
1671
- index: z.number().optional(),
1672
- type: CreatePromptType$inboundSchema,
1673
- function: z.lazy(() => CreatePromptFunction$inboundSchema),
1674
- });
1675
-
1676
- /** @internal */
1677
- export type CreatePromptToolCalls$Outbound = {
1678
- id?: string | undefined;
1679
- index?: number | undefined;
1680
- type: string;
1681
- function: CreatePromptFunction$Outbound;
1682
- };
1683
-
1684
- /** @internal */
1685
- export const CreatePromptToolCalls$outboundSchema: z.ZodType<
1686
- CreatePromptToolCalls$Outbound,
1687
- z.ZodTypeDef,
1688
- CreatePromptToolCalls
1689
- > = z.object({
1690
- id: z.string().optional(),
1691
- index: z.number().optional(),
1692
- type: CreatePromptType$outboundSchema,
1693
- function: z.lazy(() => CreatePromptFunction$outboundSchema),
1694
- });
1695
-
1696
- /**
1697
- * @internal
1698
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1699
- */
1700
- export namespace CreatePromptToolCalls$ {
1701
- /** @deprecated use `CreatePromptToolCalls$inboundSchema` instead. */
1702
- export const inboundSchema = CreatePromptToolCalls$inboundSchema;
1703
- /** @deprecated use `CreatePromptToolCalls$outboundSchema` instead. */
1704
- export const outboundSchema = CreatePromptToolCalls$outboundSchema;
1705
- /** @deprecated use `CreatePromptToolCalls$Outbound` instead. */
1706
- export type Outbound = CreatePromptToolCalls$Outbound;
1707
- }
1708
-
1709
- export function createPromptToolCallsToJSON(
1710
- createPromptToolCalls: CreatePromptToolCalls,
1711
- ): string {
1712
- return JSON.stringify(
1713
- CreatePromptToolCalls$outboundSchema.parse(createPromptToolCalls),
1714
- );
1715
- }
1716
-
1717
- export function createPromptToolCallsFromJSON(
1718
- jsonString: string,
1719
- ): SafeParseResult<CreatePromptToolCalls, SDKValidationError> {
1720
- return safeParse(
1721
- jsonString,
1722
- (x) => CreatePromptToolCalls$inboundSchema.parse(JSON.parse(x)),
1723
- `Failed to parse 'CreatePromptToolCalls' from JSON`,
1724
- );
1725
- }
1726
-
1727
- /** @internal */
1728
- export const CreatePromptMessages$inboundSchema: z.ZodType<
1729
- CreatePromptMessages,
1730
- z.ZodTypeDef,
1731
- unknown
1732
- > = z.object({
1733
- role: CreatePromptRole$inboundSchema,
1734
- content: z.union([
1735
- z.string(),
1736
- z.array(z.union([
1737
- z.lazy(() => CreatePrompt21$inboundSchema),
1738
- z.lazy(() => CreatePrompt22$inboundSchema),
1739
- ])),
1740
- ]),
1741
- tool_calls: z.array(z.lazy(() => CreatePromptToolCalls$inboundSchema))
1742
- .optional(),
1743
- }).transform((v) => {
1744
- return remap$(v, {
1745
- "tool_calls": "toolCalls",
1746
- });
1747
- });
1748
-
1749
- /** @internal */
1750
- export type CreatePromptMessages$Outbound = {
1751
- role: string;
1752
- content: string | Array<CreatePrompt21$Outbound | CreatePrompt22$Outbound>;
1753
- tool_calls?: Array<CreatePromptToolCalls$Outbound> | undefined;
1754
- };
1755
-
1756
- /** @internal */
1757
- export const CreatePromptMessages$outboundSchema: z.ZodType<
1758
- CreatePromptMessages$Outbound,
1759
- z.ZodTypeDef,
1760
- CreatePromptMessages
1761
- > = z.object({
1762
- role: CreatePromptRole$outboundSchema,
1763
- content: z.union([
1764
- z.string(),
1765
- z.array(z.union([
1766
- z.lazy(() => CreatePrompt21$outboundSchema),
1767
- z.lazy(() => CreatePrompt22$outboundSchema),
1768
- ])),
1769
- ]),
1770
- toolCalls: z.array(z.lazy(() => CreatePromptToolCalls$outboundSchema))
1771
- .optional(),
1772
- }).transform((v) => {
1773
- return remap$(v, {
1774
- toolCalls: "tool_calls",
1775
- });
1776
- });
1777
-
1778
- /**
1779
- * @internal
1780
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1781
- */
1782
- export namespace CreatePromptMessages$ {
1783
- /** @deprecated use `CreatePromptMessages$inboundSchema` instead. */
1784
- export const inboundSchema = CreatePromptMessages$inboundSchema;
1785
- /** @deprecated use `CreatePromptMessages$outboundSchema` instead. */
1786
- export const outboundSchema = CreatePromptMessages$outboundSchema;
1787
- /** @deprecated use `CreatePromptMessages$Outbound` instead. */
1788
- export type Outbound = CreatePromptMessages$Outbound;
1789
- }
1790
-
1791
- export function createPromptMessagesToJSON(
1792
- createPromptMessages: CreatePromptMessages,
1793
- ): string {
1794
- return JSON.stringify(
1795
- CreatePromptMessages$outboundSchema.parse(createPromptMessages),
1796
- );
1797
- }
1798
-
1799
- export function createPromptMessagesFromJSON(
1800
- jsonString: string,
1801
- ): SafeParseResult<CreatePromptMessages, SDKValidationError> {
1802
- return safeParse(
1803
- jsonString,
1804
- (x) => CreatePromptMessages$inboundSchema.parse(JSON.parse(x)),
1805
- `Failed to parse 'CreatePromptMessages' from JSON`,
1806
- );
1807
- }
1808
-
1809
- /** @internal */
1810
- export const PromptConfig$inboundSchema: z.ZodType<
1811
- PromptConfig,
1812
- z.ZodTypeDef,
1813
- unknown
1814
- > = z.object({
1815
- stream: z.boolean().optional(),
1816
- model: z.string().optional(),
1817
- model_type: ModelType$inboundSchema.optional(),
1818
- model_parameters: z.lazy(() => ModelParameters$inboundSchema).optional(),
1819
- provider: Provider$inboundSchema.optional(),
1820
- version: z.string().optional(),
1821
- messages: z.array(z.lazy(() => CreatePromptMessages$inboundSchema)),
1822
- }).transform((v) => {
1823
- return remap$(v, {
1824
- "model_type": "modelType",
1825
- "model_parameters": "modelParameters",
1826
- });
1827
- });
1828
-
1829
- /** @internal */
1830
- export type PromptConfig$Outbound = {
1831
- stream?: boolean | undefined;
1832
- model?: string | undefined;
1833
- model_type?: string | undefined;
1834
- model_parameters?: ModelParameters$Outbound | undefined;
1835
- provider?: string | undefined;
1836
- version?: string | undefined;
1837
- messages: Array<CreatePromptMessages$Outbound>;
1838
- };
1839
-
1840
- /** @internal */
1841
- export const PromptConfig$outboundSchema: z.ZodType<
1842
- PromptConfig$Outbound,
1843
- z.ZodTypeDef,
1844
- PromptConfig
1845
- > = z.object({
1846
- stream: z.boolean().optional(),
1847
- model: z.string().optional(),
1848
- modelType: ModelType$outboundSchema.optional(),
1849
- modelParameters: z.lazy(() => ModelParameters$outboundSchema).optional(),
1850
- provider: Provider$outboundSchema.optional(),
1851
- version: z.string().optional(),
1852
- messages: z.array(z.lazy(() => CreatePromptMessages$outboundSchema)),
1853
- }).transform((v) => {
1854
- return remap$(v, {
1855
- modelType: "model_type",
1856
- modelParameters: "model_parameters",
1857
- });
1858
- });
1859
-
1860
- /**
1861
- * @internal
1862
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1863
- */
1864
- export namespace PromptConfig$ {
1865
- /** @deprecated use `PromptConfig$inboundSchema` instead. */
1866
- export const inboundSchema = PromptConfig$inboundSchema;
1867
- /** @deprecated use `PromptConfig$outboundSchema` instead. */
1868
- export const outboundSchema = PromptConfig$outboundSchema;
1869
- /** @deprecated use `PromptConfig$Outbound` instead. */
1870
- export type Outbound = PromptConfig$Outbound;
1871
- }
1872
-
1873
- export function promptConfigToJSON(promptConfig: PromptConfig): string {
1874
- return JSON.stringify(PromptConfig$outboundSchema.parse(promptConfig));
1875
- }
1876
-
1877
- export function promptConfigFromJSON(
1878
- jsonString: string,
1879
- ): SafeParseResult<PromptConfig, SDKValidationError> {
1880
- return safeParse(
1881
- jsonString,
1882
- (x) => PromptConfig$inboundSchema.parse(JSON.parse(x)),
1883
- `Failed to parse 'PromptConfig' from JSON`,
1884
- );
1885
- }
1886
-
1887
- /** @internal */
1888
- export const Metadata$inboundSchema: z.ZodType<
1889
- Metadata,
1890
- z.ZodTypeDef,
1891
- unknown
1892
- > = z.object({
1893
- use_cases: z.array(z.string()).optional(),
1894
- language: z.string().optional(),
1895
- }).transform((v) => {
1896
- return remap$(v, {
1897
- "use_cases": "useCases",
1898
- });
1899
- });
1900
-
1901
- /** @internal */
1902
- export type Metadata$Outbound = {
1903
- use_cases?: Array<string> | undefined;
1904
- language?: string | undefined;
1905
- };
1906
-
1907
- /** @internal */
1908
- export const Metadata$outboundSchema: z.ZodType<
1909
- Metadata$Outbound,
1910
- z.ZodTypeDef,
1911
- Metadata
1912
- > = z.object({
1913
- useCases: z.array(z.string()).optional(),
1914
- language: z.string().optional(),
1915
- }).transform((v) => {
1916
- return remap$(v, {
1917
- useCases: "use_cases",
1918
- });
1919
- });
1920
-
1921
- /**
1922
- * @internal
1923
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1924
- */
1925
- export namespace Metadata$ {
1926
- /** @deprecated use `Metadata$inboundSchema` instead. */
1927
- export const inboundSchema = Metadata$inboundSchema;
1928
- /** @deprecated use `Metadata$outboundSchema` instead. */
1929
- export const outboundSchema = Metadata$outboundSchema;
1930
- /** @deprecated use `Metadata$Outbound` instead. */
1931
- export type Outbound = Metadata$Outbound;
1932
- }
1933
-
1934
- export function metadataToJSON(metadata: Metadata): string {
1935
- return JSON.stringify(Metadata$outboundSchema.parse(metadata));
1936
- }
1937
-
1938
- export function metadataFromJSON(
1939
- jsonString: string,
1940
- ): SafeParseResult<Metadata, SDKValidationError> {
1941
- return safeParse(
1942
- jsonString,
1943
- (x) => Metadata$inboundSchema.parse(JSON.parse(x)),
1944
- `Failed to parse 'Metadata' from JSON`,
1945
- );
1946
- }
1947
-
1948
- /** @internal */
1949
- export const CreatePromptPromptsType$inboundSchema: z.ZodNativeEnum<
1950
- typeof CreatePromptPromptsType
1951
- > = z.nativeEnum(CreatePromptPromptsType);
1952
-
1953
- /** @internal */
1954
- export const CreatePromptPromptsType$outboundSchema: z.ZodNativeEnum<
1955
- typeof CreatePromptPromptsType
1956
- > = CreatePromptPromptsType$inboundSchema;
1957
-
1958
- /**
1959
- * @internal
1960
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
1961
- */
1962
- export namespace CreatePromptPromptsType$ {
1963
- /** @deprecated use `CreatePromptPromptsType$inboundSchema` instead. */
1964
- export const inboundSchema = CreatePromptPromptsType$inboundSchema;
1965
- /** @deprecated use `CreatePromptPromptsType$outboundSchema` instead. */
1966
- export const outboundSchema = CreatePromptPromptsType$outboundSchema;
1967
- }
1968
-
1969
- /** @internal */
1970
- export const CreatePromptRequestBody$inboundSchema: z.ZodType<
1971
- CreatePromptRequestBody,
1972
- z.ZodTypeDef,
1973
- unknown
1974
- > = z.object({
1975
- display_name: z.string(),
1976
- description: z.nullable(z.string()).optional(),
1977
- prompt_config: z.lazy(() => PromptConfig$inboundSchema).optional(),
1978
- metadata: z.lazy(() => Metadata$inboundSchema).optional(),
1979
- key: z.string().optional(),
1980
- type: CreatePromptPromptsType$inboundSchema,
1981
- }).transform((v) => {
1982
- return remap$(v, {
1983
- "display_name": "displayName",
1984
- "prompt_config": "promptConfig",
1985
- });
1986
- });
1987
-
1988
- /** @internal */
1989
- export type CreatePromptRequestBody$Outbound = {
1990
- display_name: string;
1991
- description?: string | null | undefined;
1992
- prompt_config?: PromptConfig$Outbound | undefined;
1993
- metadata?: Metadata$Outbound | undefined;
1994
- key?: string | undefined;
1995
- type: string;
1996
- };
1997
-
1998
- /** @internal */
1999
- export const CreatePromptRequestBody$outboundSchema: z.ZodType<
2000
- CreatePromptRequestBody$Outbound,
2001
- z.ZodTypeDef,
2002
- CreatePromptRequestBody
2003
- > = z.object({
2004
- displayName: z.string(),
2005
- description: z.nullable(z.string()).optional(),
2006
- promptConfig: z.lazy(() => PromptConfig$outboundSchema).optional(),
2007
- metadata: z.lazy(() => Metadata$outboundSchema).optional(),
2008
- key: z.string().optional(),
2009
- type: CreatePromptPromptsType$outboundSchema,
2010
- }).transform((v) => {
2011
- return remap$(v, {
2012
- displayName: "display_name",
2013
- promptConfig: "prompt_config",
2014
- });
2015
- });
2016
-
2017
- /**
2018
- * @internal
2019
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2020
- */
2021
- export namespace CreatePromptRequestBody$ {
2022
- /** @deprecated use `CreatePromptRequestBody$inboundSchema` instead. */
2023
- export const inboundSchema = CreatePromptRequestBody$inboundSchema;
2024
- /** @deprecated use `CreatePromptRequestBody$outboundSchema` instead. */
2025
- export const outboundSchema = CreatePromptRequestBody$outboundSchema;
2026
- /** @deprecated use `CreatePromptRequestBody$Outbound` instead. */
2027
- export type Outbound = CreatePromptRequestBody$Outbound;
2028
- }
2029
-
2030
- export function createPromptRequestBodyToJSON(
2031
- createPromptRequestBody: CreatePromptRequestBody,
2032
- ): string {
2033
- return JSON.stringify(
2034
- CreatePromptRequestBody$outboundSchema.parse(createPromptRequestBody),
2035
- );
2036
- }
2037
-
2038
- export function createPromptRequestBodyFromJSON(
2039
- jsonString: string,
2040
- ): SafeParseResult<CreatePromptRequestBody, SDKValidationError> {
2041
- return safeParse(
2042
- jsonString,
2043
- (x) => CreatePromptRequestBody$inboundSchema.parse(JSON.parse(x)),
2044
- `Failed to parse 'CreatePromptRequestBody' from JSON`,
2045
- );
2046
- }
2047
-
2048
- /** @internal */
2049
- export const CreatePromptModelType$inboundSchema: z.ZodNativeEnum<
2050
- typeof CreatePromptModelType
2051
- > = z.nativeEnum(CreatePromptModelType);
2052
-
2053
- /** @internal */
2054
- export const CreatePromptModelType$outboundSchema: z.ZodNativeEnum<
2055
- typeof CreatePromptModelType
2056
- > = CreatePromptModelType$inboundSchema;
2057
-
2058
- /**
2059
- * @internal
2060
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2061
- */
2062
- export namespace CreatePromptModelType$ {
2063
- /** @deprecated use `CreatePromptModelType$inboundSchema` instead. */
2064
- export const inboundSchema = CreatePromptModelType$inboundSchema;
2065
- /** @deprecated use `CreatePromptModelType$outboundSchema` instead. */
2066
- export const outboundSchema = CreatePromptModelType$outboundSchema;
2067
- }
2068
-
2069
- /** @internal */
2070
- export const CreatePromptFormat$inboundSchema: z.ZodNativeEnum<
2071
- typeof CreatePromptFormat
2072
- > = z.nativeEnum(CreatePromptFormat);
2073
-
2074
- /** @internal */
2075
- export const CreatePromptFormat$outboundSchema: z.ZodNativeEnum<
2076
- typeof CreatePromptFormat
2077
- > = CreatePromptFormat$inboundSchema;
2078
-
2079
- /**
2080
- * @internal
2081
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2082
- */
2083
- export namespace CreatePromptFormat$ {
2084
- /** @deprecated use `CreatePromptFormat$inboundSchema` instead. */
2085
- export const inboundSchema = CreatePromptFormat$inboundSchema;
2086
- /** @deprecated use `CreatePromptFormat$outboundSchema` instead. */
2087
- export const outboundSchema = CreatePromptFormat$outboundSchema;
2088
- }
2089
-
2090
- /** @internal */
2091
- export const CreatePromptQuality$inboundSchema: z.ZodNativeEnum<
2092
- typeof CreatePromptQuality
2093
- > = z.nativeEnum(CreatePromptQuality);
2094
-
2095
- /** @internal */
2096
- export const CreatePromptQuality$outboundSchema: z.ZodNativeEnum<
2097
- typeof CreatePromptQuality
2098
- > = CreatePromptQuality$inboundSchema;
2099
-
2100
- /**
2101
- * @internal
2102
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2103
- */
2104
- export namespace CreatePromptQuality$ {
2105
- /** @deprecated use `CreatePromptQuality$inboundSchema` instead. */
2106
- export const inboundSchema = CreatePromptQuality$inboundSchema;
2107
- /** @deprecated use `CreatePromptQuality$outboundSchema` instead. */
2108
- export const outboundSchema = CreatePromptQuality$outboundSchema;
2109
- }
2110
-
2111
- /** @internal */
2112
- export const CreatePromptResponseFormatPromptsResponseType$inboundSchema:
2113
- z.ZodNativeEnum<typeof CreatePromptResponseFormatPromptsResponseType> = z
2114
- .nativeEnum(CreatePromptResponseFormatPromptsResponseType);
2115
-
2116
- /** @internal */
2117
- export const CreatePromptResponseFormatPromptsResponseType$outboundSchema:
2118
- z.ZodNativeEnum<typeof CreatePromptResponseFormatPromptsResponseType> =
2119
- CreatePromptResponseFormatPromptsResponseType$inboundSchema;
2120
-
2121
- /**
2122
- * @internal
2123
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2124
- */
2125
- export namespace CreatePromptResponseFormatPromptsResponseType$ {
2126
- /** @deprecated use `CreatePromptResponseFormatPromptsResponseType$inboundSchema` instead. */
2127
- export const inboundSchema =
2128
- CreatePromptResponseFormatPromptsResponseType$inboundSchema;
2129
- /** @deprecated use `CreatePromptResponseFormatPromptsResponseType$outboundSchema` instead. */
2130
- export const outboundSchema =
2131
- CreatePromptResponseFormatPromptsResponseType$outboundSchema;
2132
- }
2133
-
2134
- /** @internal */
2135
- export const CreatePromptResponseFormat2$inboundSchema: z.ZodType<
2136
- CreatePromptResponseFormat2,
2137
- z.ZodTypeDef,
2138
- unknown
2139
- > = z.object({
2140
- type: CreatePromptResponseFormatPromptsResponseType$inboundSchema,
2141
- });
2142
-
2143
- /** @internal */
2144
- export type CreatePromptResponseFormat2$Outbound = {
2145
- type: string;
2146
- };
2147
-
2148
- /** @internal */
2149
- export const CreatePromptResponseFormat2$outboundSchema: z.ZodType<
2150
- CreatePromptResponseFormat2$Outbound,
2151
- z.ZodTypeDef,
2152
- CreatePromptResponseFormat2
2153
- > = z.object({
2154
- type: CreatePromptResponseFormatPromptsResponseType$outboundSchema,
2155
- });
2156
-
2157
- /**
2158
- * @internal
2159
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2160
- */
2161
- export namespace CreatePromptResponseFormat2$ {
2162
- /** @deprecated use `CreatePromptResponseFormat2$inboundSchema` instead. */
2163
- export const inboundSchema = CreatePromptResponseFormat2$inboundSchema;
2164
- /** @deprecated use `CreatePromptResponseFormat2$outboundSchema` instead. */
2165
- export const outboundSchema = CreatePromptResponseFormat2$outboundSchema;
2166
- /** @deprecated use `CreatePromptResponseFormat2$Outbound` instead. */
2167
- export type Outbound = CreatePromptResponseFormat2$Outbound;
2168
- }
2169
-
2170
- export function createPromptResponseFormat2ToJSON(
2171
- createPromptResponseFormat2: CreatePromptResponseFormat2,
2172
- ): string {
2173
- return JSON.stringify(
2174
- CreatePromptResponseFormat2$outboundSchema.parse(
2175
- createPromptResponseFormat2,
2176
- ),
2177
- );
2178
- }
2179
-
2180
- export function createPromptResponseFormat2FromJSON(
2181
- jsonString: string,
2182
- ): SafeParseResult<CreatePromptResponseFormat2, SDKValidationError> {
2183
- return safeParse(
2184
- jsonString,
2185
- (x) => CreatePromptResponseFormat2$inboundSchema.parse(JSON.parse(x)),
2186
- `Failed to parse 'CreatePromptResponseFormat2' from JSON`,
2187
- );
2188
- }
2189
-
2190
- /** @internal */
2191
- export const CreatePromptResponseFormatPromptsType$inboundSchema:
2192
- z.ZodNativeEnum<typeof CreatePromptResponseFormatPromptsType> = z.nativeEnum(
2193
- CreatePromptResponseFormatPromptsType,
2194
- );
2195
-
2196
- /** @internal */
2197
- export const CreatePromptResponseFormatPromptsType$outboundSchema:
2198
- z.ZodNativeEnum<typeof CreatePromptResponseFormatPromptsType> =
2199
- CreatePromptResponseFormatPromptsType$inboundSchema;
2200
-
2201
- /**
2202
- * @internal
2203
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2204
- */
2205
- export namespace CreatePromptResponseFormatPromptsType$ {
2206
- /** @deprecated use `CreatePromptResponseFormatPromptsType$inboundSchema` instead. */
2207
- export const inboundSchema =
2208
- CreatePromptResponseFormatPromptsType$inboundSchema;
2209
- /** @deprecated use `CreatePromptResponseFormatPromptsType$outboundSchema` instead. */
2210
- export const outboundSchema =
2211
- CreatePromptResponseFormatPromptsType$outboundSchema;
2212
- }
2213
-
2214
- /** @internal */
2215
- export const CreatePromptResponseFormatJsonSchema$inboundSchema: z.ZodType<
2216
- CreatePromptResponseFormatJsonSchema,
2217
- z.ZodTypeDef,
2218
- unknown
2219
- > = z.object({
2220
- name: z.string(),
2221
- strict: z.boolean(),
2222
- schema: z.record(z.any()),
2223
- });
2224
-
2225
- /** @internal */
2226
- export type CreatePromptResponseFormatJsonSchema$Outbound = {
2227
- name: string;
2228
- strict: boolean;
2229
- schema: { [k: string]: any };
2230
- };
2231
-
2232
- /** @internal */
2233
- export const CreatePromptResponseFormatJsonSchema$outboundSchema: z.ZodType<
2234
- CreatePromptResponseFormatJsonSchema$Outbound,
2235
- z.ZodTypeDef,
2236
- CreatePromptResponseFormatJsonSchema
2237
- > = z.object({
2238
- name: z.string(),
2239
- strict: z.boolean(),
2240
- schema: z.record(z.any()),
2241
- });
2242
-
2243
- /**
2244
- * @internal
2245
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2246
- */
2247
- export namespace CreatePromptResponseFormatJsonSchema$ {
2248
- /** @deprecated use `CreatePromptResponseFormatJsonSchema$inboundSchema` instead. */
2249
- export const inboundSchema =
2250
- CreatePromptResponseFormatJsonSchema$inboundSchema;
2251
- /** @deprecated use `CreatePromptResponseFormatJsonSchema$outboundSchema` instead. */
2252
- export const outboundSchema =
2253
- CreatePromptResponseFormatJsonSchema$outboundSchema;
2254
- /** @deprecated use `CreatePromptResponseFormatJsonSchema$Outbound` instead. */
2255
- export type Outbound = CreatePromptResponseFormatJsonSchema$Outbound;
2256
- }
2257
-
2258
- export function createPromptResponseFormatJsonSchemaToJSON(
2259
- createPromptResponseFormatJsonSchema: CreatePromptResponseFormatJsonSchema,
2260
- ): string {
2261
- return JSON.stringify(
2262
- CreatePromptResponseFormatJsonSchema$outboundSchema.parse(
2263
- createPromptResponseFormatJsonSchema,
2264
- ),
2265
- );
2266
- }
2267
-
2268
- export function createPromptResponseFormatJsonSchemaFromJSON(
2269
- jsonString: string,
2270
- ): SafeParseResult<CreatePromptResponseFormatJsonSchema, SDKValidationError> {
2271
- return safeParse(
2272
- jsonString,
2273
- (x) =>
2274
- CreatePromptResponseFormatJsonSchema$inboundSchema.parse(JSON.parse(x)),
2275
- `Failed to parse 'CreatePromptResponseFormatJsonSchema' from JSON`,
2276
- );
2277
- }
2278
-
2279
- /** @internal */
2280
- export const CreatePromptResponseFormat1$inboundSchema: z.ZodType<
2281
- CreatePromptResponseFormat1,
2282
- z.ZodTypeDef,
2283
- unknown
2284
- > = z.object({
2285
- type: CreatePromptResponseFormatPromptsType$inboundSchema,
2286
- json_schema: z.lazy(() => CreatePromptResponseFormatJsonSchema$inboundSchema),
2287
- }).transform((v) => {
2288
- return remap$(v, {
2289
- "json_schema": "jsonSchema",
2290
- });
2291
- });
2292
-
2293
- /** @internal */
2294
- export type CreatePromptResponseFormat1$Outbound = {
2295
- type: string;
2296
- json_schema: CreatePromptResponseFormatJsonSchema$Outbound;
2297
- };
2298
-
2299
- /** @internal */
2300
- export const CreatePromptResponseFormat1$outboundSchema: z.ZodType<
2301
- CreatePromptResponseFormat1$Outbound,
2302
- z.ZodTypeDef,
2303
- CreatePromptResponseFormat1
2304
- > = z.object({
2305
- type: CreatePromptResponseFormatPromptsType$outboundSchema,
2306
- jsonSchema: z.lazy(() => CreatePromptResponseFormatJsonSchema$outboundSchema),
2307
- }).transform((v) => {
2308
- return remap$(v, {
2309
- jsonSchema: "json_schema",
2310
- });
2311
- });
2312
-
2313
- /**
2314
- * @internal
2315
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2316
- */
2317
- export namespace CreatePromptResponseFormat1$ {
2318
- /** @deprecated use `CreatePromptResponseFormat1$inboundSchema` instead. */
2319
- export const inboundSchema = CreatePromptResponseFormat1$inboundSchema;
2320
- /** @deprecated use `CreatePromptResponseFormat1$outboundSchema` instead. */
2321
- export const outboundSchema = CreatePromptResponseFormat1$outboundSchema;
2322
- /** @deprecated use `CreatePromptResponseFormat1$Outbound` instead. */
2323
- export type Outbound = CreatePromptResponseFormat1$Outbound;
2324
- }
2325
-
2326
- export function createPromptResponseFormat1ToJSON(
2327
- createPromptResponseFormat1: CreatePromptResponseFormat1,
2328
- ): string {
2329
- return JSON.stringify(
2330
- CreatePromptResponseFormat1$outboundSchema.parse(
2331
- createPromptResponseFormat1,
2332
- ),
2333
- );
2334
- }
2335
-
2336
- export function createPromptResponseFormat1FromJSON(
2337
- jsonString: string,
2338
- ): SafeParseResult<CreatePromptResponseFormat1, SDKValidationError> {
2339
- return safeParse(
2340
- jsonString,
2341
- (x) => CreatePromptResponseFormat1$inboundSchema.parse(JSON.parse(x)),
2342
- `Failed to parse 'CreatePromptResponseFormat1' from JSON`,
2343
- );
2344
- }
2345
-
2346
- /** @internal */
2347
- export const CreatePromptResponseFormat$inboundSchema: z.ZodType<
2348
- CreatePromptResponseFormat,
2349
- z.ZodTypeDef,
2350
- unknown
2351
- > = z.union([
2352
- z.lazy(() => CreatePromptResponseFormat2$inboundSchema),
2353
- z.lazy(() => CreatePromptResponseFormat1$inboundSchema),
2354
- ]);
2355
-
2356
- /** @internal */
2357
- export type CreatePromptResponseFormat$Outbound =
2358
- | CreatePromptResponseFormat2$Outbound
2359
- | CreatePromptResponseFormat1$Outbound;
2360
-
2361
- /** @internal */
2362
- export const CreatePromptResponseFormat$outboundSchema: z.ZodType<
2363
- CreatePromptResponseFormat$Outbound,
2364
- z.ZodTypeDef,
2365
- CreatePromptResponseFormat
2366
- > = z.union([
2367
- z.lazy(() => CreatePromptResponseFormat2$outboundSchema),
2368
- z.lazy(() => CreatePromptResponseFormat1$outboundSchema),
2369
- ]);
2370
-
2371
- /**
2372
- * @internal
2373
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2374
- */
2375
- export namespace CreatePromptResponseFormat$ {
2376
- /** @deprecated use `CreatePromptResponseFormat$inboundSchema` instead. */
2377
- export const inboundSchema = CreatePromptResponseFormat$inboundSchema;
2378
- /** @deprecated use `CreatePromptResponseFormat$outboundSchema` instead. */
2379
- export const outboundSchema = CreatePromptResponseFormat$outboundSchema;
2380
- /** @deprecated use `CreatePromptResponseFormat$Outbound` instead. */
2381
- export type Outbound = CreatePromptResponseFormat$Outbound;
2382
- }
2383
-
2384
- export function createPromptResponseFormatToJSON(
2385
- createPromptResponseFormat: CreatePromptResponseFormat,
2386
- ): string {
2387
- return JSON.stringify(
2388
- CreatePromptResponseFormat$outboundSchema.parse(createPromptResponseFormat),
2389
- );
2390
- }
2391
-
2392
- export function createPromptResponseFormatFromJSON(
2393
- jsonString: string,
2394
- ): SafeParseResult<CreatePromptResponseFormat, SDKValidationError> {
2395
- return safeParse(
2396
- jsonString,
2397
- (x) => CreatePromptResponseFormat$inboundSchema.parse(JSON.parse(x)),
2398
- `Failed to parse 'CreatePromptResponseFormat' from JSON`,
2399
- );
2400
- }
2401
-
2402
- /** @internal */
2403
- export const CreatePromptPhotoRealVersion$inboundSchema: z.ZodNativeEnum<
2404
- typeof CreatePromptPhotoRealVersion
2405
- > = z.nativeEnum(CreatePromptPhotoRealVersion);
2406
-
2407
- /** @internal */
2408
- export const CreatePromptPhotoRealVersion$outboundSchema: z.ZodNativeEnum<
2409
- typeof CreatePromptPhotoRealVersion
2410
- > = CreatePromptPhotoRealVersion$inboundSchema;
2411
-
2412
- /**
2413
- * @internal
2414
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2415
- */
2416
- export namespace CreatePromptPhotoRealVersion$ {
2417
- /** @deprecated use `CreatePromptPhotoRealVersion$inboundSchema` instead. */
2418
- export const inboundSchema = CreatePromptPhotoRealVersion$inboundSchema;
2419
- /** @deprecated use `CreatePromptPhotoRealVersion$outboundSchema` instead. */
2420
- export const outboundSchema = CreatePromptPhotoRealVersion$outboundSchema;
2421
- }
2422
-
2423
- /** @internal */
2424
- export const CreatePromptEncodingFormat$inboundSchema: z.ZodNativeEnum<
2425
- typeof CreatePromptEncodingFormat
2426
- > = z.nativeEnum(CreatePromptEncodingFormat);
2427
-
2428
- /** @internal */
2429
- export const CreatePromptEncodingFormat$outboundSchema: z.ZodNativeEnum<
2430
- typeof CreatePromptEncodingFormat
2431
- > = CreatePromptEncodingFormat$inboundSchema;
2432
-
2433
- /**
2434
- * @internal
2435
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2436
- */
2437
- export namespace CreatePromptEncodingFormat$ {
2438
- /** @deprecated use `CreatePromptEncodingFormat$inboundSchema` instead. */
2439
- export const inboundSchema = CreatePromptEncodingFormat$inboundSchema;
2440
- /** @deprecated use `CreatePromptEncodingFormat$outboundSchema` instead. */
2441
- export const outboundSchema = CreatePromptEncodingFormat$outboundSchema;
2442
- }
2443
-
2444
- /** @internal */
2445
- export const CreatePromptModelParameters$inboundSchema: z.ZodType<
2446
- CreatePromptModelParameters,
2447
- z.ZodTypeDef,
2448
- unknown
2449
- > = z.object({
2450
- temperature: z.number().optional(),
2451
- maxTokens: z.number().optional(),
2452
- topK: z.number().optional(),
2453
- topP: z.number().optional(),
2454
- frequencyPenalty: z.number().optional(),
2455
- presencePenalty: z.number().optional(),
2456
- numImages: z.number().optional(),
2457
- seed: z.number().optional(),
2458
- format: CreatePromptFormat$inboundSchema.optional(),
2459
- dimensions: z.string().optional(),
2460
- quality: CreatePromptQuality$inboundSchema.optional(),
2461
- style: z.string().optional(),
2462
- responseFormat: z.nullable(
2463
- z.union([
2464
- z.lazy(() => CreatePromptResponseFormat2$inboundSchema),
2465
- z.lazy(() => CreatePromptResponseFormat1$inboundSchema),
2466
- ]),
2467
- ).optional(),
2468
- photoRealVersion: CreatePromptPhotoRealVersion$inboundSchema.optional(),
2469
- encoding_format: CreatePromptEncodingFormat$inboundSchema.optional(),
2470
- }).transform((v) => {
2471
- return remap$(v, {
2472
- "encoding_format": "encodingFormat",
2473
- });
2474
- });
2475
-
2476
- /** @internal */
2477
- export type CreatePromptModelParameters$Outbound = {
2478
- temperature?: number | undefined;
2479
- maxTokens?: number | undefined;
2480
- topK?: number | undefined;
2481
- topP?: number | undefined;
2482
- frequencyPenalty?: number | undefined;
2483
- presencePenalty?: number | undefined;
2484
- numImages?: number | undefined;
2485
- seed?: number | undefined;
2486
- format?: string | undefined;
2487
- dimensions?: string | undefined;
2488
- quality?: string | undefined;
2489
- style?: string | undefined;
2490
- responseFormat?:
2491
- | CreatePromptResponseFormat2$Outbound
2492
- | CreatePromptResponseFormat1$Outbound
2493
- | null
2494
- | undefined;
2495
- photoRealVersion?: string | undefined;
2496
- encoding_format?: string | undefined;
2497
- };
2498
-
2499
- /** @internal */
2500
- export const CreatePromptModelParameters$outboundSchema: z.ZodType<
2501
- CreatePromptModelParameters$Outbound,
2502
- z.ZodTypeDef,
2503
- CreatePromptModelParameters
2504
- > = z.object({
2505
- temperature: z.number().optional(),
2506
- maxTokens: z.number().optional(),
2507
- topK: z.number().optional(),
2508
- topP: z.number().optional(),
2509
- frequencyPenalty: z.number().optional(),
2510
- presencePenalty: z.number().optional(),
2511
- numImages: z.number().optional(),
2512
- seed: z.number().optional(),
2513
- format: CreatePromptFormat$outboundSchema.optional(),
2514
- dimensions: z.string().optional(),
2515
- quality: CreatePromptQuality$outboundSchema.optional(),
2516
- style: z.string().optional(),
2517
- responseFormat: z.nullable(
2518
- z.union([
2519
- z.lazy(() => CreatePromptResponseFormat2$outboundSchema),
2520
- z.lazy(() => CreatePromptResponseFormat1$outboundSchema),
2521
- ]),
2522
- ).optional(),
2523
- photoRealVersion: CreatePromptPhotoRealVersion$outboundSchema.optional(),
2524
- encodingFormat: CreatePromptEncodingFormat$outboundSchema.optional(),
2525
- }).transform((v) => {
2526
- return remap$(v, {
2527
- encodingFormat: "encoding_format",
2528
- });
2529
- });
2530
-
2531
- /**
2532
- * @internal
2533
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2534
- */
2535
- export namespace CreatePromptModelParameters$ {
2536
- /** @deprecated use `CreatePromptModelParameters$inboundSchema` instead. */
2537
- export const inboundSchema = CreatePromptModelParameters$inboundSchema;
2538
- /** @deprecated use `CreatePromptModelParameters$outboundSchema` instead. */
2539
- export const outboundSchema = CreatePromptModelParameters$outboundSchema;
2540
- /** @deprecated use `CreatePromptModelParameters$Outbound` instead. */
2541
- export type Outbound = CreatePromptModelParameters$Outbound;
2542
- }
2543
-
2544
- export function createPromptModelParametersToJSON(
2545
- createPromptModelParameters: CreatePromptModelParameters,
2546
- ): string {
2547
- return JSON.stringify(
2548
- CreatePromptModelParameters$outboundSchema.parse(
2549
- createPromptModelParameters,
2550
- ),
2551
- );
2552
- }
2553
-
2554
- export function createPromptModelParametersFromJSON(
2555
- jsonString: string,
2556
- ): SafeParseResult<CreatePromptModelParameters, SDKValidationError> {
2557
- return safeParse(
2558
- jsonString,
2559
- (x) => CreatePromptModelParameters$inboundSchema.parse(JSON.parse(x)),
2560
- `Failed to parse 'CreatePromptModelParameters' from JSON`,
2561
- );
2562
- }
2563
-
2564
- /** @internal */
2565
- export const CreatePromptProvider$inboundSchema: z.ZodNativeEnum<
2566
- typeof CreatePromptProvider
2567
- > = z.nativeEnum(CreatePromptProvider);
2568
-
2569
- /** @internal */
2570
- export const CreatePromptProvider$outboundSchema: z.ZodNativeEnum<
2571
- typeof CreatePromptProvider
2572
- > = CreatePromptProvider$inboundSchema;
2573
-
2574
- /**
2575
- * @internal
2576
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2577
- */
2578
- export namespace CreatePromptProvider$ {
2579
- /** @deprecated use `CreatePromptProvider$inboundSchema` instead. */
2580
- export const inboundSchema = CreatePromptProvider$inboundSchema;
2581
- /** @deprecated use `CreatePromptProvider$outboundSchema` instead. */
2582
- export const outboundSchema = CreatePromptProvider$outboundSchema;
2583
- }
2584
-
2585
- /** @internal */
2586
- export const CreatePromptPromptsRole$inboundSchema: z.ZodNativeEnum<
2587
- typeof CreatePromptPromptsRole
2588
- > = z.nativeEnum(CreatePromptPromptsRole);
2589
-
2590
- /** @internal */
2591
- export const CreatePromptPromptsRole$outboundSchema: z.ZodNativeEnum<
2592
- typeof CreatePromptPromptsRole
2593
- > = CreatePromptPromptsRole$inboundSchema;
2594
-
2595
- /**
2596
- * @internal
2597
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2598
- */
2599
- export namespace CreatePromptPromptsRole$ {
2600
- /** @deprecated use `CreatePromptPromptsRole$inboundSchema` instead. */
2601
- export const inboundSchema = CreatePromptPromptsRole$inboundSchema;
2602
- /** @deprecated use `CreatePromptPromptsRole$outboundSchema` instead. */
2603
- export const outboundSchema = CreatePromptPromptsRole$outboundSchema;
2604
- }
2605
-
2606
- /** @internal */
2607
- export const CreatePrompt2PromptsResponse200Type$inboundSchema: z.ZodNativeEnum<
2608
- typeof CreatePrompt2PromptsResponse200Type
2609
- > = z.nativeEnum(CreatePrompt2PromptsResponse200Type);
2610
-
2611
- /** @internal */
2612
- export const CreatePrompt2PromptsResponse200Type$outboundSchema:
2613
- z.ZodNativeEnum<typeof CreatePrompt2PromptsResponse200Type> =
2614
- CreatePrompt2PromptsResponse200Type$inboundSchema;
2615
-
2616
- /**
2617
- * @internal
2618
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2619
- */
2620
- export namespace CreatePrompt2PromptsResponse200Type$ {
2621
- /** @deprecated use `CreatePrompt2PromptsResponse200Type$inboundSchema` instead. */
2622
- export const inboundSchema =
2623
- CreatePrompt2PromptsResponse200Type$inboundSchema;
2624
- /** @deprecated use `CreatePrompt2PromptsResponse200Type$outboundSchema` instead. */
2625
- export const outboundSchema =
2626
- CreatePrompt2PromptsResponse200Type$outboundSchema;
2627
- }
2628
-
2629
- /** @internal */
2630
- export const CreatePrompt2PromptsImageUrl$inboundSchema: z.ZodType<
2631
- CreatePrompt2PromptsImageUrl,
2632
- z.ZodTypeDef,
2633
- unknown
2634
- > = z.object({
2635
- id: z.string().optional(),
2636
- url: z.string(),
2637
- detail: z.string().optional(),
2638
- });
2639
-
2640
- /** @internal */
2641
- export type CreatePrompt2PromptsImageUrl$Outbound = {
2642
- id?: string | undefined;
2643
- url: string;
2644
- detail?: string | undefined;
2645
- };
2646
-
2647
- /** @internal */
2648
- export const CreatePrompt2PromptsImageUrl$outboundSchema: z.ZodType<
2649
- CreatePrompt2PromptsImageUrl$Outbound,
2650
- z.ZodTypeDef,
2651
- CreatePrompt2PromptsImageUrl
2652
- > = z.object({
2653
- id: z.string().optional(),
2654
- url: z.string(),
2655
- detail: z.string().optional(),
2656
- });
2657
-
2658
- /**
2659
- * @internal
2660
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2661
- */
2662
- export namespace CreatePrompt2PromptsImageUrl$ {
2663
- /** @deprecated use `CreatePrompt2PromptsImageUrl$inboundSchema` instead. */
2664
- export const inboundSchema = CreatePrompt2PromptsImageUrl$inboundSchema;
2665
- /** @deprecated use `CreatePrompt2PromptsImageUrl$outboundSchema` instead. */
2666
- export const outboundSchema = CreatePrompt2PromptsImageUrl$outboundSchema;
2667
- /** @deprecated use `CreatePrompt2PromptsImageUrl$Outbound` instead. */
2668
- export type Outbound = CreatePrompt2PromptsImageUrl$Outbound;
2669
- }
2670
-
2671
- export function createPrompt2PromptsImageUrlToJSON(
2672
- createPrompt2PromptsImageUrl: CreatePrompt2PromptsImageUrl,
2673
- ): string {
2674
- return JSON.stringify(
2675
- CreatePrompt2PromptsImageUrl$outboundSchema.parse(
2676
- createPrompt2PromptsImageUrl,
2677
- ),
2678
- );
2679
- }
2680
-
2681
- export function createPrompt2PromptsImageUrlFromJSON(
2682
- jsonString: string,
2683
- ): SafeParseResult<CreatePrompt2PromptsImageUrl, SDKValidationError> {
2684
- return safeParse(
2685
- jsonString,
2686
- (x) => CreatePrompt2PromptsImageUrl$inboundSchema.parse(JSON.parse(x)),
2687
- `Failed to parse 'CreatePrompt2PromptsImageUrl' from JSON`,
2688
- );
2689
- }
2690
-
2691
- /** @internal */
2692
- export const CreatePrompt2Prompts2$inboundSchema: z.ZodType<
2693
- CreatePrompt2Prompts2,
2694
- z.ZodTypeDef,
2695
- unknown
2696
- > = z.object({
2697
- type: CreatePrompt2PromptsResponse200Type$inboundSchema,
2698
- image_url: z.lazy(() => CreatePrompt2PromptsImageUrl$inboundSchema),
2699
- }).transform((v) => {
2700
- return remap$(v, {
2701
- "image_url": "imageUrl",
2702
- });
2703
- });
2704
-
2705
- /** @internal */
2706
- export type CreatePrompt2Prompts2$Outbound = {
2707
- type: string;
2708
- image_url: CreatePrompt2PromptsImageUrl$Outbound;
2709
- };
2710
-
2711
- /** @internal */
2712
- export const CreatePrompt2Prompts2$outboundSchema: z.ZodType<
2713
- CreatePrompt2Prompts2$Outbound,
2714
- z.ZodTypeDef,
2715
- CreatePrompt2Prompts2
2716
- > = z.object({
2717
- type: CreatePrompt2PromptsResponse200Type$outboundSchema,
2718
- imageUrl: z.lazy(() => CreatePrompt2PromptsImageUrl$outboundSchema),
2719
- }).transform((v) => {
2720
- return remap$(v, {
2721
- imageUrl: "image_url",
2722
- });
2723
- });
2724
-
2725
- /**
2726
- * @internal
2727
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2728
- */
2729
- export namespace CreatePrompt2Prompts2$ {
2730
- /** @deprecated use `CreatePrompt2Prompts2$inboundSchema` instead. */
2731
- export const inboundSchema = CreatePrompt2Prompts2$inboundSchema;
2732
- /** @deprecated use `CreatePrompt2Prompts2$outboundSchema` instead. */
2733
- export const outboundSchema = CreatePrompt2Prompts2$outboundSchema;
2734
- /** @deprecated use `CreatePrompt2Prompts2$Outbound` instead. */
2735
- export type Outbound = CreatePrompt2Prompts2$Outbound;
2736
- }
2737
-
2738
- export function createPrompt2Prompts2ToJSON(
2739
- createPrompt2Prompts2: CreatePrompt2Prompts2,
2740
- ): string {
2741
- return JSON.stringify(
2742
- CreatePrompt2Prompts2$outboundSchema.parse(createPrompt2Prompts2),
2743
- );
2744
- }
2745
-
2746
- export function createPrompt2Prompts2FromJSON(
2747
- jsonString: string,
2748
- ): SafeParseResult<CreatePrompt2Prompts2, SDKValidationError> {
2749
- return safeParse(
2750
- jsonString,
2751
- (x) => CreatePrompt2Prompts2$inboundSchema.parse(JSON.parse(x)),
2752
- `Failed to parse 'CreatePrompt2Prompts2' from JSON`,
2753
- );
2754
- }
2755
-
2756
- /** @internal */
2757
- export const CreatePrompt2PromptsResponseType$inboundSchema: z.ZodNativeEnum<
2758
- typeof CreatePrompt2PromptsResponseType
2759
- > = z.nativeEnum(CreatePrompt2PromptsResponseType);
2760
-
2761
- /** @internal */
2762
- export const CreatePrompt2PromptsResponseType$outboundSchema: z.ZodNativeEnum<
2763
- typeof CreatePrompt2PromptsResponseType
2764
- > = CreatePrompt2PromptsResponseType$inboundSchema;
2765
-
2766
- /**
2767
- * @internal
2768
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2769
- */
2770
- export namespace CreatePrompt2PromptsResponseType$ {
2771
- /** @deprecated use `CreatePrompt2PromptsResponseType$inboundSchema` instead. */
2772
- export const inboundSchema = CreatePrompt2PromptsResponseType$inboundSchema;
2773
- /** @deprecated use `CreatePrompt2PromptsResponseType$outboundSchema` instead. */
2774
- export const outboundSchema = CreatePrompt2PromptsResponseType$outboundSchema;
2775
- }
2776
-
2777
- /** @internal */
2778
- export const CreatePrompt2Prompts1$inboundSchema: z.ZodType<
2779
- CreatePrompt2Prompts1,
2780
- z.ZodTypeDef,
2781
- unknown
2782
- > = z.object({
2783
- type: CreatePrompt2PromptsResponseType$inboundSchema,
2784
- text: z.string(),
2785
- });
2786
-
2787
- /** @internal */
2788
- export type CreatePrompt2Prompts1$Outbound = {
2789
- type: string;
2790
- text: string;
2791
- };
2792
-
2793
- /** @internal */
2794
- export const CreatePrompt2Prompts1$outboundSchema: z.ZodType<
2795
- CreatePrompt2Prompts1$Outbound,
2796
- z.ZodTypeDef,
2797
- CreatePrompt2Prompts1
2798
- > = z.object({
2799
- type: CreatePrompt2PromptsResponseType$outboundSchema,
2800
- text: z.string(),
2801
- });
2802
-
2803
- /**
2804
- * @internal
2805
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2806
- */
2807
- export namespace CreatePrompt2Prompts1$ {
2808
- /** @deprecated use `CreatePrompt2Prompts1$inboundSchema` instead. */
2809
- export const inboundSchema = CreatePrompt2Prompts1$inboundSchema;
2810
- /** @deprecated use `CreatePrompt2Prompts1$outboundSchema` instead. */
2811
- export const outboundSchema = CreatePrompt2Prompts1$outboundSchema;
2812
- /** @deprecated use `CreatePrompt2Prompts1$Outbound` instead. */
2813
- export type Outbound = CreatePrompt2Prompts1$Outbound;
2814
- }
2815
-
2816
- export function createPrompt2Prompts1ToJSON(
2817
- createPrompt2Prompts1: CreatePrompt2Prompts1,
2818
- ): string {
2819
- return JSON.stringify(
2820
- CreatePrompt2Prompts1$outboundSchema.parse(createPrompt2Prompts1),
2821
- );
2822
- }
2823
-
2824
- export function createPrompt2Prompts1FromJSON(
2825
- jsonString: string,
2826
- ): SafeParseResult<CreatePrompt2Prompts1, SDKValidationError> {
2827
- return safeParse(
2828
- jsonString,
2829
- (x) => CreatePrompt2Prompts1$inboundSchema.parse(JSON.parse(x)),
2830
- `Failed to parse 'CreatePrompt2Prompts1' from JSON`,
2831
- );
2832
- }
2833
-
2834
- /** @internal */
2835
- export const CreatePromptContentPrompts2$inboundSchema: z.ZodType<
2836
- CreatePromptContentPrompts2,
2837
- z.ZodTypeDef,
2838
- unknown
2839
- > = z.union([
2840
- z.lazy(() => CreatePrompt2Prompts1$inboundSchema),
2841
- z.lazy(() => CreatePrompt2Prompts2$inboundSchema),
2842
- ]);
2843
-
2844
- /** @internal */
2845
- export type CreatePromptContentPrompts2$Outbound =
2846
- | CreatePrompt2Prompts1$Outbound
2847
- | CreatePrompt2Prompts2$Outbound;
2848
-
2849
- /** @internal */
2850
- export const CreatePromptContentPrompts2$outboundSchema: z.ZodType<
2851
- CreatePromptContentPrompts2$Outbound,
2852
- z.ZodTypeDef,
2853
- CreatePromptContentPrompts2
2854
- > = z.union([
2855
- z.lazy(() => CreatePrompt2Prompts1$outboundSchema),
2856
- z.lazy(() => CreatePrompt2Prompts2$outboundSchema),
2857
- ]);
2858
-
2859
- /**
2860
- * @internal
2861
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2862
- */
2863
- export namespace CreatePromptContentPrompts2$ {
2864
- /** @deprecated use `CreatePromptContentPrompts2$inboundSchema` instead. */
2865
- export const inboundSchema = CreatePromptContentPrompts2$inboundSchema;
2866
- /** @deprecated use `CreatePromptContentPrompts2$outboundSchema` instead. */
2867
- export const outboundSchema = CreatePromptContentPrompts2$outboundSchema;
2868
- /** @deprecated use `CreatePromptContentPrompts2$Outbound` instead. */
2869
- export type Outbound = CreatePromptContentPrompts2$Outbound;
2870
- }
2871
-
2872
- export function createPromptContentPrompts2ToJSON(
2873
- createPromptContentPrompts2: CreatePromptContentPrompts2,
2874
- ): string {
2875
- return JSON.stringify(
2876
- CreatePromptContentPrompts2$outboundSchema.parse(
2877
- createPromptContentPrompts2,
2878
- ),
2879
- );
2880
- }
2881
-
2882
- export function createPromptContentPrompts2FromJSON(
2883
- jsonString: string,
2884
- ): SafeParseResult<CreatePromptContentPrompts2, SDKValidationError> {
2885
- return safeParse(
2886
- jsonString,
2887
- (x) => CreatePromptContentPrompts2$inboundSchema.parse(JSON.parse(x)),
2888
- `Failed to parse 'CreatePromptContentPrompts2' from JSON`,
2889
- );
2890
- }
2891
-
2892
- /** @internal */
2893
- export const CreatePromptPromptsContent$inboundSchema: z.ZodType<
2894
- CreatePromptPromptsContent,
2895
- z.ZodTypeDef,
2896
- unknown
2897
- > = z.union([
2898
- z.string(),
2899
- z.array(z.union([
2900
- z.lazy(() => CreatePrompt2Prompts1$inboundSchema),
2901
- z.lazy(() => CreatePrompt2Prompts2$inboundSchema),
2902
- ])),
2903
- ]);
2904
-
2905
- /** @internal */
2906
- export type CreatePromptPromptsContent$Outbound =
2907
- | string
2908
- | Array<CreatePrompt2Prompts1$Outbound | CreatePrompt2Prompts2$Outbound>;
2909
-
2910
- /** @internal */
2911
- export const CreatePromptPromptsContent$outboundSchema: z.ZodType<
2912
- CreatePromptPromptsContent$Outbound,
2913
- z.ZodTypeDef,
2914
- CreatePromptPromptsContent
2915
- > = z.union([
2916
- z.string(),
2917
- z.array(z.union([
2918
- z.lazy(() => CreatePrompt2Prompts1$outboundSchema),
2919
- z.lazy(() => CreatePrompt2Prompts2$outboundSchema),
2920
- ])),
2921
- ]);
2922
-
2923
- /**
2924
- * @internal
2925
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2926
- */
2927
- export namespace CreatePromptPromptsContent$ {
2928
- /** @deprecated use `CreatePromptPromptsContent$inboundSchema` instead. */
2929
- export const inboundSchema = CreatePromptPromptsContent$inboundSchema;
2930
- /** @deprecated use `CreatePromptPromptsContent$outboundSchema` instead. */
2931
- export const outboundSchema = CreatePromptPromptsContent$outboundSchema;
2932
- /** @deprecated use `CreatePromptPromptsContent$Outbound` instead. */
2933
- export type Outbound = CreatePromptPromptsContent$Outbound;
2934
- }
2935
-
2936
- export function createPromptPromptsContentToJSON(
2937
- createPromptPromptsContent: CreatePromptPromptsContent,
2938
- ): string {
2939
- return JSON.stringify(
2940
- CreatePromptPromptsContent$outboundSchema.parse(createPromptPromptsContent),
2941
- );
2942
- }
2943
-
2944
- export function createPromptPromptsContentFromJSON(
2945
- jsonString: string,
2946
- ): SafeParseResult<CreatePromptPromptsContent, SDKValidationError> {
2947
- return safeParse(
2948
- jsonString,
2949
- (x) => CreatePromptPromptsContent$inboundSchema.parse(JSON.parse(x)),
2950
- `Failed to parse 'CreatePromptPromptsContent' from JSON`,
2951
- );
2952
- }
2953
-
2954
- /** @internal */
2955
- export const CreatePromptPromptsResponse200Type$inboundSchema: z.ZodNativeEnum<
2956
- typeof CreatePromptPromptsResponse200Type
2957
- > = z.nativeEnum(CreatePromptPromptsResponse200Type);
2958
-
2959
- /** @internal */
2960
- export const CreatePromptPromptsResponse200Type$outboundSchema: z.ZodNativeEnum<
2961
- typeof CreatePromptPromptsResponse200Type
2962
- > = CreatePromptPromptsResponse200Type$inboundSchema;
2963
-
2964
- /**
2965
- * @internal
2966
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
2967
- */
2968
- export namespace CreatePromptPromptsResponse200Type$ {
2969
- /** @deprecated use `CreatePromptPromptsResponse200Type$inboundSchema` instead. */
2970
- export const inboundSchema = CreatePromptPromptsResponse200Type$inboundSchema;
2971
- /** @deprecated use `CreatePromptPromptsResponse200Type$outboundSchema` instead. */
2972
- export const outboundSchema =
2973
- CreatePromptPromptsResponse200Type$outboundSchema;
2974
- }
2975
-
2976
- /** @internal */
2977
- export const CreatePromptPromptsFunction$inboundSchema: z.ZodType<
2978
- CreatePromptPromptsFunction,
2979
- z.ZodTypeDef,
2980
- unknown
2981
- > = z.object({
2982
- name: z.string(),
2983
- arguments: z.string(),
2984
- });
2985
-
2986
- /** @internal */
2987
- export type CreatePromptPromptsFunction$Outbound = {
2988
- name: string;
2989
- arguments: string;
2990
- };
2991
-
2992
- /** @internal */
2993
- export const CreatePromptPromptsFunction$outboundSchema: z.ZodType<
2994
- CreatePromptPromptsFunction$Outbound,
2995
- z.ZodTypeDef,
2996
- CreatePromptPromptsFunction
2997
- > = z.object({
2998
- name: z.string(),
2999
- arguments: z.string(),
3000
- });
3001
-
3002
- /**
3003
- * @internal
3004
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
3005
- */
3006
- export namespace CreatePromptPromptsFunction$ {
3007
- /** @deprecated use `CreatePromptPromptsFunction$inboundSchema` instead. */
3008
- export const inboundSchema = CreatePromptPromptsFunction$inboundSchema;
3009
- /** @deprecated use `CreatePromptPromptsFunction$outboundSchema` instead. */
3010
- export const outboundSchema = CreatePromptPromptsFunction$outboundSchema;
3011
- /** @deprecated use `CreatePromptPromptsFunction$Outbound` instead. */
3012
- export type Outbound = CreatePromptPromptsFunction$Outbound;
3013
- }
3014
-
3015
- export function createPromptPromptsFunctionToJSON(
3016
- createPromptPromptsFunction: CreatePromptPromptsFunction,
3017
- ): string {
3018
- return JSON.stringify(
3019
- CreatePromptPromptsFunction$outboundSchema.parse(
3020
- createPromptPromptsFunction,
3021
- ),
3022
- );
3023
- }
3024
-
3025
- export function createPromptPromptsFunctionFromJSON(
3026
- jsonString: string,
3027
- ): SafeParseResult<CreatePromptPromptsFunction, SDKValidationError> {
3028
- return safeParse(
3029
- jsonString,
3030
- (x) => CreatePromptPromptsFunction$inboundSchema.parse(JSON.parse(x)),
3031
- `Failed to parse 'CreatePromptPromptsFunction' from JSON`,
3032
- );
3033
- }
3034
-
3035
- /** @internal */
3036
- export const CreatePromptPromptsToolCalls$inboundSchema: z.ZodType<
3037
- CreatePromptPromptsToolCalls,
3038
- z.ZodTypeDef,
3039
- unknown
3040
- > = z.object({
3041
- id: z.string().optional(),
3042
- index: z.number().optional(),
3043
- type: CreatePromptPromptsResponse200Type$inboundSchema,
3044
- function: z.lazy(() => CreatePromptPromptsFunction$inboundSchema),
3045
- });
3046
-
3047
- /** @internal */
3048
- export type CreatePromptPromptsToolCalls$Outbound = {
3049
- id?: string | undefined;
3050
- index?: number | undefined;
3051
- type: string;
3052
- function: CreatePromptPromptsFunction$Outbound;
3053
- };
3054
-
3055
- /** @internal */
3056
- export const CreatePromptPromptsToolCalls$outboundSchema: z.ZodType<
3057
- CreatePromptPromptsToolCalls$Outbound,
3058
- z.ZodTypeDef,
3059
- CreatePromptPromptsToolCalls
3060
- > = z.object({
3061
- id: z.string().optional(),
3062
- index: z.number().optional(),
3063
- type: CreatePromptPromptsResponse200Type$outboundSchema,
3064
- function: z.lazy(() => CreatePromptPromptsFunction$outboundSchema),
3065
- });
3066
-
3067
- /**
3068
- * @internal
3069
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
3070
- */
3071
- export namespace CreatePromptPromptsToolCalls$ {
3072
- /** @deprecated use `CreatePromptPromptsToolCalls$inboundSchema` instead. */
3073
- export const inboundSchema = CreatePromptPromptsToolCalls$inboundSchema;
3074
- /** @deprecated use `CreatePromptPromptsToolCalls$outboundSchema` instead. */
3075
- export const outboundSchema = CreatePromptPromptsToolCalls$outboundSchema;
3076
- /** @deprecated use `CreatePromptPromptsToolCalls$Outbound` instead. */
3077
- export type Outbound = CreatePromptPromptsToolCalls$Outbound;
3078
- }
3079
-
3080
- export function createPromptPromptsToolCallsToJSON(
3081
- createPromptPromptsToolCalls: CreatePromptPromptsToolCalls,
3082
- ): string {
3083
- return JSON.stringify(
3084
- CreatePromptPromptsToolCalls$outboundSchema.parse(
3085
- createPromptPromptsToolCalls,
3086
- ),
3087
- );
3088
- }
3089
-
3090
- export function createPromptPromptsToolCallsFromJSON(
3091
- jsonString: string,
3092
- ): SafeParseResult<CreatePromptPromptsToolCalls, SDKValidationError> {
3093
- return safeParse(
3094
- jsonString,
3095
- (x) => CreatePromptPromptsToolCalls$inboundSchema.parse(JSON.parse(x)),
3096
- `Failed to parse 'CreatePromptPromptsToolCalls' from JSON`,
3097
- );
3098
- }
3099
-
3100
- /** @internal */
3101
- export const CreatePromptPromptsMessages$inboundSchema: z.ZodType<
3102
- CreatePromptPromptsMessages,
3103
- z.ZodTypeDef,
3104
- unknown
3105
- > = z.object({
3106
- role: CreatePromptPromptsRole$inboundSchema,
3107
- content: z.union([
3108
- z.string(),
3109
- z.array(z.union([
3110
- z.lazy(() => CreatePrompt2Prompts1$inboundSchema),
3111
- z.lazy(() => CreatePrompt2Prompts2$inboundSchema),
3112
- ])),
3113
- ]),
3114
- tool_calls: z.array(z.lazy(() => CreatePromptPromptsToolCalls$inboundSchema))
3115
- .optional(),
3116
- }).transform((v) => {
3117
- return remap$(v, {
3118
- "tool_calls": "toolCalls",
3119
- });
3120
- });
3121
-
3122
- /** @internal */
3123
- export type CreatePromptPromptsMessages$Outbound = {
3124
- role: string;
3125
- content:
3126
- | string
3127
- | Array<CreatePrompt2Prompts1$Outbound | CreatePrompt2Prompts2$Outbound>;
3128
- tool_calls?: Array<CreatePromptPromptsToolCalls$Outbound> | undefined;
3129
- };
3130
-
3131
- /** @internal */
3132
- export const CreatePromptPromptsMessages$outboundSchema: z.ZodType<
3133
- CreatePromptPromptsMessages$Outbound,
3134
- z.ZodTypeDef,
3135
- CreatePromptPromptsMessages
3136
- > = z.object({
3137
- role: CreatePromptPromptsRole$outboundSchema,
3138
- content: z.union([
3139
- z.string(),
3140
- z.array(z.union([
3141
- z.lazy(() => CreatePrompt2Prompts1$outboundSchema),
3142
- z.lazy(() => CreatePrompt2Prompts2$outboundSchema),
3143
- ])),
3144
- ]),
3145
- toolCalls: z.array(z.lazy(() => CreatePromptPromptsToolCalls$outboundSchema))
3146
- .optional(),
3147
- }).transform((v) => {
3148
- return remap$(v, {
3149
- toolCalls: "tool_calls",
3150
- });
3151
- });
3152
-
3153
- /**
3154
- * @internal
3155
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
3156
- */
3157
- export namespace CreatePromptPromptsMessages$ {
3158
- /** @deprecated use `CreatePromptPromptsMessages$inboundSchema` instead. */
3159
- export const inboundSchema = CreatePromptPromptsMessages$inboundSchema;
3160
- /** @deprecated use `CreatePromptPromptsMessages$outboundSchema` instead. */
3161
- export const outboundSchema = CreatePromptPromptsMessages$outboundSchema;
3162
- /** @deprecated use `CreatePromptPromptsMessages$Outbound` instead. */
3163
- export type Outbound = CreatePromptPromptsMessages$Outbound;
3164
- }
3165
-
3166
- export function createPromptPromptsMessagesToJSON(
3167
- createPromptPromptsMessages: CreatePromptPromptsMessages,
3168
- ): string {
3169
- return JSON.stringify(
3170
- CreatePromptPromptsMessages$outboundSchema.parse(
3171
- createPromptPromptsMessages,
3172
- ),
3173
- );
3174
- }
3175
-
3176
- export function createPromptPromptsMessagesFromJSON(
3177
- jsonString: string,
3178
- ): SafeParseResult<CreatePromptPromptsMessages, SDKValidationError> {
3179
- return safeParse(
3180
- jsonString,
3181
- (x) => CreatePromptPromptsMessages$inboundSchema.parse(JSON.parse(x)),
3182
- `Failed to parse 'CreatePromptPromptsMessages' from JSON`,
3183
- );
3184
- }
3185
-
3186
- /** @internal */
3187
- export const CreatePromptPromptConfig$inboundSchema: z.ZodType<
3188
- CreatePromptPromptConfig,
3189
- z.ZodTypeDef,
3190
- unknown
3191
- > = z.object({
3192
- stream: z.boolean().optional(),
3193
- model: z.string().optional(),
3194
- model_db_id: z.string().optional(),
3195
- model_type: CreatePromptModelType$inboundSchema.optional(),
3196
- model_parameters: z.lazy(() => CreatePromptModelParameters$inboundSchema)
3197
- .optional(),
3198
- provider: CreatePromptProvider$inboundSchema.optional(),
3199
- integration_id: z.nullable(z.string()).optional(),
3200
- version: z.string().optional(),
3201
- messages: z.array(z.lazy(() => CreatePromptPromptsMessages$inboundSchema)),
3202
- }).transform((v) => {
3203
- return remap$(v, {
3204
- "model_db_id": "modelDbId",
3205
- "model_type": "modelType",
3206
- "model_parameters": "modelParameters",
3207
- "integration_id": "integrationId",
3208
- });
3209
- });
3210
-
3211
- /** @internal */
3212
- export type CreatePromptPromptConfig$Outbound = {
3213
- stream?: boolean | undefined;
3214
- model?: string | undefined;
3215
- model_db_id?: string | undefined;
3216
- model_type?: string | undefined;
3217
- model_parameters?: CreatePromptModelParameters$Outbound | undefined;
3218
- provider?: string | undefined;
3219
- integration_id?: string | null | undefined;
3220
- version?: string | undefined;
3221
- messages: Array<CreatePromptPromptsMessages$Outbound>;
3222
- };
3223
-
3224
- /** @internal */
3225
- export const CreatePromptPromptConfig$outboundSchema: z.ZodType<
3226
- CreatePromptPromptConfig$Outbound,
3227
- z.ZodTypeDef,
3228
- CreatePromptPromptConfig
3229
- > = z.object({
3230
- stream: z.boolean().optional(),
3231
- model: z.string().optional(),
3232
- modelDbId: z.string().optional(),
3233
- modelType: CreatePromptModelType$outboundSchema.optional(),
3234
- modelParameters: z.lazy(() => CreatePromptModelParameters$outboundSchema)
3235
- .optional(),
3236
- provider: CreatePromptProvider$outboundSchema.optional(),
3237
- integrationId: z.nullable(z.string()).optional(),
3238
- version: z.string().optional(),
3239
- messages: z.array(z.lazy(() => CreatePromptPromptsMessages$outboundSchema)),
3240
- }).transform((v) => {
3241
- return remap$(v, {
3242
- modelDbId: "model_db_id",
3243
- modelType: "model_type",
3244
- modelParameters: "model_parameters",
3245
- integrationId: "integration_id",
3246
- });
3247
- });
3248
-
3249
- /**
3250
- * @internal
3251
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
3252
- */
3253
- export namespace CreatePromptPromptConfig$ {
3254
- /** @deprecated use `CreatePromptPromptConfig$inboundSchema` instead. */
3255
- export const inboundSchema = CreatePromptPromptConfig$inboundSchema;
3256
- /** @deprecated use `CreatePromptPromptConfig$outboundSchema` instead. */
3257
- export const outboundSchema = CreatePromptPromptConfig$outboundSchema;
3258
- /** @deprecated use `CreatePromptPromptConfig$Outbound` instead. */
3259
- export type Outbound = CreatePromptPromptConfig$Outbound;
3260
- }
3261
-
3262
- export function createPromptPromptConfigToJSON(
3263
- createPromptPromptConfig: CreatePromptPromptConfig,
3264
- ): string {
3265
- return JSON.stringify(
3266
- CreatePromptPromptConfig$outboundSchema.parse(createPromptPromptConfig),
3267
- );
3268
- }
3269
-
3270
- export function createPromptPromptConfigFromJSON(
3271
- jsonString: string,
3272
- ): SafeParseResult<CreatePromptPromptConfig, SDKValidationError> {
3273
- return safeParse(
3274
- jsonString,
3275
- (x) => CreatePromptPromptConfig$inboundSchema.parse(JSON.parse(x)),
3276
- `Failed to parse 'CreatePromptPromptConfig' from JSON`,
3277
- );
3278
- }
3279
-
3280
- /** @internal */
3281
- export const CreatePromptMetadata$inboundSchema: z.ZodType<
3282
- CreatePromptMetadata,
3283
- z.ZodTypeDef,
3284
- unknown
3285
- > = z.object({
3286
- use_cases: z.array(z.string()).optional(),
3287
- language: z.string().optional(),
3288
- }).transform((v) => {
3289
- return remap$(v, {
3290
- "use_cases": "useCases",
3291
- });
3292
- });
3293
-
3294
- /** @internal */
3295
- export type CreatePromptMetadata$Outbound = {
3296
- use_cases?: Array<string> | undefined;
3297
- language?: string | undefined;
3298
- };
3299
-
3300
- /** @internal */
3301
- export const CreatePromptMetadata$outboundSchema: z.ZodType<
3302
- CreatePromptMetadata$Outbound,
3303
- z.ZodTypeDef,
3304
- CreatePromptMetadata
3305
- > = z.object({
3306
- useCases: z.array(z.string()).optional(),
3307
- language: z.string().optional(),
3308
- }).transform((v) => {
3309
- return remap$(v, {
3310
- useCases: "use_cases",
3311
- });
3312
- });
3313
-
3314
- /**
3315
- * @internal
3316
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
3317
- */
3318
- export namespace CreatePromptMetadata$ {
3319
- /** @deprecated use `CreatePromptMetadata$inboundSchema` instead. */
3320
- export const inboundSchema = CreatePromptMetadata$inboundSchema;
3321
- /** @deprecated use `CreatePromptMetadata$outboundSchema` instead. */
3322
- export const outboundSchema = CreatePromptMetadata$outboundSchema;
3323
- /** @deprecated use `CreatePromptMetadata$Outbound` instead. */
3324
- export type Outbound = CreatePromptMetadata$Outbound;
3325
- }
3326
-
3327
- export function createPromptMetadataToJSON(
3328
- createPromptMetadata: CreatePromptMetadata,
3329
- ): string {
3330
- return JSON.stringify(
3331
- CreatePromptMetadata$outboundSchema.parse(createPromptMetadata),
3332
- );
3333
- }
3334
-
3335
- export function createPromptMetadataFromJSON(
3336
- jsonString: string,
3337
- ): SafeParseResult<CreatePromptMetadata, SDKValidationError> {
3338
- return safeParse(
3339
- jsonString,
3340
- (x) => CreatePromptMetadata$inboundSchema.parse(JSON.parse(x)),
3341
- `Failed to parse 'CreatePromptMetadata' from JSON`,
3342
- );
3343
- }
3344
-
3345
- /** @internal */
3346
- export const CreatePromptPromptsResponseType$inboundSchema: z.ZodNativeEnum<
3347
- typeof CreatePromptPromptsResponseType
3348
- > = z.nativeEnum(CreatePromptPromptsResponseType);
3349
-
3350
- /** @internal */
3351
- export const CreatePromptPromptsResponseType$outboundSchema: z.ZodNativeEnum<
3352
- typeof CreatePromptPromptsResponseType
3353
- > = CreatePromptPromptsResponseType$inboundSchema;
3354
-
3355
- /**
3356
- * @internal
3357
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
3358
- */
3359
- export namespace CreatePromptPromptsResponseType$ {
3360
- /** @deprecated use `CreatePromptPromptsResponseType$inboundSchema` instead. */
3361
- export const inboundSchema = CreatePromptPromptsResponseType$inboundSchema;
3362
- /** @deprecated use `CreatePromptPromptsResponseType$outboundSchema` instead. */
3363
- export const outboundSchema = CreatePromptPromptsResponseType$outboundSchema;
3364
- }
3365
-
3366
- /** @internal */
3367
- export const CreatePromptResponseBody$inboundSchema: z.ZodType<
3368
- CreatePromptResponseBody,
3369
- z.ZodTypeDef,
3370
- unknown
3371
- > = z.object({
3372
- _id: z.string(),
3373
- display_name: z.string(),
3374
- domain_id: z.string(),
3375
- description: z.nullable(z.string()).optional(),
3376
- prompt_config: z.lazy(() => CreatePromptPromptConfig$inboundSchema)
3377
- .optional(),
3378
- metadata: z.lazy(() => CreatePromptMetadata$inboundSchema).optional(),
3379
- key: z.string().optional(),
3380
- type: CreatePromptPromptsResponseType$inboundSchema,
3381
- }).transform((v) => {
3382
- return remap$(v, {
3383
- "_id": "id",
3384
- "display_name": "displayName",
3385
- "domain_id": "domainId",
3386
- "prompt_config": "promptConfig",
3387
- });
3388
- });
3389
-
3390
- /** @internal */
3391
- export type CreatePromptResponseBody$Outbound = {
3392
- _id: string;
3393
- display_name: string;
3394
- domain_id: string;
3395
- description?: string | null | undefined;
3396
- prompt_config?: CreatePromptPromptConfig$Outbound | undefined;
3397
- metadata?: CreatePromptMetadata$Outbound | undefined;
3398
- key?: string | undefined;
3399
- type: string;
3400
- };
3401
-
3402
- /** @internal */
3403
- export const CreatePromptResponseBody$outboundSchema: z.ZodType<
3404
- CreatePromptResponseBody$Outbound,
3405
- z.ZodTypeDef,
3406
- CreatePromptResponseBody
3407
- > = z.object({
3408
- id: z.string(),
3409
- displayName: z.string(),
3410
- domainId: z.string(),
3411
- description: z.nullable(z.string()).optional(),
3412
- promptConfig: z.lazy(() => CreatePromptPromptConfig$outboundSchema)
3413
- .optional(),
3414
- metadata: z.lazy(() => CreatePromptMetadata$outboundSchema).optional(),
3415
- key: z.string().optional(),
3416
- type: CreatePromptPromptsResponseType$outboundSchema,
3417
- }).transform((v) => {
3418
- return remap$(v, {
3419
- id: "_id",
3420
- displayName: "display_name",
3421
- domainId: "domain_id",
3422
- promptConfig: "prompt_config",
3423
- });
3424
- });
3425
-
3426
- /**
3427
- * @internal
3428
- * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
3429
- */
3430
- export namespace CreatePromptResponseBody$ {
3431
- /** @deprecated use `CreatePromptResponseBody$inboundSchema` instead. */
3432
- export const inboundSchema = CreatePromptResponseBody$inboundSchema;
3433
- /** @deprecated use `CreatePromptResponseBody$outboundSchema` instead. */
3434
- export const outboundSchema = CreatePromptResponseBody$outboundSchema;
3435
- /** @deprecated use `CreatePromptResponseBody$Outbound` instead. */
3436
- export type Outbound = CreatePromptResponseBody$Outbound;
3437
- }
3438
-
3439
- export function createPromptResponseBodyToJSON(
3440
- createPromptResponseBody: CreatePromptResponseBody,
3441
- ): string {
3442
- return JSON.stringify(
3443
- CreatePromptResponseBody$outboundSchema.parse(createPromptResponseBody),
3444
- );
3445
- }
3446
-
3447
- export function createPromptResponseBodyFromJSON(
3448
- jsonString: string,
3449
- ): SafeParseResult<CreatePromptResponseBody, SDKValidationError> {
3450
- return safeParse(
3451
- jsonString,
3452
- (x) => CreatePromptResponseBody$inboundSchema.parse(JSON.parse(x)),
3453
- `Failed to parse 'CreatePromptResponseBody' from JSON`,
3454
- );
3455
- }