aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/chatbot/response_parsers/AnswerParser.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2024-09-30 12:19:22 -0400
committerbobzel <zzzman@gmail.com>2024-09-30 12:19:22 -0400
commit139a3cb0b3b081c270187e9b4ca281d04ca923bf (patch)
treedd952f65f1bb53c29059fa22c2a38db8e0c47c47 /src/client/views/nodes/chatbot/response_parsers/AnswerParser.ts
parent04f1047d81bba00f9258543a8171683bce5272bb (diff)
upate AJ assistant from master and fix some lint errors
Diffstat (limited to 'src/client/views/nodes/chatbot/response_parsers/AnswerParser.ts')
-rw-r--r--src/client/views/nodes/chatbot/response_parsers/AnswerParser.ts9
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;