Hi Pankaj,
from what I read it seems as you successfully created your chatbot using the ConversationalUI module? If not, you can also follow the Build a Chatbot from Scratch Using the Blank GenAI App how-to.
To extend your existing chat bot, you could add your custom logic inside of your action microflow before the GenAI model is being called. For your use case, you could retrieve your key-value data from the Mendix DB, check for the conditions and either send a request to a model or use the valid data to change the response (if that should be part of the chat).
In the latter case, you would need to retrieve the latest Assistant's Message object (role = Assistant, Status = Loading, associated to your ChatContext, sort: CreatedDate = Descending) and change the Content to your custom answer and the status to the success enumeration value. Make sure also change the ChatContext status to the "Ready" enumeration value. Commit the Message and ChatContext objects. To see an example, you can look inside the ChatContext_UpdateAssistantResponse microflow (which maps a GenAI model response the chat objects).
I hope that helps.
Best regards
Liam
getting this type of errors
if used in this ChatContext_ChatWithHistory_ActionMicroflow then request is not getting false and showing OPEN AI messege as output
I would not recommend to directly change the ChatContext_Preprocessing microflow because this needs to return a "Request" object. Your custom logic can go before you do the preprocessing (see image).