hnswsqlite
Version:
Vector search with HNSWlib and SQLite in TypeScript.
19 lines (15 loc) • 511 B
text/typescript
// Stub for OpenAI embedding plugin
// To use: install axios and set OPENAI_API_KEY in env
import axios from 'axios';
export class OpenAIEmbeddingGenerator {
private apiKey: string;
private model: string;
constructor(apiKey: string, model: string = 'text-embedding-ada-002') {
this.apiKey = apiKey;
this.model = model;
}
async embed(text: string): Promise<number[]> {
// Replace with real OpenAI API call
throw new Error('Not implemented: Use OpenAI API to get embeddings.');
}
}