rubocop fix

This commit is contained in:
Jarek Radosz 2025-06-20 23:56:59 +02:00
parent 3cb3557840
commit b809d723a8
No known key found for this signature in database
GPG Key ID: 98C198E7019429B3

View File

@ -50,16 +50,16 @@ module DiscourseAi
# We buffer and return tool invocations in one go. # We buffer and return tool invocations in one go.
as_array = response.is_a?(Array) ? response : [response] as_array = response.is_a?(Array) ? response : [response]
as_array.each do |response| as_array.each do |_response|
if is_tool?(response) if is_tool?(_response)
yield(response, cancel_fn) yield(_response, cancel_fn)
elsif is_thinking?(response) elsif is_thinking?(_response)
yield(response, cancel_fn) yield(_response, cancel_fn)
elsif model_params[:response_format].present? elsif model_params[:response_format].present?
structured_output = as_structured_output(response) structured_output = as_structured_output(_response)
yield(structured_output, cancel_fn) yield(structured_output, cancel_fn)
else else
response.each_char do |char| _response.each_char do |char|
break if cancelled break if cancelled
yield(char, cancel_fn) yield(char, cancel_fn)
end end