class RubyLLM::Providers::OpenAI

def format_tool_calls(tool_calls)

def format_tool_calls(tool_calls)
  return nil unless tool_calls&.any?
  tool_calls.map do |_, tc|
    {
      id: tc.id,
      type: 'function',
      function: {
        name: tc.name,
        arguments: JSON.generate(tc.arguments)
      }
    }
  end
end