DEV: Support for extra model params in LLM completions (#1208)

This will be useful to start experiment with non-standard features like
structured outputs.
This commit is contained in:
Rafael dos Santos Silva 2025-03-21 13:49:23 -03:00 committed by GitHub
parent 01eced74a3
commit 0e2dd7378f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

@ -258,6 +258,7 @@ module DiscourseAi
feature_context: nil,
partial_tool_calls: false,
output_thinking: false,
extra_model_params: nil,
&partial_read_blk
)
self.class.record_prompt(
@ -272,6 +273,7 @@ module DiscourseAi
feature_context: feature_context,
partial_tool_calls: partial_tool_calls,
output_thinking: output_thinking,
extra_model_params: extra_model_params,
},
)
@ -279,6 +281,7 @@ module DiscourseAi
model_params[:temperature] = temperature if temperature
model_params[:top_p] = top_p if top_p
model_params.merge!(extra_model_params) if extra_model_params
if prompt.is_a?(String)
prompt =