makima-ts
Version:
Typescript SDK for Makima.
46 lines (45 loc) • 1.43 kB
TypeScript
import { KnowledgeBase, KBDocument, SearchResult } from "./types";
export declare class KnowledgeAPI {
private baseUrl;
constructor(baseUrl: string);
getKnowledgeBases(): Promise<KnowledgeBase[]>;
getKnowledgeBaseByName(name: string): Promise<KnowledgeBase>;
createKnowledgeBase(kb: {
name: string;
description?: string;
embedding_model: string;
database_provider?: string;
}): Promise<{
id: string;
}>;
updateKnowledgeBase(name: string, kb: Partial<{
embedding_model: string;
description?: string;
}>): Promise<KnowledgeBase>;
deleteKnowledgeBase(name: string): Promise<{
message: string;
}>;
addDocumentToKnowledgeBase(name: string, document: {
content: string;
metadata?: {
[key: string]: any;
};
model?: string;
}): Promise<{
id: string;
}>;
updateDocumentInKnowledgeBase(name: string, document: {
id: string;
content?: string;
metadata?: {
[key: string]: any;
};
}): Promise<{
id: string;
}>;
removeDocumentFromKnowledgeBase(name: string, documentId: string): Promise<{
message: string;
}>;
getDocumentsFromKnowledgeBase(name: string): Promise<KBDocument[]>;
searchKnowledgeBase(name: string, query: string, k: number, model?: string): Promise<SearchResult[]>;
}