@orq-ai/node 4.2.0-rc.44 → 4.2.0-rc.45

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 (151) hide show
  1. package/README.md +2 -1
  2. package/bin/mcp-server.js +4769 -1624
  3. package/bin/mcp-server.js.map +57 -56
  4. package/examples/package-lock.json +1 -1
  5. package/funcs/promptsDelete.d.ts +2 -1
  6. package/funcs/promptsDelete.d.ts.map +1 -1
  7. package/funcs/promptsDelete.js +7 -3
  8. package/funcs/promptsDelete.js.map +1 -1
  9. package/jsr.json +1 -1
  10. package/lib/config.d.ts +2 -2
  11. package/lib/config.js +2 -2
  12. package/mcp-server/mcp-server.js +1 -1
  13. package/mcp-server/server.js +1 -1
  14. package/models/components/conversationresponse.js +2 -2
  15. package/models/components/conversationwithmessagesresponse.js +2 -2
  16. package/models/components/partdoneevent.js +2 -2
  17. package/models/components/reasoningpart.js +2 -2
  18. package/models/errors/deleteprompt.d.ts +29 -0
  19. package/models/errors/deleteprompt.d.ts.map +1 -0
  20. package/models/errors/deleteprompt.js +74 -0
  21. package/models/errors/deleteprompt.js.map +1 -0
  22. package/models/errors/index.d.ts +1 -0
  23. package/models/errors/index.d.ts.map +1 -1
  24. package/models/errors/index.js +1 -0
  25. package/models/errors/index.js.map +1 -1
  26. package/models/operations/createcontact.js +2 -2
  27. package/models/operations/createconversation.js +2 -2
  28. package/models/operations/createconversationresponse.js +4 -4
  29. package/models/operations/createdataset.js +2 -2
  30. package/models/operations/createdatasetitem.js +8 -8
  31. package/models/operations/createdatasource.js +2 -2
  32. package/models/operations/createeval.d.ts +16 -16
  33. package/models/operations/createeval.d.ts.map +1 -1
  34. package/models/operations/createeval.js +56 -53
  35. package/models/operations/createeval.js.map +1 -1
  36. package/models/operations/createidentity.js +2 -2
  37. package/models/operations/createprompt.d.ts +1746 -976
  38. package/models/operations/createprompt.d.ts.map +1 -1
  39. package/models/operations/createprompt.js +2032 -1282
  40. package/models/operations/createprompt.js.map +1 -1
  41. package/models/operations/createtool.js +12 -12
  42. package/models/operations/deploymentgetconfig.d.ts +88 -88
  43. package/models/operations/deploymentgetconfig.d.ts.map +1 -1
  44. package/models/operations/deploymentgetconfig.js +131 -130
  45. package/models/operations/deploymentgetconfig.js.map +1 -1
  46. package/models/operations/deploymentinvoke.d.ts +5 -5
  47. package/models/operations/deploymentinvoke.d.ts.map +1 -1
  48. package/models/operations/deploymentinvoke.js +7 -6
  49. package/models/operations/deploymentinvoke.js.map +1 -1
  50. package/models/operations/fileget.js +2 -2
  51. package/models/operations/filelist.js +2 -2
  52. package/models/operations/fileupload.js +2 -2
  53. package/models/operations/generateconversationname.js +2 -2
  54. package/models/operations/getallprompts.d.ts +1051 -42
  55. package/models/operations/getallprompts.d.ts.map +1 -1
  56. package/models/operations/getallprompts.js +1069 -48
  57. package/models/operations/getallprompts.js.map +1 -1
  58. package/models/operations/getalltools.js +12 -12
  59. package/models/operations/getevals.js +28 -28
  60. package/models/operations/getoneprompt.d.ts +1051 -42
  61. package/models/operations/getoneprompt.d.ts.map +1 -1
  62. package/models/operations/getoneprompt.js +1071 -47
  63. package/models/operations/getoneprompt.js.map +1 -1
  64. package/models/operations/getpromptversion.d.ts +1051 -42
  65. package/models/operations/getpromptversion.d.ts.map +1 -1
  66. package/models/operations/getpromptversion.js +1070 -48
  67. package/models/operations/getpromptversion.js.map +1 -1
  68. package/models/operations/listcontacts.js +2 -2
  69. package/models/operations/listdatasetdatapoints.js +8 -8
  70. package/models/operations/listdatasets.js +2 -2
  71. package/models/operations/listdatasources.js +2 -2
  72. package/models/operations/listidentities.js +2 -2
  73. package/models/operations/listpromptversions.d.ts +1051 -42
  74. package/models/operations/listpromptversions.d.ts.map +1 -1
  75. package/models/operations/listpromptversions.js +1070 -47
  76. package/models/operations/listpromptversions.js.map +1 -1
  77. package/models/operations/retrievecontact.js +2 -2
  78. package/models/operations/retrievedatapoint.js +8 -8
  79. package/models/operations/retrievedataset.js +2 -2
  80. package/models/operations/retrievedatasource.js +2 -2
  81. package/models/operations/retrieveidentity.js +2 -2
  82. package/models/operations/retrievetool.js +12 -12
  83. package/models/operations/runagent.js +2 -2
  84. package/models/operations/streamrunagent.js +2 -2
  85. package/models/operations/updatecontact.js +2 -2
  86. package/models/operations/updateconversation.js +2 -2
  87. package/models/operations/updatedatapoint.js +8 -8
  88. package/models/operations/updatedataset.js +2 -2
  89. package/models/operations/updatedatasource.js +2 -2
  90. package/models/operations/updateeval.js +28 -28
  91. package/models/operations/updateidentity.js +2 -2
  92. package/models/operations/updateprompt.d.ts +2112 -1413
  93. package/models/operations/updateprompt.d.ts.map +1 -1
  94. package/models/operations/updateprompt.js +2200 -1525
  95. package/models/operations/updateprompt.js.map +1 -1
  96. package/models/operations/updatetool.js +14 -14
  97. package/package.json +1 -1
  98. package/src/funcs/promptsDelete.ts +12 -3
  99. package/src/lib/config.ts +2 -2
  100. package/src/mcp-server/mcp-server.ts +1 -1
  101. package/src/mcp-server/server.ts +1 -1
  102. package/src/models/components/conversationresponse.ts +2 -2
  103. package/src/models/components/conversationwithmessagesresponse.ts +2 -2
  104. package/src/models/components/partdoneevent.ts +2 -2
  105. package/src/models/components/reasoningpart.ts +2 -2
  106. package/src/models/errors/deleteprompt.ts +67 -0
  107. package/src/models/errors/index.ts +1 -0
  108. package/src/models/operations/createcontact.ts +2 -2
  109. package/src/models/operations/createconversation.ts +2 -2
  110. package/src/models/operations/createconversationresponse.ts +4 -4
  111. package/src/models/operations/createdataset.ts +2 -2
  112. package/src/models/operations/createdatasetitem.ts +8 -8
  113. package/src/models/operations/createdatasource.ts +2 -2
  114. package/src/models/operations/createeval.ts +76 -96
  115. package/src/models/operations/createidentity.ts +2 -2
  116. package/src/models/operations/createprompt.ts +5179 -3019
  117. package/src/models/operations/createtool.ts +12 -12
  118. package/src/models/operations/deploymentgetconfig.ts +252 -337
  119. package/src/models/operations/deploymentinvoke.ts +9 -13
  120. package/src/models/operations/fileget.ts +2 -2
  121. package/src/models/operations/filelist.ts +2 -2
  122. package/src/models/operations/fileupload.ts +2 -2
  123. package/src/models/operations/generateconversationname.ts +2 -2
  124. package/src/models/operations/getallprompts.ts +3543 -850
  125. package/src/models/operations/getalltools.ts +12 -12
  126. package/src/models/operations/getevals.ts +28 -28
  127. package/src/models/operations/getoneprompt.ts +3463 -786
  128. package/src/models/operations/getpromptversion.ts +3579 -835
  129. package/src/models/operations/listcontacts.ts +2 -2
  130. package/src/models/operations/listdatasetdatapoints.ts +8 -8
  131. package/src/models/operations/listdatasets.ts +2 -2
  132. package/src/models/operations/listdatasources.ts +2 -2
  133. package/src/models/operations/listidentities.ts +2 -2
  134. package/src/models/operations/listpromptversions.ts +3644 -864
  135. package/src/models/operations/retrievecontact.ts +2 -2
  136. package/src/models/operations/retrievedatapoint.ts +8 -8
  137. package/src/models/operations/retrievedataset.ts +2 -2
  138. package/src/models/operations/retrievedatasource.ts +2 -2
  139. package/src/models/operations/retrieveidentity.ts +2 -2
  140. package/src/models/operations/retrievetool.ts +12 -12
  141. package/src/models/operations/runagent.ts +2 -2
  142. package/src/models/operations/streamrunagent.ts +2 -2
  143. package/src/models/operations/updatecontact.ts +2 -2
  144. package/src/models/operations/updateconversation.ts +2 -2
  145. package/src/models/operations/updatedatapoint.ts +8 -8
  146. package/src/models/operations/updatedataset.ts +2 -2
  147. package/src/models/operations/updatedatasource.ts +2 -2
  148. package/src/models/operations/updateeval.ts +28 -28
  149. package/src/models/operations/updateidentity.ts +2 -2
  150. package/src/models/operations/updateprompt.ts +5281 -3301
  151. package/src/models/operations/updatetool.ts +14 -14
@@ -7,6 +7,7 @@ import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { safeParse } from "../../lib/schemas.js";
8
8
  import { ClosedEnum } from "../../types/enums.js";
9
9
  import { Result as SafeParseResult } from "../../types/fp.js";
10
+ import * as components from "../components/index.js";
10
11
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
12
 
12
13
  export type GetPromptVersionRequest = {
@@ -86,36 +87,41 @@ export type GetPromptVersionResponseFormat4 = ClosedEnum<
86
87
  typeof GetPromptVersionResponseFormat4
87
88
  >;
88
89
 
89
- export const GetPromptVersionResponseFormatPromptsResponseType = {
90
- Text: "text",
91
- } as const;
92
- export type GetPromptVersionResponseFormatPromptsResponseType = ClosedEnum<
93
- typeof GetPromptVersionResponseFormatPromptsResponseType
94
- >;
90
+ export const GetPromptVersionResponseFormatPromptsResponse200ApplicationJSONResponseBodyType =
91
+ {
92
+ Text: "text",
93
+ } as const;
94
+ export type GetPromptVersionResponseFormatPromptsResponse200ApplicationJSONResponseBodyType =
95
+ ClosedEnum<
96
+ typeof GetPromptVersionResponseFormatPromptsResponse200ApplicationJSONResponseBodyType
97
+ >;
95
98
 
96
99
  export type GetPromptVersionResponseFormat3 = {
97
- type: GetPromptVersionResponseFormatPromptsResponseType;
100
+ type:
101
+ GetPromptVersionResponseFormatPromptsResponse200ApplicationJSONResponseBodyType;
98
102
  };
99
103
 
100
- export const GetPromptVersionResponseFormatPromptsType = {
101
- JsonObject: "json_object",
102
- } as const;
103
- export type GetPromptVersionResponseFormatPromptsType = ClosedEnum<
104
- typeof GetPromptVersionResponseFormatPromptsType
105
- >;
104
+ export const GetPromptVersionResponseFormatPromptsResponse200ApplicationJSONType =
105
+ {
106
+ JsonObject: "json_object",
107
+ } as const;
108
+ export type GetPromptVersionResponseFormatPromptsResponse200ApplicationJSONType =
109
+ ClosedEnum<
110
+ typeof GetPromptVersionResponseFormatPromptsResponse200ApplicationJSONType
111
+ >;
106
112
 
107
113
  export type GetPromptVersionResponseFormat2 = {
108
- type: GetPromptVersionResponseFormatPromptsType;
114
+ type: GetPromptVersionResponseFormatPromptsResponse200ApplicationJSONType;
109
115
  };
110
116
 
111
- export const GetPromptVersionResponseFormatType = {
117
+ export const GetPromptVersionResponseFormatPromptsResponse200Type = {
112
118
  JsonSchema: "json_schema",
113
119
  } as const;
114
- export type GetPromptVersionResponseFormatType = ClosedEnum<
115
- typeof GetPromptVersionResponseFormatType
120
+ export type GetPromptVersionResponseFormatPromptsResponse200Type = ClosedEnum<
121
+ typeof GetPromptVersionResponseFormatPromptsResponse200Type
116
122
  >;
117
123
 
118
- export type GetPromptVersionResponseFormatJsonSchema = {
124
+ export type GetPromptVersionResponseFormatPromptsResponseJsonSchema = {
119
125
  name: string;
120
126
  description?: string | undefined;
121
127
  strict?: boolean | undefined;
@@ -123,9 +129,9 @@ export type GetPromptVersionResponseFormatJsonSchema = {
123
129
  };
124
130
 
125
131
  export type GetPromptVersionResponseFormat1 = {
126
- type: GetPromptVersionResponseFormatType;
132
+ type: GetPromptVersionResponseFormatPromptsResponse200Type;
127
133
  displayName?: string | undefined;
128
- jsonSchema: GetPromptVersionResponseFormatJsonSchema;
134
+ jsonSchema: GetPromptVersionResponseFormatPromptsResponseJsonSchema;
129
135
  };
130
136
 
131
137
  /**
@@ -139,7 +145,7 @@ export type GetPromptVersionResponseFormat1 = {
139
145
  *
140
146
  * 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.
141
147
  */
142
- export type GetPromptVersionResponseFormat =
148
+ export type GetPromptVersionPromptsResponseFormat =
143
149
  | GetPromptVersionResponseFormat1
144
150
  | GetPromptVersionResponseFormat2
145
151
  | GetPromptVersionResponseFormat3
@@ -178,7 +184,7 @@ export type GetPromptVersionEncodingFormat = ClosedEnum<
178
184
  /**
179
185
  * Constrains effort on reasoning for reasoning models. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
180
186
  */
181
- export const GetPromptVersionReasoningEffort = {
187
+ export const GetPromptVersionPromptsReasoningEffort = {
182
188
  None: "none",
183
189
  Disable: "disable",
184
190
  Minimal: "minimal",
@@ -189,8 +195,8 @@ export const GetPromptVersionReasoningEffort = {
189
195
  /**
190
196
  * Constrains effort on reasoning for reasoning models. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
191
197
  */
192
- export type GetPromptVersionReasoningEffort = ClosedEnum<
193
- typeof GetPromptVersionReasoningEffort
198
+ export type GetPromptVersionPromptsReasoningEffort = ClosedEnum<
199
+ typeof GetPromptVersionPromptsReasoningEffort
194
200
  >;
195
201
 
196
202
  /**
@@ -305,7 +311,7 @@ export type GetPromptVersionModelParameters = {
305
311
  /**
306
312
  * Constrains effort on reasoning for reasoning models. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
307
313
  */
308
- reasoningEffort?: GetPromptVersionReasoningEffort | undefined;
314
+ reasoningEffort?: GetPromptVersionPromptsReasoningEffort | undefined;
309
315
  /**
310
316
  * Gives the model enhanced reasoning capabilities for complex tasks. A value of 0 disables thinking. The minimum budget tokens for thinking are 1024. The Budget Tokens should never exceed the Max Tokens parameter. Only supported by `Anthropic`
311
317
  */
@@ -477,11 +483,13 @@ export type GetPromptVersionMessages = {
477
483
  };
478
484
 
479
485
  /**
480
- * A list of messages compatible with the openAI schema
486
+ * [DEPRECATED] Use the `prompt` property instead. A list of messages compatible with the openAI schema.
487
+ *
488
+ * @deprecated class: This will be removed in a future release, please migrate away from it as soon as possible.
481
489
  */
482
490
  export type GetPromptVersionPromptConfig = {
483
491
  stream?: boolean | undefined;
484
- model?: string | undefined;
492
+ model?: string | null | undefined;
485
493
  /**
486
494
  * The id of the resource
487
495
  */
@@ -494,7 +502,7 @@ export type GetPromptVersionPromptConfig = {
494
502
  * Model Parameters: Not all parameters apply to every model
495
503
  */
496
504
  modelParameters?: GetPromptVersionModelParameters | undefined;
497
- provider?: GetPromptVersionProvider | undefined;
505
+ provider?: GetPromptVersionProvider | null | undefined;
498
506
  /**
499
507
  * The ID of the integration to use
500
508
  */
@@ -503,1250 +511,3981 @@ export type GetPromptVersionPromptConfig = {
503
511
  messages: Array<GetPromptVersionMessages>;
504
512
  };
505
513
 
506
- export const GetPromptVersionUseCases = {
507
- AgentsSimulations: "Agents simulations",
508
- Agents: "Agents",
509
- APIInteraction: "API interaction",
510
- AutonomousAgents: "Autonomous Agents",
511
- Chatbots: "Chatbots",
512
- Classification: "Classification",
513
- CodeUnderstanding: "Code understanding",
514
- CodeWriting: "Code writing",
515
- Conversation: "Conversation",
516
- DocumentsQA: "Documents QA",
517
- Evaluation: "Evaluation",
518
- Extraction: "Extraction",
519
- MultiModal: "Multi-modal",
520
- SelfChecking: "Self-checking",
521
- SentimentAnalysis: "Sentiment analysis",
522
- Sql: "SQL",
523
- Summarization: "Summarization",
524
- Tagging: "Tagging",
525
- TranslationDocument: "Translation (document)",
526
- TranslationSentences: "Translation (sentences)",
514
+ /**
515
+ * The voice the model uses to respond. Supported voices are alloy, echo, fable, onyx, nova, and shimmer.
516
+ */
517
+ export const GetPromptVersionVoice = {
518
+ Alloy: "alloy",
519
+ Echo: "echo",
520
+ Fable: "fable",
521
+ Onyx: "onyx",
522
+ Nova: "nova",
523
+ Shimmer: "shimmer",
527
524
  } as const;
528
- export type GetPromptVersionUseCases = ClosedEnum<
529
- typeof GetPromptVersionUseCases
530
- >;
525
+ /**
526
+ * The voice the model uses to respond. Supported voices are alloy, echo, fable, onyx, nova, and shimmer.
527
+ */
528
+ export type GetPromptVersionVoice = ClosedEnum<typeof GetPromptVersionVoice>;
531
529
 
532
530
  /**
533
- * The language that the prompt is written in. Use this field to categorize the prompt for your own purpose
531
+ * Specifies the output audio format. Must be one of wav, mp3, flac, opus, or pcm16.
534
532
  */
535
- export const GetPromptVersionLanguage = {
536
- Chinese: "Chinese",
537
- Dutch: "Dutch",
538
- English: "English",
539
- French: "French",
540
- German: "German",
541
- Russian: "Russian",
542
- Spanish: "Spanish",
533
+ export const GetPromptVersionPromptsFormat = {
534
+ Wav: "wav",
535
+ Mp3: "mp3",
536
+ Flac: "flac",
537
+ Opus: "opus",
538
+ Pcm16: "pcm16",
543
539
  } as const;
544
540
  /**
545
- * The language that the prompt is written in. Use this field to categorize the prompt for your own purpose
541
+ * Specifies the output audio format. Must be one of wav, mp3, flac, opus, or pcm16.
546
542
  */
547
- export type GetPromptVersionLanguage = ClosedEnum<
548
- typeof GetPromptVersionLanguage
543
+ export type GetPromptVersionPromptsFormat = ClosedEnum<
544
+ typeof GetPromptVersionPromptsFormat
549
545
  >;
550
546
 
551
- export type GetPromptVersionMetadata = {
547
+ /**
548
+ * Parameters for audio output. Required when audio output is requested with modalities: ["audio"]. Learn more.
549
+ */
550
+ export type GetPromptVersionAudio = {
552
551
  /**
553
- * A list of use cases that the prompt is meant to be used for. Use this field to categorize the prompt for your own purpose
552
+ * The voice the model uses to respond. Supported voices are alloy, echo, fable, onyx, nova, and shimmer.
554
553
  */
555
- useCases?: Array<GetPromptVersionUseCases> | undefined;
554
+ voice: GetPromptVersionVoice;
556
555
  /**
557
- * The language that the prompt is written in. Use this field to categorize the prompt for your own purpose
556
+ * Specifies the output audio format. Must be one of wav, mp3, flac, opus, or pcm16.
558
557
  */
559
- language?: GetPromptVersionLanguage | null | undefined;
558
+ format: GetPromptVersionPromptsFormat;
560
559
  };
561
560
 
562
- /**
563
- * Prompt version retrieved successfully.
564
- */
565
- export type GetPromptVersionResponseBody = {
566
- id: string;
567
- createdById?: string | null | undefined;
568
- updatedById?: string | null | undefined;
561
+ export type GetPromptVersionResponseFormatJsonSchema = {
569
562
  /**
570
- * The prompt’s description, meant to be displayable in the UI. Use this field to optionally store a long form explanation of the prompt for your own purpose
563
+ * A description of what the response format is for, used by the model to determine how to respond in the format.
571
564
  */
572
- description?: string | null | undefined;
565
+ description?: string | undefined;
573
566
  /**
574
- * A list of messages compatible with the openAI schema
567
+ * The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
575
568
  */
576
- promptConfig: GetPromptVersionPromptConfig;
577
- metadata?: GetPromptVersionMetadata | undefined;
578
- timestamp: string;
569
+ name: string;
570
+ /**
571
+ * The schema for the response format, described as a JSON Schema object.
572
+ */
573
+ schema?: any | undefined;
574
+ /**
575
+ * Whether to enable strict schema adherence when generating the output. If set to true, the model will always follow the exact schema defined in the schema field. Only a subset of JSON Schema is supported when strict is true.
576
+ */
577
+ strict?: boolean | undefined;
579
578
  };
580
579
 
581
- /** @internal */
582
- export const GetPromptVersionRequest$inboundSchema: z.ZodType<
583
- GetPromptVersionRequest,
584
- z.ZodTypeDef,
585
- unknown
586
- > = z.object({
587
- prompt_id: z.string(),
588
- version_id: z.string(),
589
- }).transform((v) => {
590
- return remap$(v, {
591
- "prompt_id": "promptId",
592
- "version_id": "versionId",
593
- });
594
- });
595
- /** @internal */
596
- export type GetPromptVersionRequest$Outbound = {
597
- prompt_id: string;
598
- version_id: string;
580
+ /**
581
+ * @remarks
582
+ *
583
+ * JSON Schema response format. Used to generate structured JSON responses
584
+ */
585
+ export type GetPromptVersionResponseFormatPromptsJSONSchema = {
586
+ type: "json_schema";
587
+ jsonSchema: GetPromptVersionResponseFormatJsonSchema;
599
588
  };
600
589
 
601
- /** @internal */
602
- export const GetPromptVersionRequest$outboundSchema: z.ZodType<
603
- GetPromptVersionRequest$Outbound,
604
- z.ZodTypeDef,
605
- GetPromptVersionRequest
606
- > = z.object({
607
- promptId: z.string(),
608
- versionId: z.string(),
609
- }).transform((v) => {
610
- return remap$(v, {
611
- promptId: "prompt_id",
612
- versionId: "version_id",
613
- });
614
- });
590
+ /**
591
+ * @remarks
592
+ *
593
+ * JSON object response format. An older method of generating JSON responses. Using `json_schema` is recommended for models that support it. Note that the model will not generate JSON without a system or user message instructing it to do so.
594
+ */
595
+ export type GetPromptVersionResponseFormatJSONObject = {
596
+ type: "json_object";
597
+ };
615
598
 
616
- export function getPromptVersionRequestToJSON(
617
- getPromptVersionRequest: GetPromptVersionRequest,
618
- ): string {
619
- return JSON.stringify(
620
- GetPromptVersionRequest$outboundSchema.parse(getPromptVersionRequest),
621
- );
622
- }
623
- export function getPromptVersionRequestFromJSON(
624
- jsonString: string,
625
- ): SafeParseResult<GetPromptVersionRequest, SDKValidationError> {
626
- return safeParse(
627
- jsonString,
628
- (x) => GetPromptVersionRequest$inboundSchema.parse(JSON.parse(x)),
629
- `Failed to parse 'GetPromptVersionRequest' from JSON`,
630
- );
631
- }
599
+ /**
600
+ * @remarks
601
+ *
602
+ * Default response format. Used to generate text responses
603
+ */
604
+ export type GetPromptVersionResponseFormatText = {
605
+ type: "text";
606
+ };
632
607
 
633
- /** @internal */
634
- export const GetPromptVersionModelType$inboundSchema: z.ZodNativeEnum<
635
- typeof GetPromptVersionModelType
636
- > = z.nativeEnum(GetPromptVersionModelType);
637
- /** @internal */
638
- export const GetPromptVersionModelType$outboundSchema: z.ZodNativeEnum<
639
- typeof GetPromptVersionModelType
640
- > = GetPromptVersionModelType$inboundSchema;
608
+ /**
609
+ * An object specifying the format that the model must output
610
+ */
611
+ export type GetPromptVersionResponseFormat =
612
+ | GetPromptVersionResponseFormatText
613
+ | GetPromptVersionResponseFormatJSONObject
614
+ | GetPromptVersionResponseFormatPromptsJSONSchema;
641
615
 
642
- /** @internal */
643
- export const GetPromptVersionFormat$inboundSchema: z.ZodNativeEnum<
644
- typeof GetPromptVersionFormat
645
- > = z.nativeEnum(GetPromptVersionFormat);
646
- /** @internal */
647
- export const GetPromptVersionFormat$outboundSchema: z.ZodNativeEnum<
648
- typeof GetPromptVersionFormat
649
- > = GetPromptVersionFormat$inboundSchema;
616
+ /**
617
+ * Constrains effort on reasoning for [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
618
+ *
619
+ * @remarks
620
+ *
621
+ * - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1.
622
+ * - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`.
623
+ * - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
624
+ * - `xhigh` is currently only supported for `gpt-5.1-codex-max`.
625
+ *
626
+ * Any of "none", "minimal", "low", "medium", "high", "xhigh".
627
+ */
628
+ export const GetPromptVersionReasoningEffort = {
629
+ None: "none",
630
+ Minimal: "minimal",
631
+ Low: "low",
632
+ Medium: "medium",
633
+ High: "high",
634
+ Xhigh: "xhigh",
635
+ } as const;
636
+ /**
637
+ * Constrains effort on reasoning for [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
638
+ *
639
+ * @remarks
640
+ *
641
+ * - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1.
642
+ * - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`.
643
+ * - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
644
+ * - `xhigh` is currently only supported for `gpt-5.1-codex-max`.
645
+ *
646
+ * Any of "none", "minimal", "low", "medium", "high", "xhigh".
647
+ */
648
+ export type GetPromptVersionReasoningEffort = ClosedEnum<
649
+ typeof GetPromptVersionReasoningEffort
650
+ >;
650
651
 
651
- /** @internal */
652
- export const GetPromptVersionResponseFormat6$inboundSchema: z.ZodNativeEnum<
653
- typeof GetPromptVersionResponseFormat6
654
- > = z.nativeEnum(GetPromptVersionResponseFormat6);
655
- /** @internal */
656
- export const GetPromptVersionResponseFormat6$outboundSchema: z.ZodNativeEnum<
657
- typeof GetPromptVersionResponseFormat6
658
- > = GetPromptVersionResponseFormat6$inboundSchema;
652
+ /**
653
+ * Up to 4 sequences where the API will stop generating further tokens.
654
+ */
655
+ export type GetPromptVersionStop = string | Array<string>;
659
656
 
660
- /** @internal */
661
- export const GetPromptVersionResponseFormat5$inboundSchema: z.ZodNativeEnum<
662
- typeof GetPromptVersionResponseFormat5
663
- > = z.nativeEnum(GetPromptVersionResponseFormat5);
664
- /** @internal */
665
- export const GetPromptVersionResponseFormat5$outboundSchema: z.ZodNativeEnum<
666
- typeof GetPromptVersionResponseFormat5
667
- > = GetPromptVersionResponseFormat5$inboundSchema;
657
+ /**
658
+ * Options for streaming response. Only set this when you set stream: true.
659
+ */
660
+ export type GetPromptVersionStreamOptions = {
661
+ /**
662
+ * If set, an additional chunk will be streamed before the data: [DONE] message. The usage field on this chunk shows the token usage statistics for the entire request, and the choices field will always be an empty array. All other chunks will also include a usage field, but with a null value.
663
+ */
664
+ includeUsage?: boolean | undefined;
665
+ };
668
666
 
669
- /** @internal */
670
- export const GetPromptVersionResponseFormat4$inboundSchema: z.ZodNativeEnum<
671
- typeof GetPromptVersionResponseFormat4
672
- > = z.nativeEnum(GetPromptVersionResponseFormat4);
673
- /** @internal */
674
- export const GetPromptVersionResponseFormat4$outboundSchema: z.ZodNativeEnum<
675
- typeof GetPromptVersionResponseFormat4
676
- > = GetPromptVersionResponseFormat4$inboundSchema;
667
+ export type GetPromptVersionThinking =
668
+ | components.ThinkingConfigDisabledSchema
669
+ | components.ThinkingConfigEnabledSchema;
677
670
 
678
- /** @internal */
679
- export const GetPromptVersionResponseFormatPromptsResponseType$inboundSchema:
680
- z.ZodNativeEnum<typeof GetPromptVersionResponseFormatPromptsResponseType> = z
681
- .nativeEnum(GetPromptVersionResponseFormatPromptsResponseType);
682
- /** @internal */
683
- export const GetPromptVersionResponseFormatPromptsResponseType$outboundSchema:
684
- z.ZodNativeEnum<typeof GetPromptVersionResponseFormatPromptsResponseType> =
685
- GetPromptVersionResponseFormatPromptsResponseType$inboundSchema;
671
+ /**
672
+ * The type of the tool. Currently, only function is supported.
673
+ */
674
+ export const GetPromptVersionToolChoiceType = {
675
+ Function: "function",
676
+ } as const;
677
+ /**
678
+ * The type of the tool. Currently, only function is supported.
679
+ */
680
+ export type GetPromptVersionToolChoiceType = ClosedEnum<
681
+ typeof GetPromptVersionToolChoiceType
682
+ >;
686
683
 
687
- /** @internal */
688
- export const GetPromptVersionResponseFormat3$inboundSchema: z.ZodType<
689
- GetPromptVersionResponseFormat3,
690
- z.ZodTypeDef,
691
- unknown
692
- > = z.object({
693
- type: GetPromptVersionResponseFormatPromptsResponseType$inboundSchema,
694
- });
695
- /** @internal */
696
- export type GetPromptVersionResponseFormat3$Outbound = {
697
- type: string;
684
+ export type GetPromptVersionToolChoiceFunction = {
685
+ /**
686
+ * The name of the function to call.
687
+ */
688
+ name: string;
698
689
  };
699
690
 
700
- /** @internal */
701
- export const GetPromptVersionResponseFormat3$outboundSchema: z.ZodType<
702
- GetPromptVersionResponseFormat3$Outbound,
703
- z.ZodTypeDef,
704
- GetPromptVersionResponseFormat3
705
- > = z.object({
706
- type: GetPromptVersionResponseFormatPromptsResponseType$outboundSchema,
707
- });
691
+ export type GetPromptVersionToolChoice2 = {
692
+ /**
693
+ * The type of the tool. Currently, only function is supported.
694
+ */
695
+ type?: GetPromptVersionToolChoiceType | undefined;
696
+ function: GetPromptVersionToolChoiceFunction;
697
+ };
708
698
 
709
- export function getPromptVersionResponseFormat3ToJSON(
710
- getPromptVersionResponseFormat3: GetPromptVersionResponseFormat3,
699
+ export const GetPromptVersionToolChoice1 = {
700
+ None: "none",
701
+ Auto: "auto",
702
+ Required: "required",
703
+ } as const;
704
+ export type GetPromptVersionToolChoice1 = ClosedEnum<
705
+ typeof GetPromptVersionToolChoice1
706
+ >;
707
+
708
+ /**
709
+ * Controls which (if any) tool is called by the model.
710
+ */
711
+ export type GetPromptVersionToolChoice =
712
+ | GetPromptVersionToolChoice2
713
+ | GetPromptVersionToolChoice1;
714
+
715
+ export const GetPromptVersionModalities = {
716
+ Text: "text",
717
+ Audio: "audio",
718
+ } as const;
719
+ export type GetPromptVersionModalities = ClosedEnum<
720
+ typeof GetPromptVersionModalities
721
+ >;
722
+
723
+ /**
724
+ * The key of the guardrail.
725
+ */
726
+ export const GetPromptVersionId1 = {
727
+ OrqPiiDetection: "orq_pii_detection",
728
+ OrqSexualModeration: "orq_sexual_moderation",
729
+ OrqHarmfulModeration: "orq_harmful_moderation",
730
+ } as const;
731
+ /**
732
+ * The key of the guardrail.
733
+ */
734
+ export type GetPromptVersionId1 = ClosedEnum<typeof GetPromptVersionId1>;
735
+
736
+ export type GetPromptVersionId = GetPromptVersionId1 | string;
737
+
738
+ /**
739
+ * Determines whether the guardrail runs on the input (user message) or output (model response).
740
+ */
741
+ export const GetPromptVersionExecuteOn = {
742
+ Input: "input",
743
+ Output: "output",
744
+ } as const;
745
+ /**
746
+ * Determines whether the guardrail runs on the input (user message) or output (model response).
747
+ */
748
+ export type GetPromptVersionExecuteOn = ClosedEnum<
749
+ typeof GetPromptVersionExecuteOn
750
+ >;
751
+
752
+ export type GetPromptVersionGuardrails = {
753
+ id: GetPromptVersionId1 | string;
754
+ /**
755
+ * Determines whether the guardrail runs on the input (user message) or output (model response).
756
+ */
757
+ executeOn: GetPromptVersionExecuteOn;
758
+ };
759
+
760
+ export type GetPromptVersionContentPromptsResponse2002 =
761
+ components.TextContentPartSchema;
762
+
763
+ /**
764
+ * The contents of the tool message.
765
+ */
766
+ export type GetPromptVersionMessagesPromptsResponse200Content =
767
+ | string
768
+ | Array<components.TextContentPartSchema>;
769
+
770
+ /**
771
+ * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
772
+ */
773
+ export const GetPromptVersionMessagesPromptsType = {
774
+ Ephemeral: "ephemeral",
775
+ } as const;
776
+ /**
777
+ * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
778
+ */
779
+ export type GetPromptVersionMessagesPromptsType = ClosedEnum<
780
+ typeof GetPromptVersionMessagesPromptsType
781
+ >;
782
+
783
+ /**
784
+ * The time-to-live for the cache control breakpoint. This may be one of the following values:
785
+ *
786
+ * @remarks
787
+ *
788
+ * - `5m`: 5 minutes
789
+ * - `1h`: 1 hour
790
+ *
791
+ * Defaults to `5m`. Only supported by `Anthropic` Claude models.
792
+ */
793
+ export const GetPromptVersionMessagesTtl = {
794
+ Fivem: "5m",
795
+ Oneh: "1h",
796
+ } as const;
797
+ /**
798
+ * The time-to-live for the cache control breakpoint. This may be one of the following values:
799
+ *
800
+ * @remarks
801
+ *
802
+ * - `5m`: 5 minutes
803
+ * - `1h`: 1 hour
804
+ *
805
+ * Defaults to `5m`. Only supported by `Anthropic` Claude models.
806
+ */
807
+ export type GetPromptVersionMessagesTtl = ClosedEnum<
808
+ typeof GetPromptVersionMessagesTtl
809
+ >;
810
+
811
+ export type GetPromptVersionMessagesCacheControl = {
812
+ /**
813
+ * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
814
+ */
815
+ type: GetPromptVersionMessagesPromptsType;
816
+ /**
817
+ * The time-to-live for the cache control breakpoint. This may be one of the following values:
818
+ *
819
+ * @remarks
820
+ *
821
+ * - `5m`: 5 minutes
822
+ * - `1h`: 1 hour
823
+ *
824
+ * Defaults to `5m`. Only supported by `Anthropic` Claude models.
825
+ */
826
+ ttl?: GetPromptVersionMessagesTtl | undefined;
827
+ };
828
+
829
+ export type GetPromptVersionMessagesToolMessage = {
830
+ /**
831
+ * The role of the messages author, in this case tool.
832
+ */
833
+ role: "tool";
834
+ /**
835
+ * The contents of the tool message.
836
+ */
837
+ content: string | Array<components.TextContentPartSchema>;
838
+ /**
839
+ * Tool call that this message is responding to.
840
+ */
841
+ toolCallId: string | null;
842
+ cacheControl?: GetPromptVersionMessagesCacheControl | undefined;
843
+ };
844
+
845
+ export type GetPromptVersionContentPromptsResponse2 =
846
+ | (components.TextContentPartSchema & { type: "text" })
847
+ | components.RefusalPartSchema
848
+ | components.ReasoningPartSchema
849
+ | components.RedactedReasoningPartSchema;
850
+
851
+ /**
852
+ * The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified.
853
+ */
854
+ export type GetPromptVersionMessagesPromptsResponseContent =
855
+ | string
856
+ | Array<
857
+ | (components.TextContentPartSchema & { type: "text" })
858
+ | components.RefusalPartSchema
859
+ | components.ReasoningPartSchema
860
+ | components.RedactedReasoningPartSchema
861
+ >;
862
+
863
+ /**
864
+ * Data about a previous audio response from the model.
865
+ */
866
+ export type GetPromptVersionMessagesAudio = {
867
+ /**
868
+ * Unique identifier for a previous audio response from the model.
869
+ */
870
+ id: string;
871
+ };
872
+
873
+ /**
874
+ * The type of the tool. Currently, only `function` is supported.
875
+ */
876
+ export const GetPromptVersionMessagesType = {
877
+ Function: "function",
878
+ } as const;
879
+ /**
880
+ * The type of the tool. Currently, only `function` is supported.
881
+ */
882
+ export type GetPromptVersionMessagesType = ClosedEnum<
883
+ typeof GetPromptVersionMessagesType
884
+ >;
885
+
886
+ export type GetPromptVersionMessagesFunction = {
887
+ /**
888
+ * The name of the function to call.
889
+ */
890
+ name?: string | undefined;
891
+ /**
892
+ * The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function.
893
+ */
894
+ arguments?: string | undefined;
895
+ };
896
+
897
+ export type GetPromptVersionMessagesToolCalls = {
898
+ /**
899
+ * The ID of the tool call.
900
+ */
901
+ id: string;
902
+ /**
903
+ * The type of the tool. Currently, only `function` is supported.
904
+ */
905
+ type: GetPromptVersionMessagesType;
906
+ function: GetPromptVersionMessagesFunction;
907
+ /**
908
+ * Encrypted representation of the model internal reasoning state during function calling. Required by Gemini 3 models when continuing a conversation after a tool call.
909
+ */
910
+ thoughtSignature?: string | undefined;
911
+ };
912
+
913
+ export type GetPromptVersionMessagesAssistantMessage = {
914
+ /**
915
+ * The contents of the assistant message. Required unless `tool_calls` or `function_call` is specified.
916
+ */
917
+ content?:
918
+ | string
919
+ | Array<
920
+ | (components.TextContentPartSchema & { type: "text" })
921
+ | components.RefusalPartSchema
922
+ | components.ReasoningPartSchema
923
+ | components.RedactedReasoningPartSchema
924
+ >
925
+ | null
926
+ | undefined;
927
+ /**
928
+ * The refusal message by the assistant.
929
+ */
930
+ refusal?: string | null | undefined;
931
+ /**
932
+ * The role of the messages author, in this case `assistant`.
933
+ */
934
+ role: "assistant";
935
+ /**
936
+ * An optional name for the participant. Provides the model information to differentiate between participants of the same role.
937
+ */
938
+ name?: string | undefined;
939
+ /**
940
+ * Data about a previous audio response from the model.
941
+ */
942
+ audio?: GetPromptVersionMessagesAudio | null | undefined;
943
+ /**
944
+ * The tool calls generated by the model, such as function calls.
945
+ */
946
+ toolCalls?: Array<GetPromptVersionMessagesToolCalls> | undefined;
947
+ };
948
+
949
+ /**
950
+ * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
951
+ */
952
+ export const GetPromptVersion2PromptsResponse200ApplicationJSONType = {
953
+ Ephemeral: "ephemeral",
954
+ } as const;
955
+ /**
956
+ * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
957
+ */
958
+ export type GetPromptVersion2PromptsResponse200ApplicationJSONType = ClosedEnum<
959
+ typeof GetPromptVersion2PromptsResponse200ApplicationJSONType
960
+ >;
961
+
962
+ /**
963
+ * The time-to-live for the cache control breakpoint. This may be one of the following values:
964
+ *
965
+ * @remarks
966
+ *
967
+ * - `5m`: 5 minutes
968
+ * - `1h`: 1 hour
969
+ *
970
+ * Defaults to `5m`. Only supported by `Anthropic` Claude models.
971
+ */
972
+ export const GetPromptVersion2Ttl = {
973
+ Fivem: "5m",
974
+ Oneh: "1h",
975
+ } as const;
976
+ /**
977
+ * The time-to-live for the cache control breakpoint. This may be one of the following values:
978
+ *
979
+ * @remarks
980
+ *
981
+ * - `5m`: 5 minutes
982
+ * - `1h`: 1 hour
983
+ *
984
+ * Defaults to `5m`. Only supported by `Anthropic` Claude models.
985
+ */
986
+ export type GetPromptVersion2Ttl = ClosedEnum<typeof GetPromptVersion2Ttl>;
987
+
988
+ export type GetPromptVersion2CacheControl = {
989
+ /**
990
+ * Create a cache control breakpoint at this content block. Accepts only the value "ephemeral".
991
+ */
992
+ type: GetPromptVersion2PromptsResponse200ApplicationJSONType;
993
+ /**
994
+ * The time-to-live for the cache control breakpoint. This may be one of the following values:
995
+ *
996
+ * @remarks
997
+ *
998
+ * - `5m`: 5 minutes
999
+ * - `1h`: 1 hour
1000
+ *
1001
+ * Defaults to `5m`. Only supported by `Anthropic` Claude models.
1002
+ */
1003
+ ttl?: GetPromptVersion2Ttl | undefined;
1004
+ };
1005
+
1006
+ export type GetPromptVersion24 = {
1007
+ /**
1008
+ * The type of the content part. Always `file`.
1009
+ */
1010
+ type: "file";
1011
+ cacheControl?: GetPromptVersion2CacheControl | undefined;
1012
+ /**
1013
+ * File data for the content part. Must contain either file_data or uri, but not both.
1014
+ */
1015
+ file: components.FileContentPartSchema;
1016
+ };
1017
+
1018
+ export type GetPromptVersionContentPrompts2 =
1019
+ | (components.TextContentPartSchema & { type: "text" })
1020
+ | components.ImageContentPartSchema
1021
+ | components.AudioContentPartSchema
1022
+ | GetPromptVersion24;
1023
+
1024
+ /**
1025
+ * The contents of the user message.
1026
+ */
1027
+ export type GetPromptVersionMessagesPromptsContent =
1028
+ | string
1029
+ | Array<
1030
+ | (components.TextContentPartSchema & { type: "text" })
1031
+ | components.ImageContentPartSchema
1032
+ | components.AudioContentPartSchema
1033
+ | GetPromptVersion24
1034
+ >;
1035
+
1036
+ export type GetPromptVersionMessagesUserMessage = {
1037
+ /**
1038
+ * The role of the messages author, in this case `user`.
1039
+ */
1040
+ role: "user";
1041
+ /**
1042
+ * An optional name for the participant. Provides the model information to differentiate between participants of the same role.
1043
+ */
1044
+ name?: string | undefined;
1045
+ /**
1046
+ * The contents of the user message.
1047
+ */
1048
+ content:
1049
+ | string
1050
+ | Array<
1051
+ | (components.TextContentPartSchema & { type: "text" })
1052
+ | components.ImageContentPartSchema
1053
+ | components.AudioContentPartSchema
1054
+ | GetPromptVersion24
1055
+ >;
1056
+ };
1057
+
1058
+ /**
1059
+ * The contents of the system message.
1060
+ */
1061
+ export type GetPromptVersionMessagesContent =
1062
+ | string
1063
+ | Array<components.TextContentPartSchema>;
1064
+
1065
+ /**
1066
+ * Developer-provided instructions that the model should follow, regardless of messages sent by the user.
1067
+ */
1068
+ export type GetPromptVersionMessagesSystemMessage = {
1069
+ /**
1070
+ * The role of the messages author, in this case `system`.
1071
+ */
1072
+ role: "system";
1073
+ /**
1074
+ * The contents of the system message.
1075
+ */
1076
+ content: string | Array<components.TextContentPartSchema>;
1077
+ /**
1078
+ * An optional name for the participant. Provides the model information to differentiate between participants of the same role.
1079
+ */
1080
+ name?: string | undefined;
1081
+ };
1082
+
1083
+ export type GetPromptVersionPromptsMessages =
1084
+ | GetPromptVersionMessagesSystemMessage
1085
+ | GetPromptVersionMessagesUserMessage
1086
+ | GetPromptVersionMessagesAssistantMessage
1087
+ | GetPromptVersionMessagesToolMessage;
1088
+
1089
+ /**
1090
+ * Prompt configuration with model and messages. Use this instead of prompt_config.
1091
+ */
1092
+ export type GetPromptVersionPromptField = {
1093
+ /**
1094
+ * Parameters for audio output. Required when audio output is requested with modalities: ["audio"]. Learn more.
1095
+ */
1096
+ audio?: GetPromptVersionAudio | null | undefined;
1097
+ /**
1098
+ * Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim.
1099
+ */
1100
+ frequencyPenalty?: number | null | undefined;
1101
+ /**
1102
+ * `[Deprecated]`. The maximum number of tokens that can be generated in the chat completion. This value can be used to control costs for text generated via API.
1103
+ *
1104
+ * @remarks
1105
+ *
1106
+ * This value is now `deprecated` in favor of `max_completion_tokens`, and is not compatible with o1 series models.
1107
+ */
1108
+ maxTokens?: number | null | undefined;
1109
+ /**
1110
+ * An upper bound for the number of tokens that can be generated for a completion, including visible output tokens and reasoning tokens
1111
+ */
1112
+ maxCompletionTokens?: number | null | undefined;
1113
+ /**
1114
+ * Whether to return log probabilities of the output tokens or not. If true, returns the log probabilities of each output token returned in the content of message.
1115
+ */
1116
+ logprobs?: boolean | null | undefined;
1117
+ /**
1118
+ * An integer between 0 and 20 specifying the number of most likely tokens to return at each token position, each with an associated log probability. logprobs must be set to true if this parameter is used.
1119
+ */
1120
+ topLogprobs?: number | null | undefined;
1121
+ /**
1122
+ * How many chat completion choices to generate for each input message. Note that you will be charged based on the number of generated tokens across all of the choices. Keep n as 1 to minimize costs.
1123
+ */
1124
+ n?: number | null | undefined;
1125
+ /**
1126
+ * Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics.
1127
+ */
1128
+ presencePenalty?: number | null | undefined;
1129
+ /**
1130
+ * An object specifying the format that the model must output
1131
+ */
1132
+ responseFormat?:
1133
+ | GetPromptVersionResponseFormatText
1134
+ | GetPromptVersionResponseFormatJSONObject
1135
+ | GetPromptVersionResponseFormatPromptsJSONSchema
1136
+ | undefined;
1137
+ /**
1138
+ * Constrains effort on reasoning for [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
1139
+ *
1140
+ * @remarks
1141
+ *
1142
+ * - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool calls are supported for all reasoning values in gpt-5.1.
1143
+ * - All models before `gpt-5.1` default to `medium` reasoning effort, and do not support `none`.
1144
+ * - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
1145
+ * - `xhigh` is currently only supported for `gpt-5.1-codex-max`.
1146
+ *
1147
+ * Any of "none", "minimal", "low", "medium", "high", "xhigh".
1148
+ */
1149
+ reasoningEffort?: GetPromptVersionReasoningEffort | undefined;
1150
+ /**
1151
+ * Adjusts response verbosity. Lower levels yield shorter answers.
1152
+ */
1153
+ verbosity?: string | undefined;
1154
+ /**
1155
+ * If specified, our system will make a best effort to sample deterministically, such that repeated requests with the same seed and parameters should return the same result.
1156
+ */
1157
+ seed?: number | null | undefined;
1158
+ /**
1159
+ * Up to 4 sequences where the API will stop generating further tokens.
1160
+ */
1161
+ stop?: string | Array<string> | null | undefined;
1162
+ /**
1163
+ * Options for streaming response. Only set this when you set stream: true.
1164
+ */
1165
+ streamOptions?: GetPromptVersionStreamOptions | null | undefined;
1166
+ thinking?:
1167
+ | components.ThinkingConfigDisabledSchema
1168
+ | components.ThinkingConfigEnabledSchema
1169
+ | undefined;
1170
+ /**
1171
+ * What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
1172
+ */
1173
+ temperature?: number | null | undefined;
1174
+ /**
1175
+ * An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass.
1176
+ */
1177
+ topP?: number | null | undefined;
1178
+ /**
1179
+ * Limits the model to consider only the top k most likely tokens at each step.
1180
+ */
1181
+ topK?: number | null | undefined;
1182
+ /**
1183
+ * Controls which (if any) tool is called by the model.
1184
+ */
1185
+ toolChoice?:
1186
+ | GetPromptVersionToolChoice2
1187
+ | GetPromptVersionToolChoice1
1188
+ | undefined;
1189
+ /**
1190
+ * Whether to enable parallel function calling during tool use.
1191
+ */
1192
+ parallelToolCalls?: boolean | undefined;
1193
+ /**
1194
+ * Output types that you would like the model to generate. Most models are capable of generating text, which is the default: ["text"]. The gpt-4o-audio-preview model can also be used to generate audio. To request that this model generate both text and audio responses, you can use: ["text", "audio"].
1195
+ */
1196
+ modalities?: Array<GetPromptVersionModalities> | null | undefined;
1197
+ /**
1198
+ * A list of guardrails to apply to the request.
1199
+ */
1200
+ guardrails?: Array<GetPromptVersionGuardrails> | undefined;
1201
+ /**
1202
+ * Array of messages that make up the conversation. Each message has a role (system, user, assistant, or tool) and content.
1203
+ */
1204
+ messages?:
1205
+ | Array<
1206
+ | GetPromptVersionMessagesSystemMessage
1207
+ | GetPromptVersionMessagesUserMessage
1208
+ | GetPromptVersionMessagesAssistantMessage
1209
+ | GetPromptVersionMessagesToolMessage
1210
+ >
1211
+ | undefined;
1212
+ /**
1213
+ * Model ID used to generate the response, like `openai/gpt-4o` or `anthropic/claude-3-5-sonnet-20241022`. For private models, use format: `{workspaceKey}@{provider}/{model}`.
1214
+ */
1215
+ model?: string | null | undefined;
1216
+ version?: string | undefined;
1217
+ };
1218
+
1219
+ export const GetPromptVersionUseCases = {
1220
+ AgentsSimulations: "Agents simulations",
1221
+ Agents: "Agents",
1222
+ APIInteraction: "API interaction",
1223
+ AutonomousAgents: "Autonomous Agents",
1224
+ Chatbots: "Chatbots",
1225
+ Classification: "Classification",
1226
+ CodeUnderstanding: "Code understanding",
1227
+ CodeWriting: "Code writing",
1228
+ Conversation: "Conversation",
1229
+ DocumentsQA: "Documents QA",
1230
+ Evaluation: "Evaluation",
1231
+ Extraction: "Extraction",
1232
+ MultiModal: "Multi-modal",
1233
+ SelfChecking: "Self-checking",
1234
+ SentimentAnalysis: "Sentiment analysis",
1235
+ Sql: "SQL",
1236
+ Summarization: "Summarization",
1237
+ Tagging: "Tagging",
1238
+ TranslationDocument: "Translation (document)",
1239
+ TranslationSentences: "Translation (sentences)",
1240
+ } as const;
1241
+ export type GetPromptVersionUseCases = ClosedEnum<
1242
+ typeof GetPromptVersionUseCases
1243
+ >;
1244
+
1245
+ /**
1246
+ * The language that the prompt is written in. Use this field to categorize the prompt for your own purpose
1247
+ */
1248
+ export const GetPromptVersionLanguage = {
1249
+ Chinese: "Chinese",
1250
+ Dutch: "Dutch",
1251
+ English: "English",
1252
+ French: "French",
1253
+ German: "German",
1254
+ Russian: "Russian",
1255
+ Spanish: "Spanish",
1256
+ } as const;
1257
+ /**
1258
+ * The language that the prompt is written in. Use this field to categorize the prompt for your own purpose
1259
+ */
1260
+ export type GetPromptVersionLanguage = ClosedEnum<
1261
+ typeof GetPromptVersionLanguage
1262
+ >;
1263
+
1264
+ export type GetPromptVersionMetadata = {
1265
+ /**
1266
+ * A list of use cases that the prompt is meant to be used for. Use this field to categorize the prompt for your own purpose
1267
+ */
1268
+ useCases?: Array<GetPromptVersionUseCases> | undefined;
1269
+ /**
1270
+ * The language that the prompt is written in. Use this field to categorize the prompt for your own purpose
1271
+ */
1272
+ language?: GetPromptVersionLanguage | null | undefined;
1273
+ };
1274
+
1275
+ /**
1276
+ * Prompt version retrieved successfully.
1277
+ */
1278
+ export type GetPromptVersionResponseBody = {
1279
+ id: string;
1280
+ createdById?: string | null | undefined;
1281
+ updatedById?: string | null | undefined;
1282
+ /**
1283
+ * The prompt’s description, meant to be displayable in the UI. Use this field to optionally store a long form explanation of the prompt for your own purpose
1284
+ */
1285
+ description?: string | null | undefined;
1286
+ /**
1287
+ * [DEPRECATED] Use the `prompt` property instead. A list of messages compatible with the openAI schema.
1288
+ *
1289
+ * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible.
1290
+ */
1291
+ promptConfig?: GetPromptVersionPromptConfig | undefined;
1292
+ /**
1293
+ * Prompt configuration with model and messages. Use this instead of prompt_config.
1294
+ */
1295
+ prompt: GetPromptVersionPromptField;
1296
+ metadata?: GetPromptVersionMetadata | undefined;
1297
+ timestamp: string;
1298
+ };
1299
+
1300
+ /** @internal */
1301
+ export const GetPromptVersionRequest$inboundSchema: z.ZodType<
1302
+ GetPromptVersionRequest,
1303
+ z.ZodTypeDef,
1304
+ unknown
1305
+ > = z.object({
1306
+ prompt_id: z.string(),
1307
+ version_id: z.string(),
1308
+ }).transform((v) => {
1309
+ return remap$(v, {
1310
+ "prompt_id": "promptId",
1311
+ "version_id": "versionId",
1312
+ });
1313
+ });
1314
+ /** @internal */
1315
+ export type GetPromptVersionRequest$Outbound = {
1316
+ prompt_id: string;
1317
+ version_id: string;
1318
+ };
1319
+
1320
+ /** @internal */
1321
+ export const GetPromptVersionRequest$outboundSchema: z.ZodType<
1322
+ GetPromptVersionRequest$Outbound,
1323
+ z.ZodTypeDef,
1324
+ GetPromptVersionRequest
1325
+ > = z.object({
1326
+ promptId: z.string(),
1327
+ versionId: z.string(),
1328
+ }).transform((v) => {
1329
+ return remap$(v, {
1330
+ promptId: "prompt_id",
1331
+ versionId: "version_id",
1332
+ });
1333
+ });
1334
+
1335
+ export function getPromptVersionRequestToJSON(
1336
+ getPromptVersionRequest: GetPromptVersionRequest,
1337
+ ): string {
1338
+ return JSON.stringify(
1339
+ GetPromptVersionRequest$outboundSchema.parse(getPromptVersionRequest),
1340
+ );
1341
+ }
1342
+ export function getPromptVersionRequestFromJSON(
1343
+ jsonString: string,
1344
+ ): SafeParseResult<GetPromptVersionRequest, SDKValidationError> {
1345
+ return safeParse(
1346
+ jsonString,
1347
+ (x) => GetPromptVersionRequest$inboundSchema.parse(JSON.parse(x)),
1348
+ `Failed to parse 'GetPromptVersionRequest' from JSON`,
1349
+ );
1350
+ }
1351
+
1352
+ /** @internal */
1353
+ export const GetPromptVersionModelType$inboundSchema: z.ZodNativeEnum<
1354
+ typeof GetPromptVersionModelType
1355
+ > = z.nativeEnum(GetPromptVersionModelType);
1356
+ /** @internal */
1357
+ export const GetPromptVersionModelType$outboundSchema: z.ZodNativeEnum<
1358
+ typeof GetPromptVersionModelType
1359
+ > = GetPromptVersionModelType$inboundSchema;
1360
+
1361
+ /** @internal */
1362
+ export const GetPromptVersionFormat$inboundSchema: z.ZodNativeEnum<
1363
+ typeof GetPromptVersionFormat
1364
+ > = z.nativeEnum(GetPromptVersionFormat);
1365
+ /** @internal */
1366
+ export const GetPromptVersionFormat$outboundSchema: z.ZodNativeEnum<
1367
+ typeof GetPromptVersionFormat
1368
+ > = GetPromptVersionFormat$inboundSchema;
1369
+
1370
+ /** @internal */
1371
+ export const GetPromptVersionResponseFormat6$inboundSchema: z.ZodNativeEnum<
1372
+ typeof GetPromptVersionResponseFormat6
1373
+ > = z.nativeEnum(GetPromptVersionResponseFormat6);
1374
+ /** @internal */
1375
+ export const GetPromptVersionResponseFormat6$outboundSchema: z.ZodNativeEnum<
1376
+ typeof GetPromptVersionResponseFormat6
1377
+ > = GetPromptVersionResponseFormat6$inboundSchema;
1378
+
1379
+ /** @internal */
1380
+ export const GetPromptVersionResponseFormat5$inboundSchema: z.ZodNativeEnum<
1381
+ typeof GetPromptVersionResponseFormat5
1382
+ > = z.nativeEnum(GetPromptVersionResponseFormat5);
1383
+ /** @internal */
1384
+ export const GetPromptVersionResponseFormat5$outboundSchema: z.ZodNativeEnum<
1385
+ typeof GetPromptVersionResponseFormat5
1386
+ > = GetPromptVersionResponseFormat5$inboundSchema;
1387
+
1388
+ /** @internal */
1389
+ export const GetPromptVersionResponseFormat4$inboundSchema: z.ZodNativeEnum<
1390
+ typeof GetPromptVersionResponseFormat4
1391
+ > = z.nativeEnum(GetPromptVersionResponseFormat4);
1392
+ /** @internal */
1393
+ export const GetPromptVersionResponseFormat4$outboundSchema: z.ZodNativeEnum<
1394
+ typeof GetPromptVersionResponseFormat4
1395
+ > = GetPromptVersionResponseFormat4$inboundSchema;
1396
+
1397
+ /** @internal */
1398
+ export const GetPromptVersionResponseFormatPromptsResponse200ApplicationJSONResponseBodyType$inboundSchema:
1399
+ z.ZodNativeEnum<
1400
+ typeof GetPromptVersionResponseFormatPromptsResponse200ApplicationJSONResponseBodyType
1401
+ > = z.nativeEnum(
1402
+ GetPromptVersionResponseFormatPromptsResponse200ApplicationJSONResponseBodyType,
1403
+ );
1404
+ /** @internal */
1405
+ export const GetPromptVersionResponseFormatPromptsResponse200ApplicationJSONResponseBodyType$outboundSchema:
1406
+ z.ZodNativeEnum<
1407
+ typeof GetPromptVersionResponseFormatPromptsResponse200ApplicationJSONResponseBodyType
1408
+ > =
1409
+ GetPromptVersionResponseFormatPromptsResponse200ApplicationJSONResponseBodyType$inboundSchema;
1410
+
1411
+ /** @internal */
1412
+ export const GetPromptVersionResponseFormat3$inboundSchema: z.ZodType<
1413
+ GetPromptVersionResponseFormat3,
1414
+ z.ZodTypeDef,
1415
+ unknown
1416
+ > = z.object({
1417
+ type:
1418
+ GetPromptVersionResponseFormatPromptsResponse200ApplicationJSONResponseBodyType$inboundSchema,
1419
+ });
1420
+ /** @internal */
1421
+ export type GetPromptVersionResponseFormat3$Outbound = {
1422
+ type: string;
1423
+ };
1424
+
1425
+ /** @internal */
1426
+ export const GetPromptVersionResponseFormat3$outboundSchema: z.ZodType<
1427
+ GetPromptVersionResponseFormat3$Outbound,
1428
+ z.ZodTypeDef,
1429
+ GetPromptVersionResponseFormat3
1430
+ > = z.object({
1431
+ type:
1432
+ GetPromptVersionResponseFormatPromptsResponse200ApplicationJSONResponseBodyType$outboundSchema,
1433
+ });
1434
+
1435
+ export function getPromptVersionResponseFormat3ToJSON(
1436
+ getPromptVersionResponseFormat3: GetPromptVersionResponseFormat3,
1437
+ ): string {
1438
+ return JSON.stringify(
1439
+ GetPromptVersionResponseFormat3$outboundSchema.parse(
1440
+ getPromptVersionResponseFormat3,
1441
+ ),
1442
+ );
1443
+ }
1444
+ export function getPromptVersionResponseFormat3FromJSON(
1445
+ jsonString: string,
1446
+ ): SafeParseResult<GetPromptVersionResponseFormat3, SDKValidationError> {
1447
+ return safeParse(
1448
+ jsonString,
1449
+ (x) => GetPromptVersionResponseFormat3$inboundSchema.parse(JSON.parse(x)),
1450
+ `Failed to parse 'GetPromptVersionResponseFormat3' from JSON`,
1451
+ );
1452
+ }
1453
+
1454
+ /** @internal */
1455
+ export const GetPromptVersionResponseFormatPromptsResponse200ApplicationJSONType$inboundSchema:
1456
+ z.ZodNativeEnum<
1457
+ typeof GetPromptVersionResponseFormatPromptsResponse200ApplicationJSONType
1458
+ > = z.nativeEnum(
1459
+ GetPromptVersionResponseFormatPromptsResponse200ApplicationJSONType,
1460
+ );
1461
+ /** @internal */
1462
+ export const GetPromptVersionResponseFormatPromptsResponse200ApplicationJSONType$outboundSchema:
1463
+ z.ZodNativeEnum<
1464
+ typeof GetPromptVersionResponseFormatPromptsResponse200ApplicationJSONType
1465
+ > =
1466
+ GetPromptVersionResponseFormatPromptsResponse200ApplicationJSONType$inboundSchema;
1467
+
1468
+ /** @internal */
1469
+ export const GetPromptVersionResponseFormat2$inboundSchema: z.ZodType<
1470
+ GetPromptVersionResponseFormat2,
1471
+ z.ZodTypeDef,
1472
+ unknown
1473
+ > = z.object({
1474
+ type:
1475
+ GetPromptVersionResponseFormatPromptsResponse200ApplicationJSONType$inboundSchema,
1476
+ });
1477
+ /** @internal */
1478
+ export type GetPromptVersionResponseFormat2$Outbound = {
1479
+ type: string;
1480
+ };
1481
+
1482
+ /** @internal */
1483
+ export const GetPromptVersionResponseFormat2$outboundSchema: z.ZodType<
1484
+ GetPromptVersionResponseFormat2$Outbound,
1485
+ z.ZodTypeDef,
1486
+ GetPromptVersionResponseFormat2
1487
+ > = z.object({
1488
+ type:
1489
+ GetPromptVersionResponseFormatPromptsResponse200ApplicationJSONType$outboundSchema,
1490
+ });
1491
+
1492
+ export function getPromptVersionResponseFormat2ToJSON(
1493
+ getPromptVersionResponseFormat2: GetPromptVersionResponseFormat2,
1494
+ ): string {
1495
+ return JSON.stringify(
1496
+ GetPromptVersionResponseFormat2$outboundSchema.parse(
1497
+ getPromptVersionResponseFormat2,
1498
+ ),
1499
+ );
1500
+ }
1501
+ export function getPromptVersionResponseFormat2FromJSON(
1502
+ jsonString: string,
1503
+ ): SafeParseResult<GetPromptVersionResponseFormat2, SDKValidationError> {
1504
+ return safeParse(
1505
+ jsonString,
1506
+ (x) => GetPromptVersionResponseFormat2$inboundSchema.parse(JSON.parse(x)),
1507
+ `Failed to parse 'GetPromptVersionResponseFormat2' from JSON`,
1508
+ );
1509
+ }
1510
+
1511
+ /** @internal */
1512
+ export const GetPromptVersionResponseFormatPromptsResponse200Type$inboundSchema:
1513
+ z.ZodNativeEnum<typeof GetPromptVersionResponseFormatPromptsResponse200Type> =
1514
+ z.nativeEnum(GetPromptVersionResponseFormatPromptsResponse200Type);
1515
+ /** @internal */
1516
+ export const GetPromptVersionResponseFormatPromptsResponse200Type$outboundSchema:
1517
+ z.ZodNativeEnum<typeof GetPromptVersionResponseFormatPromptsResponse200Type> =
1518
+ GetPromptVersionResponseFormatPromptsResponse200Type$inboundSchema;
1519
+
1520
+ /** @internal */
1521
+ export const GetPromptVersionResponseFormatPromptsResponseJsonSchema$inboundSchema:
1522
+ z.ZodType<
1523
+ GetPromptVersionResponseFormatPromptsResponseJsonSchema,
1524
+ z.ZodTypeDef,
1525
+ unknown
1526
+ > = z.object({
1527
+ name: z.string(),
1528
+ description: z.string().optional(),
1529
+ strict: z.boolean().optional(),
1530
+ schema: z.record(z.any()),
1531
+ });
1532
+ /** @internal */
1533
+ export type GetPromptVersionResponseFormatPromptsResponseJsonSchema$Outbound = {
1534
+ name: string;
1535
+ description?: string | undefined;
1536
+ strict?: boolean | undefined;
1537
+ schema: { [k: string]: any };
1538
+ };
1539
+
1540
+ /** @internal */
1541
+ export const GetPromptVersionResponseFormatPromptsResponseJsonSchema$outboundSchema:
1542
+ z.ZodType<
1543
+ GetPromptVersionResponseFormatPromptsResponseJsonSchema$Outbound,
1544
+ z.ZodTypeDef,
1545
+ GetPromptVersionResponseFormatPromptsResponseJsonSchema
1546
+ > = z.object({
1547
+ name: z.string(),
1548
+ description: z.string().optional(),
1549
+ strict: z.boolean().optional(),
1550
+ schema: z.record(z.any()),
1551
+ });
1552
+
1553
+ export function getPromptVersionResponseFormatPromptsResponseJsonSchemaToJSON(
1554
+ getPromptVersionResponseFormatPromptsResponseJsonSchema:
1555
+ GetPromptVersionResponseFormatPromptsResponseJsonSchema,
1556
+ ): string {
1557
+ return JSON.stringify(
1558
+ GetPromptVersionResponseFormatPromptsResponseJsonSchema$outboundSchema
1559
+ .parse(getPromptVersionResponseFormatPromptsResponseJsonSchema),
1560
+ );
1561
+ }
1562
+ export function getPromptVersionResponseFormatPromptsResponseJsonSchemaFromJSON(
1563
+ jsonString: string,
1564
+ ): SafeParseResult<
1565
+ GetPromptVersionResponseFormatPromptsResponseJsonSchema,
1566
+ SDKValidationError
1567
+ > {
1568
+ return safeParse(
1569
+ jsonString,
1570
+ (x) =>
1571
+ GetPromptVersionResponseFormatPromptsResponseJsonSchema$inboundSchema
1572
+ .parse(JSON.parse(x)),
1573
+ `Failed to parse 'GetPromptVersionResponseFormatPromptsResponseJsonSchema' from JSON`,
1574
+ );
1575
+ }
1576
+
1577
+ /** @internal */
1578
+ export const GetPromptVersionResponseFormat1$inboundSchema: z.ZodType<
1579
+ GetPromptVersionResponseFormat1,
1580
+ z.ZodTypeDef,
1581
+ unknown
1582
+ > = z.object({
1583
+ type: GetPromptVersionResponseFormatPromptsResponse200Type$inboundSchema,
1584
+ display_name: z.string().optional(),
1585
+ json_schema: z.lazy(() =>
1586
+ GetPromptVersionResponseFormatPromptsResponseJsonSchema$inboundSchema
1587
+ ),
1588
+ }).transform((v) => {
1589
+ return remap$(v, {
1590
+ "display_name": "displayName",
1591
+ "json_schema": "jsonSchema",
1592
+ });
1593
+ });
1594
+ /** @internal */
1595
+ export type GetPromptVersionResponseFormat1$Outbound = {
1596
+ type: string;
1597
+ display_name?: string | undefined;
1598
+ json_schema: GetPromptVersionResponseFormatPromptsResponseJsonSchema$Outbound;
1599
+ };
1600
+
1601
+ /** @internal */
1602
+ export const GetPromptVersionResponseFormat1$outboundSchema: z.ZodType<
1603
+ GetPromptVersionResponseFormat1$Outbound,
1604
+ z.ZodTypeDef,
1605
+ GetPromptVersionResponseFormat1
1606
+ > = z.object({
1607
+ type: GetPromptVersionResponseFormatPromptsResponse200Type$outboundSchema,
1608
+ displayName: z.string().optional(),
1609
+ jsonSchema: z.lazy(() =>
1610
+ GetPromptVersionResponseFormatPromptsResponseJsonSchema$outboundSchema
1611
+ ),
1612
+ }).transform((v) => {
1613
+ return remap$(v, {
1614
+ displayName: "display_name",
1615
+ jsonSchema: "json_schema",
1616
+ });
1617
+ });
1618
+
1619
+ export function getPromptVersionResponseFormat1ToJSON(
1620
+ getPromptVersionResponseFormat1: GetPromptVersionResponseFormat1,
1621
+ ): string {
1622
+ return JSON.stringify(
1623
+ GetPromptVersionResponseFormat1$outboundSchema.parse(
1624
+ getPromptVersionResponseFormat1,
1625
+ ),
1626
+ );
1627
+ }
1628
+ export function getPromptVersionResponseFormat1FromJSON(
1629
+ jsonString: string,
1630
+ ): SafeParseResult<GetPromptVersionResponseFormat1, SDKValidationError> {
1631
+ return safeParse(
1632
+ jsonString,
1633
+ (x) => GetPromptVersionResponseFormat1$inboundSchema.parse(JSON.parse(x)),
1634
+ `Failed to parse 'GetPromptVersionResponseFormat1' from JSON`,
1635
+ );
1636
+ }
1637
+
1638
+ /** @internal */
1639
+ export const GetPromptVersionPromptsResponseFormat$inboundSchema: z.ZodType<
1640
+ GetPromptVersionPromptsResponseFormat,
1641
+ z.ZodTypeDef,
1642
+ unknown
1643
+ > = z.union([
1644
+ z.lazy(() => GetPromptVersionResponseFormat1$inboundSchema),
1645
+ z.lazy(() => GetPromptVersionResponseFormat2$inboundSchema),
1646
+ z.lazy(() => GetPromptVersionResponseFormat3$inboundSchema),
1647
+ GetPromptVersionResponseFormat4$inboundSchema,
1648
+ GetPromptVersionResponseFormat5$inboundSchema,
1649
+ GetPromptVersionResponseFormat6$inboundSchema,
1650
+ ]);
1651
+ /** @internal */
1652
+ export type GetPromptVersionPromptsResponseFormat$Outbound =
1653
+ | GetPromptVersionResponseFormat1$Outbound
1654
+ | GetPromptVersionResponseFormat2$Outbound
1655
+ | GetPromptVersionResponseFormat3$Outbound
1656
+ | string
1657
+ | string
1658
+ | string;
1659
+
1660
+ /** @internal */
1661
+ export const GetPromptVersionPromptsResponseFormat$outboundSchema: z.ZodType<
1662
+ GetPromptVersionPromptsResponseFormat$Outbound,
1663
+ z.ZodTypeDef,
1664
+ GetPromptVersionPromptsResponseFormat
1665
+ > = z.union([
1666
+ z.lazy(() => GetPromptVersionResponseFormat1$outboundSchema),
1667
+ z.lazy(() => GetPromptVersionResponseFormat2$outboundSchema),
1668
+ z.lazy(() => GetPromptVersionResponseFormat3$outboundSchema),
1669
+ GetPromptVersionResponseFormat4$outboundSchema,
1670
+ GetPromptVersionResponseFormat5$outboundSchema,
1671
+ GetPromptVersionResponseFormat6$outboundSchema,
1672
+ ]);
1673
+
1674
+ export function getPromptVersionPromptsResponseFormatToJSON(
1675
+ getPromptVersionPromptsResponseFormat: GetPromptVersionPromptsResponseFormat,
1676
+ ): string {
1677
+ return JSON.stringify(
1678
+ GetPromptVersionPromptsResponseFormat$outboundSchema.parse(
1679
+ getPromptVersionPromptsResponseFormat,
1680
+ ),
1681
+ );
1682
+ }
1683
+ export function getPromptVersionPromptsResponseFormatFromJSON(
1684
+ jsonString: string,
1685
+ ): SafeParseResult<GetPromptVersionPromptsResponseFormat, SDKValidationError> {
1686
+ return safeParse(
1687
+ jsonString,
1688
+ (x) =>
1689
+ GetPromptVersionPromptsResponseFormat$inboundSchema.parse(JSON.parse(x)),
1690
+ `Failed to parse 'GetPromptVersionPromptsResponseFormat' from JSON`,
1691
+ );
1692
+ }
1693
+
1694
+ /** @internal */
1695
+ export const GetPromptVersionPhotoRealVersion$inboundSchema: z.ZodNativeEnum<
1696
+ typeof GetPromptVersionPhotoRealVersion
1697
+ > = z.nativeEnum(GetPromptVersionPhotoRealVersion);
1698
+ /** @internal */
1699
+ export const GetPromptVersionPhotoRealVersion$outboundSchema: z.ZodNativeEnum<
1700
+ typeof GetPromptVersionPhotoRealVersion
1701
+ > = GetPromptVersionPhotoRealVersion$inboundSchema;
1702
+
1703
+ /** @internal */
1704
+ export const GetPromptVersionEncodingFormat$inboundSchema: z.ZodNativeEnum<
1705
+ typeof GetPromptVersionEncodingFormat
1706
+ > = z.nativeEnum(GetPromptVersionEncodingFormat);
1707
+ /** @internal */
1708
+ export const GetPromptVersionEncodingFormat$outboundSchema: z.ZodNativeEnum<
1709
+ typeof GetPromptVersionEncodingFormat
1710
+ > = GetPromptVersionEncodingFormat$inboundSchema;
1711
+
1712
+ /** @internal */
1713
+ export const GetPromptVersionPromptsReasoningEffort$inboundSchema:
1714
+ z.ZodNativeEnum<typeof GetPromptVersionPromptsReasoningEffort> = z.nativeEnum(
1715
+ GetPromptVersionPromptsReasoningEffort,
1716
+ );
1717
+ /** @internal */
1718
+ export const GetPromptVersionPromptsReasoningEffort$outboundSchema:
1719
+ z.ZodNativeEnum<typeof GetPromptVersionPromptsReasoningEffort> =
1720
+ GetPromptVersionPromptsReasoningEffort$inboundSchema;
1721
+
1722
+ /** @internal */
1723
+ export const GetPromptVersionVerbosity$inboundSchema: z.ZodNativeEnum<
1724
+ typeof GetPromptVersionVerbosity
1725
+ > = z.nativeEnum(GetPromptVersionVerbosity);
1726
+ /** @internal */
1727
+ export const GetPromptVersionVerbosity$outboundSchema: z.ZodNativeEnum<
1728
+ typeof GetPromptVersionVerbosity
1729
+ > = GetPromptVersionVerbosity$inboundSchema;
1730
+
1731
+ /** @internal */
1732
+ export const GetPromptVersionThinkingLevel$inboundSchema: z.ZodNativeEnum<
1733
+ typeof GetPromptVersionThinkingLevel
1734
+ > = z.nativeEnum(GetPromptVersionThinkingLevel);
1735
+ /** @internal */
1736
+ export const GetPromptVersionThinkingLevel$outboundSchema: z.ZodNativeEnum<
1737
+ typeof GetPromptVersionThinkingLevel
1738
+ > = GetPromptVersionThinkingLevel$inboundSchema;
1739
+
1740
+ /** @internal */
1741
+ export const GetPromptVersionModelParameters$inboundSchema: z.ZodType<
1742
+ GetPromptVersionModelParameters,
1743
+ z.ZodTypeDef,
1744
+ unknown
1745
+ > = z.object({
1746
+ temperature: z.number().optional(),
1747
+ maxTokens: z.number().optional(),
1748
+ topK: z.number().optional(),
1749
+ topP: z.number().optional(),
1750
+ frequencyPenalty: z.number().optional(),
1751
+ presencePenalty: z.number().optional(),
1752
+ numImages: z.number().optional(),
1753
+ seed: z.number().optional(),
1754
+ format: GetPromptVersionFormat$inboundSchema.optional(),
1755
+ dimensions: z.string().optional(),
1756
+ quality: z.string().optional(),
1757
+ style: z.string().optional(),
1758
+ responseFormat: z.nullable(
1759
+ z.union([
1760
+ z.lazy(() => GetPromptVersionResponseFormat1$inboundSchema),
1761
+ z.lazy(() => GetPromptVersionResponseFormat2$inboundSchema),
1762
+ z.lazy(() => GetPromptVersionResponseFormat3$inboundSchema),
1763
+ GetPromptVersionResponseFormat4$inboundSchema,
1764
+ GetPromptVersionResponseFormat5$inboundSchema,
1765
+ GetPromptVersionResponseFormat6$inboundSchema,
1766
+ ]),
1767
+ ).optional(),
1768
+ photoRealVersion: GetPromptVersionPhotoRealVersion$inboundSchema.optional(),
1769
+ encoding_format: GetPromptVersionEncodingFormat$inboundSchema.optional(),
1770
+ reasoningEffort: GetPromptVersionPromptsReasoningEffort$inboundSchema
1771
+ .optional(),
1772
+ budgetTokens: z.number().optional(),
1773
+ verbosity: GetPromptVersionVerbosity$inboundSchema.optional(),
1774
+ thinkingLevel: GetPromptVersionThinkingLevel$inboundSchema.optional(),
1775
+ }).transform((v) => {
1776
+ return remap$(v, {
1777
+ "encoding_format": "encodingFormat",
1778
+ });
1779
+ });
1780
+ /** @internal */
1781
+ export type GetPromptVersionModelParameters$Outbound = {
1782
+ temperature?: number | undefined;
1783
+ maxTokens?: number | undefined;
1784
+ topK?: number | undefined;
1785
+ topP?: number | undefined;
1786
+ frequencyPenalty?: number | undefined;
1787
+ presencePenalty?: number | undefined;
1788
+ numImages?: number | undefined;
1789
+ seed?: number | undefined;
1790
+ format?: string | undefined;
1791
+ dimensions?: string | undefined;
1792
+ quality?: string | undefined;
1793
+ style?: string | undefined;
1794
+ responseFormat?:
1795
+ | GetPromptVersionResponseFormat1$Outbound
1796
+ | GetPromptVersionResponseFormat2$Outbound
1797
+ | GetPromptVersionResponseFormat3$Outbound
1798
+ | string
1799
+ | string
1800
+ | string
1801
+ | null
1802
+ | undefined;
1803
+ photoRealVersion?: string | undefined;
1804
+ encoding_format?: string | undefined;
1805
+ reasoningEffort?: string | undefined;
1806
+ budgetTokens?: number | undefined;
1807
+ verbosity?: string | undefined;
1808
+ thinkingLevel?: string | undefined;
1809
+ };
1810
+
1811
+ /** @internal */
1812
+ export const GetPromptVersionModelParameters$outboundSchema: z.ZodType<
1813
+ GetPromptVersionModelParameters$Outbound,
1814
+ z.ZodTypeDef,
1815
+ GetPromptVersionModelParameters
1816
+ > = z.object({
1817
+ temperature: z.number().optional(),
1818
+ maxTokens: z.number().optional(),
1819
+ topK: z.number().optional(),
1820
+ topP: z.number().optional(),
1821
+ frequencyPenalty: z.number().optional(),
1822
+ presencePenalty: z.number().optional(),
1823
+ numImages: z.number().optional(),
1824
+ seed: z.number().optional(),
1825
+ format: GetPromptVersionFormat$outboundSchema.optional(),
1826
+ dimensions: z.string().optional(),
1827
+ quality: z.string().optional(),
1828
+ style: z.string().optional(),
1829
+ responseFormat: z.nullable(
1830
+ z.union([
1831
+ z.lazy(() => GetPromptVersionResponseFormat1$outboundSchema),
1832
+ z.lazy(() => GetPromptVersionResponseFormat2$outboundSchema),
1833
+ z.lazy(() => GetPromptVersionResponseFormat3$outboundSchema),
1834
+ GetPromptVersionResponseFormat4$outboundSchema,
1835
+ GetPromptVersionResponseFormat5$outboundSchema,
1836
+ GetPromptVersionResponseFormat6$outboundSchema,
1837
+ ]),
1838
+ ).optional(),
1839
+ photoRealVersion: GetPromptVersionPhotoRealVersion$outboundSchema.optional(),
1840
+ encodingFormat: GetPromptVersionEncodingFormat$outboundSchema.optional(),
1841
+ reasoningEffort: GetPromptVersionPromptsReasoningEffort$outboundSchema
1842
+ .optional(),
1843
+ budgetTokens: z.number().optional(),
1844
+ verbosity: GetPromptVersionVerbosity$outboundSchema.optional(),
1845
+ thinkingLevel: GetPromptVersionThinkingLevel$outboundSchema.optional(),
1846
+ }).transform((v) => {
1847
+ return remap$(v, {
1848
+ encodingFormat: "encoding_format",
1849
+ });
1850
+ });
1851
+
1852
+ export function getPromptVersionModelParametersToJSON(
1853
+ getPromptVersionModelParameters: GetPromptVersionModelParameters,
1854
+ ): string {
1855
+ return JSON.stringify(
1856
+ GetPromptVersionModelParameters$outboundSchema.parse(
1857
+ getPromptVersionModelParameters,
1858
+ ),
1859
+ );
1860
+ }
1861
+ export function getPromptVersionModelParametersFromJSON(
1862
+ jsonString: string,
1863
+ ): SafeParseResult<GetPromptVersionModelParameters, SDKValidationError> {
1864
+ return safeParse(
1865
+ jsonString,
1866
+ (x) => GetPromptVersionModelParameters$inboundSchema.parse(JSON.parse(x)),
1867
+ `Failed to parse 'GetPromptVersionModelParameters' from JSON`,
1868
+ );
1869
+ }
1870
+
1871
+ /** @internal */
1872
+ export const GetPromptVersionProvider$inboundSchema: z.ZodNativeEnum<
1873
+ typeof GetPromptVersionProvider
1874
+ > = z.nativeEnum(GetPromptVersionProvider);
1875
+ /** @internal */
1876
+ export const GetPromptVersionProvider$outboundSchema: z.ZodNativeEnum<
1877
+ typeof GetPromptVersionProvider
1878
+ > = GetPromptVersionProvider$inboundSchema;
1879
+
1880
+ /** @internal */
1881
+ export const GetPromptVersionRole$inboundSchema: z.ZodNativeEnum<
1882
+ typeof GetPromptVersionRole
1883
+ > = z.nativeEnum(GetPromptVersionRole);
1884
+ /** @internal */
1885
+ export const GetPromptVersionRole$outboundSchema: z.ZodNativeEnum<
1886
+ typeof GetPromptVersionRole
1887
+ > = GetPromptVersionRole$inboundSchema;
1888
+
1889
+ /** @internal */
1890
+ export const GetPromptVersion2File$inboundSchema: z.ZodType<
1891
+ GetPromptVersion2File,
1892
+ z.ZodTypeDef,
1893
+ unknown
1894
+ > = z.object({
1895
+ file_data: z.string().optional(),
1896
+ uri: z.string().optional(),
1897
+ mimeType: z.string().optional(),
1898
+ filename: z.string().optional(),
1899
+ }).transform((v) => {
1900
+ return remap$(v, {
1901
+ "file_data": "fileData",
1902
+ });
1903
+ });
1904
+ /** @internal */
1905
+ export type GetPromptVersion2File$Outbound = {
1906
+ file_data?: string | undefined;
1907
+ uri?: string | undefined;
1908
+ mimeType?: string | undefined;
1909
+ filename?: string | undefined;
1910
+ };
1911
+
1912
+ /** @internal */
1913
+ export const GetPromptVersion2File$outboundSchema: z.ZodType<
1914
+ GetPromptVersion2File$Outbound,
1915
+ z.ZodTypeDef,
1916
+ GetPromptVersion2File
1917
+ > = z.object({
1918
+ fileData: z.string().optional(),
1919
+ uri: z.string().optional(),
1920
+ mimeType: z.string().optional(),
1921
+ filename: z.string().optional(),
1922
+ }).transform((v) => {
1923
+ return remap$(v, {
1924
+ fileData: "file_data",
1925
+ });
1926
+ });
1927
+
1928
+ export function getPromptVersion2FileToJSON(
1929
+ getPromptVersion2File: GetPromptVersion2File,
1930
+ ): string {
1931
+ return JSON.stringify(
1932
+ GetPromptVersion2File$outboundSchema.parse(getPromptVersion2File),
1933
+ );
1934
+ }
1935
+ export function getPromptVersion2FileFromJSON(
1936
+ jsonString: string,
1937
+ ): SafeParseResult<GetPromptVersion2File, SDKValidationError> {
1938
+ return safeParse(
1939
+ jsonString,
1940
+ (x) => GetPromptVersion2File$inboundSchema.parse(JSON.parse(x)),
1941
+ `Failed to parse 'GetPromptVersion2File' from JSON`,
1942
+ );
1943
+ }
1944
+
1945
+ /** @internal */
1946
+ export const GetPromptVersion23$inboundSchema: z.ZodType<
1947
+ GetPromptVersion23,
1948
+ z.ZodTypeDef,
1949
+ unknown
1950
+ > = z.object({
1951
+ type: z.literal("file"),
1952
+ file: z.lazy(() => GetPromptVersion2File$inboundSchema),
1953
+ });
1954
+ /** @internal */
1955
+ export type GetPromptVersion23$Outbound = {
1956
+ type: "file";
1957
+ file: GetPromptVersion2File$Outbound;
1958
+ };
1959
+
1960
+ /** @internal */
1961
+ export const GetPromptVersion23$outboundSchema: z.ZodType<
1962
+ GetPromptVersion23$Outbound,
1963
+ z.ZodTypeDef,
1964
+ GetPromptVersion23
1965
+ > = z.object({
1966
+ type: z.literal("file"),
1967
+ file: z.lazy(() => GetPromptVersion2File$outboundSchema),
1968
+ });
1969
+
1970
+ export function getPromptVersion23ToJSON(
1971
+ getPromptVersion23: GetPromptVersion23,
1972
+ ): string {
1973
+ return JSON.stringify(
1974
+ GetPromptVersion23$outboundSchema.parse(getPromptVersion23),
1975
+ );
1976
+ }
1977
+ export function getPromptVersion23FromJSON(
1978
+ jsonString: string,
1979
+ ): SafeParseResult<GetPromptVersion23, SDKValidationError> {
1980
+ return safeParse(
1981
+ jsonString,
1982
+ (x) => GetPromptVersion23$inboundSchema.parse(JSON.parse(x)),
1983
+ `Failed to parse 'GetPromptVersion23' from JSON`,
1984
+ );
1985
+ }
1986
+
1987
+ /** @internal */
1988
+ export const GetPromptVersion2ImageUrl$inboundSchema: z.ZodType<
1989
+ GetPromptVersion2ImageUrl,
1990
+ z.ZodTypeDef,
1991
+ unknown
1992
+ > = z.object({
1993
+ id: z.string().optional(),
1994
+ url: z.string(),
1995
+ detail: z.string().optional(),
1996
+ });
1997
+ /** @internal */
1998
+ export type GetPromptVersion2ImageUrl$Outbound = {
1999
+ id?: string | undefined;
2000
+ url: string;
2001
+ detail?: string | undefined;
2002
+ };
2003
+
2004
+ /** @internal */
2005
+ export const GetPromptVersion2ImageUrl$outboundSchema: z.ZodType<
2006
+ GetPromptVersion2ImageUrl$Outbound,
2007
+ z.ZodTypeDef,
2008
+ GetPromptVersion2ImageUrl
2009
+ > = z.object({
2010
+ id: z.string().optional(),
2011
+ url: z.string(),
2012
+ detail: z.string().optional(),
2013
+ });
2014
+
2015
+ export function getPromptVersion2ImageUrlToJSON(
2016
+ getPromptVersion2ImageUrl: GetPromptVersion2ImageUrl,
2017
+ ): string {
2018
+ return JSON.stringify(
2019
+ GetPromptVersion2ImageUrl$outboundSchema.parse(getPromptVersion2ImageUrl),
2020
+ );
2021
+ }
2022
+ export function getPromptVersion2ImageUrlFromJSON(
2023
+ jsonString: string,
2024
+ ): SafeParseResult<GetPromptVersion2ImageUrl, SDKValidationError> {
2025
+ return safeParse(
2026
+ jsonString,
2027
+ (x) => GetPromptVersion2ImageUrl$inboundSchema.parse(JSON.parse(x)),
2028
+ `Failed to parse 'GetPromptVersion2ImageUrl' from JSON`,
2029
+ );
2030
+ }
2031
+
2032
+ /** @internal */
2033
+ export const GetPromptVersion22$inboundSchema: z.ZodType<
2034
+ GetPromptVersion22,
2035
+ z.ZodTypeDef,
2036
+ unknown
2037
+ > = z.object({
2038
+ type: z.literal("image_url"),
2039
+ image_url: z.lazy(() => GetPromptVersion2ImageUrl$inboundSchema),
2040
+ }).transform((v) => {
2041
+ return remap$(v, {
2042
+ "image_url": "imageUrl",
2043
+ });
2044
+ });
2045
+ /** @internal */
2046
+ export type GetPromptVersion22$Outbound = {
2047
+ type: "image_url";
2048
+ image_url: GetPromptVersion2ImageUrl$Outbound;
2049
+ };
2050
+
2051
+ /** @internal */
2052
+ export const GetPromptVersion22$outboundSchema: z.ZodType<
2053
+ GetPromptVersion22$Outbound,
2054
+ z.ZodTypeDef,
2055
+ GetPromptVersion22
2056
+ > = z.object({
2057
+ type: z.literal("image_url"),
2058
+ imageUrl: z.lazy(() => GetPromptVersion2ImageUrl$outboundSchema),
2059
+ }).transform((v) => {
2060
+ return remap$(v, {
2061
+ imageUrl: "image_url",
2062
+ });
2063
+ });
2064
+
2065
+ export function getPromptVersion22ToJSON(
2066
+ getPromptVersion22: GetPromptVersion22,
2067
+ ): string {
2068
+ return JSON.stringify(
2069
+ GetPromptVersion22$outboundSchema.parse(getPromptVersion22),
2070
+ );
2071
+ }
2072
+ export function getPromptVersion22FromJSON(
2073
+ jsonString: string,
2074
+ ): SafeParseResult<GetPromptVersion22, SDKValidationError> {
2075
+ return safeParse(
2076
+ jsonString,
2077
+ (x) => GetPromptVersion22$inboundSchema.parse(JSON.parse(x)),
2078
+ `Failed to parse 'GetPromptVersion22' from JSON`,
2079
+ );
2080
+ }
2081
+
2082
+ /** @internal */
2083
+ export const GetPromptVersion21$inboundSchema: z.ZodType<
2084
+ GetPromptVersion21,
2085
+ z.ZodTypeDef,
2086
+ unknown
2087
+ > = z.object({
2088
+ type: z.literal("text"),
2089
+ text: z.string(),
2090
+ });
2091
+ /** @internal */
2092
+ export type GetPromptVersion21$Outbound = {
2093
+ type: "text";
2094
+ text: string;
2095
+ };
2096
+
2097
+ /** @internal */
2098
+ export const GetPromptVersion21$outboundSchema: z.ZodType<
2099
+ GetPromptVersion21$Outbound,
2100
+ z.ZodTypeDef,
2101
+ GetPromptVersion21
2102
+ > = z.object({
2103
+ type: z.literal("text"),
2104
+ text: z.string(),
2105
+ });
2106
+
2107
+ export function getPromptVersion21ToJSON(
2108
+ getPromptVersion21: GetPromptVersion21,
2109
+ ): string {
2110
+ return JSON.stringify(
2111
+ GetPromptVersion21$outboundSchema.parse(getPromptVersion21),
2112
+ );
2113
+ }
2114
+ export function getPromptVersion21FromJSON(
2115
+ jsonString: string,
2116
+ ): SafeParseResult<GetPromptVersion21, SDKValidationError> {
2117
+ return safeParse(
2118
+ jsonString,
2119
+ (x) => GetPromptVersion21$inboundSchema.parse(JSON.parse(x)),
2120
+ `Failed to parse 'GetPromptVersion21' from JSON`,
2121
+ );
2122
+ }
2123
+
2124
+ /** @internal */
2125
+ export const GetPromptVersionContent2$inboundSchema: z.ZodType<
2126
+ GetPromptVersionContent2,
2127
+ z.ZodTypeDef,
2128
+ unknown
2129
+ > = z.union([
2130
+ z.lazy(() => GetPromptVersion21$inboundSchema),
2131
+ z.lazy(() => GetPromptVersion22$inboundSchema),
2132
+ z.lazy(() => GetPromptVersion23$inboundSchema),
2133
+ ]);
2134
+ /** @internal */
2135
+ export type GetPromptVersionContent2$Outbound =
2136
+ | GetPromptVersion21$Outbound
2137
+ | GetPromptVersion22$Outbound
2138
+ | GetPromptVersion23$Outbound;
2139
+
2140
+ /** @internal */
2141
+ export const GetPromptVersionContent2$outboundSchema: z.ZodType<
2142
+ GetPromptVersionContent2$Outbound,
2143
+ z.ZodTypeDef,
2144
+ GetPromptVersionContent2
2145
+ > = z.union([
2146
+ z.lazy(() => GetPromptVersion21$outboundSchema),
2147
+ z.lazy(() => GetPromptVersion22$outboundSchema),
2148
+ z.lazy(() => GetPromptVersion23$outboundSchema),
2149
+ ]);
2150
+
2151
+ export function getPromptVersionContent2ToJSON(
2152
+ getPromptVersionContent2: GetPromptVersionContent2,
2153
+ ): string {
2154
+ return JSON.stringify(
2155
+ GetPromptVersionContent2$outboundSchema.parse(getPromptVersionContent2),
2156
+ );
2157
+ }
2158
+ export function getPromptVersionContent2FromJSON(
2159
+ jsonString: string,
2160
+ ): SafeParseResult<GetPromptVersionContent2, SDKValidationError> {
2161
+ return safeParse(
2162
+ jsonString,
2163
+ (x) => GetPromptVersionContent2$inboundSchema.parse(JSON.parse(x)),
2164
+ `Failed to parse 'GetPromptVersionContent2' from JSON`,
2165
+ );
2166
+ }
2167
+
2168
+ /** @internal */
2169
+ export const GetPromptVersionContent$inboundSchema: z.ZodType<
2170
+ GetPromptVersionContent,
2171
+ z.ZodTypeDef,
2172
+ unknown
2173
+ > = z.union([
2174
+ z.string(),
2175
+ z.array(z.union([
2176
+ z.lazy(() => GetPromptVersion21$inboundSchema),
2177
+ z.lazy(() => GetPromptVersion22$inboundSchema),
2178
+ z.lazy(() => GetPromptVersion23$inboundSchema),
2179
+ ])),
2180
+ ]);
2181
+ /** @internal */
2182
+ export type GetPromptVersionContent$Outbound =
2183
+ | string
2184
+ | Array<
2185
+ | GetPromptVersion21$Outbound
2186
+ | GetPromptVersion22$Outbound
2187
+ | GetPromptVersion23$Outbound
2188
+ >;
2189
+
2190
+ /** @internal */
2191
+ export const GetPromptVersionContent$outboundSchema: z.ZodType<
2192
+ GetPromptVersionContent$Outbound,
2193
+ z.ZodTypeDef,
2194
+ GetPromptVersionContent
2195
+ > = z.union([
2196
+ z.string(),
2197
+ z.array(z.union([
2198
+ z.lazy(() => GetPromptVersion21$outboundSchema),
2199
+ z.lazy(() => GetPromptVersion22$outboundSchema),
2200
+ z.lazy(() => GetPromptVersion23$outboundSchema),
2201
+ ])),
2202
+ ]);
2203
+
2204
+ export function getPromptVersionContentToJSON(
2205
+ getPromptVersionContent: GetPromptVersionContent,
2206
+ ): string {
2207
+ return JSON.stringify(
2208
+ GetPromptVersionContent$outboundSchema.parse(getPromptVersionContent),
2209
+ );
2210
+ }
2211
+ export function getPromptVersionContentFromJSON(
2212
+ jsonString: string,
2213
+ ): SafeParseResult<GetPromptVersionContent, SDKValidationError> {
2214
+ return safeParse(
2215
+ jsonString,
2216
+ (x) => GetPromptVersionContent$inboundSchema.parse(JSON.parse(x)),
2217
+ `Failed to parse 'GetPromptVersionContent' from JSON`,
2218
+ );
2219
+ }
2220
+
2221
+ /** @internal */
2222
+ export const GetPromptVersionType$inboundSchema: z.ZodNativeEnum<
2223
+ typeof GetPromptVersionType
2224
+ > = z.nativeEnum(GetPromptVersionType);
2225
+ /** @internal */
2226
+ export const GetPromptVersionType$outboundSchema: z.ZodNativeEnum<
2227
+ typeof GetPromptVersionType
2228
+ > = GetPromptVersionType$inboundSchema;
2229
+
2230
+ /** @internal */
2231
+ export const GetPromptVersionFunction$inboundSchema: z.ZodType<
2232
+ GetPromptVersionFunction,
2233
+ z.ZodTypeDef,
2234
+ unknown
2235
+ > = z.object({
2236
+ name: z.string(),
2237
+ arguments: z.string(),
2238
+ });
2239
+ /** @internal */
2240
+ export type GetPromptVersionFunction$Outbound = {
2241
+ name: string;
2242
+ arguments: string;
2243
+ };
2244
+
2245
+ /** @internal */
2246
+ export const GetPromptVersionFunction$outboundSchema: z.ZodType<
2247
+ GetPromptVersionFunction$Outbound,
2248
+ z.ZodTypeDef,
2249
+ GetPromptVersionFunction
2250
+ > = z.object({
2251
+ name: z.string(),
2252
+ arguments: z.string(),
2253
+ });
2254
+
2255
+ export function getPromptVersionFunctionToJSON(
2256
+ getPromptVersionFunction: GetPromptVersionFunction,
2257
+ ): string {
2258
+ return JSON.stringify(
2259
+ GetPromptVersionFunction$outboundSchema.parse(getPromptVersionFunction),
2260
+ );
2261
+ }
2262
+ export function getPromptVersionFunctionFromJSON(
2263
+ jsonString: string,
2264
+ ): SafeParseResult<GetPromptVersionFunction, SDKValidationError> {
2265
+ return safeParse(
2266
+ jsonString,
2267
+ (x) => GetPromptVersionFunction$inboundSchema.parse(JSON.parse(x)),
2268
+ `Failed to parse 'GetPromptVersionFunction' from JSON`,
2269
+ );
2270
+ }
2271
+
2272
+ /** @internal */
2273
+ export const GetPromptVersionToolCalls$inboundSchema: z.ZodType<
2274
+ GetPromptVersionToolCalls,
2275
+ z.ZodTypeDef,
2276
+ unknown
2277
+ > = z.object({
2278
+ id: z.string().optional(),
2279
+ index: z.number().optional(),
2280
+ type: GetPromptVersionType$inboundSchema,
2281
+ function: z.lazy(() => GetPromptVersionFunction$inboundSchema),
2282
+ });
2283
+ /** @internal */
2284
+ export type GetPromptVersionToolCalls$Outbound = {
2285
+ id?: string | undefined;
2286
+ index?: number | undefined;
2287
+ type: string;
2288
+ function: GetPromptVersionFunction$Outbound;
2289
+ };
2290
+
2291
+ /** @internal */
2292
+ export const GetPromptVersionToolCalls$outboundSchema: z.ZodType<
2293
+ GetPromptVersionToolCalls$Outbound,
2294
+ z.ZodTypeDef,
2295
+ GetPromptVersionToolCalls
2296
+ > = z.object({
2297
+ id: z.string().optional(),
2298
+ index: z.number().optional(),
2299
+ type: GetPromptVersionType$outboundSchema,
2300
+ function: z.lazy(() => GetPromptVersionFunction$outboundSchema),
2301
+ });
2302
+
2303
+ export function getPromptVersionToolCallsToJSON(
2304
+ getPromptVersionToolCalls: GetPromptVersionToolCalls,
2305
+ ): string {
2306
+ return JSON.stringify(
2307
+ GetPromptVersionToolCalls$outboundSchema.parse(getPromptVersionToolCalls),
2308
+ );
2309
+ }
2310
+ export function getPromptVersionToolCallsFromJSON(
2311
+ jsonString: string,
2312
+ ): SafeParseResult<GetPromptVersionToolCalls, SDKValidationError> {
2313
+ return safeParse(
2314
+ jsonString,
2315
+ (x) => GetPromptVersionToolCalls$inboundSchema.parse(JSON.parse(x)),
2316
+ `Failed to parse 'GetPromptVersionToolCalls' from JSON`,
2317
+ );
2318
+ }
2319
+
2320
+ /** @internal */
2321
+ export const GetPromptVersionMessages$inboundSchema: z.ZodType<
2322
+ GetPromptVersionMessages,
2323
+ z.ZodTypeDef,
2324
+ unknown
2325
+ > = z.object({
2326
+ role: GetPromptVersionRole$inboundSchema,
2327
+ content: z.nullable(
2328
+ z.union([
2329
+ z.string(),
2330
+ z.array(
2331
+ z.union([
2332
+ z.lazy(() => GetPromptVersion21$inboundSchema),
2333
+ z.lazy(() => GetPromptVersion22$inboundSchema),
2334
+ z.lazy(() => GetPromptVersion23$inboundSchema),
2335
+ ]),
2336
+ ),
2337
+ ]),
2338
+ ),
2339
+ tool_calls: z.array(z.lazy(() => GetPromptVersionToolCalls$inboundSchema))
2340
+ .optional(),
2341
+ tool_call_id: z.nullable(z.string()).optional(),
2342
+ }).transform((v) => {
2343
+ return remap$(v, {
2344
+ "tool_calls": "toolCalls",
2345
+ "tool_call_id": "toolCallId",
2346
+ });
2347
+ });
2348
+ /** @internal */
2349
+ export type GetPromptVersionMessages$Outbound = {
2350
+ role: string;
2351
+ content:
2352
+ | string
2353
+ | Array<
2354
+ | GetPromptVersion21$Outbound
2355
+ | GetPromptVersion22$Outbound
2356
+ | GetPromptVersion23$Outbound
2357
+ >
2358
+ | null;
2359
+ tool_calls?: Array<GetPromptVersionToolCalls$Outbound> | undefined;
2360
+ tool_call_id?: string | null | undefined;
2361
+ };
2362
+
2363
+ /** @internal */
2364
+ export const GetPromptVersionMessages$outboundSchema: z.ZodType<
2365
+ GetPromptVersionMessages$Outbound,
2366
+ z.ZodTypeDef,
2367
+ GetPromptVersionMessages
2368
+ > = z.object({
2369
+ role: GetPromptVersionRole$outboundSchema,
2370
+ content: z.nullable(
2371
+ z.union([
2372
+ z.string(),
2373
+ z.array(
2374
+ z.union([
2375
+ z.lazy(() => GetPromptVersion21$outboundSchema),
2376
+ z.lazy(() => GetPromptVersion22$outboundSchema),
2377
+ z.lazy(() => GetPromptVersion23$outboundSchema),
2378
+ ]),
2379
+ ),
2380
+ ]),
2381
+ ),
2382
+ toolCalls: z.array(z.lazy(() => GetPromptVersionToolCalls$outboundSchema))
2383
+ .optional(),
2384
+ toolCallId: z.nullable(z.string()).optional(),
2385
+ }).transform((v) => {
2386
+ return remap$(v, {
2387
+ toolCalls: "tool_calls",
2388
+ toolCallId: "tool_call_id",
2389
+ });
2390
+ });
2391
+
2392
+ export function getPromptVersionMessagesToJSON(
2393
+ getPromptVersionMessages: GetPromptVersionMessages,
2394
+ ): string {
2395
+ return JSON.stringify(
2396
+ GetPromptVersionMessages$outboundSchema.parse(getPromptVersionMessages),
2397
+ );
2398
+ }
2399
+ export function getPromptVersionMessagesFromJSON(
2400
+ jsonString: string,
2401
+ ): SafeParseResult<GetPromptVersionMessages, SDKValidationError> {
2402
+ return safeParse(
2403
+ jsonString,
2404
+ (x) => GetPromptVersionMessages$inboundSchema.parse(JSON.parse(x)),
2405
+ `Failed to parse 'GetPromptVersionMessages' from JSON`,
2406
+ );
2407
+ }
2408
+
2409
+ /** @internal */
2410
+ export const GetPromptVersionPromptConfig$inboundSchema: z.ZodType<
2411
+ GetPromptVersionPromptConfig,
2412
+ z.ZodTypeDef,
2413
+ unknown
2414
+ > = z.object({
2415
+ stream: z.boolean().optional(),
2416
+ model: z.nullable(z.string()).optional(),
2417
+ model_db_id: z.nullable(z.string()).optional(),
2418
+ model_type: z.nullable(GetPromptVersionModelType$inboundSchema).optional(),
2419
+ model_parameters: z.lazy(() => GetPromptVersionModelParameters$inboundSchema)
2420
+ .optional(),
2421
+ provider: z.nullable(GetPromptVersionProvider$inboundSchema).optional(),
2422
+ integration_id: z.nullable(z.string()).optional(),
2423
+ version: z.string().optional(),
2424
+ messages: z.array(z.lazy(() => GetPromptVersionMessages$inboundSchema)),
2425
+ }).transform((v) => {
2426
+ return remap$(v, {
2427
+ "model_db_id": "modelDbId",
2428
+ "model_type": "modelType",
2429
+ "model_parameters": "modelParameters",
2430
+ "integration_id": "integrationId",
2431
+ });
2432
+ });
2433
+ /** @internal */
2434
+ export type GetPromptVersionPromptConfig$Outbound = {
2435
+ stream?: boolean | undefined;
2436
+ model?: string | null | undefined;
2437
+ model_db_id?: string | null | undefined;
2438
+ model_type?: string | null | undefined;
2439
+ model_parameters?: GetPromptVersionModelParameters$Outbound | undefined;
2440
+ provider?: string | null | undefined;
2441
+ integration_id?: string | null | undefined;
2442
+ version?: string | undefined;
2443
+ messages: Array<GetPromptVersionMessages$Outbound>;
2444
+ };
2445
+
2446
+ /** @internal */
2447
+ export const GetPromptVersionPromptConfig$outboundSchema: z.ZodType<
2448
+ GetPromptVersionPromptConfig$Outbound,
2449
+ z.ZodTypeDef,
2450
+ GetPromptVersionPromptConfig
2451
+ > = z.object({
2452
+ stream: z.boolean().optional(),
2453
+ model: z.nullable(z.string()).optional(),
2454
+ modelDbId: z.nullable(z.string()).optional(),
2455
+ modelType: z.nullable(GetPromptVersionModelType$outboundSchema).optional(),
2456
+ modelParameters: z.lazy(() => GetPromptVersionModelParameters$outboundSchema)
2457
+ .optional(),
2458
+ provider: z.nullable(GetPromptVersionProvider$outboundSchema).optional(),
2459
+ integrationId: z.nullable(z.string()).optional(),
2460
+ version: z.string().optional(),
2461
+ messages: z.array(z.lazy(() => GetPromptVersionMessages$outboundSchema)),
2462
+ }).transform((v) => {
2463
+ return remap$(v, {
2464
+ modelDbId: "model_db_id",
2465
+ modelType: "model_type",
2466
+ modelParameters: "model_parameters",
2467
+ integrationId: "integration_id",
2468
+ });
2469
+ });
2470
+
2471
+ export function getPromptVersionPromptConfigToJSON(
2472
+ getPromptVersionPromptConfig: GetPromptVersionPromptConfig,
2473
+ ): string {
2474
+ return JSON.stringify(
2475
+ GetPromptVersionPromptConfig$outboundSchema.parse(
2476
+ getPromptVersionPromptConfig,
2477
+ ),
2478
+ );
2479
+ }
2480
+ export function getPromptVersionPromptConfigFromJSON(
2481
+ jsonString: string,
2482
+ ): SafeParseResult<GetPromptVersionPromptConfig, SDKValidationError> {
2483
+ return safeParse(
2484
+ jsonString,
2485
+ (x) => GetPromptVersionPromptConfig$inboundSchema.parse(JSON.parse(x)),
2486
+ `Failed to parse 'GetPromptVersionPromptConfig' from JSON`,
2487
+ );
2488
+ }
2489
+
2490
+ /** @internal */
2491
+ export const GetPromptVersionVoice$inboundSchema: z.ZodNativeEnum<
2492
+ typeof GetPromptVersionVoice
2493
+ > = z.nativeEnum(GetPromptVersionVoice);
2494
+ /** @internal */
2495
+ export const GetPromptVersionVoice$outboundSchema: z.ZodNativeEnum<
2496
+ typeof GetPromptVersionVoice
2497
+ > = GetPromptVersionVoice$inboundSchema;
2498
+
2499
+ /** @internal */
2500
+ export const GetPromptVersionPromptsFormat$inboundSchema: z.ZodNativeEnum<
2501
+ typeof GetPromptVersionPromptsFormat
2502
+ > = z.nativeEnum(GetPromptVersionPromptsFormat);
2503
+ /** @internal */
2504
+ export const GetPromptVersionPromptsFormat$outboundSchema: z.ZodNativeEnum<
2505
+ typeof GetPromptVersionPromptsFormat
2506
+ > = GetPromptVersionPromptsFormat$inboundSchema;
2507
+
2508
+ /** @internal */
2509
+ export const GetPromptVersionAudio$inboundSchema: z.ZodType<
2510
+ GetPromptVersionAudio,
2511
+ z.ZodTypeDef,
2512
+ unknown
2513
+ > = z.object({
2514
+ voice: GetPromptVersionVoice$inboundSchema,
2515
+ format: GetPromptVersionPromptsFormat$inboundSchema,
2516
+ });
2517
+ /** @internal */
2518
+ export type GetPromptVersionAudio$Outbound = {
2519
+ voice: string;
2520
+ format: string;
2521
+ };
2522
+
2523
+ /** @internal */
2524
+ export const GetPromptVersionAudio$outboundSchema: z.ZodType<
2525
+ GetPromptVersionAudio$Outbound,
2526
+ z.ZodTypeDef,
2527
+ GetPromptVersionAudio
2528
+ > = z.object({
2529
+ voice: GetPromptVersionVoice$outboundSchema,
2530
+ format: GetPromptVersionPromptsFormat$outboundSchema,
2531
+ });
2532
+
2533
+ export function getPromptVersionAudioToJSON(
2534
+ getPromptVersionAudio: GetPromptVersionAudio,
2535
+ ): string {
2536
+ return JSON.stringify(
2537
+ GetPromptVersionAudio$outboundSchema.parse(getPromptVersionAudio),
2538
+ );
2539
+ }
2540
+ export function getPromptVersionAudioFromJSON(
2541
+ jsonString: string,
2542
+ ): SafeParseResult<GetPromptVersionAudio, SDKValidationError> {
2543
+ return safeParse(
2544
+ jsonString,
2545
+ (x) => GetPromptVersionAudio$inboundSchema.parse(JSON.parse(x)),
2546
+ `Failed to parse 'GetPromptVersionAudio' from JSON`,
2547
+ );
2548
+ }
2549
+
2550
+ /** @internal */
2551
+ export const GetPromptVersionResponseFormatJsonSchema$inboundSchema: z.ZodType<
2552
+ GetPromptVersionResponseFormatJsonSchema,
2553
+ z.ZodTypeDef,
2554
+ unknown
2555
+ > = z.object({
2556
+ description: z.string().optional(),
2557
+ name: z.string(),
2558
+ schema: z.any().optional(),
2559
+ strict: z.boolean().default(false),
2560
+ });
2561
+ /** @internal */
2562
+ export type GetPromptVersionResponseFormatJsonSchema$Outbound = {
2563
+ description?: string | undefined;
2564
+ name: string;
2565
+ schema?: any | undefined;
2566
+ strict: boolean;
2567
+ };
2568
+
2569
+ /** @internal */
2570
+ export const GetPromptVersionResponseFormatJsonSchema$outboundSchema: z.ZodType<
2571
+ GetPromptVersionResponseFormatJsonSchema$Outbound,
2572
+ z.ZodTypeDef,
2573
+ GetPromptVersionResponseFormatJsonSchema
2574
+ > = z.object({
2575
+ description: z.string().optional(),
2576
+ name: z.string(),
2577
+ schema: z.any().optional(),
2578
+ strict: z.boolean().default(false),
2579
+ });
2580
+
2581
+ export function getPromptVersionResponseFormatJsonSchemaToJSON(
2582
+ getPromptVersionResponseFormatJsonSchema:
2583
+ GetPromptVersionResponseFormatJsonSchema,
2584
+ ): string {
2585
+ return JSON.stringify(
2586
+ GetPromptVersionResponseFormatJsonSchema$outboundSchema.parse(
2587
+ getPromptVersionResponseFormatJsonSchema,
2588
+ ),
2589
+ );
2590
+ }
2591
+ export function getPromptVersionResponseFormatJsonSchemaFromJSON(
2592
+ jsonString: string,
2593
+ ): SafeParseResult<
2594
+ GetPromptVersionResponseFormatJsonSchema,
2595
+ SDKValidationError
2596
+ > {
2597
+ return safeParse(
2598
+ jsonString,
2599
+ (x) =>
2600
+ GetPromptVersionResponseFormatJsonSchema$inboundSchema.parse(
2601
+ JSON.parse(x),
2602
+ ),
2603
+ `Failed to parse 'GetPromptVersionResponseFormatJsonSchema' from JSON`,
2604
+ );
2605
+ }
2606
+
2607
+ /** @internal */
2608
+ export const GetPromptVersionResponseFormatPromptsJSONSchema$inboundSchema:
2609
+ z.ZodType<
2610
+ GetPromptVersionResponseFormatPromptsJSONSchema,
2611
+ z.ZodTypeDef,
2612
+ unknown
2613
+ > = z.object({
2614
+ type: z.literal("json_schema"),
2615
+ json_schema: z.lazy(() =>
2616
+ GetPromptVersionResponseFormatJsonSchema$inboundSchema
2617
+ ),
2618
+ }).transform((v) => {
2619
+ return remap$(v, {
2620
+ "json_schema": "jsonSchema",
2621
+ });
2622
+ });
2623
+ /** @internal */
2624
+ export type GetPromptVersionResponseFormatPromptsJSONSchema$Outbound = {
2625
+ type: "json_schema";
2626
+ json_schema: GetPromptVersionResponseFormatJsonSchema$Outbound;
2627
+ };
2628
+
2629
+ /** @internal */
2630
+ export const GetPromptVersionResponseFormatPromptsJSONSchema$outboundSchema:
2631
+ z.ZodType<
2632
+ GetPromptVersionResponseFormatPromptsJSONSchema$Outbound,
2633
+ z.ZodTypeDef,
2634
+ GetPromptVersionResponseFormatPromptsJSONSchema
2635
+ > = z.object({
2636
+ type: z.literal("json_schema"),
2637
+ jsonSchema: z.lazy(() =>
2638
+ GetPromptVersionResponseFormatJsonSchema$outboundSchema
2639
+ ),
2640
+ }).transform((v) => {
2641
+ return remap$(v, {
2642
+ jsonSchema: "json_schema",
2643
+ });
2644
+ });
2645
+
2646
+ export function getPromptVersionResponseFormatPromptsJSONSchemaToJSON(
2647
+ getPromptVersionResponseFormatPromptsJSONSchema:
2648
+ GetPromptVersionResponseFormatPromptsJSONSchema,
2649
+ ): string {
2650
+ return JSON.stringify(
2651
+ GetPromptVersionResponseFormatPromptsJSONSchema$outboundSchema.parse(
2652
+ getPromptVersionResponseFormatPromptsJSONSchema,
2653
+ ),
2654
+ );
2655
+ }
2656
+ export function getPromptVersionResponseFormatPromptsJSONSchemaFromJSON(
2657
+ jsonString: string,
2658
+ ): SafeParseResult<
2659
+ GetPromptVersionResponseFormatPromptsJSONSchema,
2660
+ SDKValidationError
2661
+ > {
2662
+ return safeParse(
2663
+ jsonString,
2664
+ (x) =>
2665
+ GetPromptVersionResponseFormatPromptsJSONSchema$inboundSchema.parse(
2666
+ JSON.parse(x),
2667
+ ),
2668
+ `Failed to parse 'GetPromptVersionResponseFormatPromptsJSONSchema' from JSON`,
2669
+ );
2670
+ }
2671
+
2672
+ /** @internal */
2673
+ export const GetPromptVersionResponseFormatJSONObject$inboundSchema: z.ZodType<
2674
+ GetPromptVersionResponseFormatJSONObject,
2675
+ z.ZodTypeDef,
2676
+ unknown
2677
+ > = z.object({
2678
+ type: z.literal("json_object"),
2679
+ });
2680
+ /** @internal */
2681
+ export type GetPromptVersionResponseFormatJSONObject$Outbound = {
2682
+ type: "json_object";
2683
+ };
2684
+
2685
+ /** @internal */
2686
+ export const GetPromptVersionResponseFormatJSONObject$outboundSchema: z.ZodType<
2687
+ GetPromptVersionResponseFormatJSONObject$Outbound,
2688
+ z.ZodTypeDef,
2689
+ GetPromptVersionResponseFormatJSONObject
2690
+ > = z.object({
2691
+ type: z.literal("json_object"),
2692
+ });
2693
+
2694
+ export function getPromptVersionResponseFormatJSONObjectToJSON(
2695
+ getPromptVersionResponseFormatJSONObject:
2696
+ GetPromptVersionResponseFormatJSONObject,
2697
+ ): string {
2698
+ return JSON.stringify(
2699
+ GetPromptVersionResponseFormatJSONObject$outboundSchema.parse(
2700
+ getPromptVersionResponseFormatJSONObject,
2701
+ ),
2702
+ );
2703
+ }
2704
+ export function getPromptVersionResponseFormatJSONObjectFromJSON(
2705
+ jsonString: string,
2706
+ ): SafeParseResult<
2707
+ GetPromptVersionResponseFormatJSONObject,
2708
+ SDKValidationError
2709
+ > {
2710
+ return safeParse(
2711
+ jsonString,
2712
+ (x) =>
2713
+ GetPromptVersionResponseFormatJSONObject$inboundSchema.parse(
2714
+ JSON.parse(x),
2715
+ ),
2716
+ `Failed to parse 'GetPromptVersionResponseFormatJSONObject' from JSON`,
2717
+ );
2718
+ }
2719
+
2720
+ /** @internal */
2721
+ export const GetPromptVersionResponseFormatText$inboundSchema: z.ZodType<
2722
+ GetPromptVersionResponseFormatText,
2723
+ z.ZodTypeDef,
2724
+ unknown
2725
+ > = z.object({
2726
+ type: z.literal("text"),
2727
+ });
2728
+ /** @internal */
2729
+ export type GetPromptVersionResponseFormatText$Outbound = {
2730
+ type: "text";
2731
+ };
2732
+
2733
+ /** @internal */
2734
+ export const GetPromptVersionResponseFormatText$outboundSchema: z.ZodType<
2735
+ GetPromptVersionResponseFormatText$Outbound,
2736
+ z.ZodTypeDef,
2737
+ GetPromptVersionResponseFormatText
2738
+ > = z.object({
2739
+ type: z.literal("text"),
2740
+ });
2741
+
2742
+ export function getPromptVersionResponseFormatTextToJSON(
2743
+ getPromptVersionResponseFormatText: GetPromptVersionResponseFormatText,
2744
+ ): string {
2745
+ return JSON.stringify(
2746
+ GetPromptVersionResponseFormatText$outboundSchema.parse(
2747
+ getPromptVersionResponseFormatText,
2748
+ ),
2749
+ );
2750
+ }
2751
+ export function getPromptVersionResponseFormatTextFromJSON(
2752
+ jsonString: string,
2753
+ ): SafeParseResult<GetPromptVersionResponseFormatText, SDKValidationError> {
2754
+ return safeParse(
2755
+ jsonString,
2756
+ (x) =>
2757
+ GetPromptVersionResponseFormatText$inboundSchema.parse(JSON.parse(x)),
2758
+ `Failed to parse 'GetPromptVersionResponseFormatText' from JSON`,
2759
+ );
2760
+ }
2761
+
2762
+ /** @internal */
2763
+ export const GetPromptVersionResponseFormat$inboundSchema: z.ZodType<
2764
+ GetPromptVersionResponseFormat,
2765
+ z.ZodTypeDef,
2766
+ unknown
2767
+ > = z.union([
2768
+ z.lazy(() => GetPromptVersionResponseFormatText$inboundSchema),
2769
+ z.lazy(() => GetPromptVersionResponseFormatJSONObject$inboundSchema),
2770
+ z.lazy(() => GetPromptVersionResponseFormatPromptsJSONSchema$inboundSchema),
2771
+ ]);
2772
+ /** @internal */
2773
+ export type GetPromptVersionResponseFormat$Outbound =
2774
+ | GetPromptVersionResponseFormatText$Outbound
2775
+ | GetPromptVersionResponseFormatJSONObject$Outbound
2776
+ | GetPromptVersionResponseFormatPromptsJSONSchema$Outbound;
2777
+
2778
+ /** @internal */
2779
+ export const GetPromptVersionResponseFormat$outboundSchema: z.ZodType<
2780
+ GetPromptVersionResponseFormat$Outbound,
2781
+ z.ZodTypeDef,
2782
+ GetPromptVersionResponseFormat
2783
+ > = z.union([
2784
+ z.lazy(() => GetPromptVersionResponseFormatText$outboundSchema),
2785
+ z.lazy(() => GetPromptVersionResponseFormatJSONObject$outboundSchema),
2786
+ z.lazy(() => GetPromptVersionResponseFormatPromptsJSONSchema$outboundSchema),
2787
+ ]);
2788
+
2789
+ export function getPromptVersionResponseFormatToJSON(
2790
+ getPromptVersionResponseFormat: GetPromptVersionResponseFormat,
2791
+ ): string {
2792
+ return JSON.stringify(
2793
+ GetPromptVersionResponseFormat$outboundSchema.parse(
2794
+ getPromptVersionResponseFormat,
2795
+ ),
2796
+ );
2797
+ }
2798
+ export function getPromptVersionResponseFormatFromJSON(
2799
+ jsonString: string,
2800
+ ): SafeParseResult<GetPromptVersionResponseFormat, SDKValidationError> {
2801
+ return safeParse(
2802
+ jsonString,
2803
+ (x) => GetPromptVersionResponseFormat$inboundSchema.parse(JSON.parse(x)),
2804
+ `Failed to parse 'GetPromptVersionResponseFormat' from JSON`,
2805
+ );
2806
+ }
2807
+
2808
+ /** @internal */
2809
+ export const GetPromptVersionReasoningEffort$inboundSchema: z.ZodNativeEnum<
2810
+ typeof GetPromptVersionReasoningEffort
2811
+ > = z.nativeEnum(GetPromptVersionReasoningEffort);
2812
+ /** @internal */
2813
+ export const GetPromptVersionReasoningEffort$outboundSchema: z.ZodNativeEnum<
2814
+ typeof GetPromptVersionReasoningEffort
2815
+ > = GetPromptVersionReasoningEffort$inboundSchema;
2816
+
2817
+ /** @internal */
2818
+ export const GetPromptVersionStop$inboundSchema: z.ZodType<
2819
+ GetPromptVersionStop,
2820
+ z.ZodTypeDef,
2821
+ unknown
2822
+ > = z.union([z.string(), z.array(z.string())]);
2823
+ /** @internal */
2824
+ export type GetPromptVersionStop$Outbound = string | Array<string>;
2825
+
2826
+ /** @internal */
2827
+ export const GetPromptVersionStop$outboundSchema: z.ZodType<
2828
+ GetPromptVersionStop$Outbound,
2829
+ z.ZodTypeDef,
2830
+ GetPromptVersionStop
2831
+ > = z.union([z.string(), z.array(z.string())]);
2832
+
2833
+ export function getPromptVersionStopToJSON(
2834
+ getPromptVersionStop: GetPromptVersionStop,
711
2835
  ): string {
712
2836
  return JSON.stringify(
713
- GetPromptVersionResponseFormat3$outboundSchema.parse(
714
- getPromptVersionResponseFormat3,
2837
+ GetPromptVersionStop$outboundSchema.parse(getPromptVersionStop),
2838
+ );
2839
+ }
2840
+ export function getPromptVersionStopFromJSON(
2841
+ jsonString: string,
2842
+ ): SafeParseResult<GetPromptVersionStop, SDKValidationError> {
2843
+ return safeParse(
2844
+ jsonString,
2845
+ (x) => GetPromptVersionStop$inboundSchema.parse(JSON.parse(x)),
2846
+ `Failed to parse 'GetPromptVersionStop' from JSON`,
2847
+ );
2848
+ }
2849
+
2850
+ /** @internal */
2851
+ export const GetPromptVersionStreamOptions$inboundSchema: z.ZodType<
2852
+ GetPromptVersionStreamOptions,
2853
+ z.ZodTypeDef,
2854
+ unknown
2855
+ > = z.object({
2856
+ include_usage: z.boolean().optional(),
2857
+ }).transform((v) => {
2858
+ return remap$(v, {
2859
+ "include_usage": "includeUsage",
2860
+ });
2861
+ });
2862
+ /** @internal */
2863
+ export type GetPromptVersionStreamOptions$Outbound = {
2864
+ include_usage?: boolean | undefined;
2865
+ };
2866
+
2867
+ /** @internal */
2868
+ export const GetPromptVersionStreamOptions$outboundSchema: z.ZodType<
2869
+ GetPromptVersionStreamOptions$Outbound,
2870
+ z.ZodTypeDef,
2871
+ GetPromptVersionStreamOptions
2872
+ > = z.object({
2873
+ includeUsage: z.boolean().optional(),
2874
+ }).transform((v) => {
2875
+ return remap$(v, {
2876
+ includeUsage: "include_usage",
2877
+ });
2878
+ });
2879
+
2880
+ export function getPromptVersionStreamOptionsToJSON(
2881
+ getPromptVersionStreamOptions: GetPromptVersionStreamOptions,
2882
+ ): string {
2883
+ return JSON.stringify(
2884
+ GetPromptVersionStreamOptions$outboundSchema.parse(
2885
+ getPromptVersionStreamOptions,
715
2886
  ),
716
2887
  );
717
2888
  }
718
- export function getPromptVersionResponseFormat3FromJSON(
2889
+ export function getPromptVersionStreamOptionsFromJSON(
719
2890
  jsonString: string,
720
- ): SafeParseResult<GetPromptVersionResponseFormat3, SDKValidationError> {
2891
+ ): SafeParseResult<GetPromptVersionStreamOptions, SDKValidationError> {
721
2892
  return safeParse(
722
2893
  jsonString,
723
- (x) => GetPromptVersionResponseFormat3$inboundSchema.parse(JSON.parse(x)),
724
- `Failed to parse 'GetPromptVersionResponseFormat3' from JSON`,
2894
+ (x) => GetPromptVersionStreamOptions$inboundSchema.parse(JSON.parse(x)),
2895
+ `Failed to parse 'GetPromptVersionStreamOptions' from JSON`,
725
2896
  );
726
2897
  }
727
2898
 
728
2899
  /** @internal */
729
- export const GetPromptVersionResponseFormatPromptsType$inboundSchema:
730
- z.ZodNativeEnum<typeof GetPromptVersionResponseFormatPromptsType> = z
731
- .nativeEnum(GetPromptVersionResponseFormatPromptsType);
2900
+ export const GetPromptVersionThinking$inboundSchema: z.ZodType<
2901
+ GetPromptVersionThinking,
2902
+ z.ZodTypeDef,
2903
+ unknown
2904
+ > = z.union([
2905
+ components.ThinkingConfigDisabledSchema$inboundSchema,
2906
+ components.ThinkingConfigEnabledSchema$inboundSchema,
2907
+ ]);
732
2908
  /** @internal */
733
- export const GetPromptVersionResponseFormatPromptsType$outboundSchema:
734
- z.ZodNativeEnum<typeof GetPromptVersionResponseFormatPromptsType> =
735
- GetPromptVersionResponseFormatPromptsType$inboundSchema;
2909
+ export type GetPromptVersionThinking$Outbound =
2910
+ | components.ThinkingConfigDisabledSchema$Outbound
2911
+ | components.ThinkingConfigEnabledSchema$Outbound;
736
2912
 
737
2913
  /** @internal */
738
- export const GetPromptVersionResponseFormat2$inboundSchema: z.ZodType<
739
- GetPromptVersionResponseFormat2,
2914
+ export const GetPromptVersionThinking$outboundSchema: z.ZodType<
2915
+ GetPromptVersionThinking$Outbound,
2916
+ z.ZodTypeDef,
2917
+ GetPromptVersionThinking
2918
+ > = z.union([
2919
+ components.ThinkingConfigDisabledSchema$outboundSchema,
2920
+ components.ThinkingConfigEnabledSchema$outboundSchema,
2921
+ ]);
2922
+
2923
+ export function getPromptVersionThinkingToJSON(
2924
+ getPromptVersionThinking: GetPromptVersionThinking,
2925
+ ): string {
2926
+ return JSON.stringify(
2927
+ GetPromptVersionThinking$outboundSchema.parse(getPromptVersionThinking),
2928
+ );
2929
+ }
2930
+ export function getPromptVersionThinkingFromJSON(
2931
+ jsonString: string,
2932
+ ): SafeParseResult<GetPromptVersionThinking, SDKValidationError> {
2933
+ return safeParse(
2934
+ jsonString,
2935
+ (x) => GetPromptVersionThinking$inboundSchema.parse(JSON.parse(x)),
2936
+ `Failed to parse 'GetPromptVersionThinking' from JSON`,
2937
+ );
2938
+ }
2939
+
2940
+ /** @internal */
2941
+ export const GetPromptVersionToolChoiceType$inboundSchema: z.ZodNativeEnum<
2942
+ typeof GetPromptVersionToolChoiceType
2943
+ > = z.nativeEnum(GetPromptVersionToolChoiceType);
2944
+ /** @internal */
2945
+ export const GetPromptVersionToolChoiceType$outboundSchema: z.ZodNativeEnum<
2946
+ typeof GetPromptVersionToolChoiceType
2947
+ > = GetPromptVersionToolChoiceType$inboundSchema;
2948
+
2949
+ /** @internal */
2950
+ export const GetPromptVersionToolChoiceFunction$inboundSchema: z.ZodType<
2951
+ GetPromptVersionToolChoiceFunction,
740
2952
  z.ZodTypeDef,
741
2953
  unknown
742
2954
  > = z.object({
743
- type: GetPromptVersionResponseFormatPromptsType$inboundSchema,
2955
+ name: z.string(),
744
2956
  });
745
2957
  /** @internal */
746
- export type GetPromptVersionResponseFormat2$Outbound = {
747
- type: string;
2958
+ export type GetPromptVersionToolChoiceFunction$Outbound = {
2959
+ name: string;
748
2960
  };
749
2961
 
750
2962
  /** @internal */
751
- export const GetPromptVersionResponseFormat2$outboundSchema: z.ZodType<
752
- GetPromptVersionResponseFormat2$Outbound,
2963
+ export const GetPromptVersionToolChoiceFunction$outboundSchema: z.ZodType<
2964
+ GetPromptVersionToolChoiceFunction$Outbound,
753
2965
  z.ZodTypeDef,
754
- GetPromptVersionResponseFormat2
2966
+ GetPromptVersionToolChoiceFunction
755
2967
  > = z.object({
756
- type: GetPromptVersionResponseFormatPromptsType$outboundSchema,
2968
+ name: z.string(),
757
2969
  });
758
2970
 
759
- export function getPromptVersionResponseFormat2ToJSON(
760
- getPromptVersionResponseFormat2: GetPromptVersionResponseFormat2,
2971
+ export function getPromptVersionToolChoiceFunctionToJSON(
2972
+ getPromptVersionToolChoiceFunction: GetPromptVersionToolChoiceFunction,
761
2973
  ): string {
762
2974
  return JSON.stringify(
763
- GetPromptVersionResponseFormat2$outboundSchema.parse(
764
- getPromptVersionResponseFormat2,
2975
+ GetPromptVersionToolChoiceFunction$outboundSchema.parse(
2976
+ getPromptVersionToolChoiceFunction,
765
2977
  ),
766
2978
  );
767
2979
  }
768
- export function getPromptVersionResponseFormat2FromJSON(
2980
+ export function getPromptVersionToolChoiceFunctionFromJSON(
769
2981
  jsonString: string,
770
- ): SafeParseResult<GetPromptVersionResponseFormat2, SDKValidationError> {
2982
+ ): SafeParseResult<GetPromptVersionToolChoiceFunction, SDKValidationError> {
771
2983
  return safeParse(
772
2984
  jsonString,
773
- (x) => GetPromptVersionResponseFormat2$inboundSchema.parse(JSON.parse(x)),
774
- `Failed to parse 'GetPromptVersionResponseFormat2' from JSON`,
2985
+ (x) =>
2986
+ GetPromptVersionToolChoiceFunction$inboundSchema.parse(JSON.parse(x)),
2987
+ `Failed to parse 'GetPromptVersionToolChoiceFunction' from JSON`,
2988
+ );
2989
+ }
2990
+
2991
+ /** @internal */
2992
+ export const GetPromptVersionToolChoice2$inboundSchema: z.ZodType<
2993
+ GetPromptVersionToolChoice2,
2994
+ z.ZodTypeDef,
2995
+ unknown
2996
+ > = z.object({
2997
+ type: GetPromptVersionToolChoiceType$inboundSchema.optional(),
2998
+ function: z.lazy(() => GetPromptVersionToolChoiceFunction$inboundSchema),
2999
+ });
3000
+ /** @internal */
3001
+ export type GetPromptVersionToolChoice2$Outbound = {
3002
+ type?: string | undefined;
3003
+ function: GetPromptVersionToolChoiceFunction$Outbound;
3004
+ };
3005
+
3006
+ /** @internal */
3007
+ export const GetPromptVersionToolChoice2$outboundSchema: z.ZodType<
3008
+ GetPromptVersionToolChoice2$Outbound,
3009
+ z.ZodTypeDef,
3010
+ GetPromptVersionToolChoice2
3011
+ > = z.object({
3012
+ type: GetPromptVersionToolChoiceType$outboundSchema.optional(),
3013
+ function: z.lazy(() => GetPromptVersionToolChoiceFunction$outboundSchema),
3014
+ });
3015
+
3016
+ export function getPromptVersionToolChoice2ToJSON(
3017
+ getPromptVersionToolChoice2: GetPromptVersionToolChoice2,
3018
+ ): string {
3019
+ return JSON.stringify(
3020
+ GetPromptVersionToolChoice2$outboundSchema.parse(
3021
+ getPromptVersionToolChoice2,
3022
+ ),
3023
+ );
3024
+ }
3025
+ export function getPromptVersionToolChoice2FromJSON(
3026
+ jsonString: string,
3027
+ ): SafeParseResult<GetPromptVersionToolChoice2, SDKValidationError> {
3028
+ return safeParse(
3029
+ jsonString,
3030
+ (x) => GetPromptVersionToolChoice2$inboundSchema.parse(JSON.parse(x)),
3031
+ `Failed to parse 'GetPromptVersionToolChoice2' from JSON`,
775
3032
  );
776
3033
  }
777
3034
 
778
3035
  /** @internal */
779
- export const GetPromptVersionResponseFormatType$inboundSchema: z.ZodNativeEnum<
780
- typeof GetPromptVersionResponseFormatType
781
- > = z.nativeEnum(GetPromptVersionResponseFormatType);
3036
+ export const GetPromptVersionToolChoice1$inboundSchema: z.ZodNativeEnum<
3037
+ typeof GetPromptVersionToolChoice1
3038
+ > = z.nativeEnum(GetPromptVersionToolChoice1);
782
3039
  /** @internal */
783
- export const GetPromptVersionResponseFormatType$outboundSchema: z.ZodNativeEnum<
784
- typeof GetPromptVersionResponseFormatType
785
- > = GetPromptVersionResponseFormatType$inboundSchema;
3040
+ export const GetPromptVersionToolChoice1$outboundSchema: z.ZodNativeEnum<
3041
+ typeof GetPromptVersionToolChoice1
3042
+ > = GetPromptVersionToolChoice1$inboundSchema;
786
3043
 
787
3044
  /** @internal */
788
- export const GetPromptVersionResponseFormatJsonSchema$inboundSchema: z.ZodType<
789
- GetPromptVersionResponseFormatJsonSchema,
3045
+ export const GetPromptVersionToolChoice$inboundSchema: z.ZodType<
3046
+ GetPromptVersionToolChoice,
3047
+ z.ZodTypeDef,
3048
+ unknown
3049
+ > = z.union([
3050
+ z.lazy(() => GetPromptVersionToolChoice2$inboundSchema),
3051
+ GetPromptVersionToolChoice1$inboundSchema,
3052
+ ]);
3053
+ /** @internal */
3054
+ export type GetPromptVersionToolChoice$Outbound =
3055
+ | GetPromptVersionToolChoice2$Outbound
3056
+ | string;
3057
+
3058
+ /** @internal */
3059
+ export const GetPromptVersionToolChoice$outboundSchema: z.ZodType<
3060
+ GetPromptVersionToolChoice$Outbound,
3061
+ z.ZodTypeDef,
3062
+ GetPromptVersionToolChoice
3063
+ > = z.union([
3064
+ z.lazy(() => GetPromptVersionToolChoice2$outboundSchema),
3065
+ GetPromptVersionToolChoice1$outboundSchema,
3066
+ ]);
3067
+
3068
+ export function getPromptVersionToolChoiceToJSON(
3069
+ getPromptVersionToolChoice: GetPromptVersionToolChoice,
3070
+ ): string {
3071
+ return JSON.stringify(
3072
+ GetPromptVersionToolChoice$outboundSchema.parse(getPromptVersionToolChoice),
3073
+ );
3074
+ }
3075
+ export function getPromptVersionToolChoiceFromJSON(
3076
+ jsonString: string,
3077
+ ): SafeParseResult<GetPromptVersionToolChoice, SDKValidationError> {
3078
+ return safeParse(
3079
+ jsonString,
3080
+ (x) => GetPromptVersionToolChoice$inboundSchema.parse(JSON.parse(x)),
3081
+ `Failed to parse 'GetPromptVersionToolChoice' from JSON`,
3082
+ );
3083
+ }
3084
+
3085
+ /** @internal */
3086
+ export const GetPromptVersionModalities$inboundSchema: z.ZodNativeEnum<
3087
+ typeof GetPromptVersionModalities
3088
+ > = z.nativeEnum(GetPromptVersionModalities);
3089
+ /** @internal */
3090
+ export const GetPromptVersionModalities$outboundSchema: z.ZodNativeEnum<
3091
+ typeof GetPromptVersionModalities
3092
+ > = GetPromptVersionModalities$inboundSchema;
3093
+
3094
+ /** @internal */
3095
+ export const GetPromptVersionId1$inboundSchema: z.ZodNativeEnum<
3096
+ typeof GetPromptVersionId1
3097
+ > = z.nativeEnum(GetPromptVersionId1);
3098
+ /** @internal */
3099
+ export const GetPromptVersionId1$outboundSchema: z.ZodNativeEnum<
3100
+ typeof GetPromptVersionId1
3101
+ > = GetPromptVersionId1$inboundSchema;
3102
+
3103
+ /** @internal */
3104
+ export const GetPromptVersionId$inboundSchema: z.ZodType<
3105
+ GetPromptVersionId,
3106
+ z.ZodTypeDef,
3107
+ unknown
3108
+ > = z.union([GetPromptVersionId1$inboundSchema, z.string()]);
3109
+ /** @internal */
3110
+ export type GetPromptVersionId$Outbound = string | string;
3111
+
3112
+ /** @internal */
3113
+ export const GetPromptVersionId$outboundSchema: z.ZodType<
3114
+ GetPromptVersionId$Outbound,
3115
+ z.ZodTypeDef,
3116
+ GetPromptVersionId
3117
+ > = z.union([GetPromptVersionId1$outboundSchema, z.string()]);
3118
+
3119
+ export function getPromptVersionIdToJSON(
3120
+ getPromptVersionId: GetPromptVersionId,
3121
+ ): string {
3122
+ return JSON.stringify(
3123
+ GetPromptVersionId$outboundSchema.parse(getPromptVersionId),
3124
+ );
3125
+ }
3126
+ export function getPromptVersionIdFromJSON(
3127
+ jsonString: string,
3128
+ ): SafeParseResult<GetPromptVersionId, SDKValidationError> {
3129
+ return safeParse(
3130
+ jsonString,
3131
+ (x) => GetPromptVersionId$inboundSchema.parse(JSON.parse(x)),
3132
+ `Failed to parse 'GetPromptVersionId' from JSON`,
3133
+ );
3134
+ }
3135
+
3136
+ /** @internal */
3137
+ export const GetPromptVersionExecuteOn$inboundSchema: z.ZodNativeEnum<
3138
+ typeof GetPromptVersionExecuteOn
3139
+ > = z.nativeEnum(GetPromptVersionExecuteOn);
3140
+ /** @internal */
3141
+ export const GetPromptVersionExecuteOn$outboundSchema: z.ZodNativeEnum<
3142
+ typeof GetPromptVersionExecuteOn
3143
+ > = GetPromptVersionExecuteOn$inboundSchema;
3144
+
3145
+ /** @internal */
3146
+ export const GetPromptVersionGuardrails$inboundSchema: z.ZodType<
3147
+ GetPromptVersionGuardrails,
790
3148
  z.ZodTypeDef,
791
3149
  unknown
792
3150
  > = z.object({
793
- name: z.string(),
794
- description: z.string().optional(),
795
- strict: z.boolean().optional(),
796
- schema: z.record(z.any()),
3151
+ id: z.union([GetPromptVersionId1$inboundSchema, z.string()]),
3152
+ execute_on: GetPromptVersionExecuteOn$inboundSchema,
3153
+ }).transform((v) => {
3154
+ return remap$(v, {
3155
+ "execute_on": "executeOn",
3156
+ });
797
3157
  });
798
3158
  /** @internal */
799
- export type GetPromptVersionResponseFormatJsonSchema$Outbound = {
800
- name: string;
801
- description?: string | undefined;
802
- strict?: boolean | undefined;
803
- schema: { [k: string]: any };
3159
+ export type GetPromptVersionGuardrails$Outbound = {
3160
+ id: string | string;
3161
+ execute_on: string;
3162
+ };
3163
+
3164
+ /** @internal */
3165
+ export const GetPromptVersionGuardrails$outboundSchema: z.ZodType<
3166
+ GetPromptVersionGuardrails$Outbound,
3167
+ z.ZodTypeDef,
3168
+ GetPromptVersionGuardrails
3169
+ > = z.object({
3170
+ id: z.union([GetPromptVersionId1$outboundSchema, z.string()]),
3171
+ executeOn: GetPromptVersionExecuteOn$outboundSchema,
3172
+ }).transform((v) => {
3173
+ return remap$(v, {
3174
+ executeOn: "execute_on",
3175
+ });
3176
+ });
3177
+
3178
+ export function getPromptVersionGuardrailsToJSON(
3179
+ getPromptVersionGuardrails: GetPromptVersionGuardrails,
3180
+ ): string {
3181
+ return JSON.stringify(
3182
+ GetPromptVersionGuardrails$outboundSchema.parse(getPromptVersionGuardrails),
3183
+ );
3184
+ }
3185
+ export function getPromptVersionGuardrailsFromJSON(
3186
+ jsonString: string,
3187
+ ): SafeParseResult<GetPromptVersionGuardrails, SDKValidationError> {
3188
+ return safeParse(
3189
+ jsonString,
3190
+ (x) => GetPromptVersionGuardrails$inboundSchema.parse(JSON.parse(x)),
3191
+ `Failed to parse 'GetPromptVersionGuardrails' from JSON`,
3192
+ );
3193
+ }
3194
+
3195
+ /** @internal */
3196
+ export const GetPromptVersionContentPromptsResponse2002$inboundSchema:
3197
+ z.ZodType<GetPromptVersionContentPromptsResponse2002, z.ZodTypeDef, unknown> =
3198
+ components.TextContentPartSchema$inboundSchema;
3199
+ /** @internal */
3200
+ export type GetPromptVersionContentPromptsResponse2002$Outbound =
3201
+ components.TextContentPartSchema$Outbound;
3202
+
3203
+ /** @internal */
3204
+ export const GetPromptVersionContentPromptsResponse2002$outboundSchema:
3205
+ z.ZodType<
3206
+ GetPromptVersionContentPromptsResponse2002$Outbound,
3207
+ z.ZodTypeDef,
3208
+ GetPromptVersionContentPromptsResponse2002
3209
+ > = components.TextContentPartSchema$outboundSchema;
3210
+
3211
+ export function getPromptVersionContentPromptsResponse2002ToJSON(
3212
+ getPromptVersionContentPromptsResponse2002:
3213
+ GetPromptVersionContentPromptsResponse2002,
3214
+ ): string {
3215
+ return JSON.stringify(
3216
+ GetPromptVersionContentPromptsResponse2002$outboundSchema.parse(
3217
+ getPromptVersionContentPromptsResponse2002,
3218
+ ),
3219
+ );
3220
+ }
3221
+ export function getPromptVersionContentPromptsResponse2002FromJSON(
3222
+ jsonString: string,
3223
+ ): SafeParseResult<
3224
+ GetPromptVersionContentPromptsResponse2002,
3225
+ SDKValidationError
3226
+ > {
3227
+ return safeParse(
3228
+ jsonString,
3229
+ (x) =>
3230
+ GetPromptVersionContentPromptsResponse2002$inboundSchema.parse(
3231
+ JSON.parse(x),
3232
+ ),
3233
+ `Failed to parse 'GetPromptVersionContentPromptsResponse2002' from JSON`,
3234
+ );
3235
+ }
3236
+
3237
+ /** @internal */
3238
+ export const GetPromptVersionMessagesPromptsResponse200Content$inboundSchema:
3239
+ z.ZodType<
3240
+ GetPromptVersionMessagesPromptsResponse200Content,
3241
+ z.ZodTypeDef,
3242
+ unknown
3243
+ > = z.union([
3244
+ z.string(),
3245
+ z.array(components.TextContentPartSchema$inboundSchema),
3246
+ ]);
3247
+ /** @internal */
3248
+ export type GetPromptVersionMessagesPromptsResponse200Content$Outbound =
3249
+ | string
3250
+ | Array<components.TextContentPartSchema$Outbound>;
3251
+
3252
+ /** @internal */
3253
+ export const GetPromptVersionMessagesPromptsResponse200Content$outboundSchema:
3254
+ z.ZodType<
3255
+ GetPromptVersionMessagesPromptsResponse200Content$Outbound,
3256
+ z.ZodTypeDef,
3257
+ GetPromptVersionMessagesPromptsResponse200Content
3258
+ > = z.union([
3259
+ z.string(),
3260
+ z.array(components.TextContentPartSchema$outboundSchema),
3261
+ ]);
3262
+
3263
+ export function getPromptVersionMessagesPromptsResponse200ContentToJSON(
3264
+ getPromptVersionMessagesPromptsResponse200Content:
3265
+ GetPromptVersionMessagesPromptsResponse200Content,
3266
+ ): string {
3267
+ return JSON.stringify(
3268
+ GetPromptVersionMessagesPromptsResponse200Content$outboundSchema.parse(
3269
+ getPromptVersionMessagesPromptsResponse200Content,
3270
+ ),
3271
+ );
3272
+ }
3273
+ export function getPromptVersionMessagesPromptsResponse200ContentFromJSON(
3274
+ jsonString: string,
3275
+ ): SafeParseResult<
3276
+ GetPromptVersionMessagesPromptsResponse200Content,
3277
+ SDKValidationError
3278
+ > {
3279
+ return safeParse(
3280
+ jsonString,
3281
+ (x) =>
3282
+ GetPromptVersionMessagesPromptsResponse200Content$inboundSchema.parse(
3283
+ JSON.parse(x),
3284
+ ),
3285
+ `Failed to parse 'GetPromptVersionMessagesPromptsResponse200Content' from JSON`,
3286
+ );
3287
+ }
3288
+
3289
+ /** @internal */
3290
+ export const GetPromptVersionMessagesPromptsType$inboundSchema: z.ZodNativeEnum<
3291
+ typeof GetPromptVersionMessagesPromptsType
3292
+ > = z.nativeEnum(GetPromptVersionMessagesPromptsType);
3293
+ /** @internal */
3294
+ export const GetPromptVersionMessagesPromptsType$outboundSchema:
3295
+ z.ZodNativeEnum<typeof GetPromptVersionMessagesPromptsType> =
3296
+ GetPromptVersionMessagesPromptsType$inboundSchema;
3297
+
3298
+ /** @internal */
3299
+ export const GetPromptVersionMessagesTtl$inboundSchema: z.ZodNativeEnum<
3300
+ typeof GetPromptVersionMessagesTtl
3301
+ > = z.nativeEnum(GetPromptVersionMessagesTtl);
3302
+ /** @internal */
3303
+ export const GetPromptVersionMessagesTtl$outboundSchema: z.ZodNativeEnum<
3304
+ typeof GetPromptVersionMessagesTtl
3305
+ > = GetPromptVersionMessagesTtl$inboundSchema;
3306
+
3307
+ /** @internal */
3308
+ export const GetPromptVersionMessagesCacheControl$inboundSchema: z.ZodType<
3309
+ GetPromptVersionMessagesCacheControl,
3310
+ z.ZodTypeDef,
3311
+ unknown
3312
+ > = z.object({
3313
+ type: GetPromptVersionMessagesPromptsType$inboundSchema,
3314
+ ttl: GetPromptVersionMessagesTtl$inboundSchema.default("5m"),
3315
+ });
3316
+ /** @internal */
3317
+ export type GetPromptVersionMessagesCacheControl$Outbound = {
3318
+ type: string;
3319
+ ttl: string;
804
3320
  };
805
3321
 
806
3322
  /** @internal */
807
- export const GetPromptVersionResponseFormatJsonSchema$outboundSchema: z.ZodType<
808
- GetPromptVersionResponseFormatJsonSchema$Outbound,
3323
+ export const GetPromptVersionMessagesCacheControl$outboundSchema: z.ZodType<
3324
+ GetPromptVersionMessagesCacheControl$Outbound,
809
3325
  z.ZodTypeDef,
810
- GetPromptVersionResponseFormatJsonSchema
3326
+ GetPromptVersionMessagesCacheControl
811
3327
  > = z.object({
812
- name: z.string(),
813
- description: z.string().optional(),
814
- strict: z.boolean().optional(),
815
- schema: z.record(z.any()),
3328
+ type: GetPromptVersionMessagesPromptsType$outboundSchema,
3329
+ ttl: GetPromptVersionMessagesTtl$outboundSchema.default("5m"),
816
3330
  });
817
3331
 
818
- export function getPromptVersionResponseFormatJsonSchemaToJSON(
819
- getPromptVersionResponseFormatJsonSchema:
820
- GetPromptVersionResponseFormatJsonSchema,
3332
+ export function getPromptVersionMessagesCacheControlToJSON(
3333
+ getPromptVersionMessagesCacheControl: GetPromptVersionMessagesCacheControl,
821
3334
  ): string {
822
3335
  return JSON.stringify(
823
- GetPromptVersionResponseFormatJsonSchema$outboundSchema.parse(
824
- getPromptVersionResponseFormatJsonSchema,
3336
+ GetPromptVersionMessagesCacheControl$outboundSchema.parse(
3337
+ getPromptVersionMessagesCacheControl,
825
3338
  ),
826
3339
  );
827
3340
  }
828
- export function getPromptVersionResponseFormatJsonSchemaFromJSON(
3341
+ export function getPromptVersionMessagesCacheControlFromJSON(
829
3342
  jsonString: string,
830
- ): SafeParseResult<
831
- GetPromptVersionResponseFormatJsonSchema,
832
- SDKValidationError
833
- > {
3343
+ ): SafeParseResult<GetPromptVersionMessagesCacheControl, SDKValidationError> {
834
3344
  return safeParse(
835
3345
  jsonString,
836
3346
  (x) =>
837
- GetPromptVersionResponseFormatJsonSchema$inboundSchema.parse(
838
- JSON.parse(x),
839
- ),
840
- `Failed to parse 'GetPromptVersionResponseFormatJsonSchema' from JSON`,
3347
+ GetPromptVersionMessagesCacheControl$inboundSchema.parse(JSON.parse(x)),
3348
+ `Failed to parse 'GetPromptVersionMessagesCacheControl' from JSON`,
841
3349
  );
842
3350
  }
843
3351
 
844
3352
  /** @internal */
845
- export const GetPromptVersionResponseFormat1$inboundSchema: z.ZodType<
846
- GetPromptVersionResponseFormat1,
3353
+ export const GetPromptVersionMessagesToolMessage$inboundSchema: z.ZodType<
3354
+ GetPromptVersionMessagesToolMessage,
847
3355
  z.ZodTypeDef,
848
3356
  unknown
849
3357
  > = z.object({
850
- type: GetPromptVersionResponseFormatType$inboundSchema,
851
- display_name: z.string().optional(),
852
- json_schema: z.lazy(() =>
853
- GetPromptVersionResponseFormatJsonSchema$inboundSchema
854
- ),
3358
+ role: z.literal("tool"),
3359
+ content: z.union([
3360
+ z.string(),
3361
+ z.array(components.TextContentPartSchema$inboundSchema),
3362
+ ]),
3363
+ tool_call_id: z.nullable(z.string()),
3364
+ cache_control: z.lazy(() =>
3365
+ GetPromptVersionMessagesCacheControl$inboundSchema
3366
+ ).optional(),
855
3367
  }).transform((v) => {
856
3368
  return remap$(v, {
857
- "display_name": "displayName",
858
- "json_schema": "jsonSchema",
3369
+ "tool_call_id": "toolCallId",
3370
+ "cache_control": "cacheControl",
859
3371
  });
860
3372
  });
861
3373
  /** @internal */
862
- export type GetPromptVersionResponseFormat1$Outbound = {
863
- type: string;
864
- display_name?: string | undefined;
865
- json_schema: GetPromptVersionResponseFormatJsonSchema$Outbound;
3374
+ export type GetPromptVersionMessagesToolMessage$Outbound = {
3375
+ role: "tool";
3376
+ content: string | Array<components.TextContentPartSchema$Outbound>;
3377
+ tool_call_id: string | null;
3378
+ cache_control?: GetPromptVersionMessagesCacheControl$Outbound | undefined;
866
3379
  };
867
3380
 
868
3381
  /** @internal */
869
- export const GetPromptVersionResponseFormat1$outboundSchema: z.ZodType<
870
- GetPromptVersionResponseFormat1$Outbound,
3382
+ export const GetPromptVersionMessagesToolMessage$outboundSchema: z.ZodType<
3383
+ GetPromptVersionMessagesToolMessage$Outbound,
871
3384
  z.ZodTypeDef,
872
- GetPromptVersionResponseFormat1
3385
+ GetPromptVersionMessagesToolMessage
873
3386
  > = z.object({
874
- type: GetPromptVersionResponseFormatType$outboundSchema,
875
- displayName: z.string().optional(),
876
- jsonSchema: z.lazy(() =>
877
- GetPromptVersionResponseFormatJsonSchema$outboundSchema
878
- ),
3387
+ role: z.literal("tool"),
3388
+ content: z.union([
3389
+ z.string(),
3390
+ z.array(components.TextContentPartSchema$outboundSchema),
3391
+ ]),
3392
+ toolCallId: z.nullable(z.string()),
3393
+ cacheControl: z.lazy(() =>
3394
+ GetPromptVersionMessagesCacheControl$outboundSchema
3395
+ ).optional(),
879
3396
  }).transform((v) => {
880
3397
  return remap$(v, {
881
- displayName: "display_name",
882
- jsonSchema: "json_schema",
3398
+ toolCallId: "tool_call_id",
3399
+ cacheControl: "cache_control",
883
3400
  });
884
3401
  });
885
3402
 
886
- export function getPromptVersionResponseFormat1ToJSON(
887
- getPromptVersionResponseFormat1: GetPromptVersionResponseFormat1,
3403
+ export function getPromptVersionMessagesToolMessageToJSON(
3404
+ getPromptVersionMessagesToolMessage: GetPromptVersionMessagesToolMessage,
888
3405
  ): string {
889
3406
  return JSON.stringify(
890
- GetPromptVersionResponseFormat1$outboundSchema.parse(
891
- getPromptVersionResponseFormat1,
3407
+ GetPromptVersionMessagesToolMessage$outboundSchema.parse(
3408
+ getPromptVersionMessagesToolMessage,
892
3409
  ),
893
3410
  );
894
3411
  }
895
- export function getPromptVersionResponseFormat1FromJSON(
3412
+ export function getPromptVersionMessagesToolMessageFromJSON(
896
3413
  jsonString: string,
897
- ): SafeParseResult<GetPromptVersionResponseFormat1, SDKValidationError> {
3414
+ ): SafeParseResult<GetPromptVersionMessagesToolMessage, SDKValidationError> {
898
3415
  return safeParse(
899
3416
  jsonString,
900
- (x) => GetPromptVersionResponseFormat1$inboundSchema.parse(JSON.parse(x)),
901
- `Failed to parse 'GetPromptVersionResponseFormat1' from JSON`,
3417
+ (x) =>
3418
+ GetPromptVersionMessagesToolMessage$inboundSchema.parse(JSON.parse(x)),
3419
+ `Failed to parse 'GetPromptVersionMessagesToolMessage' from JSON`,
902
3420
  );
903
3421
  }
904
3422
 
905
3423
  /** @internal */
906
- export const GetPromptVersionResponseFormat$inboundSchema: z.ZodType<
907
- GetPromptVersionResponseFormat,
3424
+ export const GetPromptVersionContentPromptsResponse2$inboundSchema: z.ZodType<
3425
+ GetPromptVersionContentPromptsResponse2,
908
3426
  z.ZodTypeDef,
909
3427
  unknown
910
3428
  > = z.union([
911
- z.lazy(() => GetPromptVersionResponseFormat1$inboundSchema),
912
- z.lazy(() => GetPromptVersionResponseFormat2$inboundSchema),
913
- z.lazy(() => GetPromptVersionResponseFormat3$inboundSchema),
914
- GetPromptVersionResponseFormat4$inboundSchema,
915
- GetPromptVersionResponseFormat5$inboundSchema,
916
- GetPromptVersionResponseFormat6$inboundSchema,
3429
+ components.TextContentPartSchema$inboundSchema.and(
3430
+ z.object({ type: z.literal("text") }),
3431
+ ),
3432
+ components.RefusalPartSchema$inboundSchema,
3433
+ components.ReasoningPartSchema$inboundSchema,
3434
+ components.RedactedReasoningPartSchema$inboundSchema,
917
3435
  ]);
918
3436
  /** @internal */
919
- export type GetPromptVersionResponseFormat$Outbound =
920
- | GetPromptVersionResponseFormat1$Outbound
921
- | GetPromptVersionResponseFormat2$Outbound
922
- | GetPromptVersionResponseFormat3$Outbound
923
- | string
924
- | string
925
- | string;
3437
+ export type GetPromptVersionContentPromptsResponse2$Outbound =
3438
+ | (components.TextContentPartSchema$Outbound & { type: "text" })
3439
+ | components.RefusalPartSchema$Outbound
3440
+ | components.ReasoningPartSchema$Outbound
3441
+ | components.RedactedReasoningPartSchema$Outbound;
926
3442
 
927
3443
  /** @internal */
928
- export const GetPromptVersionResponseFormat$outboundSchema: z.ZodType<
929
- GetPromptVersionResponseFormat$Outbound,
3444
+ export const GetPromptVersionContentPromptsResponse2$outboundSchema: z.ZodType<
3445
+ GetPromptVersionContentPromptsResponse2$Outbound,
930
3446
  z.ZodTypeDef,
931
- GetPromptVersionResponseFormat
3447
+ GetPromptVersionContentPromptsResponse2
932
3448
  > = z.union([
933
- z.lazy(() => GetPromptVersionResponseFormat1$outboundSchema),
934
- z.lazy(() => GetPromptVersionResponseFormat2$outboundSchema),
935
- z.lazy(() => GetPromptVersionResponseFormat3$outboundSchema),
936
- GetPromptVersionResponseFormat4$outboundSchema,
937
- GetPromptVersionResponseFormat5$outboundSchema,
938
- GetPromptVersionResponseFormat6$outboundSchema,
3449
+ components.TextContentPartSchema$outboundSchema.and(
3450
+ z.object({ type: z.literal("text") }),
3451
+ ),
3452
+ components.RefusalPartSchema$outboundSchema,
3453
+ components.ReasoningPartSchema$outboundSchema,
3454
+ components.RedactedReasoningPartSchema$outboundSchema,
939
3455
  ]);
940
3456
 
941
- export function getPromptVersionResponseFormatToJSON(
942
- getPromptVersionResponseFormat: GetPromptVersionResponseFormat,
3457
+ export function getPromptVersionContentPromptsResponse2ToJSON(
3458
+ getPromptVersionContentPromptsResponse2:
3459
+ GetPromptVersionContentPromptsResponse2,
943
3460
  ): string {
944
3461
  return JSON.stringify(
945
- GetPromptVersionResponseFormat$outboundSchema.parse(
946
- getPromptVersionResponseFormat,
3462
+ GetPromptVersionContentPromptsResponse2$outboundSchema.parse(
3463
+ getPromptVersionContentPromptsResponse2,
947
3464
  ),
948
3465
  );
949
3466
  }
950
- export function getPromptVersionResponseFormatFromJSON(
3467
+ export function getPromptVersionContentPromptsResponse2FromJSON(
951
3468
  jsonString: string,
952
- ): SafeParseResult<GetPromptVersionResponseFormat, SDKValidationError> {
3469
+ ): SafeParseResult<
3470
+ GetPromptVersionContentPromptsResponse2,
3471
+ SDKValidationError
3472
+ > {
953
3473
  return safeParse(
954
3474
  jsonString,
955
- (x) => GetPromptVersionResponseFormat$inboundSchema.parse(JSON.parse(x)),
956
- `Failed to parse 'GetPromptVersionResponseFormat' from JSON`,
3475
+ (x) =>
3476
+ GetPromptVersionContentPromptsResponse2$inboundSchema.parse(
3477
+ JSON.parse(x),
3478
+ ),
3479
+ `Failed to parse 'GetPromptVersionContentPromptsResponse2' from JSON`,
957
3480
  );
958
3481
  }
959
3482
 
960
3483
  /** @internal */
961
- export const GetPromptVersionPhotoRealVersion$inboundSchema: z.ZodNativeEnum<
962
- typeof GetPromptVersionPhotoRealVersion
963
- > = z.nativeEnum(GetPromptVersionPhotoRealVersion);
964
- /** @internal */
965
- export const GetPromptVersionPhotoRealVersion$outboundSchema: z.ZodNativeEnum<
966
- typeof GetPromptVersionPhotoRealVersion
967
- > = GetPromptVersionPhotoRealVersion$inboundSchema;
968
-
969
- /** @internal */
970
- export const GetPromptVersionEncodingFormat$inboundSchema: z.ZodNativeEnum<
971
- typeof GetPromptVersionEncodingFormat
972
- > = z.nativeEnum(GetPromptVersionEncodingFormat);
973
- /** @internal */
974
- export const GetPromptVersionEncodingFormat$outboundSchema: z.ZodNativeEnum<
975
- typeof GetPromptVersionEncodingFormat
976
- > = GetPromptVersionEncodingFormat$inboundSchema;
977
-
978
- /** @internal */
979
- export const GetPromptVersionReasoningEffort$inboundSchema: z.ZodNativeEnum<
980
- typeof GetPromptVersionReasoningEffort
981
- > = z.nativeEnum(GetPromptVersionReasoningEffort);
3484
+ export const GetPromptVersionMessagesPromptsResponseContent$inboundSchema:
3485
+ z.ZodType<
3486
+ GetPromptVersionMessagesPromptsResponseContent,
3487
+ z.ZodTypeDef,
3488
+ unknown
3489
+ > = z.union([
3490
+ z.string(),
3491
+ z.array(
3492
+ z.union([
3493
+ components.TextContentPartSchema$inboundSchema.and(
3494
+ z.object({ type: z.literal("text") }),
3495
+ ),
3496
+ components.RefusalPartSchema$inboundSchema,
3497
+ components.ReasoningPartSchema$inboundSchema,
3498
+ components.RedactedReasoningPartSchema$inboundSchema,
3499
+ ]),
3500
+ ),
3501
+ ]);
982
3502
  /** @internal */
983
- export const GetPromptVersionReasoningEffort$outboundSchema: z.ZodNativeEnum<
984
- typeof GetPromptVersionReasoningEffort
985
- > = GetPromptVersionReasoningEffort$inboundSchema;
3503
+ export type GetPromptVersionMessagesPromptsResponseContent$Outbound =
3504
+ | string
3505
+ | Array<
3506
+ | (components.TextContentPartSchema$Outbound & { type: "text" })
3507
+ | components.RefusalPartSchema$Outbound
3508
+ | components.ReasoningPartSchema$Outbound
3509
+ | components.RedactedReasoningPartSchema$Outbound
3510
+ >;
986
3511
 
987
3512
  /** @internal */
988
- export const GetPromptVersionVerbosity$inboundSchema: z.ZodNativeEnum<
989
- typeof GetPromptVersionVerbosity
990
- > = z.nativeEnum(GetPromptVersionVerbosity);
991
- /** @internal */
992
- export const GetPromptVersionVerbosity$outboundSchema: z.ZodNativeEnum<
993
- typeof GetPromptVersionVerbosity
994
- > = GetPromptVersionVerbosity$inboundSchema;
3513
+ export const GetPromptVersionMessagesPromptsResponseContent$outboundSchema:
3514
+ z.ZodType<
3515
+ GetPromptVersionMessagesPromptsResponseContent$Outbound,
3516
+ z.ZodTypeDef,
3517
+ GetPromptVersionMessagesPromptsResponseContent
3518
+ > = z.union([
3519
+ z.string(),
3520
+ z.array(
3521
+ z.union([
3522
+ components.TextContentPartSchema$outboundSchema.and(
3523
+ z.object({ type: z.literal("text") }),
3524
+ ),
3525
+ components.RefusalPartSchema$outboundSchema,
3526
+ components.ReasoningPartSchema$outboundSchema,
3527
+ components.RedactedReasoningPartSchema$outboundSchema,
3528
+ ]),
3529
+ ),
3530
+ ]);
995
3531
 
996
- /** @internal */
997
- export const GetPromptVersionThinkingLevel$inboundSchema: z.ZodNativeEnum<
998
- typeof GetPromptVersionThinkingLevel
999
- > = z.nativeEnum(GetPromptVersionThinkingLevel);
1000
- /** @internal */
1001
- export const GetPromptVersionThinkingLevel$outboundSchema: z.ZodNativeEnum<
1002
- typeof GetPromptVersionThinkingLevel
1003
- > = GetPromptVersionThinkingLevel$inboundSchema;
3532
+ export function getPromptVersionMessagesPromptsResponseContentToJSON(
3533
+ getPromptVersionMessagesPromptsResponseContent:
3534
+ GetPromptVersionMessagesPromptsResponseContent,
3535
+ ): string {
3536
+ return JSON.stringify(
3537
+ GetPromptVersionMessagesPromptsResponseContent$outboundSchema.parse(
3538
+ getPromptVersionMessagesPromptsResponseContent,
3539
+ ),
3540
+ );
3541
+ }
3542
+ export function getPromptVersionMessagesPromptsResponseContentFromJSON(
3543
+ jsonString: string,
3544
+ ): SafeParseResult<
3545
+ GetPromptVersionMessagesPromptsResponseContent,
3546
+ SDKValidationError
3547
+ > {
3548
+ return safeParse(
3549
+ jsonString,
3550
+ (x) =>
3551
+ GetPromptVersionMessagesPromptsResponseContent$inboundSchema.parse(
3552
+ JSON.parse(x),
3553
+ ),
3554
+ `Failed to parse 'GetPromptVersionMessagesPromptsResponseContent' from JSON`,
3555
+ );
3556
+ }
1004
3557
 
1005
3558
  /** @internal */
1006
- export const GetPromptVersionModelParameters$inboundSchema: z.ZodType<
1007
- GetPromptVersionModelParameters,
3559
+ export const GetPromptVersionMessagesAudio$inboundSchema: z.ZodType<
3560
+ GetPromptVersionMessagesAudio,
1008
3561
  z.ZodTypeDef,
1009
3562
  unknown
1010
3563
  > = z.object({
1011
- temperature: z.number().optional(),
1012
- maxTokens: z.number().optional(),
1013
- topK: z.number().optional(),
1014
- topP: z.number().optional(),
1015
- frequencyPenalty: z.number().optional(),
1016
- presencePenalty: z.number().optional(),
1017
- numImages: z.number().optional(),
1018
- seed: z.number().optional(),
1019
- format: GetPromptVersionFormat$inboundSchema.optional(),
1020
- dimensions: z.string().optional(),
1021
- quality: z.string().optional(),
1022
- style: z.string().optional(),
1023
- responseFormat: z.nullable(
1024
- z.union([
1025
- z.lazy(() => GetPromptVersionResponseFormat1$inboundSchema),
1026
- z.lazy(() => GetPromptVersionResponseFormat2$inboundSchema),
1027
- z.lazy(() => GetPromptVersionResponseFormat3$inboundSchema),
1028
- GetPromptVersionResponseFormat4$inboundSchema,
1029
- GetPromptVersionResponseFormat5$inboundSchema,
1030
- GetPromptVersionResponseFormat6$inboundSchema,
1031
- ]),
1032
- ).optional(),
1033
- photoRealVersion: GetPromptVersionPhotoRealVersion$inboundSchema.optional(),
1034
- encoding_format: GetPromptVersionEncodingFormat$inboundSchema.optional(),
1035
- reasoningEffort: GetPromptVersionReasoningEffort$inboundSchema.optional(),
1036
- budgetTokens: z.number().optional(),
1037
- verbosity: GetPromptVersionVerbosity$inboundSchema.optional(),
1038
- thinkingLevel: GetPromptVersionThinkingLevel$inboundSchema.optional(),
1039
- }).transform((v) => {
1040
- return remap$(v, {
1041
- "encoding_format": "encodingFormat",
1042
- });
3564
+ id: z.string(),
1043
3565
  });
1044
3566
  /** @internal */
1045
- export type GetPromptVersionModelParameters$Outbound = {
1046
- temperature?: number | undefined;
1047
- maxTokens?: number | undefined;
1048
- topK?: number | undefined;
1049
- topP?: number | undefined;
1050
- frequencyPenalty?: number | undefined;
1051
- presencePenalty?: number | undefined;
1052
- numImages?: number | undefined;
1053
- seed?: number | undefined;
1054
- format?: string | undefined;
1055
- dimensions?: string | undefined;
1056
- quality?: string | undefined;
1057
- style?: string | undefined;
1058
- responseFormat?:
1059
- | GetPromptVersionResponseFormat1$Outbound
1060
- | GetPromptVersionResponseFormat2$Outbound
1061
- | GetPromptVersionResponseFormat3$Outbound
1062
- | string
1063
- | string
1064
- | string
1065
- | null
1066
- | undefined;
1067
- photoRealVersion?: string | undefined;
1068
- encoding_format?: string | undefined;
1069
- reasoningEffort?: string | undefined;
1070
- budgetTokens?: number | undefined;
1071
- verbosity?: string | undefined;
1072
- thinkingLevel?: string | undefined;
1073
- };
1074
-
1075
- /** @internal */
1076
- export const GetPromptVersionModelParameters$outboundSchema: z.ZodType<
1077
- GetPromptVersionModelParameters$Outbound,
1078
- z.ZodTypeDef,
1079
- GetPromptVersionModelParameters
1080
- > = z.object({
1081
- temperature: z.number().optional(),
1082
- maxTokens: z.number().optional(),
1083
- topK: z.number().optional(),
1084
- topP: z.number().optional(),
1085
- frequencyPenalty: z.number().optional(),
1086
- presencePenalty: z.number().optional(),
1087
- numImages: z.number().optional(),
1088
- seed: z.number().optional(),
1089
- format: GetPromptVersionFormat$outboundSchema.optional(),
1090
- dimensions: z.string().optional(),
1091
- quality: z.string().optional(),
1092
- style: z.string().optional(),
1093
- responseFormat: z.nullable(
1094
- z.union([
1095
- z.lazy(() => GetPromptVersionResponseFormat1$outboundSchema),
1096
- z.lazy(() => GetPromptVersionResponseFormat2$outboundSchema),
1097
- z.lazy(() => GetPromptVersionResponseFormat3$outboundSchema),
1098
- GetPromptVersionResponseFormat4$outboundSchema,
1099
- GetPromptVersionResponseFormat5$outboundSchema,
1100
- GetPromptVersionResponseFormat6$outboundSchema,
1101
- ]),
1102
- ).optional(),
1103
- photoRealVersion: GetPromptVersionPhotoRealVersion$outboundSchema.optional(),
1104
- encodingFormat: GetPromptVersionEncodingFormat$outboundSchema.optional(),
1105
- reasoningEffort: GetPromptVersionReasoningEffort$outboundSchema.optional(),
1106
- budgetTokens: z.number().optional(),
1107
- verbosity: GetPromptVersionVerbosity$outboundSchema.optional(),
1108
- thinkingLevel: GetPromptVersionThinkingLevel$outboundSchema.optional(),
1109
- }).transform((v) => {
1110
- return remap$(v, {
1111
- encodingFormat: "encoding_format",
1112
- });
3567
+ export type GetPromptVersionMessagesAudio$Outbound = {
3568
+ id: string;
3569
+ };
3570
+
3571
+ /** @internal */
3572
+ export const GetPromptVersionMessagesAudio$outboundSchema: z.ZodType<
3573
+ GetPromptVersionMessagesAudio$Outbound,
3574
+ z.ZodTypeDef,
3575
+ GetPromptVersionMessagesAudio
3576
+ > = z.object({
3577
+ id: z.string(),
1113
3578
  });
1114
3579
 
1115
- export function getPromptVersionModelParametersToJSON(
1116
- getPromptVersionModelParameters: GetPromptVersionModelParameters,
3580
+ export function getPromptVersionMessagesAudioToJSON(
3581
+ getPromptVersionMessagesAudio: GetPromptVersionMessagesAudio,
1117
3582
  ): string {
1118
3583
  return JSON.stringify(
1119
- GetPromptVersionModelParameters$outboundSchema.parse(
1120
- getPromptVersionModelParameters,
3584
+ GetPromptVersionMessagesAudio$outboundSchema.parse(
3585
+ getPromptVersionMessagesAudio,
1121
3586
  ),
1122
3587
  );
1123
3588
  }
1124
- export function getPromptVersionModelParametersFromJSON(
3589
+ export function getPromptVersionMessagesAudioFromJSON(
1125
3590
  jsonString: string,
1126
- ): SafeParseResult<GetPromptVersionModelParameters, SDKValidationError> {
3591
+ ): SafeParseResult<GetPromptVersionMessagesAudio, SDKValidationError> {
1127
3592
  return safeParse(
1128
3593
  jsonString,
1129
- (x) => GetPromptVersionModelParameters$inboundSchema.parse(JSON.parse(x)),
1130
- `Failed to parse 'GetPromptVersionModelParameters' from JSON`,
3594
+ (x) => GetPromptVersionMessagesAudio$inboundSchema.parse(JSON.parse(x)),
3595
+ `Failed to parse 'GetPromptVersionMessagesAudio' from JSON`,
1131
3596
  );
1132
3597
  }
1133
3598
 
1134
3599
  /** @internal */
1135
- export const GetPromptVersionProvider$inboundSchema: z.ZodNativeEnum<
1136
- typeof GetPromptVersionProvider
1137
- > = z.nativeEnum(GetPromptVersionProvider);
1138
- /** @internal */
1139
- export const GetPromptVersionProvider$outboundSchema: z.ZodNativeEnum<
1140
- typeof GetPromptVersionProvider
1141
- > = GetPromptVersionProvider$inboundSchema;
1142
-
1143
- /** @internal */
1144
- export const GetPromptVersionRole$inboundSchema: z.ZodNativeEnum<
1145
- typeof GetPromptVersionRole
1146
- > = z.nativeEnum(GetPromptVersionRole);
3600
+ export const GetPromptVersionMessagesType$inboundSchema: z.ZodNativeEnum<
3601
+ typeof GetPromptVersionMessagesType
3602
+ > = z.nativeEnum(GetPromptVersionMessagesType);
1147
3603
  /** @internal */
1148
- export const GetPromptVersionRole$outboundSchema: z.ZodNativeEnum<
1149
- typeof GetPromptVersionRole
1150
- > = GetPromptVersionRole$inboundSchema;
3604
+ export const GetPromptVersionMessagesType$outboundSchema: z.ZodNativeEnum<
3605
+ typeof GetPromptVersionMessagesType
3606
+ > = GetPromptVersionMessagesType$inboundSchema;
1151
3607
 
1152
3608
  /** @internal */
1153
- export const GetPromptVersion2File$inboundSchema: z.ZodType<
1154
- GetPromptVersion2File,
3609
+ export const GetPromptVersionMessagesFunction$inboundSchema: z.ZodType<
3610
+ GetPromptVersionMessagesFunction,
1155
3611
  z.ZodTypeDef,
1156
3612
  unknown
1157
3613
  > = z.object({
1158
- file_data: z.string().optional(),
1159
- uri: z.string().optional(),
1160
- mimeType: z.string().optional(),
1161
- filename: z.string().optional(),
1162
- }).transform((v) => {
1163
- return remap$(v, {
1164
- "file_data": "fileData",
1165
- });
3614
+ name: z.string().optional(),
3615
+ arguments: z.string().optional(),
1166
3616
  });
1167
3617
  /** @internal */
1168
- export type GetPromptVersion2File$Outbound = {
1169
- file_data?: string | undefined;
1170
- uri?: string | undefined;
1171
- mimeType?: string | undefined;
1172
- filename?: string | undefined;
3618
+ export type GetPromptVersionMessagesFunction$Outbound = {
3619
+ name?: string | undefined;
3620
+ arguments?: string | undefined;
1173
3621
  };
1174
3622
 
1175
3623
  /** @internal */
1176
- export const GetPromptVersion2File$outboundSchema: z.ZodType<
1177
- GetPromptVersion2File$Outbound,
3624
+ export const GetPromptVersionMessagesFunction$outboundSchema: z.ZodType<
3625
+ GetPromptVersionMessagesFunction$Outbound,
1178
3626
  z.ZodTypeDef,
1179
- GetPromptVersion2File
3627
+ GetPromptVersionMessagesFunction
1180
3628
  > = z.object({
1181
- fileData: z.string().optional(),
1182
- uri: z.string().optional(),
1183
- mimeType: z.string().optional(),
1184
- filename: z.string().optional(),
1185
- }).transform((v) => {
1186
- return remap$(v, {
1187
- fileData: "file_data",
1188
- });
3629
+ name: z.string().optional(),
3630
+ arguments: z.string().optional(),
1189
3631
  });
1190
3632
 
1191
- export function getPromptVersion2FileToJSON(
1192
- getPromptVersion2File: GetPromptVersion2File,
3633
+ export function getPromptVersionMessagesFunctionToJSON(
3634
+ getPromptVersionMessagesFunction: GetPromptVersionMessagesFunction,
1193
3635
  ): string {
1194
3636
  return JSON.stringify(
1195
- GetPromptVersion2File$outboundSchema.parse(getPromptVersion2File),
3637
+ GetPromptVersionMessagesFunction$outboundSchema.parse(
3638
+ getPromptVersionMessagesFunction,
3639
+ ),
1196
3640
  );
1197
3641
  }
1198
- export function getPromptVersion2FileFromJSON(
3642
+ export function getPromptVersionMessagesFunctionFromJSON(
1199
3643
  jsonString: string,
1200
- ): SafeParseResult<GetPromptVersion2File, SDKValidationError> {
3644
+ ): SafeParseResult<GetPromptVersionMessagesFunction, SDKValidationError> {
1201
3645
  return safeParse(
1202
3646
  jsonString,
1203
- (x) => GetPromptVersion2File$inboundSchema.parse(JSON.parse(x)),
1204
- `Failed to parse 'GetPromptVersion2File' from JSON`,
3647
+ (x) => GetPromptVersionMessagesFunction$inboundSchema.parse(JSON.parse(x)),
3648
+ `Failed to parse 'GetPromptVersionMessagesFunction' from JSON`,
1205
3649
  );
1206
3650
  }
1207
3651
 
1208
3652
  /** @internal */
1209
- export const GetPromptVersion23$inboundSchema: z.ZodType<
1210
- GetPromptVersion23,
3653
+ export const GetPromptVersionMessagesToolCalls$inboundSchema: z.ZodType<
3654
+ GetPromptVersionMessagesToolCalls,
1211
3655
  z.ZodTypeDef,
1212
3656
  unknown
1213
3657
  > = z.object({
1214
- type: z.literal("file"),
1215
- file: z.lazy(() => GetPromptVersion2File$inboundSchema),
3658
+ id: z.string(),
3659
+ type: GetPromptVersionMessagesType$inboundSchema,
3660
+ function: z.lazy(() => GetPromptVersionMessagesFunction$inboundSchema),
3661
+ thought_signature: z.string().optional(),
3662
+ }).transform((v) => {
3663
+ return remap$(v, {
3664
+ "thought_signature": "thoughtSignature",
3665
+ });
1216
3666
  });
1217
3667
  /** @internal */
1218
- export type GetPromptVersion23$Outbound = {
1219
- type: "file";
1220
- file: GetPromptVersion2File$Outbound;
3668
+ export type GetPromptVersionMessagesToolCalls$Outbound = {
3669
+ id: string;
3670
+ type: string;
3671
+ function: GetPromptVersionMessagesFunction$Outbound;
3672
+ thought_signature?: string | undefined;
1221
3673
  };
1222
3674
 
1223
3675
  /** @internal */
1224
- export const GetPromptVersion23$outboundSchema: z.ZodType<
1225
- GetPromptVersion23$Outbound,
3676
+ export const GetPromptVersionMessagesToolCalls$outboundSchema: z.ZodType<
3677
+ GetPromptVersionMessagesToolCalls$Outbound,
1226
3678
  z.ZodTypeDef,
1227
- GetPromptVersion23
3679
+ GetPromptVersionMessagesToolCalls
1228
3680
  > = z.object({
1229
- type: z.literal("file"),
1230
- file: z.lazy(() => GetPromptVersion2File$outboundSchema),
3681
+ id: z.string(),
3682
+ type: GetPromptVersionMessagesType$outboundSchema,
3683
+ function: z.lazy(() => GetPromptVersionMessagesFunction$outboundSchema),
3684
+ thoughtSignature: z.string().optional(),
3685
+ }).transform((v) => {
3686
+ return remap$(v, {
3687
+ thoughtSignature: "thought_signature",
3688
+ });
1231
3689
  });
1232
3690
 
1233
- export function getPromptVersion23ToJSON(
1234
- getPromptVersion23: GetPromptVersion23,
3691
+ export function getPromptVersionMessagesToolCallsToJSON(
3692
+ getPromptVersionMessagesToolCalls: GetPromptVersionMessagesToolCalls,
1235
3693
  ): string {
1236
3694
  return JSON.stringify(
1237
- GetPromptVersion23$outboundSchema.parse(getPromptVersion23),
3695
+ GetPromptVersionMessagesToolCalls$outboundSchema.parse(
3696
+ getPromptVersionMessagesToolCalls,
3697
+ ),
1238
3698
  );
1239
3699
  }
1240
- export function getPromptVersion23FromJSON(
3700
+ export function getPromptVersionMessagesToolCallsFromJSON(
1241
3701
  jsonString: string,
1242
- ): SafeParseResult<GetPromptVersion23, SDKValidationError> {
3702
+ ): SafeParseResult<GetPromptVersionMessagesToolCalls, SDKValidationError> {
1243
3703
  return safeParse(
1244
3704
  jsonString,
1245
- (x) => GetPromptVersion23$inboundSchema.parse(JSON.parse(x)),
1246
- `Failed to parse 'GetPromptVersion23' from JSON`,
3705
+ (x) => GetPromptVersionMessagesToolCalls$inboundSchema.parse(JSON.parse(x)),
3706
+ `Failed to parse 'GetPromptVersionMessagesToolCalls' from JSON`,
1247
3707
  );
1248
3708
  }
1249
3709
 
1250
3710
  /** @internal */
1251
- export const GetPromptVersion2ImageUrl$inboundSchema: z.ZodType<
1252
- GetPromptVersion2ImageUrl,
3711
+ export const GetPromptVersionMessagesAssistantMessage$inboundSchema: z.ZodType<
3712
+ GetPromptVersionMessagesAssistantMessage,
1253
3713
  z.ZodTypeDef,
1254
3714
  unknown
1255
3715
  > = z.object({
1256
- id: z.string().optional(),
1257
- url: z.string(),
1258
- detail: z.string().optional(),
3716
+ content: z.nullable(
3717
+ z.union([
3718
+ z.string(),
3719
+ z.array(
3720
+ z.union([
3721
+ components.TextContentPartSchema$inboundSchema.and(
3722
+ z.object({ type: z.literal("text") }),
3723
+ ),
3724
+ components.RefusalPartSchema$inboundSchema,
3725
+ components.ReasoningPartSchema$inboundSchema,
3726
+ components.RedactedReasoningPartSchema$inboundSchema,
3727
+ ]),
3728
+ ),
3729
+ ]),
3730
+ ).optional(),
3731
+ refusal: z.nullable(z.string()).optional(),
3732
+ role: z.literal("assistant"),
3733
+ name: z.string().optional(),
3734
+ audio: z.nullable(z.lazy(() => GetPromptVersionMessagesAudio$inboundSchema))
3735
+ .optional(),
3736
+ tool_calls: z.array(
3737
+ z.lazy(() => GetPromptVersionMessagesToolCalls$inboundSchema),
3738
+ ).optional(),
3739
+ }).transform((v) => {
3740
+ return remap$(v, {
3741
+ "tool_calls": "toolCalls",
3742
+ });
1259
3743
  });
1260
3744
  /** @internal */
1261
- export type GetPromptVersion2ImageUrl$Outbound = {
1262
- id?: string | undefined;
1263
- url: string;
1264
- detail?: string | undefined;
3745
+ export type GetPromptVersionMessagesAssistantMessage$Outbound = {
3746
+ content?:
3747
+ | string
3748
+ | Array<
3749
+ | (components.TextContentPartSchema$Outbound & { type: "text" })
3750
+ | components.RefusalPartSchema$Outbound
3751
+ | components.ReasoningPartSchema$Outbound
3752
+ | components.RedactedReasoningPartSchema$Outbound
3753
+ >
3754
+ | null
3755
+ | undefined;
3756
+ refusal?: string | null | undefined;
3757
+ role: "assistant";
3758
+ name?: string | undefined;
3759
+ audio?: GetPromptVersionMessagesAudio$Outbound | null | undefined;
3760
+ tool_calls?: Array<GetPromptVersionMessagesToolCalls$Outbound> | undefined;
1265
3761
  };
1266
3762
 
1267
3763
  /** @internal */
1268
- export const GetPromptVersion2ImageUrl$outboundSchema: z.ZodType<
1269
- GetPromptVersion2ImageUrl$Outbound,
3764
+ export const GetPromptVersionMessagesAssistantMessage$outboundSchema: z.ZodType<
3765
+ GetPromptVersionMessagesAssistantMessage$Outbound,
1270
3766
  z.ZodTypeDef,
1271
- GetPromptVersion2ImageUrl
3767
+ GetPromptVersionMessagesAssistantMessage
1272
3768
  > = z.object({
1273
- id: z.string().optional(),
1274
- url: z.string(),
1275
- detail: z.string().optional(),
3769
+ content: z.nullable(
3770
+ z.union([
3771
+ z.string(),
3772
+ z.array(
3773
+ z.union([
3774
+ components.TextContentPartSchema$outboundSchema.and(
3775
+ z.object({ type: z.literal("text") }),
3776
+ ),
3777
+ components.RefusalPartSchema$outboundSchema,
3778
+ components.ReasoningPartSchema$outboundSchema,
3779
+ components.RedactedReasoningPartSchema$outboundSchema,
3780
+ ]),
3781
+ ),
3782
+ ]),
3783
+ ).optional(),
3784
+ refusal: z.nullable(z.string()).optional(),
3785
+ role: z.literal("assistant"),
3786
+ name: z.string().optional(),
3787
+ audio: z.nullable(z.lazy(() => GetPromptVersionMessagesAudio$outboundSchema))
3788
+ .optional(),
3789
+ toolCalls: z.array(
3790
+ z.lazy(() => GetPromptVersionMessagesToolCalls$outboundSchema),
3791
+ ).optional(),
3792
+ }).transform((v) => {
3793
+ return remap$(v, {
3794
+ toolCalls: "tool_calls",
3795
+ });
1276
3796
  });
1277
3797
 
1278
- export function getPromptVersion2ImageUrlToJSON(
1279
- getPromptVersion2ImageUrl: GetPromptVersion2ImageUrl,
3798
+ export function getPromptVersionMessagesAssistantMessageToJSON(
3799
+ getPromptVersionMessagesAssistantMessage:
3800
+ GetPromptVersionMessagesAssistantMessage,
1280
3801
  ): string {
1281
3802
  return JSON.stringify(
1282
- GetPromptVersion2ImageUrl$outboundSchema.parse(getPromptVersion2ImageUrl),
3803
+ GetPromptVersionMessagesAssistantMessage$outboundSchema.parse(
3804
+ getPromptVersionMessagesAssistantMessage,
3805
+ ),
1283
3806
  );
1284
3807
  }
1285
- export function getPromptVersion2ImageUrlFromJSON(
3808
+ export function getPromptVersionMessagesAssistantMessageFromJSON(
1286
3809
  jsonString: string,
1287
- ): SafeParseResult<GetPromptVersion2ImageUrl, SDKValidationError> {
3810
+ ): SafeParseResult<
3811
+ GetPromptVersionMessagesAssistantMessage,
3812
+ SDKValidationError
3813
+ > {
1288
3814
  return safeParse(
1289
3815
  jsonString,
1290
- (x) => GetPromptVersion2ImageUrl$inboundSchema.parse(JSON.parse(x)),
1291
- `Failed to parse 'GetPromptVersion2ImageUrl' from JSON`,
3816
+ (x) =>
3817
+ GetPromptVersionMessagesAssistantMessage$inboundSchema.parse(
3818
+ JSON.parse(x),
3819
+ ),
3820
+ `Failed to parse 'GetPromptVersionMessagesAssistantMessage' from JSON`,
1292
3821
  );
1293
3822
  }
1294
3823
 
1295
3824
  /** @internal */
1296
- export const GetPromptVersion22$inboundSchema: z.ZodType<
1297
- GetPromptVersion22,
3825
+ export const GetPromptVersion2PromptsResponse200ApplicationJSONType$inboundSchema:
3826
+ z.ZodNativeEnum<
3827
+ typeof GetPromptVersion2PromptsResponse200ApplicationJSONType
3828
+ > = z.nativeEnum(GetPromptVersion2PromptsResponse200ApplicationJSONType);
3829
+ /** @internal */
3830
+ export const GetPromptVersion2PromptsResponse200ApplicationJSONType$outboundSchema:
3831
+ z.ZodNativeEnum<
3832
+ typeof GetPromptVersion2PromptsResponse200ApplicationJSONType
3833
+ > = GetPromptVersion2PromptsResponse200ApplicationJSONType$inboundSchema;
3834
+
3835
+ /** @internal */
3836
+ export const GetPromptVersion2Ttl$inboundSchema: z.ZodNativeEnum<
3837
+ typeof GetPromptVersion2Ttl
3838
+ > = z.nativeEnum(GetPromptVersion2Ttl);
3839
+ /** @internal */
3840
+ export const GetPromptVersion2Ttl$outboundSchema: z.ZodNativeEnum<
3841
+ typeof GetPromptVersion2Ttl
3842
+ > = GetPromptVersion2Ttl$inboundSchema;
3843
+
3844
+ /** @internal */
3845
+ export const GetPromptVersion2CacheControl$inboundSchema: z.ZodType<
3846
+ GetPromptVersion2CacheControl,
1298
3847
  z.ZodTypeDef,
1299
3848
  unknown
1300
3849
  > = z.object({
1301
- type: z.literal("image_url"),
1302
- image_url: z.lazy(() => GetPromptVersion2ImageUrl$inboundSchema),
1303
- }).transform((v) => {
1304
- return remap$(v, {
1305
- "image_url": "imageUrl",
1306
- });
3850
+ type: GetPromptVersion2PromptsResponse200ApplicationJSONType$inboundSchema,
3851
+ ttl: GetPromptVersion2Ttl$inboundSchema.default("5m"),
1307
3852
  });
1308
3853
  /** @internal */
1309
- export type GetPromptVersion22$Outbound = {
1310
- type: "image_url";
1311
- image_url: GetPromptVersion2ImageUrl$Outbound;
3854
+ export type GetPromptVersion2CacheControl$Outbound = {
3855
+ type: string;
3856
+ ttl: string;
1312
3857
  };
1313
3858
 
1314
3859
  /** @internal */
1315
- export const GetPromptVersion22$outboundSchema: z.ZodType<
1316
- GetPromptVersion22$Outbound,
3860
+ export const GetPromptVersion2CacheControl$outboundSchema: z.ZodType<
3861
+ GetPromptVersion2CacheControl$Outbound,
1317
3862
  z.ZodTypeDef,
1318
- GetPromptVersion22
3863
+ GetPromptVersion2CacheControl
1319
3864
  > = z.object({
1320
- type: z.literal("image_url"),
1321
- imageUrl: z.lazy(() => GetPromptVersion2ImageUrl$outboundSchema),
1322
- }).transform((v) => {
1323
- return remap$(v, {
1324
- imageUrl: "image_url",
1325
- });
3865
+ type: GetPromptVersion2PromptsResponse200ApplicationJSONType$outboundSchema,
3866
+ ttl: GetPromptVersion2Ttl$outboundSchema.default("5m"),
1326
3867
  });
1327
3868
 
1328
- export function getPromptVersion22ToJSON(
1329
- getPromptVersion22: GetPromptVersion22,
3869
+ export function getPromptVersion2CacheControlToJSON(
3870
+ getPromptVersion2CacheControl: GetPromptVersion2CacheControl,
1330
3871
  ): string {
1331
3872
  return JSON.stringify(
1332
- GetPromptVersion22$outboundSchema.parse(getPromptVersion22),
3873
+ GetPromptVersion2CacheControl$outboundSchema.parse(
3874
+ getPromptVersion2CacheControl,
3875
+ ),
1333
3876
  );
1334
3877
  }
1335
- export function getPromptVersion22FromJSON(
3878
+ export function getPromptVersion2CacheControlFromJSON(
1336
3879
  jsonString: string,
1337
- ): SafeParseResult<GetPromptVersion22, SDKValidationError> {
3880
+ ): SafeParseResult<GetPromptVersion2CacheControl, SDKValidationError> {
1338
3881
  return safeParse(
1339
3882
  jsonString,
1340
- (x) => GetPromptVersion22$inboundSchema.parse(JSON.parse(x)),
1341
- `Failed to parse 'GetPromptVersion22' from JSON`,
3883
+ (x) => GetPromptVersion2CacheControl$inboundSchema.parse(JSON.parse(x)),
3884
+ `Failed to parse 'GetPromptVersion2CacheControl' from JSON`,
1342
3885
  );
1343
3886
  }
1344
3887
 
1345
3888
  /** @internal */
1346
- export const GetPromptVersion21$inboundSchema: z.ZodType<
1347
- GetPromptVersion21,
3889
+ export const GetPromptVersion24$inboundSchema: z.ZodType<
3890
+ GetPromptVersion24,
1348
3891
  z.ZodTypeDef,
1349
3892
  unknown
1350
3893
  > = z.object({
1351
- type: z.literal("text"),
1352
- text: z.string(),
3894
+ type: z.literal("file"),
3895
+ cache_control: z.lazy(() => GetPromptVersion2CacheControl$inboundSchema)
3896
+ .optional(),
3897
+ file: components.FileContentPartSchema$inboundSchema,
3898
+ }).transform((v) => {
3899
+ return remap$(v, {
3900
+ "cache_control": "cacheControl",
3901
+ });
1353
3902
  });
1354
3903
  /** @internal */
1355
- export type GetPromptVersion21$Outbound = {
1356
- type: "text";
1357
- text: string;
3904
+ export type GetPromptVersion24$Outbound = {
3905
+ type: "file";
3906
+ cache_control?: GetPromptVersion2CacheControl$Outbound | undefined;
3907
+ file: components.FileContentPartSchema$Outbound;
1358
3908
  };
1359
3909
 
1360
3910
  /** @internal */
1361
- export const GetPromptVersion21$outboundSchema: z.ZodType<
1362
- GetPromptVersion21$Outbound,
3911
+ export const GetPromptVersion24$outboundSchema: z.ZodType<
3912
+ GetPromptVersion24$Outbound,
1363
3913
  z.ZodTypeDef,
1364
- GetPromptVersion21
3914
+ GetPromptVersion24
1365
3915
  > = z.object({
1366
- type: z.literal("text"),
1367
- text: z.string(),
3916
+ type: z.literal("file"),
3917
+ cacheControl: z.lazy(() => GetPromptVersion2CacheControl$outboundSchema)
3918
+ .optional(),
3919
+ file: components.FileContentPartSchema$outboundSchema,
3920
+ }).transform((v) => {
3921
+ return remap$(v, {
3922
+ cacheControl: "cache_control",
3923
+ });
1368
3924
  });
1369
3925
 
1370
- export function getPromptVersion21ToJSON(
1371
- getPromptVersion21: GetPromptVersion21,
3926
+ export function getPromptVersion24ToJSON(
3927
+ getPromptVersion24: GetPromptVersion24,
1372
3928
  ): string {
1373
3929
  return JSON.stringify(
1374
- GetPromptVersion21$outboundSchema.parse(getPromptVersion21),
3930
+ GetPromptVersion24$outboundSchema.parse(getPromptVersion24),
1375
3931
  );
1376
3932
  }
1377
- export function getPromptVersion21FromJSON(
3933
+ export function getPromptVersion24FromJSON(
1378
3934
  jsonString: string,
1379
- ): SafeParseResult<GetPromptVersion21, SDKValidationError> {
3935
+ ): SafeParseResult<GetPromptVersion24, SDKValidationError> {
1380
3936
  return safeParse(
1381
3937
  jsonString,
1382
- (x) => GetPromptVersion21$inboundSchema.parse(JSON.parse(x)),
1383
- `Failed to parse 'GetPromptVersion21' from JSON`,
3938
+ (x) => GetPromptVersion24$inboundSchema.parse(JSON.parse(x)),
3939
+ `Failed to parse 'GetPromptVersion24' from JSON`,
1384
3940
  );
1385
3941
  }
1386
3942
 
1387
3943
  /** @internal */
1388
- export const GetPromptVersionContent2$inboundSchema: z.ZodType<
1389
- GetPromptVersionContent2,
3944
+ export const GetPromptVersionContentPrompts2$inboundSchema: z.ZodType<
3945
+ GetPromptVersionContentPrompts2,
1390
3946
  z.ZodTypeDef,
1391
3947
  unknown
1392
3948
  > = z.union([
1393
- z.lazy(() => GetPromptVersion21$inboundSchema),
1394
- z.lazy(() => GetPromptVersion22$inboundSchema),
1395
- z.lazy(() => GetPromptVersion23$inboundSchema),
3949
+ components.TextContentPartSchema$inboundSchema.and(
3950
+ z.object({ type: z.literal("text") }),
3951
+ ),
3952
+ components.ImageContentPartSchema$inboundSchema,
3953
+ components.AudioContentPartSchema$inboundSchema,
3954
+ z.lazy(() => GetPromptVersion24$inboundSchema),
1396
3955
  ]);
1397
3956
  /** @internal */
1398
- export type GetPromptVersionContent2$Outbound =
1399
- | GetPromptVersion21$Outbound
1400
- | GetPromptVersion22$Outbound
1401
- | GetPromptVersion23$Outbound;
3957
+ export type GetPromptVersionContentPrompts2$Outbound =
3958
+ | (components.TextContentPartSchema$Outbound & { type: "text" })
3959
+ | components.ImageContentPartSchema$Outbound
3960
+ | components.AudioContentPartSchema$Outbound
3961
+ | GetPromptVersion24$Outbound;
1402
3962
 
1403
3963
  /** @internal */
1404
- export const GetPromptVersionContent2$outboundSchema: z.ZodType<
1405
- GetPromptVersionContent2$Outbound,
3964
+ export const GetPromptVersionContentPrompts2$outboundSchema: z.ZodType<
3965
+ GetPromptVersionContentPrompts2$Outbound,
1406
3966
  z.ZodTypeDef,
1407
- GetPromptVersionContent2
3967
+ GetPromptVersionContentPrompts2
1408
3968
  > = z.union([
1409
- z.lazy(() => GetPromptVersion21$outboundSchema),
1410
- z.lazy(() => GetPromptVersion22$outboundSchema),
1411
- z.lazy(() => GetPromptVersion23$outboundSchema),
3969
+ components.TextContentPartSchema$outboundSchema.and(
3970
+ z.object({ type: z.literal("text") }),
3971
+ ),
3972
+ components.ImageContentPartSchema$outboundSchema,
3973
+ components.AudioContentPartSchema$outboundSchema,
3974
+ z.lazy(() => GetPromptVersion24$outboundSchema),
1412
3975
  ]);
1413
3976
 
1414
- export function getPromptVersionContent2ToJSON(
1415
- getPromptVersionContent2: GetPromptVersionContent2,
3977
+ export function getPromptVersionContentPrompts2ToJSON(
3978
+ getPromptVersionContentPrompts2: GetPromptVersionContentPrompts2,
1416
3979
  ): string {
1417
3980
  return JSON.stringify(
1418
- GetPromptVersionContent2$outboundSchema.parse(getPromptVersionContent2),
3981
+ GetPromptVersionContentPrompts2$outboundSchema.parse(
3982
+ getPromptVersionContentPrompts2,
3983
+ ),
1419
3984
  );
1420
3985
  }
1421
- export function getPromptVersionContent2FromJSON(
3986
+ export function getPromptVersionContentPrompts2FromJSON(
1422
3987
  jsonString: string,
1423
- ): SafeParseResult<GetPromptVersionContent2, SDKValidationError> {
3988
+ ): SafeParseResult<GetPromptVersionContentPrompts2, SDKValidationError> {
1424
3989
  return safeParse(
1425
3990
  jsonString,
1426
- (x) => GetPromptVersionContent2$inboundSchema.parse(JSON.parse(x)),
1427
- `Failed to parse 'GetPromptVersionContent2' from JSON`,
3991
+ (x) => GetPromptVersionContentPrompts2$inboundSchema.parse(JSON.parse(x)),
3992
+ `Failed to parse 'GetPromptVersionContentPrompts2' from JSON`,
1428
3993
  );
1429
3994
  }
1430
3995
 
1431
3996
  /** @internal */
1432
- export const GetPromptVersionContent$inboundSchema: z.ZodType<
1433
- GetPromptVersionContent,
3997
+ export const GetPromptVersionMessagesPromptsContent$inboundSchema: z.ZodType<
3998
+ GetPromptVersionMessagesPromptsContent,
1434
3999
  z.ZodTypeDef,
1435
4000
  unknown
1436
4001
  > = z.union([
1437
- z.string(),
1438
- z.array(z.union([
1439
- z.lazy(() => GetPromptVersion21$inboundSchema),
1440
- z.lazy(() => GetPromptVersion22$inboundSchema),
1441
- z.lazy(() => GetPromptVersion23$inboundSchema),
1442
- ])),
4002
+ z.string(),
4003
+ z.array(
4004
+ z.union([
4005
+ components.TextContentPartSchema$inboundSchema.and(
4006
+ z.object({ type: z.literal("text") }),
4007
+ ),
4008
+ components.ImageContentPartSchema$inboundSchema,
4009
+ components.AudioContentPartSchema$inboundSchema,
4010
+ z.lazy(() => GetPromptVersion24$inboundSchema),
4011
+ ]),
4012
+ ),
1443
4013
  ]);
1444
4014
  /** @internal */
1445
- export type GetPromptVersionContent$Outbound =
4015
+ export type GetPromptVersionMessagesPromptsContent$Outbound =
1446
4016
  | string
1447
4017
  | Array<
1448
- | GetPromptVersion21$Outbound
1449
- | GetPromptVersion22$Outbound
1450
- | GetPromptVersion23$Outbound
4018
+ | (components.TextContentPartSchema$Outbound & { type: "text" })
4019
+ | components.ImageContentPartSchema$Outbound
4020
+ | components.AudioContentPartSchema$Outbound
4021
+ | GetPromptVersion24$Outbound
1451
4022
  >;
1452
4023
 
1453
4024
  /** @internal */
1454
- export const GetPromptVersionContent$outboundSchema: z.ZodType<
1455
- GetPromptVersionContent$Outbound,
4025
+ export const GetPromptVersionMessagesPromptsContent$outboundSchema: z.ZodType<
4026
+ GetPromptVersionMessagesPromptsContent$Outbound,
1456
4027
  z.ZodTypeDef,
1457
- GetPromptVersionContent
4028
+ GetPromptVersionMessagesPromptsContent
1458
4029
  > = z.union([
1459
4030
  z.string(),
1460
- z.array(z.union([
1461
- z.lazy(() => GetPromptVersion21$outboundSchema),
1462
- z.lazy(() => GetPromptVersion22$outboundSchema),
1463
- z.lazy(() => GetPromptVersion23$outboundSchema),
1464
- ])),
4031
+ z.array(
4032
+ z.union([
4033
+ components.TextContentPartSchema$outboundSchema.and(
4034
+ z.object({ type: z.literal("text") }),
4035
+ ),
4036
+ components.ImageContentPartSchema$outboundSchema,
4037
+ components.AudioContentPartSchema$outboundSchema,
4038
+ z.lazy(() => GetPromptVersion24$outboundSchema),
4039
+ ]),
4040
+ ),
1465
4041
  ]);
1466
4042
 
1467
- export function getPromptVersionContentToJSON(
1468
- getPromptVersionContent: GetPromptVersionContent,
4043
+ export function getPromptVersionMessagesPromptsContentToJSON(
4044
+ getPromptVersionMessagesPromptsContent:
4045
+ GetPromptVersionMessagesPromptsContent,
1469
4046
  ): string {
1470
4047
  return JSON.stringify(
1471
- GetPromptVersionContent$outboundSchema.parse(getPromptVersionContent),
4048
+ GetPromptVersionMessagesPromptsContent$outboundSchema.parse(
4049
+ getPromptVersionMessagesPromptsContent,
4050
+ ),
1472
4051
  );
1473
4052
  }
1474
- export function getPromptVersionContentFromJSON(
4053
+ export function getPromptVersionMessagesPromptsContentFromJSON(
1475
4054
  jsonString: string,
1476
- ): SafeParseResult<GetPromptVersionContent, SDKValidationError> {
4055
+ ): SafeParseResult<GetPromptVersionMessagesPromptsContent, SDKValidationError> {
1477
4056
  return safeParse(
1478
4057
  jsonString,
1479
- (x) => GetPromptVersionContent$inboundSchema.parse(JSON.parse(x)),
1480
- `Failed to parse 'GetPromptVersionContent' from JSON`,
4058
+ (x) =>
4059
+ GetPromptVersionMessagesPromptsContent$inboundSchema.parse(JSON.parse(x)),
4060
+ `Failed to parse 'GetPromptVersionMessagesPromptsContent' from JSON`,
1481
4061
  );
1482
4062
  }
1483
4063
 
1484
4064
  /** @internal */
1485
- export const GetPromptVersionType$inboundSchema: z.ZodNativeEnum<
1486
- typeof GetPromptVersionType
1487
- > = z.nativeEnum(GetPromptVersionType);
1488
- /** @internal */
1489
- export const GetPromptVersionType$outboundSchema: z.ZodNativeEnum<
1490
- typeof GetPromptVersionType
1491
- > = GetPromptVersionType$inboundSchema;
1492
-
1493
- /** @internal */
1494
- export const GetPromptVersionFunction$inboundSchema: z.ZodType<
1495
- GetPromptVersionFunction,
4065
+ export const GetPromptVersionMessagesUserMessage$inboundSchema: z.ZodType<
4066
+ GetPromptVersionMessagesUserMessage,
1496
4067
  z.ZodTypeDef,
1497
4068
  unknown
1498
4069
  > = z.object({
1499
- name: z.string(),
1500
- arguments: z.string(),
4070
+ role: z.literal("user"),
4071
+ name: z.string().optional(),
4072
+ content: z.union([
4073
+ z.string(),
4074
+ z.array(
4075
+ z.union([
4076
+ components.TextContentPartSchema$inboundSchema.and(
4077
+ z.object({ type: z.literal("text") }),
4078
+ ),
4079
+ components.ImageContentPartSchema$inboundSchema,
4080
+ components.AudioContentPartSchema$inboundSchema,
4081
+ z.lazy(() => GetPromptVersion24$inboundSchema),
4082
+ ]),
4083
+ ),
4084
+ ]),
1501
4085
  });
1502
4086
  /** @internal */
1503
- export type GetPromptVersionFunction$Outbound = {
1504
- name: string;
1505
- arguments: string;
4087
+ export type GetPromptVersionMessagesUserMessage$Outbound = {
4088
+ role: "user";
4089
+ name?: string | undefined;
4090
+ content:
4091
+ | string
4092
+ | Array<
4093
+ | (components.TextContentPartSchema$Outbound & { type: "text" })
4094
+ | components.ImageContentPartSchema$Outbound
4095
+ | components.AudioContentPartSchema$Outbound
4096
+ | GetPromptVersion24$Outbound
4097
+ >;
1506
4098
  };
1507
4099
 
1508
4100
  /** @internal */
1509
- export const GetPromptVersionFunction$outboundSchema: z.ZodType<
1510
- GetPromptVersionFunction$Outbound,
4101
+ export const GetPromptVersionMessagesUserMessage$outboundSchema: z.ZodType<
4102
+ GetPromptVersionMessagesUserMessage$Outbound,
1511
4103
  z.ZodTypeDef,
1512
- GetPromptVersionFunction
4104
+ GetPromptVersionMessagesUserMessage
1513
4105
  > = z.object({
1514
- name: z.string(),
1515
- arguments: z.string(),
4106
+ role: z.literal("user"),
4107
+ name: z.string().optional(),
4108
+ content: z.union([
4109
+ z.string(),
4110
+ z.array(
4111
+ z.union([
4112
+ components.TextContentPartSchema$outboundSchema.and(
4113
+ z.object({ type: z.literal("text") }),
4114
+ ),
4115
+ components.ImageContentPartSchema$outboundSchema,
4116
+ components.AudioContentPartSchema$outboundSchema,
4117
+ z.lazy(() => GetPromptVersion24$outboundSchema),
4118
+ ]),
4119
+ ),
4120
+ ]),
1516
4121
  });
1517
4122
 
1518
- export function getPromptVersionFunctionToJSON(
1519
- getPromptVersionFunction: GetPromptVersionFunction,
4123
+ export function getPromptVersionMessagesUserMessageToJSON(
4124
+ getPromptVersionMessagesUserMessage: GetPromptVersionMessagesUserMessage,
1520
4125
  ): string {
1521
4126
  return JSON.stringify(
1522
- GetPromptVersionFunction$outboundSchema.parse(getPromptVersionFunction),
4127
+ GetPromptVersionMessagesUserMessage$outboundSchema.parse(
4128
+ getPromptVersionMessagesUserMessage,
4129
+ ),
1523
4130
  );
1524
4131
  }
1525
- export function getPromptVersionFunctionFromJSON(
4132
+ export function getPromptVersionMessagesUserMessageFromJSON(
1526
4133
  jsonString: string,
1527
- ): SafeParseResult<GetPromptVersionFunction, SDKValidationError> {
4134
+ ): SafeParseResult<GetPromptVersionMessagesUserMessage, SDKValidationError> {
1528
4135
  return safeParse(
1529
4136
  jsonString,
1530
- (x) => GetPromptVersionFunction$inboundSchema.parse(JSON.parse(x)),
1531
- `Failed to parse 'GetPromptVersionFunction' from JSON`,
4137
+ (x) =>
4138
+ GetPromptVersionMessagesUserMessage$inboundSchema.parse(JSON.parse(x)),
4139
+ `Failed to parse 'GetPromptVersionMessagesUserMessage' from JSON`,
1532
4140
  );
1533
4141
  }
1534
4142
 
1535
4143
  /** @internal */
1536
- export const GetPromptVersionToolCalls$inboundSchema: z.ZodType<
1537
- GetPromptVersionToolCalls,
4144
+ export const GetPromptVersionMessagesContent$inboundSchema: z.ZodType<
4145
+ GetPromptVersionMessagesContent,
1538
4146
  z.ZodTypeDef,
1539
4147
  unknown
1540
- > = z.object({
1541
- id: z.string().optional(),
1542
- index: z.number().optional(),
1543
- type: GetPromptVersionType$inboundSchema,
1544
- function: z.lazy(() => GetPromptVersionFunction$inboundSchema),
1545
- });
4148
+ > = z.union([
4149
+ z.string(),
4150
+ z.array(components.TextContentPartSchema$inboundSchema),
4151
+ ]);
1546
4152
  /** @internal */
1547
- export type GetPromptVersionToolCalls$Outbound = {
1548
- id?: string | undefined;
1549
- index?: number | undefined;
1550
- type: string;
1551
- function: GetPromptVersionFunction$Outbound;
1552
- };
4153
+ export type GetPromptVersionMessagesContent$Outbound =
4154
+ | string
4155
+ | Array<components.TextContentPartSchema$Outbound>;
1553
4156
 
1554
4157
  /** @internal */
1555
- export const GetPromptVersionToolCalls$outboundSchema: z.ZodType<
1556
- GetPromptVersionToolCalls$Outbound,
4158
+ export const GetPromptVersionMessagesContent$outboundSchema: z.ZodType<
4159
+ GetPromptVersionMessagesContent$Outbound,
1557
4160
  z.ZodTypeDef,
1558
- GetPromptVersionToolCalls
1559
- > = z.object({
1560
- id: z.string().optional(),
1561
- index: z.number().optional(),
1562
- type: GetPromptVersionType$outboundSchema,
1563
- function: z.lazy(() => GetPromptVersionFunction$outboundSchema),
1564
- });
4161
+ GetPromptVersionMessagesContent
4162
+ > = z.union([
4163
+ z.string(),
4164
+ z.array(components.TextContentPartSchema$outboundSchema),
4165
+ ]);
1565
4166
 
1566
- export function getPromptVersionToolCallsToJSON(
1567
- getPromptVersionToolCalls: GetPromptVersionToolCalls,
4167
+ export function getPromptVersionMessagesContentToJSON(
4168
+ getPromptVersionMessagesContent: GetPromptVersionMessagesContent,
1568
4169
  ): string {
1569
4170
  return JSON.stringify(
1570
- GetPromptVersionToolCalls$outboundSchema.parse(getPromptVersionToolCalls),
4171
+ GetPromptVersionMessagesContent$outboundSchema.parse(
4172
+ getPromptVersionMessagesContent,
4173
+ ),
1571
4174
  );
1572
4175
  }
1573
- export function getPromptVersionToolCallsFromJSON(
4176
+ export function getPromptVersionMessagesContentFromJSON(
1574
4177
  jsonString: string,
1575
- ): SafeParseResult<GetPromptVersionToolCalls, SDKValidationError> {
4178
+ ): SafeParseResult<GetPromptVersionMessagesContent, SDKValidationError> {
1576
4179
  return safeParse(
1577
4180
  jsonString,
1578
- (x) => GetPromptVersionToolCalls$inboundSchema.parse(JSON.parse(x)),
1579
- `Failed to parse 'GetPromptVersionToolCalls' from JSON`,
4181
+ (x) => GetPromptVersionMessagesContent$inboundSchema.parse(JSON.parse(x)),
4182
+ `Failed to parse 'GetPromptVersionMessagesContent' from JSON`,
1580
4183
  );
1581
4184
  }
1582
4185
 
1583
4186
  /** @internal */
1584
- export const GetPromptVersionMessages$inboundSchema: z.ZodType<
1585
- GetPromptVersionMessages,
4187
+ export const GetPromptVersionMessagesSystemMessage$inboundSchema: z.ZodType<
4188
+ GetPromptVersionMessagesSystemMessage,
1586
4189
  z.ZodTypeDef,
1587
4190
  unknown
1588
4191
  > = z.object({
1589
- role: GetPromptVersionRole$inboundSchema,
1590
- content: z.nullable(
1591
- z.union([
1592
- z.string(),
1593
- z.array(
1594
- z.union([
1595
- z.lazy(() => GetPromptVersion21$inboundSchema),
1596
- z.lazy(() => GetPromptVersion22$inboundSchema),
1597
- z.lazy(() => GetPromptVersion23$inboundSchema),
1598
- ]),
1599
- ),
1600
- ]),
1601
- ),
1602
- tool_calls: z.array(z.lazy(() => GetPromptVersionToolCalls$inboundSchema))
1603
- .optional(),
1604
- tool_call_id: z.nullable(z.string()).optional(),
1605
- }).transform((v) => {
1606
- return remap$(v, {
1607
- "tool_calls": "toolCalls",
1608
- "tool_call_id": "toolCallId",
1609
- });
4192
+ role: z.literal("system"),
4193
+ content: z.union([
4194
+ z.string(),
4195
+ z.array(components.TextContentPartSchema$inboundSchema),
4196
+ ]),
4197
+ name: z.string().optional(),
1610
4198
  });
1611
4199
  /** @internal */
1612
- export type GetPromptVersionMessages$Outbound = {
1613
- role: string;
1614
- content:
1615
- | string
1616
- | Array<
1617
- | GetPromptVersion21$Outbound
1618
- | GetPromptVersion22$Outbound
1619
- | GetPromptVersion23$Outbound
1620
- >
1621
- | null;
1622
- tool_calls?: Array<GetPromptVersionToolCalls$Outbound> | undefined;
1623
- tool_call_id?: string | null | undefined;
4200
+ export type GetPromptVersionMessagesSystemMessage$Outbound = {
4201
+ role: "system";
4202
+ content: string | Array<components.TextContentPartSchema$Outbound>;
4203
+ name?: string | undefined;
1624
4204
  };
1625
4205
 
1626
4206
  /** @internal */
1627
- export const GetPromptVersionMessages$outboundSchema: z.ZodType<
1628
- GetPromptVersionMessages$Outbound,
4207
+ export const GetPromptVersionMessagesSystemMessage$outboundSchema: z.ZodType<
4208
+ GetPromptVersionMessagesSystemMessage$Outbound,
1629
4209
  z.ZodTypeDef,
1630
- GetPromptVersionMessages
4210
+ GetPromptVersionMessagesSystemMessage
1631
4211
  > = z.object({
1632
- role: GetPromptVersionRole$outboundSchema,
1633
- content: z.nullable(
1634
- z.union([
1635
- z.string(),
1636
- z.array(
1637
- z.union([
1638
- z.lazy(() => GetPromptVersion21$outboundSchema),
1639
- z.lazy(() => GetPromptVersion22$outboundSchema),
1640
- z.lazy(() => GetPromptVersion23$outboundSchema),
1641
- ]),
1642
- ),
1643
- ]),
1644
- ),
1645
- toolCalls: z.array(z.lazy(() => GetPromptVersionToolCalls$outboundSchema))
1646
- .optional(),
1647
- toolCallId: z.nullable(z.string()).optional(),
1648
- }).transform((v) => {
1649
- return remap$(v, {
1650
- toolCalls: "tool_calls",
1651
- toolCallId: "tool_call_id",
1652
- });
4212
+ role: z.literal("system"),
4213
+ content: z.union([
4214
+ z.string(),
4215
+ z.array(components.TextContentPartSchema$outboundSchema),
4216
+ ]),
4217
+ name: z.string().optional(),
1653
4218
  });
1654
4219
 
1655
- export function getPromptVersionMessagesToJSON(
1656
- getPromptVersionMessages: GetPromptVersionMessages,
4220
+ export function getPromptVersionMessagesSystemMessageToJSON(
4221
+ getPromptVersionMessagesSystemMessage: GetPromptVersionMessagesSystemMessage,
1657
4222
  ): string {
1658
4223
  return JSON.stringify(
1659
- GetPromptVersionMessages$outboundSchema.parse(getPromptVersionMessages),
4224
+ GetPromptVersionMessagesSystemMessage$outboundSchema.parse(
4225
+ getPromptVersionMessagesSystemMessage,
4226
+ ),
1660
4227
  );
1661
4228
  }
1662
- export function getPromptVersionMessagesFromJSON(
4229
+ export function getPromptVersionMessagesSystemMessageFromJSON(
1663
4230
  jsonString: string,
1664
- ): SafeParseResult<GetPromptVersionMessages, SDKValidationError> {
4231
+ ): SafeParseResult<GetPromptVersionMessagesSystemMessage, SDKValidationError> {
1665
4232
  return safeParse(
1666
4233
  jsonString,
1667
- (x) => GetPromptVersionMessages$inboundSchema.parse(JSON.parse(x)),
1668
- `Failed to parse 'GetPromptVersionMessages' from JSON`,
4234
+ (x) =>
4235
+ GetPromptVersionMessagesSystemMessage$inboundSchema.parse(JSON.parse(x)),
4236
+ `Failed to parse 'GetPromptVersionMessagesSystemMessage' from JSON`,
1669
4237
  );
1670
4238
  }
1671
4239
 
1672
4240
  /** @internal */
1673
- export const GetPromptVersionPromptConfig$inboundSchema: z.ZodType<
1674
- GetPromptVersionPromptConfig,
4241
+ export const GetPromptVersionPromptsMessages$inboundSchema: z.ZodType<
4242
+ GetPromptVersionPromptsMessages,
4243
+ z.ZodTypeDef,
4244
+ unknown
4245
+ > = z.union([
4246
+ z.lazy(() => GetPromptVersionMessagesSystemMessage$inboundSchema),
4247
+ z.lazy(() => GetPromptVersionMessagesUserMessage$inboundSchema),
4248
+ z.lazy(() => GetPromptVersionMessagesAssistantMessage$inboundSchema),
4249
+ z.lazy(() => GetPromptVersionMessagesToolMessage$inboundSchema),
4250
+ ]);
4251
+ /** @internal */
4252
+ export type GetPromptVersionPromptsMessages$Outbound =
4253
+ | GetPromptVersionMessagesSystemMessage$Outbound
4254
+ | GetPromptVersionMessagesUserMessage$Outbound
4255
+ | GetPromptVersionMessagesAssistantMessage$Outbound
4256
+ | GetPromptVersionMessagesToolMessage$Outbound;
4257
+
4258
+ /** @internal */
4259
+ export const GetPromptVersionPromptsMessages$outboundSchema: z.ZodType<
4260
+ GetPromptVersionPromptsMessages$Outbound,
4261
+ z.ZodTypeDef,
4262
+ GetPromptVersionPromptsMessages
4263
+ > = z.union([
4264
+ z.lazy(() => GetPromptVersionMessagesSystemMessage$outboundSchema),
4265
+ z.lazy(() => GetPromptVersionMessagesUserMessage$outboundSchema),
4266
+ z.lazy(() => GetPromptVersionMessagesAssistantMessage$outboundSchema),
4267
+ z.lazy(() => GetPromptVersionMessagesToolMessage$outboundSchema),
4268
+ ]);
4269
+
4270
+ export function getPromptVersionPromptsMessagesToJSON(
4271
+ getPromptVersionPromptsMessages: GetPromptVersionPromptsMessages,
4272
+ ): string {
4273
+ return JSON.stringify(
4274
+ GetPromptVersionPromptsMessages$outboundSchema.parse(
4275
+ getPromptVersionPromptsMessages,
4276
+ ),
4277
+ );
4278
+ }
4279
+ export function getPromptVersionPromptsMessagesFromJSON(
4280
+ jsonString: string,
4281
+ ): SafeParseResult<GetPromptVersionPromptsMessages, SDKValidationError> {
4282
+ return safeParse(
4283
+ jsonString,
4284
+ (x) => GetPromptVersionPromptsMessages$inboundSchema.parse(JSON.parse(x)),
4285
+ `Failed to parse 'GetPromptVersionPromptsMessages' from JSON`,
4286
+ );
4287
+ }
4288
+
4289
+ /** @internal */
4290
+ export const GetPromptVersionPromptField$inboundSchema: z.ZodType<
4291
+ GetPromptVersionPromptField,
1675
4292
  z.ZodTypeDef,
1676
4293
  unknown
1677
4294
  > = z.object({
1678
- stream: z.boolean().optional(),
1679
- model: z.string().optional(),
1680
- model_db_id: z.nullable(z.string()).optional(),
1681
- model_type: z.nullable(GetPromptVersionModelType$inboundSchema).optional(),
1682
- model_parameters: z.lazy(() => GetPromptVersionModelParameters$inboundSchema)
4295
+ audio: z.nullable(z.lazy(() => GetPromptVersionAudio$inboundSchema))
1683
4296
  .optional(),
1684
- provider: GetPromptVersionProvider$inboundSchema.optional(),
1685
- integration_id: z.nullable(z.string()).optional(),
4297
+ frequency_penalty: z.nullable(z.number()).optional(),
4298
+ max_tokens: z.nullable(z.number().int()).optional(),
4299
+ max_completion_tokens: z.nullable(z.number().int()).optional(),
4300
+ logprobs: z.nullable(z.boolean()).optional(),
4301
+ top_logprobs: z.nullable(z.number().int()).optional(),
4302
+ n: z.nullable(z.number().int()).optional(),
4303
+ presence_penalty: z.nullable(z.number()).optional(),
4304
+ response_format: z.union([
4305
+ z.lazy(() => GetPromptVersionResponseFormatText$inboundSchema),
4306
+ z.lazy(() => GetPromptVersionResponseFormatJSONObject$inboundSchema),
4307
+ z.lazy(() => GetPromptVersionResponseFormatPromptsJSONSchema$inboundSchema),
4308
+ ]).optional(),
4309
+ reasoning_effort: GetPromptVersionReasoningEffort$inboundSchema.optional(),
4310
+ verbosity: z.string().optional(),
4311
+ seed: z.nullable(z.number()).optional(),
4312
+ stop: z.nullable(z.union([z.string(), z.array(z.string())])).optional(),
4313
+ stream_options: z.nullable(
4314
+ z.lazy(() => GetPromptVersionStreamOptions$inboundSchema),
4315
+ ).optional(),
4316
+ thinking: z.union([
4317
+ components.ThinkingConfigDisabledSchema$inboundSchema,
4318
+ components.ThinkingConfigEnabledSchema$inboundSchema,
4319
+ ]).optional(),
4320
+ temperature: z.nullable(z.number()).optional(),
4321
+ top_p: z.nullable(z.number()).optional(),
4322
+ top_k: z.nullable(z.number()).optional(),
4323
+ tool_choice: z.union([
4324
+ z.lazy(() => GetPromptVersionToolChoice2$inboundSchema),
4325
+ GetPromptVersionToolChoice1$inboundSchema,
4326
+ ]).optional(),
4327
+ parallel_tool_calls: z.boolean().optional(),
4328
+ modalities: z.nullable(z.array(GetPromptVersionModalities$inboundSchema))
4329
+ .optional(),
4330
+ guardrails: z.array(z.lazy(() => GetPromptVersionGuardrails$inboundSchema))
4331
+ .optional(),
4332
+ messages: z.array(
4333
+ z.union([
4334
+ z.lazy(() => GetPromptVersionMessagesSystemMessage$inboundSchema),
4335
+ z.lazy(() => GetPromptVersionMessagesUserMessage$inboundSchema),
4336
+ z.lazy(() => GetPromptVersionMessagesAssistantMessage$inboundSchema),
4337
+ z.lazy(() => GetPromptVersionMessagesToolMessage$inboundSchema),
4338
+ ]),
4339
+ ).optional(),
4340
+ model: z.nullable(z.string()).optional(),
1686
4341
  version: z.string().optional(),
1687
- messages: z.array(z.lazy(() => GetPromptVersionMessages$inboundSchema)),
1688
4342
  }).transform((v) => {
1689
4343
  return remap$(v, {
1690
- "model_db_id": "modelDbId",
1691
- "model_type": "modelType",
1692
- "model_parameters": "modelParameters",
1693
- "integration_id": "integrationId",
4344
+ "frequency_penalty": "frequencyPenalty",
4345
+ "max_tokens": "maxTokens",
4346
+ "max_completion_tokens": "maxCompletionTokens",
4347
+ "top_logprobs": "topLogprobs",
4348
+ "presence_penalty": "presencePenalty",
4349
+ "response_format": "responseFormat",
4350
+ "reasoning_effort": "reasoningEffort",
4351
+ "stream_options": "streamOptions",
4352
+ "top_p": "topP",
4353
+ "top_k": "topK",
4354
+ "tool_choice": "toolChoice",
4355
+ "parallel_tool_calls": "parallelToolCalls",
1694
4356
  });
1695
4357
  });
1696
4358
  /** @internal */
1697
- export type GetPromptVersionPromptConfig$Outbound = {
1698
- stream?: boolean | undefined;
1699
- model?: string | undefined;
1700
- model_db_id?: string | null | undefined;
1701
- model_type?: string | null | undefined;
1702
- model_parameters?: GetPromptVersionModelParameters$Outbound | undefined;
1703
- provider?: string | undefined;
1704
- integration_id?: string | null | undefined;
4359
+ export type GetPromptVersionPromptField$Outbound = {
4360
+ audio?: GetPromptVersionAudio$Outbound | null | undefined;
4361
+ frequency_penalty?: number | null | undefined;
4362
+ max_tokens?: number | null | undefined;
4363
+ max_completion_tokens?: number | null | undefined;
4364
+ logprobs?: boolean | null | undefined;
4365
+ top_logprobs?: number | null | undefined;
4366
+ n?: number | null | undefined;
4367
+ presence_penalty?: number | null | undefined;
4368
+ response_format?:
4369
+ | GetPromptVersionResponseFormatText$Outbound
4370
+ | GetPromptVersionResponseFormatJSONObject$Outbound
4371
+ | GetPromptVersionResponseFormatPromptsJSONSchema$Outbound
4372
+ | undefined;
4373
+ reasoning_effort?: string | undefined;
4374
+ verbosity?: string | undefined;
4375
+ seed?: number | null | undefined;
4376
+ stop?: string | Array<string> | null | undefined;
4377
+ stream_options?: GetPromptVersionStreamOptions$Outbound | null | undefined;
4378
+ thinking?:
4379
+ | components.ThinkingConfigDisabledSchema$Outbound
4380
+ | components.ThinkingConfigEnabledSchema$Outbound
4381
+ | undefined;
4382
+ temperature?: number | null | undefined;
4383
+ top_p?: number | null | undefined;
4384
+ top_k?: number | null | undefined;
4385
+ tool_choice?: GetPromptVersionToolChoice2$Outbound | string | undefined;
4386
+ parallel_tool_calls?: boolean | undefined;
4387
+ modalities?: Array<string> | null | undefined;
4388
+ guardrails?: Array<GetPromptVersionGuardrails$Outbound> | undefined;
4389
+ messages?:
4390
+ | Array<
4391
+ | GetPromptVersionMessagesSystemMessage$Outbound
4392
+ | GetPromptVersionMessagesUserMessage$Outbound
4393
+ | GetPromptVersionMessagesAssistantMessage$Outbound
4394
+ | GetPromptVersionMessagesToolMessage$Outbound
4395
+ >
4396
+ | undefined;
4397
+ model?: string | null | undefined;
1705
4398
  version?: string | undefined;
1706
- messages: Array<GetPromptVersionMessages$Outbound>;
1707
4399
  };
1708
4400
 
1709
4401
  /** @internal */
1710
- export const GetPromptVersionPromptConfig$outboundSchema: z.ZodType<
1711
- GetPromptVersionPromptConfig$Outbound,
4402
+ export const GetPromptVersionPromptField$outboundSchema: z.ZodType<
4403
+ GetPromptVersionPromptField$Outbound,
1712
4404
  z.ZodTypeDef,
1713
- GetPromptVersionPromptConfig
4405
+ GetPromptVersionPromptField
1714
4406
  > = z.object({
1715
- stream: z.boolean().optional(),
1716
- model: z.string().optional(),
1717
- modelDbId: z.nullable(z.string()).optional(),
1718
- modelType: z.nullable(GetPromptVersionModelType$outboundSchema).optional(),
1719
- modelParameters: z.lazy(() => GetPromptVersionModelParameters$outboundSchema)
4407
+ audio: z.nullable(z.lazy(() => GetPromptVersionAudio$outboundSchema))
1720
4408
  .optional(),
1721
- provider: GetPromptVersionProvider$outboundSchema.optional(),
1722
- integrationId: z.nullable(z.string()).optional(),
4409
+ frequencyPenalty: z.nullable(z.number()).optional(),
4410
+ maxTokens: z.nullable(z.number().int()).optional(),
4411
+ maxCompletionTokens: z.nullable(z.number().int()).optional(),
4412
+ logprobs: z.nullable(z.boolean()).optional(),
4413
+ topLogprobs: z.nullable(z.number().int()).optional(),
4414
+ n: z.nullable(z.number().int()).optional(),
4415
+ presencePenalty: z.nullable(z.number()).optional(),
4416
+ responseFormat: z.union([
4417
+ z.lazy(() => GetPromptVersionResponseFormatText$outboundSchema),
4418
+ z.lazy(() => GetPromptVersionResponseFormatJSONObject$outboundSchema),
4419
+ z.lazy(() =>
4420
+ GetPromptVersionResponseFormatPromptsJSONSchema$outboundSchema
4421
+ ),
4422
+ ]).optional(),
4423
+ reasoningEffort: GetPromptVersionReasoningEffort$outboundSchema.optional(),
4424
+ verbosity: z.string().optional(),
4425
+ seed: z.nullable(z.number()).optional(),
4426
+ stop: z.nullable(z.union([z.string(), z.array(z.string())])).optional(),
4427
+ streamOptions: z.nullable(
4428
+ z.lazy(() => GetPromptVersionStreamOptions$outboundSchema),
4429
+ ).optional(),
4430
+ thinking: z.union([
4431
+ components.ThinkingConfigDisabledSchema$outboundSchema,
4432
+ components.ThinkingConfigEnabledSchema$outboundSchema,
4433
+ ]).optional(),
4434
+ temperature: z.nullable(z.number()).optional(),
4435
+ topP: z.nullable(z.number()).optional(),
4436
+ topK: z.nullable(z.number()).optional(),
4437
+ toolChoice: z.union([
4438
+ z.lazy(() => GetPromptVersionToolChoice2$outboundSchema),
4439
+ GetPromptVersionToolChoice1$outboundSchema,
4440
+ ]).optional(),
4441
+ parallelToolCalls: z.boolean().optional(),
4442
+ modalities: z.nullable(z.array(GetPromptVersionModalities$outboundSchema))
4443
+ .optional(),
4444
+ guardrails: z.array(z.lazy(() => GetPromptVersionGuardrails$outboundSchema))
4445
+ .optional(),
4446
+ messages: z.array(
4447
+ z.union([
4448
+ z.lazy(() => GetPromptVersionMessagesSystemMessage$outboundSchema),
4449
+ z.lazy(() => GetPromptVersionMessagesUserMessage$outboundSchema),
4450
+ z.lazy(() => GetPromptVersionMessagesAssistantMessage$outboundSchema),
4451
+ z.lazy(() => GetPromptVersionMessagesToolMessage$outboundSchema),
4452
+ ]),
4453
+ ).optional(),
4454
+ model: z.nullable(z.string()).optional(),
1723
4455
  version: z.string().optional(),
1724
- messages: z.array(z.lazy(() => GetPromptVersionMessages$outboundSchema)),
1725
4456
  }).transform((v) => {
1726
4457
  return remap$(v, {
1727
- modelDbId: "model_db_id",
1728
- modelType: "model_type",
1729
- modelParameters: "model_parameters",
1730
- integrationId: "integration_id",
4458
+ frequencyPenalty: "frequency_penalty",
4459
+ maxTokens: "max_tokens",
4460
+ maxCompletionTokens: "max_completion_tokens",
4461
+ topLogprobs: "top_logprobs",
4462
+ presencePenalty: "presence_penalty",
4463
+ responseFormat: "response_format",
4464
+ reasoningEffort: "reasoning_effort",
4465
+ streamOptions: "stream_options",
4466
+ topP: "top_p",
4467
+ topK: "top_k",
4468
+ toolChoice: "tool_choice",
4469
+ parallelToolCalls: "parallel_tool_calls",
1731
4470
  });
1732
4471
  });
1733
4472
 
1734
- export function getPromptVersionPromptConfigToJSON(
1735
- getPromptVersionPromptConfig: GetPromptVersionPromptConfig,
4473
+ export function getPromptVersionPromptFieldToJSON(
4474
+ getPromptVersionPromptField: GetPromptVersionPromptField,
1736
4475
  ): string {
1737
4476
  return JSON.stringify(
1738
- GetPromptVersionPromptConfig$outboundSchema.parse(
1739
- getPromptVersionPromptConfig,
4477
+ GetPromptVersionPromptField$outboundSchema.parse(
4478
+ getPromptVersionPromptField,
1740
4479
  ),
1741
4480
  );
1742
4481
  }
1743
- export function getPromptVersionPromptConfigFromJSON(
4482
+ export function getPromptVersionPromptFieldFromJSON(
1744
4483
  jsonString: string,
1745
- ): SafeParseResult<GetPromptVersionPromptConfig, SDKValidationError> {
4484
+ ): SafeParseResult<GetPromptVersionPromptField, SDKValidationError> {
1746
4485
  return safeParse(
1747
4486
  jsonString,
1748
- (x) => GetPromptVersionPromptConfig$inboundSchema.parse(JSON.parse(x)),
1749
- `Failed to parse 'GetPromptVersionPromptConfig' from JSON`,
4487
+ (x) => GetPromptVersionPromptField$inboundSchema.parse(JSON.parse(x)),
4488
+ `Failed to parse 'GetPromptVersionPromptField' from JSON`,
1750
4489
  );
1751
4490
  }
1752
4491
 
@@ -1828,7 +4567,9 @@ export const GetPromptVersionResponseBody$inboundSchema: z.ZodType<
1828
4567
  created_by_id: z.nullable(z.string()).optional(),
1829
4568
  updated_by_id: z.nullable(z.string()).optional(),
1830
4569
  description: z.nullable(z.string()).optional(),
1831
- prompt_config: z.lazy(() => GetPromptVersionPromptConfig$inboundSchema),
4570
+ prompt_config: z.lazy(() => GetPromptVersionPromptConfig$inboundSchema)
4571
+ .optional(),
4572
+ prompt: z.lazy(() => GetPromptVersionPromptField$inboundSchema),
1832
4573
  metadata: z.lazy(() => GetPromptVersionMetadata$inboundSchema).optional(),
1833
4574
  timestamp: z.string(),
1834
4575
  }).transform((v) => {
@@ -1845,7 +4586,8 @@ export type GetPromptVersionResponseBody$Outbound = {
1845
4586
  created_by_id?: string | null | undefined;
1846
4587
  updated_by_id?: string | null | undefined;
1847
4588
  description?: string | null | undefined;
1848
- prompt_config: GetPromptVersionPromptConfig$Outbound;
4589
+ prompt_config?: GetPromptVersionPromptConfig$Outbound | undefined;
4590
+ prompt: GetPromptVersionPromptField$Outbound;
1849
4591
  metadata?: GetPromptVersionMetadata$Outbound | undefined;
1850
4592
  timestamp: string;
1851
4593
  };
@@ -1860,7 +4602,9 @@ export const GetPromptVersionResponseBody$outboundSchema: z.ZodType<
1860
4602
  createdById: z.nullable(z.string()).optional(),
1861
4603
  updatedById: z.nullable(z.string()).optional(),
1862
4604
  description: z.nullable(z.string()).optional(),
1863
- promptConfig: z.lazy(() => GetPromptVersionPromptConfig$outboundSchema),
4605
+ promptConfig: z.lazy(() => GetPromptVersionPromptConfig$outboundSchema)
4606
+ .optional(),
4607
+ prompt: z.lazy(() => GetPromptVersionPromptField$outboundSchema),
1864
4608
  metadata: z.lazy(() => GetPromptVersionMetadata$outboundSchema).optional(),
1865
4609
  timestamp: z.string(),
1866
4610
  }).transform((v) => {