This site is no longer updated.Go to new Conversational Cloud docs

require


Description

require — tag serves to connect all the dependent files to the main script. In essence, it is an alternative option for indicating all the dependent files within chatbot.yaml.

Value type

  • string — define the name of an uploaded file

Parameters

  • type (string) — optional parameter, defines type of a file; default type is based on a file extension.
  • from (string) — name of a module which contains a file to be imported; module’s version and repository are specified in chatbot.yml.
  • rootTheme (string) — root theme for every state in an uploaded file.
  • provide (multiline json) — set of parameters for an uploaded module.
  • name (string) — name of pattern for named entities’ dictionary.
  • var (string) — name of js-variable with data from a dictionary.
  • injector (string) — meta parameters that can be delivered through the $injector object.
  • module (string) — name of a module which contains a file to be imported.

The module’s name is either defined in the dependecies section of configuration file chatbot.yaml, or it corresponds to the folder’s name in the folder of system modules.

Nested data

  • named parameters

How to use

  • Simple example of use
require: catchAll.js
require: /services/api.js

  • parametervarName;
 require: answers.yml
          var = answers

  • parameters from, rootTheme, provide;
require: catchAll.zb
        from = common
        rootTheme = /offtopic/catchAll
        provide = {
            doSwitch: false,
            hintState: “/offtopic/IKnowSomethingElse”
            }

  • parameters type, patternName;
require: cities.csv
         type = namedEntities
         name = $City

  • parameter injector;
require: another.sc
injector = { catchAll: { useSwitch2: false } }

  • parameter module;
 require: patterns.sc
    module = common

  • it is possible to use substitutions in parameter values.
require: {{$inject.dictFile}}
        type = namedEntities
        name = $City