This is a basic flow simulator for flows written in ink.
We depend on dlls
from this version of ink repository. The same are bundled here
in ./lib
. For building on Linux (only system supported) you will need mono
. Once
you have it, run make
.
After building, you will get a binary with name InkSimulator.exe
which can be
executed against an ink flow along with a number of dialogs n
to generate as
follows:
env MONO_PATH=./lib mono InkSimulator.exe ./resources/flow.ink 20 | jq | head -20
{ "637066816526499910": [ { "tid": "637066816526499910:0", "type": "M", "text": "Hello, I am an automated assistant. How can I help you?" }, { "tid": "637066816526499910:1", "type": "U", "text": "change object_to_change[:address_kind physical]" }, { "tid": "637066816526499910:2", "type": "M", "text": "Your bank branch can help you with this How can I help you?" }, { "tid": "637066816526499910:3", "type": "U",
Texts for U
(user) turns are supposed to be plt
parseable assertions.
While we rely on ink’s runtime engine and so support all the features it has, we also have certain conventions so that we end up generating useful data. Here is a list:
- For choices, use plt style assertions specified in
[]
. First text after the assertion is ignored as we don’t care about the templated version of user’s text. Note that you might need to escape extra square brackets. See flows in./resources
directory for examples. - If you, as a user, want to say pass to a choice, write
null
as its entry (again, see examples in./resources
). This is needed when we want to use a cascade of choice to represent multiple inputs from user. - For down weighing probability of certain choice, add a tag like
p:0.4
to it. Default assumption is ofp:1.0
. The mechanism for probability based picking is to first pick a branch at random and then accept the outcome using the tagged probability.