Skip to content

skit-ai/ink-simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ink Simulator

This is a basic flow simulator for flows written in ink.

Building

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.

Running

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.

Writing flows

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:

  1. 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.
  2. 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.
  3. For down weighing probability of certain choice, add a tag like p:0.4 to it. Default assumption is of p: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.

Releases

No releases published

Packages

No packages published