Const formations
formations: ReadonlyMap<string, IFormationImmutable<INodeImmutable>> = new FormationMap<INodeImmutable>([{id: welcome,discourse: {type: DiscourseType.Statement,statement: new NodeText('Welcome!'),},link: {type: LinkType.Direct,id: description,},},{id: description,discourse: {type: DiscourseType.Statement,statement: new NodeText('This is the demo conversation tree.'),},link: {type: LinkType.Direct,id: intents,},},{id: intents,discourse: {type: DiscourseType.Expected,statement: new NodeText('What would you like to learn about today?'),suggestions: [new NodeText('Animals πΈ'), new NodeText('Spoken Words π£οΈ'), new NodeText('Cars π')],expected: [new TargetIntent('animals'),new TargetIntent('spoken words'),new TargetIntent('cars'),],},link: {type: LinkType.Conditional,conditions: {'response.intent.animals.confidence > 0.5': animals,'response.intent.spokenWords.confidence > 0.5': spokenWords,'response.intent.cars.confidence > 0.5': cars,},fallback: intents,},},{id: animals,discourse: {type: DiscourseType.Statement,statement: new NodeText('Here are some questions about animals πΊπ΅π§π¦π€π¦π‘π¦π¦π¦π'),},link: {type: LinkType.Direct,id: dogImage,},},{id: dogImage,discourse: {type: DiscourseType.Statement,statement: new NodeImage({url: 'https://farm7.staticflickr.com/6053/6312937936_cebaf2feb9_z_d.jpg',aspect: 640 / 427,}),},link: {type: LinkType.Direct,id: dog,},},{id: dog,discourse: {type: DiscourseType.Expected,statement: new NodeText('What animal is in the image?'),suggestions: [new NodeText('Monkey'), new NodeText('Dog'), new NodeText('Emu')],expected: [new TargetMeaning('dog'),],},meta: {features: ['question'],},link: {type: LinkType.Conditional,conditions: {'response.meaning.dog.confidence > 0.5': success(catImage),},fallback: failure(dogImage),},},{id: catImage,discourse: {type: DiscourseType.Statement,statement: new NodeImage({url: 'https://farm6.staticflickr.com/5070/5621803163_5772be9d8c_z_d.jpg',aspect: 640 / 480,}),},link: {type: LinkType.Direct,id: cat,},},{id: cat,discourse: {type: DiscourseType.Expected,statement: new NodeText('Can you identify the animal above?'),suggestions: [new NodeText('Cat'), new NodeText('Dog'), new NodeText('Elephant')],expected: [new TargetMeaning('cat'),],},meta: {features: ['question'],},link: {type: LinkType.Conditional,conditions: {'response.meaning.cat.confidence > 0.5': success(loop),},fallback: failure(catImage),},},{id: spokenWords,discourse: {type: DiscourseType.Statement,statement: new NodeText('Let\'s listen to some spoken words!'),},link: {type: LinkType.Direct,id: oneSmallStepForMan,},},{id: oneSmallStepForMan,discourse: {type: DiscourseType.Expected,statement: new NodeAudio({url: 'https://www.nasa.gov/mp3/590331main_ringtone_smallStep.mp3',start: 4000,end: 6500,}),suggestions: [new NodeText('One Small Step for (a) Man'),new NodeText('a Giant Leap for Mankind'),],expected: [new TargetMeaning('step'),],},link: {type: LinkType.Conditional,conditions: {'response.meaning.step.confidence > 0.5': success(houstonWeveHadAProblem),},fallback: failure(oneSmallStepForMan),},},{id: houstonWeveHadAProblem,discourse: {type: DiscourseType.Expected,statement: new NodeAudio({url: 'https://www.nasa.gov/mp3/574928main_houston_problem.mp3',start: 5000,end: 7000,}),suggestions: [new NodeText('Houston, we\'ve had a problem'),new NodeText('Houston, we need ice cream'),],expected: [new TargetMeaning('problem'),],},link: {type: LinkType.Conditional,conditions: {'response.meaning.problem.confidence > 0.5': success(loop),},fallback: failure(houstonWeveHadAProblem),},},{id: loop,discourse: {type: DiscourseType.Statement,statement: new NodeText('Now we will loop back to the beginning!'),},link: {type: LinkType.Direct,id: welcome,},},{id: oops,discourse: {type: DiscourseType.Statement,statement: new NodeText('Oops, that\'s not rightβ¦'),},link: {type: LinkType.Direct,id: welcome,},},{id: tryAgain,discourse: {type: DiscourseType.Statement,statement: new NodeText('Hmm, try again π€'),},link: {type: LinkType.Direct,id: welcome,},},{id: haveAnotherGo,discourse: {type: DiscourseType.Statement,statement: new NodeText('Have another go, that wasn\'t the right answer!'),},link: {type: LinkType.Direct,id: welcome,},},{id: incorrect,discourse: {type: DiscourseType.Statement,statement: new NodeText('Incorrect π'),},link: {type: LinkType.Direct,id: welcome,},},{id: yep,discourse: {type: DiscourseType.Statement,statement: new NodeText('Yep π€©'),},link: {type: LinkType.Direct,id: welcome,},},{id: wellDone,discourse: {type: DiscourseType.Statement,statement: new NodeText('Well done!'),},link: {type: LinkType.Direct,id: welcome,},},{id: awesomeWork,discourse: {type: DiscourseType.Statement,statement: new NodeText('Awesome work π'),},link: {type: LinkType.Direct,id: welcome,},},{id: correct,discourse: {type: DiscourseType.Statement,statement: new NodeText('Correct π€'),},link: {type: LinkType.Direct,id: welcome,},},{id: cars,discourse: {type: DiscourseType.Expected,statement: new NodeCarousel([new NodeCard([new NodeImage({url: 'https://farm3.staticflickr.com/2435/3878392879_2e0a2fb5c3_z_d.jpg?zz=1',aspect: 4 / 3,}),new NodePadding(new NodeContainer([new NodeHeading('Vintage'),new NodeText('Vintage cars are usually loved and cherished by their owners.',),]),),]),new NodeCard([new NodeImage({url: 'https://farm4.staticflickr.com/3937/15543680945_835ec70d35_z_d.jpg',aspect: 4 / 3,}),new NodePadding(new NodeContainer([new NodeHeading('Muscle'),new NodeText('Muscle cars have large, powerful, engines that guzzle gasoline!',),]),),]),new NodeCard([new NodeImage({url: 'https://farm4.staticflickr.com/3901/14647004256_a796c9a59d_z_d.jpg',aspect: 4 / 3,}),new NodePadding(new NodeContainer([new NodeHeading('Hyper'),new NodeText('The most exclusive and expensive cars. Often the fastest road legal cars in the world.',),]),),]),]),suggestions: [new NodeText('Continue'),],expected: [new TargetMeaning('continue'),],},link: {type: LinkType.Conditional,conditions: {'response.meaning.continue.confidence > 0.5': loop,},fallback: intents,},},])