mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-03 13:19:16 +00:00
Revert "Convert conversationId int to string before making api request to bulk update file filters"
This reverts commitc9665fb20b. Revert "Fix handling for new conversation in agents page" This reverts commit3466f04992. Revert "Add a unique_id field for identifiying conversations (#914)" This reverts commitece2ec2d90.
This commit is contained in:
@@ -163,7 +163,7 @@ export function modifyFileFilterForConversation(
|
||||
const method = mode === "add" ? "POST" : "DELETE";
|
||||
|
||||
const body = {
|
||||
conversation_id: String(conversationId),
|
||||
conversation_id: conversationId,
|
||||
filenames: filenames,
|
||||
};
|
||||
const addUrl = `/api/chat/conversation/file-filters/bulk`;
|
||||
@@ -177,6 +177,7 @@ export function modifyFileFilterForConversation(
|
||||
})
|
||||
.then((response) => response.json())
|
||||
.then((data) => {
|
||||
console.log("ADDEDFILES DATA: ", data);
|
||||
setAddedFiles(data);
|
||||
})
|
||||
.catch((err) => {
|
||||
@@ -185,11 +186,6 @@ export function modifyFileFilterForConversation(
|
||||
});
|
||||
}
|
||||
|
||||
interface NewConversationMetadata {
|
||||
conversationId: string;
|
||||
conversationUniqueId: string;
|
||||
}
|
||||
|
||||
export async function createNewConversation(slug: string) {
|
||||
try {
|
||||
const response = await fetch(`/api/chat/sessions?client=web&agent_slug=${slug}`, {
|
||||
@@ -198,14 +194,9 @@ export async function createNewConversation(slug: string) {
|
||||
if (!response.ok)
|
||||
throw new Error(`Failed to fetch chat sessions with status: ${response.status}`);
|
||||
const data = await response.json();
|
||||
const uniqueId = data.unique_id;
|
||||
const conversationId = data.conversation_id;
|
||||
if (!uniqueId) throw new Error("Unique ID not found in response");
|
||||
if (!conversationId) throw new Error("Conversation ID not found in response");
|
||||
return {
|
||||
conversationId: conversationId,
|
||||
conversationUniqueId: uniqueId,
|
||||
} as NewConversationMetadata;
|
||||
const conversationID = data.conversation_id;
|
||||
if (!conversationID) throw new Error("Conversation ID not found in response");
|
||||
return conversationID;
|
||||
} catch (error) {
|
||||
console.error("Error creating new conversation:", error);
|
||||
throw error;
|
||||
|
||||
Reference in New Issue
Block a user