Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

165 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MORZE-SCRIPT-ENGINE

Run

gem install bundler

bundle install

chmod +x bin/console

bin/console

examples in console_data/

Supported types

  • Intent
  • Text (regexp, one from array, full equals)
  • Answer
  • Condition
  • Global fallback

While working with intents you need to set AI_HOST variable (example: AI_HOST=http://localhost:8000) in .env file for connecting to morzebot-ai-v2 service

Documentation

You need to configure your script via json config. Every block has key type

type

{
  "type": "text"
}

data

Every block can have different data.

Available fields:

  • "root" - first column block
  • "global" - can be called from any flow
  • "to_start" - after success return to start
  • "<type of block>" - for example "intent": { ...
{
  "data": {
    "root": true,
    "global": false,
    "intent": {
      "content": "test content"
    }
  }
}

"<type of block>" available fields:

intent

"content": "<name of intent>"

text

text block has 3 compare_types of content

"content": "<regexp string | array of strings | string>"

"compare_type": "<regexp | from_array | one>"

  • regexp - match by regular expression
  • from_array - choose one from array
  • one - compare with string

answer

empty

condition

"content": "<array of conditons ([[cond, next_block_id ], ...])>"

example "content": [["$sent == 'да'", "next_block_id_1"]]

$sent - reserved variable which contains user sentence

in future will be other variables

global_fallback

key must be "__fallback__"! move to this block after failed execution as default

caption_before

{
    "caption_before": "test"
}

send text before successful block executing

caption_after

{
    "caption_after": "test"
}

send text after successful block executing

next_block_id

{
    "next_block_id": "next_block_id_test"
}

move to next block after successful executing

fallback_id

{
    "fallback_id": "fallback_id_1"
}

move to fallback block after failed executing

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages