import { fileURLToPath as __fileURLToPath } from 'url';
import { dirname as __pathDirname } from 'path';
const __filename = __fileURLToPath(import.meta.url);
const __dirname = __pathDirname(__filename);
class OllamaEmbeddingProvider {
  dimension;
  baseUrl;
  model;
  constructor(baseUrl, model, dimension) {
    this.baseUrl = baseUrl;
    this.model = model;
    this.dimension = dimension;
  }
  async embed(text) {
    const res = await fetch(`${this.baseUrl}/api/embeddings`, {
      method: "POST",
      headers: { "Content-Type": "application/json" },
      body: JSON.stringify({ model: this.model, prompt: text })
    });
    if (!res.ok) throw new Error(`Ollama embed failed: ${res.status}`);
    const data = await res.json();
    return data.embedding;
  }
  async embedBatch(texts) {
    return Promise.all(texts.map((t) => this.embed(t)));
  }
}
export {
  OllamaEmbeddingProvider
};
//# sourceMappingURL=ollama-embedding-provider.js.map
