botbook/book/chapter-02-Package Reference.md
2019-03-01 15:34:29 -03:00

2.2 KiB

General Bots Packages Reference

How To

Configure the server to deploy specific directory

  1. Create/Edit the .env file and add the ADDITIONAL_DEPLOY_PATH key pointing to the .gbai local parent folder of .gbapp, .gbot, .gbtheme, .gbkb package directories.
  2. Specify STORAGE_SYNC to TRUE so database sync is run when the server is run.
  3. In case of Microsoft SQL Server add the following keys: STORAGE_SERVER, STORAGE_NAME, STORAGE_USERNAME, STORAGE_PASSWORD, STORAGE_DIALECT to mssql.

Note:

  • You can specify several bots separated by semicolon, the BotServer will serve all of them at once.

Package Types

.gbai

Embraces all packages types (content, logic & conversation) into a pluggable bot directory. A sample .gbai is available.

.gbapp

The artificial intelligence extensions in form of pluggable apps. Dialogs, Services and all model related to data. A set of interactions, use cases, integrations in form of conversationals dialogs. The .gbapp adds the General Bot base library (botlib) for building Node.js TypeScript Apps packages.

Four components builds up a General Bot App:

  • dialogs
  • models
  • services
  • tests

Dialogs

All code contained in a dialog builds the flow to custom conversations in built-in and additional packages .

Models

Models builds the foundation of data relationships in form of entities.

Services

Services are a façade for bot back-end logic and other custom processing.

Tests

Tests try to automate code execution validation before crashing in production.

.gbot

An expression of an artificial inteligence entity. A .gbot file defines all bots dependencies related to services and other resources.

.gbtheme

A theme of a bot at a given time. CSS files & images that can compose all UI presentation and using it a branding can be done. A sample .gbtheme is available

.gbkb

A set of subjects that bot knows in a form of hierarchical menu-based QnA. A sample .gbkb is available.

.gblib

Shared code that can be used across bot apps.