Skip to content

Commit 63f5494

Browse files
committed
Update comments
1 parent 3c0c701 commit 63f5494

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

app/frontend/src/components/Answer/AnswerParser.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ type HtmlParsedAnswer = {
66
citations: string[];
77
};
88

9-
// Function to validate citation format and check if it is a valid citation within the context
9+
// Function to validate citation format and check if dataPoint starts with possible citation
1010
function isCitationValid(contextDataPoints: any, citationCandidate: string): boolean {
1111
const regex = /^[^\s]+\.[a-zA-Z0-9]+/;
1212
if (!regex.test(citationCandidate)) {
@@ -23,7 +23,6 @@ function isCitationValid(contextDataPoints: any, citationCandidate: string): boo
2323
return false;
2424
}
2525

26-
// Check if dataPoint starts with citation
2726
const isValidCitation = dataPointsArray.some(dataPoint => dataPoint.startsWith(citationCandidate));
2827

2928
if (!isValidCitation) {
@@ -37,7 +36,7 @@ export function parseAnswerToHtml(answer: ChatAppResponse, isStreaming: boolean,
3736
const contextDataPoints = answer.context.data_points;
3837
const citations: string[] = [];
3938

40-
// trim any whitespace from the end of the answer after removing follow-up questions
39+
// Trim any whitespace from the end of the answer after removing follow-up questions
4140
let parsedAnswer = answer.message.content.trim();
4241

4342
// Omit a citation that is still being typed during streaming

0 commit comments

Comments
 (0)