class Multiwoven::Integrations::Source::OpenAI::Client

def process_response(response)

def process_response(response)
  if success?(response)
    data = JSON.parse(response.body)
    [RecordMessage.new(data: data, emitted_at: Time.now.to_i).to_multiwoven_message]
  else
    create_log_message("OPEN AI:RUN_MODEL", "error", "request failed: #{response.body}")
  end
rescue StandardError => e
  handle_exception(e, { context: "OPEN AI:PROCESS_RESPONSE:EXCEPTION", type: "error" })
end