UNPKG

contextual-agent-sdk

Version:

SDK for building AI agents with seamless voice-text context switching

56 lines 1.66 kB
import { ContextProvider, ContextResult, BaseConfig } from '../types/context'; interface DocumentSource { type: 'file' | 'directory' | 'url' | 'custom'; path: string; format?: 'markdown' | 'text' | 'json' | 'auto'; encoding?: string; weight?: number; tags?: string[]; } interface KnowledgeBaseConfig extends BaseConfig { options?: { sources?: DocumentSource[]; searchType?: 'exact' | 'fuzzy' | 'semantic'; maxResults?: number; chunkSize?: number; customSearch?: (query: string) => Promise<any[]>; autoDiscoverDocs?: { enabled?: boolean; rootPath?: string; patterns?: string[]; recursive?: boolean; }; }; } export declare class KnowledgeBaseProvider implements ContextProvider { id: string; name: string; source: 'knowledge_base'; priority: number; enabled: boolean; private config; private documentCache; constructor(config: KnowledgeBaseConfig); getContext(params: { query?: string; }): Promise<ContextResult | null>; formatContext(context: ContextResult): string; private searchDocumentSource; private loadFile; private loadDirectory; private loadUrl; private parseDocument; private parseMarkdown; private parseJson; private detectFormat; private isDocumentFile; private autoDiscoverDocuments; private getDocumentWeight; private getDocumentType; private matchesQuery; private getCachedDocument; private cacheDocument; private formatResults; } export {}; //# sourceMappingURL=KnowledgeBaseProvider.d.ts.map