Skip to content

Commit

Permalink
translated for detect intent
Browse files Browse the repository at this point in the history
  • Loading branch information
khanh1902 committed Jun 14, 2024
1 parent 1f67981 commit 015268b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions actions/Prompting.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ class Prompting extends ComponentDialog {
const conversationData = await this.dialog.conversationDataAccessor.get(
step.context
);

let answer = { name: "answer", value: step.result, type: "string" };

// assign answer
Expand Down Expand Up @@ -153,7 +153,11 @@ class Prompting extends ComponentDialog {
step.context
);

const userIntent = await predict(step.result, trainedData);
const { language } = conversationData;

const userInput = await translate(step.result, language);

const userIntent = await predict(userInput, trainedData);

if (!userIntent) {
return await step.replaceDialog(PROMPTING_WATERFALL, {
Expand Down

0 comments on commit 015268b

Please sign in to comment.