mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-09 21:29:11 +00:00
Remove unused handleCompiledReferences chat functions
This commit is contained in:
@@ -15,24 +15,6 @@ export interface ResponseWithReferences {
|
|||||||
response?: string;
|
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 {
|
interface MessageChunk {
|
||||||
type: string;
|
type: string;
|
||||||
data: string | object;
|
data: string | object;
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import { useAuthenticatedData } from '@/app/common/auth';
|
|||||||
|
|
||||||
import ChatInputArea, { ChatOptions } from '@/app/components/chatInputArea/chatInputArea';
|
import ChatInputArea, { ChatOptions } from '@/app/components/chatInputArea/chatInputArea';
|
||||||
import { StreamMessage } from '@/app/components/chatMessage/chatMessage';
|
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';
|
import { AgentData } from '@/app/agents/page';
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user