Skip to content

Tutorial Bot Template

Keith Sterling edited this page Oct 2, 2017 · 12 revisions

Template

We will start by creating a basic file structure to contain our tutorial files. A template already exists in Github call Template-y. This contains the following folder structure

Download this folder from Github and either use directly, or make a copy so that you always keep Tutorial files as they were when downloaded. We then rename the folder from template-y to tutorial-y.

tutorial-y \aiml Aiml files go here \maps Map files go here \rdf RDF knowledge files go here \sets Set files go here \src Source code for extensions, services etc go here \test Test files code in \src folder go here \temp Log, brain and error files are created here by Program-y

On Linux and Max

clear
export PYTHONPATH=./src:../program-y/src:../template-y/libs/MetOffer-1.3.2:.
python3 ../program-y/src/programy/clients/console.py --config ./config.yaml --cformat yaml --logging ./logging.yaml

On Windows

@echo off
CLS
mkdir .\temp
SET PYTHONPATH=..\programy\src;..\programy\libs\MetOffer-1.3.2;.
python ..\programy\src\programy\clients\console.py --config .\config.windows.yaml --cformat yaml --logging .\logging.windows.yaml

Configuration

Next we need to modify the configuration files so that

On Linux and Mac

Open config.yaml

  • Remove references to ../program-y/bots/y-bot/aiml in files section of aiml
  • Remove references to ../program-y/bots/y-bot/sets in files section of sets
  • Remove references to ../program-y/bots/y-bot/maps in files section of maps
  • Remove references to ../program-y/bots/y-bot/rdf in files section of rdf
  • Rename templatey.brain to tutorial.brain in binaries section

On Windows

Open config.yaml

  • Remove references to ..\program-y\bots\y-bot\aiml in files section of aiml
  • Remove references to ..\program-y\bots\y-bot\sets in files section of sets
  • Remove references to ..\program-y\bots\y-bot\maps in files section of maps
  • Remove references to ..\program-y\bots\y-bot\rdf in files section of rdf
  • Rename templatey.brain to tutorial.brain in binaries section

Running the Bot

On Linux and Mac

> console.sh

On Windows

$ console.cmd

You will then see the tutorial start

Loading, please wait...
No bot root argument set, defaulting to [.]
Y-Bot version 0.0.1, initiated March 14, 2017
Hey, what’s up?
>>> 

There is nothing to ask it as we have not created any AIML yes, any questions will get the default response

Try it, ask it anything, you’ll get the same response

Loading, please wait...
No bot root argument set, defaulting to [.]
Y-Bot version 0.0.1, initiated March 14, 2017
Hey, what’s up?
>>> Hello
Sorry, I don’t have an answer for that.

We are now ready to start creating out AIML grammars


Back to Tutorial | Next - Getting Started

Clone this wiki locally