I am building a chatbot that has generative UI capabilities, and I am facing an issue regarding tool results and assistant responses. Here’s the situation:
- When a question is asked, my bot calls a tool (like fetching data, etc.), and I get the tool’s result (in JSON format) to render a rich UI.
- I also display the assistant’s response below the UI, which includes pleasantries, follow-up questions, and some additional context. The problem arises because the assistant’s response also includes the full details of the tool result, which results in redundancy, as I am already using that tool result to render the UI.
What I want to achieve:
- I would like to keep the pleasantries and follow-up questions in the assistant’s response, but I do not want the tool’s detailed results to be repeated.
- Essentially, I want to ensure the assistant’s response focuses on human-like interactions and context without redundantly showing the tool result, which I am already handling separately.
Is there a way to structure the assistant’s response so that it excludes the tool result when it’s already being used in the UI, but still provides the necessary pleasantries and follow-up questions?
Any insights or best practices for this would be greatly appreciated!
Thanks!