This repository was archived by the owner on Jun 5, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -317,8 +317,22 @@ def _get_question_answer_from_partial(
317
317
contains a list of messages as question. QuestionAnswer contains a single message as question.
318
318
"""
319
319
# Get the last user message as the question
320
+ message_str = partial_question_answer .partial_questions .messages [- 1 ]
321
+ if (
322
+ partial_question_answer .partial_questions .provider == "copilot"
323
+ and partial_question_answer .partial_questions .type == "chat"
324
+ ):
325
+ message_str = "\n " .join (partial_question_answer .partial_questions .messages )
326
+
327
+ # sanitize answer from reserved words
328
+ if partial_question_answer .answer and partial_question_answer .answer .message :
329
+ partial_question_answer .answer .message = re .sub (
330
+ r"(question_about_specific_files|question_about_specific_code|unknown)\s*" ,
331
+ "" ,
332
+ partial_question_answer .answer .message ,
333
+ ).strip ()
320
334
question = ChatMessage (
321
- message = partial_question_answer . partial_questions . messages [ - 1 ] ,
335
+ message = message_str ,
322
336
timestamp = partial_question_answer .partial_questions .timestamp ,
323
337
message_id = partial_question_answer .partial_questions .message_id ,
324
338
)
You can’t perform that action at this time.
0 commit comments