Method: NLPCloud::Client#chatbot

Defined in:
lib/nlpcloud.rb

#chatbot(text, context: nil, history: nil) ⇒ Object



70
71
72
73
74
75
76
77
78
# File 'lib/nlpcloud.rb', line 70

def chatbot(text, context: nil, history: nil)
  payload = {
    'text' => text,
    'context' => context,
    'history' => history
  }
  response = RestClient.post("#{@root_url}/chatbot", payload.to_json, @headers)
  JSON.parse(response.body)
end