Skip to content

Strip keywords from the final answer

What does this MR do and why?

Sometimes we get the response from chat that contains system keywords. We should strip then from the response.

Example:

image (3).png

I think that the problem could be in the situation when the response is empty, but we wrap it in the Thought: construction and we never strip this the answer. In case if the response is empty, it's treated as the final answer. thought is nil in this case.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

How to set up and validate locally

It's a bit hard to reproduce because such malformed answers happens very rarely. Only one way to test is to setup chat on your gdk and ask multiple questions and check responses. Ideally, you shouldn't see any responses like Thought: Action: . This is how I tested it locally.

Edited by Tetiana Chupryna

Merge request reports