Class: Mocodo::KnowledgeQA

Inherits:
Base
  • Object
show all
Defined in:
lib/mocodo/knowledge_qa.rb

Constant Summary collapse

EndPoint =
"/knowledgeQA/v1/ask"

Constants inherited from Base

Base::BaseURL

Instance Attribute Summary

Attributes inherited from Base

#api_key, #response

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Mocodo::Base

Instance Method Details

#create_qa(text) ⇒ Object



5
6
7
8
# File 'lib/mocodo/knowledge_qa.rb', line 5

def create_qa text
  uri = build_url(EndPoint, q: URI.encode(text))
  JSON.parse(open(uri).read)
end