@smyslenny/agent-memory 4.3.0 → 4.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -676,8 +676,11 @@ function createLocalHttpEmbeddingProvider(opts) {
676
676
  }
677
677
  };
678
678
  }
679
+ var GEMINI_DEFAULT_BASE_URL = "https://generativelanguage.googleapis.com";
679
680
  function createGeminiEmbeddingProvider(opts) {
680
- const id = stableProviderId(`gemini:${opts.model}`, `${opts.model}|${opts.dimension}`);
681
+ const baseUrl = trimTrailingSlashes(opts.baseUrl || GEMINI_DEFAULT_BASE_URL);
682
+ const descriptorInput = `${baseUrl}|${opts.model}|${opts.dimension}`;
683
+ const id = stableProviderId(`gemini:${opts.model}`, descriptorInput);
681
684
  return {
682
685
  id,
683
686
  model: opts.model,
@@ -685,7 +688,7 @@ function createGeminiEmbeddingProvider(opts) {
685
688
  async embed(texts) {
686
689
  if (texts.length === 0) return [];
687
690
  const fetchFn = getFetch(opts.fetchImpl);
688
- const url = `https://generativelanguage.googleapis.com/v1beta/models/${opts.model}:batchEmbedContents?key=${opts.apiKey}`;
691
+ const url = `${baseUrl}/v1beta/models/${opts.model}:batchEmbedContents?key=${opts.apiKey}`;
689
692
  const requests = texts.map((text) => ({
690
693
  model: `models/${opts.model}`,
691
694
  content: { parts: [{ text }] },
@@ -770,6 +773,7 @@ function createEmbeddingProvider(input, opts) {
770
773
  model: normalized.model,
771
774
  dimension: normalized.dimension,
772
775
  apiKey: normalized.apiKey,
776
+ baseUrl: normalized.baseUrl || void 0,
773
777
  fetchImpl: opts?.fetchImpl
774
778
  });
775
779
  }