diff --git a/lib/ruby_llm/providers/openai/chat.rb b/lib/ruby_llm/providers/openai/chat.rb index 98151e0e6..9ed7e170b 100644 --- a/lib/ruby_llm/providers/openai/chat.rb +++ b/lib/ruby_llm/providers/openai/chat.rb @@ -21,10 +21,7 @@ def render_payload(messages, tools:, temperature:, model:, stream: false, schema # Only include temperature if it's not nil (some models don't accept it) payload[:temperature] = temperature unless temperature.nil? - if tools.any? - payload[:tools] = tools.map { |_, tool| tool_for(tool) } - payload[:tool_choice] = 'auto' - end + payload[:tools] = tools.map { |_, tool| tool_for(tool) } if tools.any? if schema # Use strict mode from schema if specified, default to true