groq-ocr
Version:
a library to run OCR with Groq provided models.
26 lines (25 loc) • 1.09 kB
TypeScript
/**
* Enumeration representing available Groq Vision model options.
* @enum {string}
* @readonly
* @description Models that can be used for vision and language processing with Groq API
*/
export declare enum GroqVisionModel {
LLAMA_32_11B = "llama-3.2-11b-vision-preview",
LLAMA_32_90B = "llama-3.2-90b-vision-preview"
}
/**
* Performs Optical Character Recognition (OCR) on an image file using Groq's API.
*
* @param options - The OCR options
* @param options.filePath - The path to the image file to perform OCR on. Accepts local file paths or remote URLs. Allowed extensions: .jpg, .jpeg, .png, .pdf
* @param options.apiKey - Optional Groq API key. Defaults to GROQ_API_KEY environment variable
* @param options.model - Optional Groq vision model to use. Defaults to LLAMA_32_11B
* @returns Promise<string> A promise that resolves to the extracted text in markdown format
*/
export declare function ocr({ filePath, apiKey, model, jsonMode, }: {
filePath: string;
apiKey?: string;
model?: GroqVisionModel;
jsonMode?: boolean;
}): Promise<string>;