Class: Mocodo::KnowledgeQA
Constant Summary collapse
- EndPoint =
"/knowledgeQA/v1/ask"
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
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 |