mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-23 23:48:56 +01:00
Remove unused handleCompiledReferences chat functions
This commit is contained in:
parent
7858aff2e2
commit
a733e5c1d4
2 changed files with 1 additions and 19 deletions
|
@ -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;
|
||||
|
|
|
@ -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';
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue