fix(chat): respond unknown event response in v2
This is a high priority MR for Switch to Chat Agent V2 (gitlab-org#13533 - closed). Please prioritize the review and merge.
What does this merge request do and why?
This MR fixes Parse unformatted answers from LLM (gitlab-org/gitlab#480563 - closed) by collecting unknown action output which currently discared.
Rails-counter part: gitlab-org/gitlab!165606 (merged)
How to set up and validate locally
Example query:
curl -X 'POST' \
'http://localhost:5052/v2/chat/agent' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"prompt": "Hi, how are you? Do not include Final Answer: in response. Do not include Thought: in response. Do not include Action: in response.",
"options": {
"chat_history": "string",
"agent_scratchpad": {
"agent_type": "react",
"steps": []
}
}
}'
Example response:
{"type":"unknown","data":{"text":"Hello! I'm doing well, thank you for asking. As GitLab Duo Chat, I'm here to assist you with any questions or information you need about GitLab, software development, or related topics. How can I help you today? \n\nIf you have any specific questions or if there's anything you'd like to know about GitLab's features, CI/CD pipelines, project management, or any other aspect of software development, please feel free to ask. I'm here to provide accurate and helpful information.\n\nYour feedback is important to us. After our interaction, please don't hesitate to share your thoughts on how I can improve or if there's anything else you need assistance with."}}
Merge request checklist
-
Tests added for new functionality. If not, please raise an issue to follow up. -
Documentation added/updated, if needed.
Edited by Shinya Maeda