feat: view and add document chunks for mongodb and faiss

This commit is contained in:
Siddhant Rai
2025-02-07 19:39:07 +05:30
parent f97b56a87b
commit 0379b81d43
11 changed files with 558 additions and 56 deletions

View File

@@ -24,6 +24,9 @@ const endpoints = {
UPDATE_TOOL_STATUS: '/api/update_tool_status',
UPDATE_TOOL: '/api/update_tool',
DELETE_TOOL: '/api/delete_tool',
GET_CHUNKS: (docId: string, page: number, per_page: number) =>
`/api/get_chunks?id=${docId}&page=${page}&per_page=${per_page}`,
ADD_CHUNK: '/api/add_chunk',
},
CONVERSATION: {
ANSWER: '/api/answer',

View File

@@ -47,6 +47,14 @@ const userService = {
apiClient.post(endpoints.USER.UPDATE_TOOL, data),
deleteTool: (data: any): Promise<any> =>
apiClient.post(endpoints.USER.DELETE_TOOL, data),
getDocumentChunks: (
docId: string,
page: number,
perPage: number,
): Promise<any> =>
apiClient.get(endpoints.USER.GET_CHUNKS(docId, page, perPage)),
addChunk: (data: any): Promise<any> =>
apiClient.post(endpoints.USER.ADD_CHUNK, data),
};
export default userService;