import { EmbeddingModel } from "../types"; import { OpenAIEmbeddingModel } from "./openai"; export type EmbeddingModelType = "openai" | "huggingface" | "local"; export interface EmbeddingConfig { type: EmbeddingModelType; apiKey?: string; modelName?: string; baseUrl?: string; } export class EmbeddingFactory { static create(config: EmbeddingConfig): EmbeddingModel { switch (config.type) { case "openai": if (!config.apiKey) { throw new Error("OpenAI API key is required"); } return new OpenAIEmbeddingModel(config.apiKey, config.modelName); // TODO: Add other embedding model implementations // case 'huggingface': // return new HuggingFaceEmbeddingModel(config); // case 'local': // return new LocalEmbeddingModel(config); default: throw new Error(`Unsupported embedding model type: ${config.type}`); } } } export * from "./openai"; export type { EmbeddingModel } from "../types";