Phrase generation agent
It is an agent that generates a sc-link with the reply message text, where sc-variables names substitued with constant sc-links contents from knowledge base. This agent is called by StandartMessageReplyAgent to do this work and it returns the own result to him for answering the user question.
Action class:
action_phrase_generation
Parameters:
-
replyMessageNode
that is the result of StandartMessageReplyAgent; -
phraseLink
is a sc-link with a text template.
Workflow:
- The agent tryes to get
templateNode
, that connected withphraseLink
bynrel_phrase_template
norole relation;
- Then it seeks for arguments of the template -
parametersNode
, this node is connected withactionAddr
byrrel_3
role relation; - After this the PhraseGenerationAgent generates sc-link by template using
templateNode
,parametersNode
andphraseLink
; - The language of created sc-link depends on language of
phraseLink
. If there is alang_ru
node and a constant positive role relation fromlang_ru
tophraseLink
, then the agent creates similiar role relation fromlang_ru
tolinkResult
. If the agent can't find the language of this sc-link, he doesn't create any relation; - In the sc-link the agent finds all sc-variables and using the
templateNode
choose necessary sc-elements from knowledge base. SC-variables are replaced by identifiers of these sc-elements, that were found; - The final sc-link connects with
actionAddr
bynrel_result
norole relation, PhraseGenerationAgent finishes his work.
Example
Example of an input structure:
Example of an output structure:
Result
Possible result codes:
SC_RESULT_OK
- the reply message is generated.SC_RESULT_ERROR
- internal error, answer can't be found.SC_RESULT_ERROR_INVALID_PARAMS
- the action has no reply message or phrase link.