Is it possible to access the object macros internally in RiveScript? I'm bit confused with that. I have defined the following script:
> object small python
return "4"
< object
+ small
- <call>small</call>
Which gives me an error when I enter small
:
error: [ERR: Object Not Found]
The definition of the
object
seems to be ok, but you are probably running it from https://play.rivescript.com/ or https://www.rivescript.com/try, which only allow JavaScript or CoffeeScript (see the about page).You can use rivescript-python to run the code, which you can install by:
Then put your rivescript in a file (
.rive
), for example, inhelloworld.rive
.Then in python:
Now you can use
bot.reply
to get the answer for a certain input:Edit: I have tested this code on Ubuntu 14.04 with Python 3.4.3 and Python 2.7.12 and rivescript 1.14.4.