diff options
Diffstat (limited to 'src/client/views/nodes/chatbot/response_parsers/AnswerParser.ts')
| -rw-r--r-- | src/client/views/nodes/chatbot/response_parsers/AnswerParser.ts | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/client/views/nodes/chatbot/response_parsers/AnswerParser.ts b/src/client/views/nodes/chatbot/response_parsers/AnswerParser.ts index 3b4fdb6f5..1ac753790 100644 --- a/src/client/views/nodes/chatbot/response_parsers/AnswerParser.ts +++ b/src/client/views/nodes/chatbot/response_parsers/AnswerParser.ts @@ -1,5 +1,5 @@ -import { ASSISTANT_ROLE, AssistantMessage, Citation, CHUNK_TYPE, TEXT_TYPE, getChunkType, ProcessingInfo } from '../types/types'; import { v4 as uuid } from 'uuid'; +import { ASSISTANT_ROLE, AssistantMessage, Citation, ProcessingInfo, TEXT_TYPE, getChunkType } from '../types/types'; export class AnswerParser { static parse(xml: string, processingInfo: ProcessingInfo[]): AssistantMessage { @@ -22,8 +22,8 @@ export class AnswerParser { } let rawTextContent = answerMatch[1].trim(); - let content: AssistantMessage['content'] = []; - let citations: Citation[] = []; + const content: AssistantMessage['content'] = []; + const citations: Citation[] = []; let contentIndex = 0; // Remove citations and follow-up questions from rawTextContent @@ -43,6 +43,7 @@ export class AnswerParser { if (citationsMatch) { const citationsContent = citationsMatch[1]; while ((citationMatch = citationRegex.exec(citationsContent)) !== null) { + // eslint-disable-next-line @typescript-eslint/no-unused-vars const [_, index, chunk_id, type, direct_text] = citationMatch; const citation_id = uuid(); citationMap.set(index, citation_id); @@ -102,7 +103,7 @@ export class AnswerParser { } } - let followUpQuestions: string[] = []; + const followUpQuestions: string[] = []; if (followUpQuestionsMatch) { const questionsText = followUpQuestionsMatch[1]; let questionMatch; |
