Manage AI Knowledge Bases in Wacht
fetchKnowledgeBases(options?: ListKnowledgeBasesOptions)
options
(optional): An object containing pagination and filtering options.
page
(number): The page number to retrieve.per_page
(number): The number of items per page.search
(string): Search term for knowledge bases.Promise<KnowledgeBaseListResponse>
: A promise that resolves to a list of AI knowledge bases and pagination information.
createKnowledgeBase(request: CreateAiKnowledgeBaseRequest)
request
(CreateAiKnowledgeBaseRequest): The request body containing the details of the new AI knowledge base.Promise<AiKnowledgeBase>
: A promise that resolves to the newly created AI knowledge base object.
fetchKnowledgeBase(knowledgeBaseId: string)
knowledgeBaseId
(string): The unique identifier of the AI knowledge base.Promise<AiKnowledgeBase>
: A promise that resolves to the AI knowledge base object.
updateKnowledgeBase(knowledgeBaseId: string, request: UpdateAiKnowledgeBaseRequest)
knowledgeBaseId
(string): The unique identifier of the AI knowledge base to update.request
(UpdateAiKnowledgeBaseRequest): The request body containing the updated details of the AI knowledge base.Promise<AiKnowledgeBase>
: A promise that resolves to the updated AI knowledge base object.
deleteKnowledgeBase(knowledgeBaseId: string)
knowledgeBaseId
(string): The unique identifier of the AI knowledge base to delete.Promise<void>
: A promise that resolves when the knowledge base is successfully deleted.
fetchDocuments(knowledgeBaseId: string)
knowledgeBaseId
(string): The unique identifier of the knowledge base.Promise<DocumentListResponse>
: A promise that resolves to a list of documents and pagination information.
uploadDocument(knowledgeBaseId: string, file: Buffer, fileName: string)
knowledgeBaseId
(string): The unique identifier of the knowledge base.file
(Buffer): The content of the file to upload.fileName
(string): The name of the file.Promise<KnowledgeBaseDocument>
: A promise that resolves to the newly uploaded document object.
deleteDocument(knowledgeBaseId: string, documentId: string)
knowledgeBaseId
(string): The unique identifier of the knowledge base.documentId
(string): The unique identifier of the document to delete.Promise<void>
: A promise that resolves when the document is successfully deleted.
searchGlobal(options: KnowledgeBaseSearchOptions)
options
(KnowledgeBaseSearchOptions): The search options.
query
(string): The search query.limit
(number): The maximum number of search results to return.threshold
(number): The minimum relevance score for results.Promise<KnowledgeBaseSearchResult>
: A promise that resolves to the search results.
searchKnowledgeBase(knowledgeBaseId: string, options: KnowledgeBaseSearchOptions)
knowledgeBaseId
(string): The unique identifier of the knowledge base.options
(KnowledgeBaseSearchOptions): The search options.
query
(string): The search query.limit
(number): The maximum number of search results to return.threshold
(number): The minimum relevance score for results.Promise<KnowledgeBaseSearchResult>
: A promise that resolves to the search results.