new ArchSettingsNluKnowledge(coreKnowledgeSettingsViewModel)
Parameters:
| Name | Type | Description |
|---|---|---|
coreKnowledgeSettingsViewModel |
Object | ( Internal ) an Architect core error knowledge settings view model. |
Extends
Members
-
static, readonly displayTypeName :string
-
Returns the display type name string 'ArchSettingsNluKnowledge'.
-
readonly isArchBaseCoreObject :boolean
-
Returns true indicating that this is an ArchBaseCoreObject instance.
- Overrides:
-
readonly isArchSettingsNluKnowledge :boolean
-
Returns true indicating that this is an ArchSettingsNluKnowledge instance.
-
readonly knowledgeAnswerHighlight :ArchValueBoolean
-
A boolean value which, if it evaluates to true, will enable answer highlight.
-
readonly knowledgeAnswerHighlightFlowProgression :ArchValueString
-
The text on the label to progress the flow
-
readonly knowledgeAnswerHighlightFullArticle :ArchValueString
-
The text on the label to view the full article
-
readonly knowledgeBaseId :string
-
Returns the knowledge base id if there is one set on this ArchActionSettingsNluKnowledge instance. If there is not one set, nothing is returned.
-
readonly knowledgeBaseName :string
-
Returns the knowledge base name if there is one set on this ArchActionSettingsNluKnowledge instance. If there is not one set, nothing is returned.
-
readonly knowledgeConfirmation :ArchValueCommunication
-
Wording the bot will use after playing back one or more knowledge base answers. For example, 'Does this answer your question?'
-
knowledgeCustomTask :ArchTask
-
The target task for custom knowledge settings. The
ArchSettingsNluKnowledge#knowledgeSettingsModeneeds to be configured to custom first. -
readonly knowledgeInitialResponseFollowup :ArchValueCommunication
-
Follow-up wording the bot will use after presenting a knowledge article. For example, 'I hope I answered your question. You can ask anything else you might want to know.' This property maps to the Answer Follow-up setting you would see in the Knowledge settings within a Digital Bot Flow. What you want to do here is have the participant ask their next question as a result of this wording.
-
readonly knowledgeInitialResponseMulti :ArchValueCommunication
-
Wording the bot will use to introduce a numbered list of matching Knowledge answers, in the case where multiple good matches are found in the Knowledge Base. For example, 'This is what I found'
-
readonly knowledgeInitialResponseMultiRetry :ArchValueCommunication
-
Wording the bot will use to re-introduce a numbered list of matching Knowledge answers, in the case where the user's first attempt to choose a number was unsuccessful. For example, 'I didn't understand that. Please pick one of the following:'
-
readonly knowledgeInitialResponseSingle :ArchValueCommunication
-
Wording the bot will use prior to playing back a single knowledge base answer. For example, 'This is what I found'
-
readonly knowledgeNoMatch :ArchValueCommunication
-
Wording the bot will use to represent the 'no match' option. For example, 'None of the above'
-
readonly knowledgePathMode :ArchValueString
-
The knowledge path mode determines what behavior will occur when a knowledge article is matched in a Digital Bot Flow. There are two modes: statement and task. Statement mode allows you to configure an Answer Follow-up that communicates a message when a knowledge article is successfully matched. Task mode allows you to link a reusable task that will begin when a knowledge article is successfully matched.
-
readonly knowledgeSettingsMode :ArchValueString
-
Controls how knowledge matches are handled at runtime. The custom setting allows you to choose a reusable task that will be executed when a knowledge match occurs. The string values in
ArchEnums#KNOWLEDGE_SETTINGS_MODESlist valid values. -
knowledgeTargetTask :ArchTask
-
The target task for this knowledge settings path. The
knowledgePathModeneeds to be configured to task first. -
readonly logStr :string
-
A string suitable for logging that contains information about this action. This will contain the action tracking id, name and scripting type name.
- Overrides:
-
readonly logStrTypeOnly :string
-
This is a string suitable for logging information about this object where it's just the object's type. This is normally used when logging errors that occur in constructor parameter checking because the scripting object isn't set up and the normal logging str contents wouldn't be set up.
- Overrides:
-
readonly maxNumOfAnswersReturned :ArchValueInteger
-
The maximum number of knowledge base answers to be returned by the bot from the selected knowledge base.
-
readonly responseBias :ArchValueString
-
The bias the bot should use when interpreting participant input to prefer knowledge base answers, other natural language understanding settings such as intents, or weight input equally. The string values in
ArchEnums#NLU_RESPONSE_BIAS_MODESlists valid values. -
readonly sendKnowledgeFeedback :ArchValueBoolean
-
A boolean value which, if it evaluates to true, will send knowledge confirmation feedback to the knowledge service which will be used to improve the performance of your knowledge base.
-
readonly welcomeArticleId :string
-
Returns the knowledge base welcome article id if there is one set on this ArchActionSettingsNluKnowledge instance. If there is not one set, nothing is returned.
-
readonly welcomeArticleName :string
-
Returns the knowledge base welcome article name if there is one set on this ArchActionSettingsNluKnowledge instance. If there is not one set, nothing is returned.
Methods
-
isFilterMatch(archFilterObject) → {boolean}
-
Returns whether or not this Architect Scripting object is a match for the supplied ArchFilterObject instance.
Parameters:
Name Type Description archFilterObjectArchFilterObject the object filter to use to determine if it's a match.
Returns:
boolean- Overrides:
-
logError(errorStr)
-
Logs an error to the logging service with a log header from this object's
logStrproperty value whenArchLogging#logErrorsis true.Parameters:
Name Type Description errorStrstring the error string to log.
- Overrides:
-
logErrorAndThrow(errorStr)
-
Logs an error to the logging service with a log header from this object's
logStrproperty value whenArchLogging#logErrorsis true and then throws the string in the errorStr parameter.Parameters:
Name Type Description errorStrstring the error string to log. This should be a non-blank string.
Throws:
- Throws the submitted error string.
- Overrides:
-
logNote(noteStr)
-
Logs a note to the logging service with a log header from this object's
logStrproperty value whenArchLogging#logNotesis true.Parameters:
Name Type Description noteStrstring the note string to log. This should be a non-blank string.
- Overrides:
-
logNoteVerbose(noteStr)
-
Logs a note to the logging service with a log header from this object's
logStrproperty value whenArchLogging#logNotesVerboseis true.Parameters:
Name Type Description noteStrstring the note string to log. This should be a non-blank string.
- Overrides:
-
logWarning(warningStr)
-
Logs a warning to the logging service with a log header from this object's
logStrproperty value whenArchLogging#logWarningsis true.Parameters:
Name Type Description warningStrstring the warning string to log. This should be a non-blank string.
- Overrides:
-
setKnowledgeBaseByIdAsync(knowledgeBaseId, callbackFunctionopt) → {Promise.<ArchSettingsNluKnowledge>}
-
This sets the knowledge base that will be used for use at runtime by the knowledge base id.
Parameters:
Name Type Attributes Description knowledgeBaseIdstring the id of the Knowledge Base to set.
callbackFunctionfunction <optional>
a callback function to call if the Knowledge Base is successfully looked up and configured on this action. The first parameter passed to the callback function will be this Architect NLU Knowledge Settings instance.
Returns:
Promise.<ArchSettingsNluKnowledge> -
setKnowledgeBaseByNameAsync(knowledgeBaseName, callbackFunctionopt) → {Promise.<ArchSettingsNluKnowledge>}
-
This sets the knowledge base that will be used for use at runtime by the knowledge base name.
Parameters:
Name Type Attributes Description knowledgeBaseNamestring the name of the Knowledge Base to set. Knowledge Base names are looked up case insensitively.
callbackFunctionfunction <optional>
a callback function to call if the Knowledge Base is successfully looked up and configured on this action. The first parameter passed to the callback function will be this Architect NLU Knowledge Settings instance.
Returns:
Promise.<ArchSettingsNluKnowledge> -
setKnowledgePathModeStatement()
-
Helper function to set the knowledge path mode to statement.
-
setKnowledgePathModeTask()
-
Helper function to set the knowledge path mode to task.
-
setKnowledgeSettingsModeCustom()
-
Helper function to set the knowledge settings mode to custom.
-
setKnowledgeSettingsModeStandard()
-
Helper function to set the knowledge settings mode to standard.
-
setWelcomeArticleByIdAsync(knowledgeBaseDocumentId, callbackFunctionopt) → {Promise.<ArchSettingsNluKnowledge>}
-
This sets the welcome article that will be used by the bot at runtime by the knowledge base document's identifier. Remember that prior to setting a knowledge base document as the welcome article that the knowledge base must be configured since this search operation will look up a document by id within that knowledge base.
Parameters:
Name Type Attributes Description knowledgeBaseDocumentIdstring the id of the Knowledge Base document to set.
callbackFunctionfunction <optional>
a callback function to call if the Knowledge Base Article is successfully looked up and configured on this action. The first parameter passed to the callback function will be this Architect NLU Knowledge Settings instance.
Returns:
Promise.<ArchSettingsNluKnowledge> -
setWelcomeArticleByNameAsync(knowledgeBaseDocumentName, callbackFunctionopt) → {Promise.<any>}
-
This sets the welcome article that will be used by the bot at runtime by the knowledge base document's name. Remember that prior to setting a knowledge base document as the welcome article that the knowledge base must be configured since this search operation will look up a document by name within that knowledge base.
Parameters:
Name Type Attributes Description knowledgeBaseDocumentNamestring the name of the Knowledge Base document to set as the welcome article. Knowledge Base document names are looked up case insensitively.
callbackFunctionfunction <optional>
a callback function to call if the Knowledge Base Article is successfully looked up and configured on this action. The first parameter passed to the callback function will be this Architect NLU Knowledge Settings instance.
Returns:
Promise.<any> -
traverse(callbackFunction, traverseFilteropt) → {number}
-
This method iterates over this object and ArchBaseCoreObject instances within it. For each object it will call the
ArchBaseObject#isFilterMatchmethod with a filter and call the supplied callback function if isMatch returns true. The callback will be passed anArchTraverseInfowith details about the match such as the match object itself along with current contextual information such as the object hierarchy for the match object relative to the object on which this traverse call is being made.The traverse
filteris one which you can create by callingArchFactoryFilters#createFilterObjectand then add desired clauses or clause containers to it. If not specified, this function will use adefault filter.Here is an example that does a simple flow traversal using the default filter and logs information about objects in the callback from the traverse object that's passed back:
archInboundCallFlow.traverse(function(traverseInfo) { archLogging.logNote(' Object : ' + traverseInfo.matchObject.logStr); archLogging.logNote(' Hierarchy: ' + traverseInfo.context.hierarchyStr); });This might be enough for most uses and you can check various aspects about the object in the callback such as "is this an Architect action?" by seeing if traverseInfo.matchObject.isArchBaseAction is true. You can specify a filter for the traversal code to use as well and only have it call your callback when the object's
ArchBaseCoreObject#isFilterMatchmethod returns true for the filter. Here's an example that creates a filter for callbacks onany type of transfer action, anydecision actionor objects whose name property case insensitively matches the word 'foo'. While this could all be done with one property callback clause the example will use multiple clauses for the sake of simplicity:const myTraverseFilter = filterFactory.createFilterObject(archEnums.FILTER_CONTAINER_OPERATORS.or); myTraverseFilter.addClausePropertyValueEquals('isArchBaseActionTransfer', true); myTraverseFilter.addClausePropertyValueEquals('isArchActionDecision', true); myTraverseFilter.addClausePropertyCallback('name', function(propValue, archContainingObject, propName) { // We fully spelled out the function signature above but archContainingObject and propName are // not needed in this case. The archContainingObject is the object that contains the // property and propName is the property name itself. We pass in propName because the same // function could be used for multiple property callback clauses. // Remember to return a boolean true, false or undefined from ths callback. :) return propValue && propValue.toLowerCase() === 'foo'; }); archTask.traverse(function(traverseContext) { // You will only be called back here for ArchBaseCoreObject instances that // have the isArchBaseActionTransfer or isArchActionDecision property values equal to true. }, myTraverseFilter);If you supply a filter with no clauses, this tells the traverse method to call the supplied callback function for every
ArchBaseCoreObjectit traverses.If you want traversal itself to stop after a callback, simply return boolean false from the callback function you supply to the traverse call.
The traverse method does not process deprecated property names such as
orgId,orgNameorlanguageSettings. Additionally it does not traverse in to properties that would "jump out" of the current traversal. An example of this would be if the code was traversing anArchActionJumpToMenuaction that it would not start traversing in to the menu that it jumps to. Another example would be aArchActionChangeStateaction where it would not traverse in to the target state of the action. This also means traversal does not traverse in to theArchBaseValue#flowLevelDefaultproperty.And lastly, as Scripting evolves over time with new versions, you can expect to get callbacks for new object types such as new actions or new properties on objects. As such, it's important not to assume any particular order in callbacks to keep code most compatible with traversal callbacks. Or if you use inequality checks in filter clauses remember that new "stuff" may satisfy an inequality check which may or may not be anticipated in your logic.
Note: This traverse method is a helper method and is very handy for iterating over Architect Scripting objects and their properties in a generic fashion with filtering capabilities. Obviously you can write your own custom traversal code if this implementation doesn't cut it for some reason. :)
This function returns the number of times it called the callback function.
Parameters:
Name Type Attributes Default Description callbackFunctioncallbackTraverseInfo the callback function to call for objects that match the traverse filter.
traverseFilterArchFilterObject <optional>
ArchFactoryFilters#createFilterTraverseDefaultthe filter to use when performing the traversal to determine which
ArchBaseCoreObjectinstances you wish to be called back for. If no filter is specified, this function will callArchFactoryFilters#createFilterTraverseDefaultand use that traversal default filter. The wantArchBaseValues parameter on that call is set to true.Returns:
number- Overrides: