How to create and configure Slots

icon picker
Language recognition | Language slot

Purpose and general information

@Language
is a
@Slot
that allows an
@Agent
to determine the language of a string and to write the recognition result to the
@chat_language
@Context Variable
.
image.png

Slot creation and settings

Slot attributes

image.png
Name ー the name of the
@Slot
, which will be displayed in the
@Script Tree
. The maximum length of a field value is 40 characters.
Source ー the string to be checked, the language of which must be recognized. Specified as a full-fledged
@Expression
with operators that produces a result — a string, or an
@Expression
with one
@Context Variable
. Examples: {{ variable }} or {{ var1 + var2 + var3 }}.
By default, the field is: {{ client_message }}.

Slot operation

When passing a
@Language
@Slot
, the following operations are performed in the order listed:
Determining the value of the
@Test String
: the result of the
@Slot
specified in the Source field is calculated.
If the value of the
@Test String
is a non-empty string, proceed to the next operation.
If the value of the
@Test String
has one of the following values, then the value False is written to the
@chat_language
variable:
Empty string;
An
@Expression
which value cannot be calculated;
Array;
Note: Arrays can be converted to strings using the string function, so they will be recognized by the slot. ​Example: [ “hello”, “how”, “doing?” ] | string
Object;
Number;
Boolean;
Date.
Example 1:Source: {{ variable }}, where variable does not exist in the
@Chat Context
. ​Result:
@chat_language
is set to FalseExample 2:Source: {{ variable }}, where variable = " "Result:
@chat_language
is set to FalseExample 3:Source: {{ variable }}, where variable = 123Result:
@chat_language
is set to FalseExample 4:Source: {{ variable }}, where variable = ["hello","how are you doing?"]Result:
@chat_language
is set to False
Determining the language and saving the result:
the system determines the possible languages
@Test String
;
the language with the greatest
@Language Detection Confidence Level
is determined:
if the
@Language Detection Confidence Level
exceeds the
@Language Detection Confidence Threshold
, then the name of the recognized language is written to the
@chat_language
variable. ​Format: string Name of language in English. ​Example: ​Source : {{ variable }}, where variable = "Hi, how are you?"Result:
@chat_language
contains Russian.
Note: The
@Language Detection Confidence Threshold
is calculated automatically by the system for each request.
if the
@Language Detection Confidence Level
does not exceed the
@Language Detection Confidence Threshold
, the value unknown is written to the
@chat_language
variable.
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.