SeedVault / rhizome

conversational bot engine created by Botanic/SEED team
https://seedtoken.io
Other
7 stars 2 forks source link

Add .Flow v2 math functions and algebraic operators #9

Open nicolasbotanic opened 5 years ago

nicolasbotanic commented 5 years ago

Please check https://github.com/SeedVault/flow "Algebraic operators and mathematical functions" section. You will see all .Flow v2 instructions needed to gain math features.

You can see the code of others simple .Flow instructions in file engines/dotflow2/core_functions.py methods df2_eq, df2_gt, df2_lt, etc... Add the code in this file.

You can easily test .Flow v2 instructions using the provided console:

BBOT_ENV=development python -m channels.console.app joe testbot 1 nodebug

This will enter to the provided demo bot's console as userid "joe" You can run any .Flow instruction with the command df2:

Expected result with $add:

You: :df2 add(2, 2, 2)
Testbot: 6

And so on...

It is welcomed and encouraged to add more instructions than what we have in the documentation