@@ -63,11 +63,11 @@ export type ChatGenerationParamsResponseFormatText = {
6363} ;
6464
6565export type ChatGenerationParamsResponseFormatUnion =
66- | ResponseFormatJSONSchema
67- | ResponseFormatTextGrammar
68- | ChatGenerationParamsResponseFormatText
69- | ChatGenerationParamsResponseFormatJSONObject
70- | ChatGenerationParamsResponseFormatPython ;
66+ | ( ResponseFormatJSONSchema & { type : "json_schema" } )
67+ | ( ResponseFormatTextGrammar & { type : "grammar" } )
68+ | ( ChatGenerationParamsResponseFormatText & { type : "text" } )
69+ | ( ChatGenerationParamsResponseFormatJSONObject & { type : "json_object" } )
70+ | ( ChatGenerationParamsResponseFormatPython & { type : "python" } ) ;
7171
7272export type ChatGenerationParamsStop = string | Array < string > ;
7373
@@ -85,11 +85,11 @@ export type ChatGenerationParams = {
8585 presencePenalty ?: number | null | undefined ;
8686 reasoning ?: Reasoning | undefined ;
8787 responseFormat ?:
88- | ResponseFormatJSONSchema
89- | ResponseFormatTextGrammar
90- | ChatGenerationParamsResponseFormatText
91- | ChatGenerationParamsResponseFormatJSONObject
92- | ChatGenerationParamsResponseFormatPython
88+ | ( ResponseFormatJSONSchema & { type : "json_schema" } )
89+ | ( ResponseFormatTextGrammar & { type : "grammar" } )
90+ | ( ChatGenerationParamsResponseFormatText & { type : "text" } )
91+ | ( ChatGenerationParamsResponseFormatJSONObject & { type : "json_object" } )
92+ | ( ChatGenerationParamsResponseFormatPython & { type : "python" } )
9393 | undefined ;
9494 seed ?: number | null | undefined ;
9595 stop ?: string | Array < string > | null | undefined ;
@@ -200,22 +200,34 @@ export function chatGenerationParamsResponseFormatTextToJSON(
200200
201201/** @internal */
202202export type ChatGenerationParamsResponseFormatUnion$Outbound =
203- | ResponseFormatJSONSchema$Outbound
204- | ResponseFormatTextGrammar$Outbound
205- | ChatGenerationParamsResponseFormatText$Outbound
206- | ChatGenerationParamsResponseFormatJSONObject$Outbound
207- | ChatGenerationParamsResponseFormatPython$Outbound ;
203+ | ( ResponseFormatJSONSchema$Outbound & { type : "json_schema" } )
204+ | ( ResponseFormatTextGrammar$Outbound & { type : "grammar" } )
205+ | ( ChatGenerationParamsResponseFormatText$Outbound & { type : "text" } )
206+ | ( ChatGenerationParamsResponseFormatJSONObject$Outbound & {
207+ type : "json_object" ;
208+ } )
209+ | ( ChatGenerationParamsResponseFormatPython$Outbound & { type : "python" } ) ;
208210
209211/** @internal */
210212export const ChatGenerationParamsResponseFormatUnion$outboundSchema : z . ZodType <
211213 ChatGenerationParamsResponseFormatUnion$Outbound ,
212214 ChatGenerationParamsResponseFormatUnion
213215> = z . union ( [
214- ResponseFormatJSONSchema$outboundSchema ,
215- ResponseFormatTextGrammar$outboundSchema ,
216- z . lazy ( ( ) => ChatGenerationParamsResponseFormatText$outboundSchema ) ,
217- z . lazy ( ( ) => ChatGenerationParamsResponseFormatJSONObject$outboundSchema ) ,
218- z . lazy ( ( ) => ChatGenerationParamsResponseFormatPython$outboundSchema ) ,
216+ ResponseFormatJSONSchema$outboundSchema . and (
217+ z . object ( { type : z . literal ( "json_schema" ) } ) ,
218+ ) ,
219+ ResponseFormatTextGrammar$outboundSchema . and (
220+ z . object ( { type : z . literal ( "grammar" ) } ) ,
221+ ) ,
222+ z . lazy ( ( ) => ChatGenerationParamsResponseFormatText$outboundSchema ) . and (
223+ z . object ( { type : z . literal ( "text" ) } ) ,
224+ ) ,
225+ z . lazy ( ( ) => ChatGenerationParamsResponseFormatJSONObject$outboundSchema ) . and (
226+ z . object ( { type : z . literal ( "json_object" ) } ) ,
227+ ) ,
228+ z . lazy ( ( ) => ChatGenerationParamsResponseFormatPython$outboundSchema ) . and (
229+ z . object ( { type : z . literal ( "python" ) } ) ,
230+ ) ,
219231] ) ;
220232
221233export function chatGenerationParamsResponseFormatUnionToJSON (
@@ -261,11 +273,13 @@ export type ChatGenerationParams$Outbound = {
261273 presence_penalty ?: number | null | undefined ;
262274 reasoning ?: Reasoning$Outbound | undefined ;
263275 response_format ?:
264- | ResponseFormatJSONSchema$Outbound
265- | ResponseFormatTextGrammar$Outbound
266- | ChatGenerationParamsResponseFormatText$Outbound
267- | ChatGenerationParamsResponseFormatJSONObject$Outbound
268- | ChatGenerationParamsResponseFormatPython$Outbound
276+ | ( ResponseFormatJSONSchema$Outbound & { type : "json_schema" } )
277+ | ( ResponseFormatTextGrammar$Outbound & { type : "grammar" } )
278+ | ( ChatGenerationParamsResponseFormatText$Outbound & { type : "text" } )
279+ | ( ChatGenerationParamsResponseFormatJSONObject$Outbound & {
280+ type : "json_object" ;
281+ } )
282+ | ( ChatGenerationParamsResponseFormatPython$Outbound & { type : "python" } )
269283 | undefined ;
270284 seed ?: number | null | undefined ;
271285 stop ?: string | Array < string > | null | undefined ;
@@ -296,11 +310,20 @@ export const ChatGenerationParams$outboundSchema: z.ZodType<
296310 presencePenalty : z . nullable ( z . number ( ) ) . optional ( ) ,
297311 reasoning : z . lazy ( ( ) => Reasoning$outboundSchema ) . optional ( ) ,
298312 responseFormat : z . union ( [
299- ResponseFormatJSONSchema$outboundSchema ,
300- ResponseFormatTextGrammar$outboundSchema ,
301- z . lazy ( ( ) => ChatGenerationParamsResponseFormatText$outboundSchema ) ,
302- z . lazy ( ( ) => ChatGenerationParamsResponseFormatJSONObject$outboundSchema ) ,
303- z . lazy ( ( ) => ChatGenerationParamsResponseFormatPython$outboundSchema ) ,
313+ ResponseFormatJSONSchema$outboundSchema . and (
314+ z . object ( { type : z . literal ( "json_schema" ) } ) ,
315+ ) ,
316+ ResponseFormatTextGrammar$outboundSchema . and (
317+ z . object ( { type : z . literal ( "grammar" ) } ) ,
318+ ) ,
319+ z . lazy ( ( ) => ChatGenerationParamsResponseFormatText$outboundSchema ) . and (
320+ z . object ( { type : z . literal ( "text" ) } ) ,
321+ ) ,
322+ z . lazy ( ( ) => ChatGenerationParamsResponseFormatJSONObject$outboundSchema )
323+ . and ( z . object ( { type : z . literal ( "json_object" ) } ) ) ,
324+ z . lazy ( ( ) => ChatGenerationParamsResponseFormatPython$outboundSchema ) . and (
325+ z . object ( { type : z . literal ( "python" ) } ) ,
326+ ) ,
304327 ] ) . optional ( ) ,
305328 seed : z . nullable ( z . int ( ) ) . optional ( ) ,
306329 stop : z . nullable ( z . union ( [ z . string ( ) , z . array ( z . string ( ) ) ] ) ) . optional ( ) ,
0 commit comments