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