module RasaCore::ResponseFormatter

Public Instance Methods

format_response_body(body, frmt) click to toggle source
# File lib/rasa_core/response_formatter.rb, line 3
def format_response_body(body, frmt)
  if [:no_format, :json].include?(frmt)
    body
  else
    JSON.parse(body || '{}', object_class: OpenStruct)
  end
end