Remove unused handleCompiledReferences chat functions

This commit is contained in:
Debanjum Singh Solanky 2024-08-02 01:57:56 +05:30
parent 7858aff2e2
commit a733e5c1d4
2 changed files with 1 additions and 19 deletions

View file

@ -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;

View file

@ -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';