@openclaw/amazon-bedrock-provider 2026.5.16-beta.3 → 2026.5.16-beta.5
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/embedding-provider.js +12 -12
- package/package.json +5 -5
|
@@ -226,7 +226,7 @@ async function createBedrockEmbeddingProvider(options) {
|
|
|
226
226
|
dimensions: client.dimensions,
|
|
227
227
|
family
|
|
228
228
|
});
|
|
229
|
-
const invoke = async (body) => {
|
|
229
|
+
const invoke = async (body, signal) => {
|
|
230
230
|
await refreshAwsSharedConfigCacheForBedrock();
|
|
231
231
|
const sdk = new BedrockRuntimeClient({ region: client.region });
|
|
232
232
|
try {
|
|
@@ -235,28 +235,28 @@ async function createBedrockEmbeddingProvider(options) {
|
|
|
235
235
|
body,
|
|
236
236
|
contentType: "application/json",
|
|
237
237
|
accept: "application/json"
|
|
238
|
-
}));
|
|
238
|
+
}), signal ? { abortSignal: signal } : void 0);
|
|
239
239
|
return new TextDecoder().decode(res.body);
|
|
240
240
|
} finally {
|
|
241
241
|
sdk.destroy();
|
|
242
242
|
}
|
|
243
243
|
};
|
|
244
244
|
const isCohere = family === "cohere-v3" || family === "cohere-v4";
|
|
245
|
-
const embedSingle = async (text) => {
|
|
246
|
-
return sanitizeAndNormalizeEmbedding(parseSingle(family, await invoke(buildBody(family, text, client.dimensions))));
|
|
245
|
+
const embedSingle = async (text, signal) => {
|
|
246
|
+
return sanitizeAndNormalizeEmbedding(parseSingle(family, await invoke(buildBody(family, text, client.dimensions), signal)));
|
|
247
247
|
};
|
|
248
|
-
const embedCohere = async (texts, inputType) => {
|
|
249
|
-
return parseCohereBatch(family, await invoke(buildCohereBody(family, texts, inputType, client.dimensions))).map((e) => sanitizeAndNormalizeEmbedding(e));
|
|
248
|
+
const embedCohere = async (texts, inputType, signal) => {
|
|
249
|
+
return parseCohereBatch(family, await invoke(buildCohereBody(family, texts, inputType, client.dimensions), signal)).map((e) => sanitizeAndNormalizeEmbedding(e));
|
|
250
250
|
};
|
|
251
|
-
const embedQuery = async (text) => {
|
|
251
|
+
const embedQuery = async (text, options) => {
|
|
252
252
|
if (!text.trim()) return [];
|
|
253
|
-
if (isCohere) return (await embedCohere([text], "search_query"))[0] ?? [];
|
|
254
|
-
return embedSingle(text);
|
|
253
|
+
if (isCohere) return (await embedCohere([text], "search_query", options?.signal))[0] ?? [];
|
|
254
|
+
return embedSingle(text, options?.signal);
|
|
255
255
|
};
|
|
256
|
-
const embedBatch = async (texts) => {
|
|
256
|
+
const embedBatch = async (texts, options) => {
|
|
257
257
|
if (texts.length === 0) return [];
|
|
258
|
-
if (isCohere) return embedCohere(texts, "search_document");
|
|
259
|
-
return Promise.all(texts.map((t) => t.trim() ? embedSingle(t) : Promise.resolve([])));
|
|
258
|
+
if (isCohere) return embedCohere(texts, "search_document", options?.signal);
|
|
259
|
+
return Promise.all(texts.map((t) => t.trim() ? embedSingle(t, options?.signal) : Promise.resolve([])));
|
|
260
260
|
};
|
|
261
261
|
return {
|
|
262
262
|
provider: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/amazon-bedrock-provider",
|
|
3
|
-
"version": "2026.5.16-beta.
|
|
3
|
+
"version": "2026.5.16-beta.5",
|
|
4
4
|
"description": "OpenClaw Amazon Bedrock provider plugin",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"@aws-sdk/client-bedrock": "3.1047.0",
|
|
12
12
|
"@aws-sdk/client-bedrock-runtime": "3.1045.0",
|
|
13
13
|
"@aws-sdk/credential-provider-node": "3.972.41",
|
|
14
|
-
"@earendil-works/pi-ai": "0.74.
|
|
14
|
+
"@earendil-works/pi-ai": "0.74.1",
|
|
15
15
|
"@smithy/shared-ini-file-loader": "4.5.2"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
"minHostVersion": ">=2026.5.12-beta.1"
|
|
28
28
|
},
|
|
29
29
|
"compat": {
|
|
30
|
-
"pluginApi": ">=2026.5.16-beta.
|
|
30
|
+
"pluginApi": ">=2026.5.16-beta.5"
|
|
31
31
|
},
|
|
32
32
|
"build": {
|
|
33
|
-
"openclawVersion": "2026.5.16-beta.
|
|
33
|
+
"openclawVersion": "2026.5.16-beta.5",
|
|
34
34
|
"bundledDist": false
|
|
35
35
|
},
|
|
36
36
|
"release": {
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"openclaw.plugin.json"
|
|
47
47
|
],
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"openclaw": ">=2026.5.16-beta.
|
|
49
|
+
"openclaw": ">=2026.5.16-beta.5"
|
|
50
50
|
},
|
|
51
51
|
"peerDependenciesMeta": {
|
|
52
52
|
"openclaw": {
|