UNPKG

crewai-ts

Version:

TypeScript port of crewAI for agent-based workflows

64 lines 1.79 kB
/** * PDFSearchTool implementation * Provides PDF document search capabilities for agents using RAG * Optimized for performance, memory efficiency, and large document handling */ import { Knowledge } from '../../knowledge/index.js'; /** * Result of a PDF search operation */ export interface PDFSearchResult { query: string; results: Array<{ content: string; score: number; metadata: { page?: number; pageCount?: number; fileName?: string; filePath?: string; title?: string; author?: string; [key: string]: any; }; }>; error?: string; } /** * Options for configuring the PDFSearchTool */ export interface PDFSearchToolOptions { knowledgeBase?: Knowledge; cacheResults?: boolean; cacheExpiration?: number; timeoutMs?: number; maxRetries?: number; chunkSize?: number; chunkOverlap?: number; embeddingModelName?: string; } /** * Creates an optimized PDF search tool */ export declare function createPDFSearchTool(options?: PDFSearchToolOptions): import("../StructuredTool.js").StructuredTool<{ metadata?: Record<string, any>; query?: string; similarityThreshold?: number; pdfPath?: string | string[]; resultCount?: number; pageNumbers?: number[]; pageRange?: { end?: number; start?: number; }; }, PDFSearchResult>; /** * Real implementation would include PDF parsing and processing * This would require importing libraries such as pdf-parse or pdfjs * And implementing functions for: * - Loading and parsing PDFs * - Chunking text content * - Creating embeddings * - Optimized search with hot/warm/cold tiered storage */ //# sourceMappingURL=PDFSearchTool.d.ts.map