From a733e5c1d458e7b99eeed54c58baea1219a79568 Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Fri, 2 Aug 2024 01:57:56 +0530 Subject: [PATCH] Remove unused handleCompiledReferences chat functions --- src/interface/web/app/common/chatFunctions.ts | 18 ------------------ src/interface/web/app/share/chat/page.tsx | 2 +- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/src/interface/web/app/common/chatFunctions.ts b/src/interface/web/app/common/chatFunctions.ts index 51a21115..17d6aec9 100644 --- a/src/interface/web/app/common/chatFunctions.ts +++ b/src/interface/web/app/common/chatFunctions.ts @@ -15,24 +15,6 @@ export interface ResponseWithReferences { response?: string; } -export function handleCompiledReferences(chunk: string, currentResponse: string) { - const rawReference = chunk.split("### compiled references:")[1]; - const rawResponse = chunk.split("### compiled references:")[0]; - let references: ResponseWithReferences = {}; - - // Set the initial response - references.response = currentResponse + rawResponse; - - const rawReferenceAsJson = JSON.parse(rawReference); - if (rawReferenceAsJson instanceof Array) { - references.context = rawReferenceAsJson; - } else if (typeof rawReferenceAsJson === "object" && rawReferenceAsJson !== null) { - references.online = rawReferenceAsJson; - } - - return references; -} - interface MessageChunk { type: string; data: string | object; diff --git a/src/interface/web/app/share/chat/page.tsx b/src/interface/web/app/share/chat/page.tsx index 1d41fb1d..c763248b 100644 --- a/src/interface/web/app/share/chat/page.tsx +++ b/src/interface/web/app/share/chat/page.tsx @@ -15,7 +15,7 @@ import { useAuthenticatedData } from '@/app/common/auth'; import ChatInputArea, { ChatOptions } from '@/app/components/chatInputArea/chatInputArea'; import { StreamMessage } from '@/app/components/chatMessage/chatMessage'; -import { convertMessageChunkToJson, handleCompiledReferences, handleImageResponse, processMessageChunk, RawReferenceData } from '@/app/common/chatFunctions'; +import { processMessageChunk } from '@/app/common/chatFunctions'; import { AgentData } from '@/app/agents/page';