@thecodingwhale/cv-processor
Version:
CV Processor to extract structured data from PDF resumes using TypeScript
47 lines (46 loc) • 1.45 kB
TypeScript
import { CVData, ProcessorOptions } from './types';
import { AIProvider, ConversionType } from './types/AIProvider';
/**
* AI-powered CV Processor class to extract structured data from PDF resumes
*/
export declare class AICVProcessor {
private aiProvider;
private verbose;
private instructionsPath;
private expectedTotalFields?;
private categories?;
/**
* Initialize the AI CV processor
*/
constructor(aiProvider: AIProvider, options?: ProcessorOptions);
/**
* Validate if a string is a proper URL
*/
private isValidUrl;
/**
* Load instructions from the specified file
* Falls back to default instructions if file cannot be read
*/
private loadInstructions;
/**
* Estimate token count based on text content
* This is a fallback when actual token counts aren't available
*/
private estimateTokenCount;
/**
* Process a URL and extract structured CV information using AI
*/
processUrlToTexts(url: string): Promise<CVData>;
/**
* Fetch URL content using Playwright with 5-second wait for dynamic content
*/
private fetchUrlWithPlaywright;
/**
* Process a CV PDF and extract structured information using AI
*/
processCv(texts: string[], conversionType?: ConversionType): Promise<CVData>;
/**
* Save CV data to a JSON file
*/
saveToJson(cvData: CVData, outputPath: string): void;
}