@promptbook/browser
Version:
Promptbook: Run AI apps in plain human language across multiple models and platforms
52 lines (51 loc) • 1.77 kB
TypeScript
import { BaseCommitmentDefinition } from '../_base/BaseCommitmentDefinition';
import type { AgentModelRequirements } from '../_misc/AgentModelRequirements';
import { FrontendRAGService } from './FrontendRAGService';
/**
* KNOWLEDGE commitment definition
*
* The KNOWLEDGE commitment adds specific knowledge, facts, or context to the agent
* using RAG (Retrieval-Augmented Generation) approach for external sources.
*
* Supports both direct text knowledge and external sources like PDFs.
*
* Example usage in agent source:
*
* ```book
* KNOWLEDGE The company was founded in 2020 and specializes in AI-powered solutions
* KNOWLEDGE https://example.com/company-handbook.pdf
* KNOWLEDGE https://example.com/product-documentation.pdf
* ```
*
* @private [🪔] Maybe export the commitments through some package
*/
export declare class KnowledgeCommitmentDefinition extends BaseCommitmentDefinition<'KNOWLEDGE'> {
private ragService;
constructor();
/**
* Short one-line description of KNOWLEDGE.
*/
get description(): string;
/**
* Markdown documentation for KNOWLEDGE commitment.
*/
get documentation(): string;
applyToAgentModelRequirements(requirements: AgentModelRequirements, content: string): AgentModelRequirements;
/**
* Check if content is a URL
*/
private isUrl;
/**
* Get RAG service instance for retrieving context during chat
*/
getRagService(): FrontendRAGService;
}
/**
* Singleton instance of the KNOWLEDGE commitment definition
*
* @private [🪔] Maybe export the commitments through some package
*/
export declare const KnowledgeCommitment: KnowledgeCommitmentDefinition;
/**
* Note: [💞] Ignore a discrepancy between file name and entity name
*/