diff --git a/CS/ReportingApp/wwwroot/js/aiIntegration.js b/CS/ReportingApp/wwwroot/js/aiIntegration.js index 55278d3..9799b30 100644 --- a/CS/ReportingApp/wwwroot/js/aiIntegration.js +++ b/CS/ReportingApp/wwwroot/js/aiIntegration.js @@ -116,17 +116,23 @@ const createAssistantTab = (function() { stylingMode: 'text', onClick: () => refreshAnswer(data.component) }); - buttonContainer.appendChild(refreshBtnElement); - lastRefreshButton = refreshBtnElement; + if(data.component.option('items').at(-1).author === assistant.name) { + buttonContainer.appendChild(refreshBtnElement); + lastRefreshButton = refreshBtnElement; + } container.appendChild(buttonContainer); }, onMessageEntered: async (e) => { + lastRefreshButton?.remove(); const instance = e.component; instance.option('alerts', []); instance.renderMessage(e.message); instance.option({ typingUsers: [assistant] }); const userInput = e.message.text; - const response = await getAIResponse(instance, userInput, assistant.id ?? model.chatId); + if(!assistant.id && model.chatId) { + assistant.id = model.chatId; + } + const response = await getAIResponse(instance, userInput, assistant.id); RenderAssistantMessage(instance, response); } }; diff --git a/README.md b/README.md index 0d98671..e71f7ca 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ -![](https://img.shields.io/endpoint?url=https://codecentral.devexpress.com/api/v1/VersionRange/853003889/24.2.6%2B) [![](https://img.shields.io/badge/Open_in_DevExpress_Support_Center-FF7200?style=flat-square&logo=DevExpress&logoColor=white)](https://supportcenter.devexpress.com/ticket/details/T1252182) [![](https://img.shields.io/badge/📖_How_to_use_DevExpress_Examples-e9f6fc?style=flat-square)](https://docs.devexpress.com/GeneralInformation/403183) [![](https://img.shields.io/badge/💬_Leave_Feedback-feecdd?style=flat-square)](#does-this-example-address-your-development-requirementsobjectives)