@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.
@@ -691,7 +691,9 @@ function createLocalHttpEmbeddingProvider(opts) {
691
691
  };
692
692
  }
693
693
  function createGeminiEmbeddingProvider(opts) {
694
- const id = stableProviderId(`gemini:${opts.model}`, `${opts.model}|${opts.dimension}`);
694
+ const baseUrl = trimTrailingSlashes(opts.baseUrl || GEMINI_DEFAULT_BASE_URL);
695
+ const descriptorInput = `${baseUrl}|${opts.model}|${opts.dimension}`;
696
+ const id = stableProviderId(`gemini:${opts.model}`, descriptorInput);
695
697
  return {
696
698
  id,
697
699
  model: opts.model,
@@ -699,7 +701,7 @@ function createGeminiEmbeddingProvider(opts) {
699
701
  async embed(texts) {
700
702
  if (texts.length === 0) return [];
701
703
  const fetchFn = getFetch(opts.fetchImpl);
702
- const url2 = `https://generativelanguage.googleapis.com/v1beta/models/${opts.model}:batchEmbedContents?key=${opts.apiKey}`;
704
+ const url2 = `${baseUrl}/v1beta/models/${opts.model}:batchEmbedContents?key=${opts.apiKey}`;
703
705
  const requests = texts.map((text) => ({
704
706
  model: `models/${opts.model}`,
705
707
  content: { parts: [{ text }] },
@@ -731,9 +733,11 @@ function createGeminiEmbeddingProvider(opts) {
731
733
  function normalizeEmbeddingBaseUrl(baseUrl) {
732
734
  return trimTrailingSlashes(baseUrl);
733
735
  }
736
+ var GEMINI_DEFAULT_BASE_URL;
734
737
  var init_embedding = __esm({
735
738
  "src/search/embedding.ts"() {
736
739
  "use strict";
740
+ GEMINI_DEFAULT_BASE_URL = "https://generativelanguage.googleapis.com";
737
741
  }
738
742
  });
739
743
 
@@ -789,6 +793,7 @@ function createEmbeddingProvider(input, opts) {
789
793
  model: normalized.model,
790
794
  dimension: normalized.dimension,
791
795
  apiKey: normalized.apiKey,
796
+ baseUrl: normalized.baseUrl || void 0,
792
797
  fetchImpl: opts?.fetchImpl
793
798
  });
794
799
  }