import { createLogger } from "../logger.js";
const log = createLogger("providers");
let cached = null;
function getEmbedProvider() {
  if (cached) return cached;
  cached = import("../embedding/fastembed-provider.js").then(async (m) => {
    const p = new m.FastembedEmbedProvider();
    await p.warmup();
    log.info("embed provider ready", { provider: "embed", impl: "fastembed", modelId: p.modelId, dim: p.dim });
    return p;
  }).catch((err) => {
    cached = null;
    throw err;
  });
  return cached;
}
function _resetEmbedProviderForTest() {
  cached = null;
}
export {
  _resetEmbedProviderForTest,
  getEmbedProvider
};
//# sourceMappingURL=embed-provider.js.map