Fix tanuki bot response
What does this MR do and why?
Related to https://gitlab.com/gitlab-org/gitlab/-/issues/413702
response_body is expected to return string, currently we don't use additional fields anyway, it should be good to remove, pasting slack channel discussion related to this:
Hi :wave: , it seems that we don't use :source attribute returned from tanuki bot (this was added in https://gitlab.com/gitlab-org/gitlab/-/merge_requests/118463/diffs#2493d80c5bd62773499b80b107256bbbce8c452c_0_20). I'm wondering if I can simplify tanuki bot's response modifier to return just content's string (instead of hash), or can you think of any side effects this would cause?
Maddie
2 hours ago
Hey @jprovaznik
:wave: good catch, yeah I think it’s safe to remove it. It might have been left when we had both REST and GraphQL running but I see REST has been removed :100:
There is still an potential issue with empty_response - I think it returns different structure than expected, but it can be addressed in a separate MR (I'm not sure what is the best way to fix it).
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
How to set up and validate locally
- Enable tanuki bot
Feature.enable(:ai_tanuki_bot)
- Open tanuki bot chat in UI and ask a question
- verify that response doesn't contian json string "{content: ....}", but only content's text itself
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Jan Provaznik