s/online_context/onlineContext chat API response field for consistency

This will align the name of the online context field returned by
current chat message and chat history
This commit is contained in:
Debanjum Singh Solanky
2024-07-23 19:50:43 +05:30
parent 0277d16daf
commit eb4e12d3c5
4 changed files with 5 additions and 5 deletions

View File

@@ -515,7 +515,7 @@ function processMessageChunk(rawChunk) {
isVoice: false,
}
} else if (chunk.type === "references") {
chatMessageState.references = {"notes": chunk.data.context, "online": chunk.data.online_results};
chatMessageState.references = {"notes": chunk.data.context, "online": chunk.data.onlineContext};
} else if (chunk.type === 'message') {
const chunkData = chunk.data;
if (typeof chunkData === 'object' && chunkData !== null) {

View File

@@ -947,7 +947,7 @@ export class KhojChatView extends KhojPaneView {
isVoice: false,
};
} else if (chunk.type === "references") {
this.chatMessageState.references = {"notes": chunk.data.context, "online": chunk.data.online_results};
this.chatMessageState.references = {"notes": chunk.data.context, "online": chunk.data.onlineContext};
} else if (chunk.type === 'message') {
const chunkData = chunk.data;
if (typeof chunkData === 'object' && chunkData !== null) {

View File

@@ -834,7 +834,7 @@ To get started, just start typing below. You can also type / to see a list of co
isVoice: false,
}
} else if (chunk.type === "references") {
chatMessageState.references = {"notes": chunk.data.context, "online": chunk.data.online_results};
chatMessageState.references = {"notes": chunk.data.context, "online": chunk.data.onlineContext};
} else if (chunk.type === 'message') {
const chunkData = chunk.data;
if (typeof chunkData === 'object' && chunkData !== null) {

View File

@@ -831,7 +831,7 @@ async def chat(
{
"inferredQueries": inferred_queries,
"context": compiled_references,
"online_results": online_results,
"onlineContext": online_results,
},
):
yield result
@@ -887,7 +887,7 @@ async def chat(
"content-type": "application/json",
"intentType": intent_type,
"context": compiled_references,
"online_results": online_results,
"onlineContext": online_results,
"inferredQueries": [improved_image_prompt],
"image": image,
}