@courseproof/ai
v0.1.1
Published
[](https://opensource.org/licenses/MIT)
Maintainers
Readme
@courseproof/ai
AI-powered certificate data extraction using large language models. Supports OpenAI, Anthropic Claude, and Google Gemini as backends.
Exports
AICertificateExtractor
| Method | Description |
|--------|-------------|
| extract(options) | Extracts structured certificate data, returns AIExtractionResult |
| extractAndMap(options) | Extracts and maps result to a Certificate object |
Functions
| Function | Description |
|----------|-------------|
| extractWithAI(config, options) | Low-level function calling the AI provider with retry logic |
| createPromptForCertificate(text, options?) | Builds a custom extraction prompt |
Interfaces
interface AIExtractionResult {
title?: string;
issuer?: string;
platform?: string;
recipientName?: string;
issueDate?: string;
credentialId?: string;
skills?: string[];
confidence: number;
}
interface ExtractionOptions {
text: string;
image?: Buffer;
context?: string;
}Usage
import { AICertificateExtractor } from "@courseproof/ai";
const extractor = new AICertificateExtractor({
provider: "openai",
apiKey: process.env.OPENAI_API_KEY,
model: "gpt-4",
});
const result = await extractor.extract({
text: "Course: Machine Learning, Issuer: Stanford University, Date: Jan 2024",
});
console.log(result.title); // "Machine Learning"
console.log(result.issuer); // "Stanford University"Installation
npm install @courseproof/aiLicense
MIT — see LICENSE for details.
Part of the CourseProof monorepo.
