{
    "componentChunkName": "component---src-templates-doc-page-js",
    "path": "/docs/en/common/bot_structure/configuration_file/",
    "result": {"data":{"site":{"siteMetadata":{"title":"Gatsby-doc-engine"}},"markdownRemark":{"id":"7e1f1d44-e33f-5b88-814f-54ec0574ea3e","excerpt":"Configuration file?>  is the main configuration file of a chat bot. It contains the name of the script main file, information about linked modules…","html":"<h1>Configuration file</h1>\n<hr>\n<p class='warn'><code class=\"language-text\">chatbot.yaml</code> is the main configuration file of a chat bot. It contains the name of the script main file, information about linked modules, configuration of the NLU module, list of tests and other configuration data.</p>\n</br>\n<h3>General settings</h3>\n</br>\n<h5>Bot name</h5>\n<div class=\"gatsby-highlight\" data-language=\"yaml\"><pre class=\"language-yaml\"><code class=\"language-yaml\"><span class=\"token key atrule\">name</span><span class=\"token punctuation\">:</span> botName</code></pre></div>\n<p>This parameter is used to generate the name of a zip file when you run the <code class=\"language-text\">build</code> or <code class=\"language-text\">buildDeploy</code> command and the <code class=\"language-text\">botId</code> when you run <code class=\"language-text\">deploy</code> or <code class=\"language-text\">buildDeploy</code>.</p>\n</br>\n<h5>Main file</h5>\n<div class=\"gatsby-highlight\" data-language=\"yaml\"><pre class=\"language-yaml\"><code class=\"language-yaml\"><span class=\"token key atrule\">entryPoint</span><span class=\"token punctuation\">:</span> main.sc</code></pre></div>\n<p><code class=\"language-text\">main.sc</code> or <code class=\"language-text\">entryPoint.sc</code> is the main file of the chat bot script from which the script starts to load. The file must be located in the <code class=\"language-text\">src</code> folder.</p>\n<p class='warn'>Other scripts and JS files can be loaded at the start of the script via the <code class=\"language-text\">require</code> tag.</p>\n</br>\n<h5>Script XML tests</h5>\n<div class=\"gatsby-highlight\" data-language=\"yaml\"><pre class=\"language-yaml\"><code class=\"language-yaml\"><span class=\"token key atrule\">tests</span><span class=\"token punctuation\">:</span>\n  <span class=\"token key atrule\">include</span><span class=\"token punctuation\">:</span>\n  <span class=\"token punctuation\">-</span> <span class=\"token string\">\"**/*.xml\"</span>\n  <span class=\"token key atrule\">exclude</span><span class=\"token punctuation\">:</span>\n  <span class=\"token punctuation\">-</span> broken.xml</code></pre></div>\n<p>You can use script XML tests to verify chat bot logic by emulating client requests and verifying bot responses.</p>\n<p>Any tests located in the <code class=\"language-text\">test</code> folder run automatically when you deploy your bot. You can override this behavior in the <code class=\"language-text\">tests</code> section.</p>\n<p>The <code class=\"language-text\">tests</code> section can contain two subsections, <code class=\"language-text\">include</code> and <code class=\"language-text\">exclude</code>, each of them being the list of <a href=\"http://ant.apache.org/manual/dirtasks.html#patterns\" target=\"_blank\" rel=\"noopener noreferrer\">ant templates</a> with file names.</p>\n<ul>\n<li><code class=\"language-text\">include</code> — only the tests from the files that match the templates listed in this section will be executed.</li>\n<li><code class=\"language-text\">exclude</code> — all the files matching the templates listed in this section will be excluded from execution.</li>\n</ul>\n</br>\n<h5>JS unit tests</h5>\n<div class=\"gatsby-highlight\" data-language=\"yaml\"><pre class=\"language-yaml\"><code class=\"language-yaml\"><span class=\"token key atrule\">jsTests</span><span class=\"token punctuation\">:</span>\n  <span class=\"token key atrule\">extensions</span><span class=\"token punctuation\">:</span>\n     <span class=\"token punctuation\">-</span> spec.js\n     <span class=\"token punctuation\">-</span> test.js\n  <span class=\"token key atrule\">include</span><span class=\"token punctuation\">:</span>\n     <span class=\"token punctuation\">-</span> <span class=\"token string\">\"**/*.test.js\"</span>\n     <span class=\"token punctuation\">-</span> <span class=\"token string\">\"dir/*.spec.js\"</span>\n  <span class=\"token key atrule\">exclude</span><span class=\"token punctuation\">:</span>\n     <span class=\"token punctuation\">-</span> broken.test.js\n     <span class=\"token punctuation\">-</span> modules/common/<span class=\"token important\">**</span></code></pre></div>\n<p>You can run JS unit tests on the platform to automatically verify whether your JS code is correct.</p>\n<p class='tip'>JS unit tests can only be executed locally. You can use the <code class=\"language-text\">ZB-CLI</code> maintenance utility for that.</p>\n<p>The <a href=\"https://jasmine.github.io/\" target=\"_blank\" rel=\"noopener noreferrer\">Jasmine</a> framework is used to run the tests. All the files from the <code class=\"language-text\">test</code> folder with the <code class=\"language-text\">test.js</code> extension are run by default. You can refine your unit test inclusion rules in the <code class=\"language-text\">chatbot.yaml</code> file and specify extensions for files containing tests.</p>\n<p>The <code class=\"language-text\">jsTests</code> section can contain two subsections, <code class=\"language-text\">include</code> and <code class=\"language-text\">exclude</code>, each of them being the list of <a href=\"http://ant.apache.org/manual/dirtasks.html#patterns\" target=\"_blank\" rel=\"noopener noreferrer\">ant templates</a> with file names.</p>\n<ul>\n<li><code class=\"language-text\">include</code> — only the tests from the files that match the templates listed in this section will be executed.</li>\n<li><code class=\"language-text\">exclude</code> — all the files matching the templates listed in this section will be excluded from execution.</li>\n</ul>\n<p>You can override the extension for your test files in the <code class=\"language-text\">extensions</code> subsection.</p>\n</br>\n<h5>Default bot language</h5>\n<div class=\"gatsby-highlight\" data-language=\"yaml\"><pre class=\"language-yaml\"><code class=\"language-yaml\"><span class=\"token key atrule\">language</span><span class=\"token punctuation\">:</span> ru</code></pre></div>\n<p>Use the <code class=\"language-text\">language</code> parameter to specify your default bot language by filling the <code class=\"language-text\">$request.language</code> field (if it was not specified in the request).</p>\n<p>The <code class=\"language-text\">$request.language</code> language will then be used to display localized error messages, and it can also be used in scripts.</p>\n</br>\n<h5>Error messages</h5>\n<div class=\"gatsby-highlight\" data-language=\"yaml\"><pre class=\"language-yaml\"><code class=\"language-yaml\"><span class=\"token key atrule\">messages</span><span class=\"token punctuation\">:</span>\n  <span class=\"token key atrule\">onError</span><span class=\"token punctuation\">:</span>\n    <span class=\"token key atrule\">defaultMessage</span><span class=\"token punctuation\">:</span> Something has gone wrong\n    <span class=\"token key atrule\">locales</span><span class=\"token punctuation\">:</span>\n      <span class=\"token key atrule\">ru</span><span class=\"token punctuation\">:</span> Something has gone wrong\n      <span class=\"token key atrule\">en</span><span class=\"token punctuation\">:</span> Failed on request processing</code></pre></div>\n<p>You can override your chat bot error message text in the <code class=\"language-text\">message</code> section. The text of the message is specified in the <code class=\"language-text\">defaultMessage</code> field.</p>\n<p class='tip'>If an error occurs and this field is not specified, the bot will not respond.</p>\n<p>Localized message is selected depending on the client language given with the <code class=\"language-text\">$request.language</code> parameter. If the parameter is not given, the <code class=\"language-text\">defaultMessage</code> message is displayed.</p>\n</br>\n<h5>Including dependencies</h5>\n<div class=\"gatsby-highlight\" data-language=\"yaml\"><pre class=\"language-yaml\"><code class=\"language-yaml\"><span class=\"token key atrule\">dependencies</span><span class=\"token punctuation\">:</span>\n <span class=\"token punctuation\">-</span> <span class=\"token key atrule\">name</span><span class=\"token punctuation\">:</span> common\n   <span class=\"token key atrule\">type</span><span class=\"token punctuation\">:</span> git\n   <span class=\"token key atrule\">url</span><span class=\"token punctuation\">:</span> https<span class=\"token punctuation\">:</span>//&lt;repository<span class=\"token punctuation\">></span>\n   <span class=\"token key atrule\">version</span><span class=\"token punctuation\">:</span> heads/master\n <span class=\"token punctuation\">-</span> <span class=\"token key atrule\">name</span><span class=\"token punctuation\">:</span> another_common\n   <span class=\"token key atrule\">type</span><span class=\"token punctuation\">:</span> git\n   <span class=\"token key atrule\">url</span><span class=\"token punctuation\">:</span> https<span class=\"token punctuation\">:</span>//&lt;repository<span class=\"token punctuation\">></span>\n   <span class=\"token key atrule\">version</span><span class=\"token punctuation\">:</span> heads/master\n</code></pre></div>\n<p>You can define the list of dependencies of your project in the <code class=\"language-text\">dependencies</code> section.</p>\n</br>\n<table>\n<thead>\n<tr>\n<th>Field</th>\n<th>Possible values</th>\n<th>Descriptions</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code class=\"language-text\">name</code></td>\n<td><code class=\"language-text\">&lt;name></code></td>\n<td>Name of the module to be used when you include files with the <code class=\"language-text\">require</code> statement.</td>\n</tr>\n<tr>\n<td><code class=\"language-text\">type</code></td>\n<td><code class=\"language-text\">git</code>, <code class=\"language-text\">module</code></td>\n<td>Dependency type. Here: <code class=\"language-text\">git</code> is an external git repository; <code class=\"language-text\">module</code> specifies the folder if the repository contains multiple modules.</td>\n</tr>\n<tr>\n<td><code class=\"language-text\">url</code></td>\n<td><code class=\"language-text\">http://</code>  <code class=\"language-text\">git://</code>  <code class=\"language-text\">file://</code></td>\n<td><code class=\"language-text\">url</code> address of the repository. For <code class=\"language-text\">git</code> dependencies only.</td>\n</tr>\n<tr>\n<td><code class=\"language-text\">version</code></td>\n<td><code class=\"language-text\">heads/master</code></td>\n<td>Dependency version; can specify the <code class=\"language-text\">branch</code> of the <code class=\"language-text\">tag</code>. For <code class=\"language-text\">git</code> dependencies only.</td>\n</tr>\n</tbody>\n</table>\n<p>?>Dependencies are downloaded to the <code class=\"language-text\">module</code> folder when you deploy via the web interface.</p>\n</br>\n<h5>Injector</h5>\n<div class=\"gatsby-highlight\" data-language=\"yaml\"><pre class=\"language-yaml\"><code class=\"language-yaml\"><span class=\"token key atrule\">injector</span><span class=\"token punctuation\">:</span>\n   <span class=\"token key atrule\">name</span><span class=\"token punctuation\">:</span> value\n   <span class=\"token key atrule\">var1</span><span class=\"token punctuation\">:</span> value2</code></pre></div>\n<p>Use the <code class=\"language-text\">injector</code> section to define configuration parameters of your chat bot. Parameters defined here will be available in chat bot scripts via the <code class=\"language-text\">$injector</code> variable.</p>\n<p class='warn'><a href=/1.10.3/docs/en/JS_API/variables/injector  >Learn more about <code class=\"language-text\">$injector</code></a></p>\n</br>\n<h3>NLU functions</h3>\n<p>Specify parameters for the platform’s nlp functions in order to enable an STS classifier. You can find detailed description of parameters and configuration file examples in <a href=\"/1.10.3/docs/en/classificator/connection_classificator\">this article</a>.</p>\n<p>Specify the following parameters in the <code class=\"language-text\">chatbot.yaml</code> file if you want to use the CAILA NLU service:</p>\n<div class=\"gatsby-highlight\" data-language=\"yaml\"><pre class=\"language-yaml\"><code class=\"language-yaml\"><span class=\"token key atrule\">language</span><span class=\"token punctuation\">:</span> ru\n<span class=\"token key atrule\">botEngine</span><span class=\"token punctuation\">:</span> v2\n\n<span class=\"token key atrule\">sts</span><span class=\"token punctuation\">:</span>\n    <span class=\"token key atrule\">noMatchThreshold</span><span class=\"token punctuation\">:</span> <span class=\"token number\">0.2</span>\n<span class=\"token key atrule\">caila</span><span class=\"token punctuation\">:</span>\n    <span class=\"token key atrule\">noMatchThreshold</span><span class=\"token punctuation\">:</span> <span class=\"token number\">0.2</span></code></pre></div>\n<p class='warn'><a href=/1.10.3/docs/en/NLU_core/nlu_core  >Learn more about the CAILA NLU service</a></p>\n</br>\n<h3>File example</h3>\n<ul>\n<li>Minimum configuration file:</li>\n</ul>\n<div class=\"gatsby-highlight\" data-language=\"yaml\"><pre class=\"language-yaml\"><code class=\"language-yaml\"><span class=\"token key atrule\">name</span><span class=\"token punctuation\">:</span> echo<span class=\"token punctuation\">-</span>template\n\n<span class=\"token key atrule\">entryPoint</span><span class=\"token punctuation\">:</span>\n  <span class=\"token punctuation\">-</span> main.sc\n\n<span class=\"token key atrule\">tests</span><span class=\"token punctuation\">:</span>\n  <span class=\"token key atrule\">include</span><span class=\"token punctuation\">:</span>\n    <span class=\"token punctuation\">-</span> test.xml</code></pre></div>\n</br>\n<ul>\n<li>Configuration file of a project that uses the CAILA NLU service:</li>\n</ul>\n<div class=\"gatsby-highlight\" data-language=\"yaml\"><pre class=\"language-yaml\"><code class=\"language-yaml\"><span class=\"token key atrule\">name</span><span class=\"token punctuation\">:</span> zb<span class=\"token punctuation\">-</span>cailapub\n\n<span class=\"token key atrule\">entryPoint</span><span class=\"token punctuation\">:</span>\n  <span class=\"token punctuation\">-</span> main.sc\n\n<span class=\"token key atrule\">botEngine</span><span class=\"token punctuation\">:</span> v2\n<span class=\"token key atrule\">language</span><span class=\"token punctuation\">:</span> ru\n\n<span class=\"token key atrule\">sts</span><span class=\"token punctuation\">:</span>\n    <span class=\"token key atrule\">noMatchThreshold</span><span class=\"token punctuation\">:</span> <span class=\"token number\">0.2</span>\n\n<span class=\"token key atrule\">caila</span><span class=\"token punctuation\">:</span>\n    <span class=\"token key atrule\">noMatchThreshold</span><span class=\"token punctuation\">:</span> <span class=\"token number\">0.2</span></code></pre></div>\n</br>\n<ul>\n<li>Configuration file of a project that uses the STS classifier:</li>\n</ul>\n<div class=\"gatsby-highlight\" data-language=\"yml\"><pre class=\"language-yml\"><code class=\"language-yml\"><span class=\"token key atrule\">name</span><span class=\"token punctuation\">:</span> content\n\n<span class=\"token key atrule\">entryPoint</span><span class=\"token punctuation\">:</span>\n  <span class=\"token punctuation\">-</span> main.sc\n\n<span class=\"token key atrule\">dependencies</span><span class=\"token punctuation\">:</span>\n  <span class=\"token punctuation\">-</span> <span class=\"token key atrule\">name</span><span class=\"token punctuation\">:</span> common\n    <span class=\"token key atrule\">type</span><span class=\"token punctuation\">:</span> git\n    <span class=\"token key atrule\">url</span><span class=\"token punctuation\">:</span> https<span class=\"token punctuation\">:</span>//bitbucket.org/common\n    <span class=\"token key atrule\">version</span><span class=\"token punctuation\">:</span> heads/master\n    \n<span class=\"token key atrule\">tests</span><span class=\"token punctuation\">:</span>\n  <span class=\"token key atrule\">include</span><span class=\"token punctuation\">:</span>\n    <span class=\"token punctuation\">-</span> test.xml\n    <span class=\"token punctuation\">-</span> purchase_return.xml\n    <span class=\"token punctuation\">-</span> order.xml\n    <span class=\"token punctuation\">-</span> commercial.xml\n    <span class=\"token punctuation\">-</span> unsubscription.xml\n\n\n<span class=\"token key atrule\">nlp</span><span class=\"token punctuation\">:</span>\n  <span class=\"token key atrule\">lengthLimit</span><span class=\"token punctuation\">:</span>\n    <span class=\"token key atrule\">symbols</span><span class=\"token punctuation\">:</span> <span class=\"token number\">1200</span>\n  <span class=\"token key atrule\">vocabFile</span><span class=\"token punctuation\">:</span> common<span class=\"token punctuation\">-</span>vocabulary.json\n  <span class=\"token key atrule\">spellcheck</span><span class=\"token punctuation\">:</span>\n    <span class=\"token key atrule\">enabled</span><span class=\"token punctuation\">:</span> <span class=\"token boolean important\">true</span>\n    <span class=\"token key atrule\">minWordLengthForEditDistance</span><span class=\"token punctuation\">:</span> <span class=\"token number\">3</span>\n    <span class=\"token key atrule\">maxWordEditDistance</span><span class=\"token punctuation\">:</span> <span class=\"token number\">0</span>\n\n<span class=\"token key atrule\">messages</span><span class=\"token punctuation\">:</span>\n    <span class=\"token key atrule\">onError</span><span class=\"token punctuation\">:</span>\n        <span class=\"token key atrule\">defaultMessage</span><span class=\"token punctuation\">:</span> Oops<span class=\"token punctuation\">,</span> something has gone wrong.\n        <span class=\"token key atrule\">locales</span><span class=\"token punctuation\">:</span>\n            <span class=\"token key atrule\">ru</span><span class=\"token punctuation\">:</span> Oops<span class=\"token punctuation\">,</span> something has gone wrong.</code></pre></div>","frontmatter":{"title":"","description":null},"headings":[{"value":"Configuration file"}]}},"pageContext":{"slug":"/docs/en/common/bot_structure/configuration_file/","previous":{"fields":{"slug":"/docs/en/common/bot_structure/csv/"},"frontmatter":{"title":"","description":null}},"next":{"fields":{"slug":"/docs/en/common/bot_structure/about_bot_structure/"},"frontmatter":{"title":"","description":null}}}},
    "staticQueryHashes": ["1209419333"]}