This repository has been archived by the owner on May 7, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Message
Ben edited this page Mar 13, 2016
·
4 revisions
With wit_bot, a message is a text query that can be sent to wit.ai for processing (it's pretty much the entire purpose of wit_bot).
Create a message:
message = WitBot::Message.new WitBot.thread, "This is a cool test.", id: SecureRandom.uuid
message = WitBot::Message.new "This is a cool test." # thread and id are by default the values I gave above
message = WitBot.thread.create_message "This is a cool test." # you can create messages off of threads
message = WitBot.create_message "This is a cool test." # Same as above.
Once you've done so, you can send it to wit.ai for processing:
message.send
After that's done, the follow attributes are set:
message._text #=> the text wit.ai interpreted the message as.
message.id #=> the id of the message wit.ai sent back
message.sent #=> true
message._outcomes #=> raw outcomes
message.outcomes #=> outcomes
message.outcome #=> most probable outcome
Down here?
Cool.
I should add something somewhat interesting for you to read...
Here's how to get started with wit_bot in 3 steps:
- Learn how to use wit.ai
- Learn how to setup the gem
- Learn how to send a message
- Learn how to use message threads
- Learn how to use context
- Learn how to use conversations
- Learn to use the REPL
- Learn how to use conversations
- Learn how to use participants
- Learn how to use bots