UNPKG

@promptbook/utils

Version:

Promptbook: Run AI apps in plain human language across multiple models and platforms

35 lines (34 loc) 1.3 kB
import type { AgentModelRequirements } from '../../_misc/AgentModelRequirements'; import { FrontendRAGService } from '../FrontendRAGService'; /** * Helper utilities for RAG processing in chat systems * * @private */ export declare class RAGHelper { /** * Initialize knowledge sources from agent requirements * This should be called when starting a chat session */ static initializeKnowledgeSources(requirements: AgentModelRequirements): Promise<FrontendRAGService | null>; /** * Get relevant context for a user query * This should be called before sending the query to the AI model */ static getRelevantContext(ragService: FrontendRAGService | null, userQuery: string): Promise<string>; /** * Update system message with relevant context for a query */ static updateSystemMessageWithContext(requirements: AgentModelRequirements, ragService: FrontendRAGService | null, userQuery: string): Promise<AgentModelRequirements>; /** * Get statistics about the knowledge base */ static getKnowledgeStats(ragService: FrontendRAGService | null): { sources: number; chunks: number; isInitialized: boolean; } | null; } /** * Note: [💞] Ignore a discrepancy between file name and entity name */