@eggplantio/eai-model
v4.0.1
Published
Library to create and modify Eggplant AI models
Downloads
1,715
Readme
EGGPLANT AI MODEL
Library to create and manipulate Eggplant AI models.
Quick start
To create a blank model and add a bunch of state/actions to it:
import { createAction } from 'eai-model/action'
import { createState, STATE_TYPES } from 'eai-model/state'
import { createModel, addState, addAction, connect } from 'eai-model/model'
let m = createModel('foo')
const s = createState('Login', STATE_TYPES.normal)
m = addState(m, s)
const a1 = createAction('Enter username', s.id)
m = addAction(m, a1)
const a2 = createAction('Enter password', s.id)
m = addAction(m, a2)
const a3 = createAction('Submit', s.id)
m = addAction(m, a3)
const s2 = createState('Search')
m = addState(s2)
m = connect(m, a3.id, s2.id)