feat: basic entities of kb

This commit is contained in:
Junyan Qin
2025-06-29 21:00:48 +08:00
parent 22ef1a399e
commit bbf583ddb5
6 changed files with 221 additions and 0 deletions

View File

@@ -34,6 +34,9 @@ import {
AsyncTask,
ApiRespWebChatMessage,
ApiRespWebChatMessages,
ApiRespKnowledgeBases,
ApiRespKnowledgeBase,
KnowledgeBase,
} from '@/app/infra/entities/api';
import { GetBotLogsRequest } from '@/app/infra/http/requestParam/bots/GetBotLogsRequest';
import { GetBotLogsResponse } from '@/app/infra/http/requestParam/bots/GetBotLogsResponse';
@@ -427,6 +430,19 @@ class HttpClient {
return this.post(`/api/v1/platform/bots/${botId}/logs`, request);
}
// ============ Knowledge Base API ============
public getKnowledgeBases(): Promise<ApiRespKnowledgeBases> {
return this.get('/api/v1/knowledge/bases');
}
public getKnowledgeBase(uuid: string): Promise<ApiRespKnowledgeBase> {
return this.get(`/api/v1/knowledge/bases/${uuid}`);
}
public createKnowledgeBase(base: KnowledgeBase): Promise<{ uuid: string }> {
return this.post('/api/v1/knowledge/bases', base);
}
// ============ Plugins API ============
public getPlugins(): Promise<ApiRespPlugins> {
return this.get('/api/v1/plugins');