From 84b64d4d1a0a0d1ea35ea8f306ac05dc27aca08b Mon Sep 17 00:00:00 2001 From: Abdul-Microsoft Date: Fri, 14 Feb 2025 12:11:46 +0000 Subject: [PATCH 1/2] Added code changes to implement functionality to disable the chat once the agent receives a human clarification response from the user. --- src/frontend/wwwroot/task/task.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/frontend/wwwroot/task/task.js b/src/frontend/wwwroot/task/task.js index acd716cb..c01f6870 100644 --- a/src/frontend/wwwroot/task/task.js +++ b/src/frontend/wwwroot/task/task.js @@ -217,7 +217,8 @@ fetchTaskStages(data[0]); sessionStorage.setItem("apiTask", JSON.stringify(data[0])); - const isHumanClarificationRequestNull = data?.[0]?.human_clarification_request === null + //const isHumanClarificationRequestNull = data?.[0]?.human_clarification_request === null + const isHumanClarificationResponseNotNull = data?.[0]?.human_clarification_response !== null; const taskMessageTextareaElement =document.getElementById("taskMessageTextarea"); const taskMessageAddButton = document.getElementById("taskMessageAddButton"); const textInputContainer = document.getElementsByClassName("text-input-container"); From 35a79eda9516dbd522e8067243181f76e1e0b28b Mon Sep 17 00:00:00 2001 From: Abdul-Microsoft Date: Fri, 14 Feb 2025 12:21:49 +0000 Subject: [PATCH 2/2] Added changes to disable chat after receiving human clarification response --- src/frontend/wwwroot/task/task.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/frontend/wwwroot/task/task.js b/src/frontend/wwwroot/task/task.js index c01f6870..7e1cdb10 100644 --- a/src/frontend/wwwroot/task/task.js +++ b/src/frontend/wwwroot/task/task.js @@ -223,6 +223,14 @@ const taskMessageAddButton = document.getElementById("taskMessageAddButton"); const textInputContainer = document.getElementsByClassName("text-input-container"); + if (isHumanClarificationResponseNotNull) { + // Update the local state to set human_clarification_request to null + data[0].human_clarification_request = null; + console.log("Human clarification request set to null locally."); + } + + const isHumanClarificationRequestNull = data?.[0]?.human_clarification_request === null + if(isHumanClarificationRequestNull && taskMessageTextareaElement){ taskMessageTextareaElement.setAttribute('disabled', true) taskMessageTextareaElement.style.backgroundColor = "#efefef";