I'm looking for a way to solve the following scenario using Rivescript and Python. The chatbot has no answer to a question, in this case it asks the user for the correct answer and records it in the rivescript file.
Do you have an idea? Does it even work in Rivescript?
Best wishes Oliver
This can be done with a little bit of creativity. Self-learning bots aren't an officially supported feature in RiveScript, but you can get something to work using object macros that write new replies out to
.rive files to grow the bot's brain over time.
RiveScript Playground example you can test in your web browser: https://play.rivescript.com/s/0r4ZYvklR9
The basic ideas are:
+ when i say * you say *allows the user to teach the bot a new reply.
rs.set_uservar(username, "origMessage", message)
when i say * you say *trigger re-parses the user's message to get the original punctuation and formatting they used.
learned.rivefile and also calls
stream()to load the new reply for immediate use by the bot "right now."
origMessage variable: if the program did not set the variable, the learned reply is just somewhat limited to only include simple text with very few punctuation symbols preserved.