module OpenAI::HTTP

def multipart_parameters(parameters)

def multipart_parameters(parameters)
  parameters&.transform_values do |value|
    next value unless value.respond_to?(:close) # File or IO object.
    # Doesn't seem like OpenAI needs mime_type yet, so not worth
    # the library to figure this out. Hence the empty string
    # as the second argument.
    Faraday::UploadIO.new(value, "", value.path)
  end
end