Render references after chat response is streamed for smoother render

Otherwise the Khoj's chat response is filling up in between the
streamed message and already rendered references section at the bottom
of the message

Define OnlineContext type to simplify typing online context param
across other interfaces and functions
This commit is contained in:
Debanjum Singh Solanky
2024-08-02 02:33:04 +05:30
parent a733e5c1d4
commit 02b46a1784
5 changed files with 60 additions and 59 deletions

View File

@@ -33,6 +33,10 @@ export interface Context {
file: string;
}
export interface OnlineContext {
[key: string]: OnlineContextData;
}
export interface WebPage {
link: string;
query: string;
@@ -85,11 +89,9 @@ export interface SingleChatMessage {
automationId: string;
by: string;
message: string;
context: Context[];
created: string;
onlineContext: {
[key: string]: OnlineContextData
}
context: Context[];
onlineContext: OnlineContext;
rawQuery?: string;
intent?: Intent;
agent?: AgentData;
@@ -99,9 +101,7 @@ export interface StreamMessage {
rawResponse: string;
trainOfThought: string[];
context: Context[];
onlineContext: {
[key: string]: OnlineContextData
}
onlineContext: OnlineContext;
completed: boolean;
rawQuery: string;
timestamp: string;