Language to simplify chatbot script development
Contents
Note: you can install this package inside a virtual environment too ;)
-
Go to WFC releases and download the most recent release
-
Install the package with pip3, since this tool is writen using Python3
$ pip3 install /path/to/wfc-X.Y.zip
With the snipet shown at Hello World section do:
$ python -m wfc < hello.flow > hello.yaml
Or:
$ wfc < hello.flow > hello.json
And you'll get a new file hello.json
with this contents:
{
"version": "2.1.0",
"flows": [
{
"name": "helloWorld",
"actions": [
{
"send_text": {
"text": "Hello World, I am a Bot!"
},
"id": "15f644f7-69da-4278-91ab-f7284c9b93a7"
}
]
}
]
}
Or:
$ wfc -v 2.2.0 < hello.flow > hello.json
And you'll get a new file hello.json
with this contents:
{
"version": "2.2.0",
"flows": [
{
"name": "helloWorld",
"actions": [
{
"send_text": {
"text": "Hello World, I am a Bot!"
},
"id": "324e027c-7beb-42eb-b2ab-6f27c0ff757a"
}
]
}
]
}
There are some command line options available
-o
or--output
specifies an output path to use rather than the standard output-q
or--quiet
runs the compiler in quiet mode, so it won't display any error message-v
or--outversion
specifies the output version format, currently it supports script versions 2.1.0 and 2.2.0. see output versions for details.-w
or--workdir
sets the working directory, its the fault value is the current work directory-h
or--help
displays help information-V
or--version
displays the version number
Examples:
$ wfc -o my-bot.json module1.flow module2.flow main.flow
$ wfc -v 2.2.0 -o my-bot.json module1.flow module2.flow main.flow
flow helloWorld do
say 'Hello World, I am a Bot!'
done
For more details about Wizeline Flow, see the language reference