Add index button
This commit is contained in:
@@ -623,6 +623,23 @@ export const deleteKnowledgeDocument = async (kbId: string, docId: string): Prom
|
||||
await apiRequest(`/knowledge/bases/${kbId}/documents/${docId}`, { method: 'DELETE' });
|
||||
};
|
||||
|
||||
export const indexKnowledgeDocument = async (
|
||||
kbId: string,
|
||||
docId: string,
|
||||
content: string,
|
||||
): Promise<{ message: string; chunkCount: number }> => {
|
||||
return apiRequest<{ message: string; chunkCount: number }>(
|
||||
`/knowledge/bases/${kbId}/documents/${docId}/index`,
|
||||
{
|
||||
method: 'POST',
|
||||
body: {
|
||||
document_id: docId,
|
||||
content,
|
||||
},
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
export type KnowledgeSearchResultItem = {
|
||||
content: string;
|
||||
metadata?: {
|
||||
|
||||
Reference in New Issue
Block a user