@@ -241,7 +241,8 @@ def initialize(dialect_klass, gateway_klass, llm_model, gateway: nil)
241
241
# @param feature_context { Hash - Optional } - The feature context to use for the completion.
242
242
# @param partial_tool_calls { Boolean - Optional } - If true, the completion will return partial tool calls.
243
243
# @param output_thinking { Boolean - Optional } - If true, the completion will return the thinking output for thinking models.
244
- # @param extra_model_params { Hash - Optional } - Other params that are not available accross models. e.g. response_format JSON schema.
244
+ # @param response_format { Hash - Optional } - JSON schema passed to the API as the desired structured output.
245
+ # @param [Experimental] extra_model_params { Hash - Optional } - Other params that are not available accross models. e.g. response_format JSON schema.
245
246
#
246
247
# @param &on_partial_blk { Block - Optional } - The passed block will get called with the LLM partial response alongside a cancel function.
247
248
#
@@ -259,6 +260,7 @@ def generate(
259
260
feature_context : nil ,
260
261
partial_tool_calls : false ,
261
262
output_thinking : false ,
263
+ response_format : nil ,
262
264
extra_model_params : nil ,
263
265
&partial_read_blk
264
266
)
@@ -274,6 +276,7 @@ def generate(
274
276
feature_context : feature_context ,
275
277
partial_tool_calls : partial_tool_calls ,
276
278
output_thinking : output_thinking ,
279
+ response_format : response_format ,
277
280
extra_model_params : extra_model_params ,
278
281
} ,
279
282
)
@@ -282,6 +285,7 @@ def generate(
282
285
283
286
model_params [ :temperature ] = temperature if temperature
284
287
model_params [ :top_p ] = top_p if top_p
288
+ model_params [ :response_format ] = response_format if response_format
285
289
model_params . merge! ( extra_model_params ) if extra_model_params
286
290
287
291
if prompt . is_a? ( String )
0 commit comments