@openclaw/voyage-provider 2026.11.7 → 2026.11.10-beta.2
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"entries":[{"output":"embedding-batch.js","source":"extensions/voyage/embedding-batch.ts"},{"output":"index.js","source":"extensions/voyage/index.ts"},{"output":"memory-embedding-adapter.js","source":"extensions/voyage/memory-embedding-adapter.ts"}],"chunks":[{"output":"embedding-batch.js","sha256":"
|
|
1
|
+
{"version":3,"entries":[{"output":"embedding-batch.js","source":"extensions/voyage/embedding-batch.ts"},{"output":"index.js","source":"extensions/voyage/index.ts"},{"output":"memory-embedding-adapter.js","source":"extensions/voyage/memory-embedding-adapter.ts"}],"chunks":[{"output":"embedding-batch.js","sha256":"6a13751a27dd93385f0ec6dfbd5e677af9ac6664ed0810843706ae46c90b8ac6","facadeSource":"extensions/voyage/embedding-batch.ts","sources":["extensions/voyage/embedding-batch.ts"]},{"output":"index.js","sha256":"90ee73620e11eeca26c087cb438f12c49ef7cd458e61d03e9303115dfd27b730","facadeSource":"extensions/voyage/index.ts","sources":["extensions/voyage/index.ts"]},{"output":"memory-embedding-adapter.js","sha256":"24db750c85c02062f377c941399723c1152b237bfba81f43939f695f7bae1876","facadeSource":"extensions/voyage/memory-embedding-adapter.ts","sources":["extensions/voyage/memory-embedding-adapter.ts"]}],"unrenderedSources":[]}
|
package/dist/embedding-batch.js
CHANGED
|
@@ -2,34 +2,37 @@ import { EMBEDDING_BATCH_ENDPOINT, buildBatchHeaders, buildEmbeddingBatchGroupOp
|
|
|
2
2
|
import { assertOkOrThrowProviderError, createProviderOperationDeadline, readProviderJsonResponse, resolveProviderOperationTimeoutMs, waitProviderOperationPollInterval } from "openclaw/plugin-sdk/provider-http";
|
|
3
3
|
import { readResponseWithLimit } from "openclaw/plugin-sdk/response-limit-runtime";
|
|
4
4
|
import { normalizeStringEntries } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
|
-
|
|
5
|
+
// extensions/voyage/embedding-batch.ts
|
|
6
6
|
const VOYAGE_BATCH_COMPLETION_WINDOW = "12h";
|
|
7
7
|
const VOYAGE_BATCH_MAX_REQUESTS = 5e4;
|
|
8
8
|
const VOYAGE_BATCH_RESPONSE_MAX_BYTES = 16777216;
|
|
9
|
-
function
|
|
10
|
-
return {
|
|
9
|
+
async function fetchVoyageBatchResource(params) {
|
|
10
|
+
return await withRemoteHttpResponse({
|
|
11
11
|
url: resolveEmbeddingEndpointUrl(params.client.baseUrl, params.path),
|
|
12
12
|
ssrfPolicy: params.client.ssrfPolicy,
|
|
13
13
|
resolveRequestHeaders: params.client.resolveRequestHeaders,
|
|
14
14
|
signal: params.signal,
|
|
15
15
|
init: { headers: buildBatchHeaders(params.client, { json: true }) },
|
|
16
|
-
onResponse:
|
|
17
|
-
|
|
16
|
+
onResponse: async (res, requestHeaders) => {
|
|
17
|
+
await assertOkOrThrowProviderError(res, params.label, { requestHeaders });
|
|
18
|
+
return await params.parse(res);
|
|
19
|
+
}
|
|
20
|
+
});
|
|
18
21
|
}
|
|
19
22
|
async function readVoyageBatchError(params) {
|
|
20
23
|
try {
|
|
21
|
-
return await
|
|
24
|
+
return await fetchVoyageBatchResource({
|
|
22
25
|
client: params.client,
|
|
23
26
|
path: `files/${params.errorFileId}/content`,
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
label: "voyage.batch-error-file-content",
|
|
28
|
+
parse: async (res) => {
|
|
26
29
|
const bytes = await readResponseWithLimit(res, VOYAGE_BATCH_RESPONSE_MAX_BYTES, { onOverflow: ({ maxBytes: maxBytesLocal }) => /* @__PURE__ */ new Error(`voyage batch error file content exceeds ${maxBytesLocal} bytes`) });
|
|
27
30
|
const text = new TextDecoder().decode(bytes);
|
|
28
31
|
if (!text.trim()) return;
|
|
29
32
|
const lines = normalizeStringEntries(text.split("\n")).map((line) => JSON.parse(line));
|
|
30
33
|
return formatBatchErrorDetail(extractBatchErrorMessage(lines));
|
|
31
34
|
}
|
|
32
|
-
})
|
|
35
|
+
});
|
|
33
36
|
} catch (err) {
|
|
34
37
|
return formatUnavailableBatchError(err);
|
|
35
38
|
}
|
|
@@ -73,14 +76,12 @@ async function runVoyageEmbeddingBatches(params) {
|
|
|
73
76
|
client: params.client,
|
|
74
77
|
errorFileId
|
|
75
78
|
}),
|
|
76
|
-
readOutput: (fileId, read) =>
|
|
79
|
+
readOutput: (fileId, read) => fetchVoyageBatchResource({
|
|
77
80
|
client: params.client,
|
|
78
81
|
path: `files/${fileId}/content`,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
})),
|
|
82
|
+
label: "voyage.batch-file-content",
|
|
83
|
+
parse: read
|
|
84
|
+
}),
|
|
84
85
|
waitForBatch: async (batchInfo, pollIntervalMs, timeoutMs) => {
|
|
85
86
|
const batchId = batchInfo.id;
|
|
86
87
|
const client = params.client;
|
|
@@ -98,15 +99,13 @@ async function runVoyageEmbeddingBatches(params) {
|
|
|
98
99
|
timeoutMs,
|
|
99
100
|
debug,
|
|
100
101
|
initial: batchInfo,
|
|
101
|
-
fetchStatus:
|
|
102
|
+
fetchStatus: (signal) => fetchVoyageBatchResource({
|
|
102
103
|
client,
|
|
103
104
|
path: `batches/${batchId}`,
|
|
105
|
+
label: "voyage.batch-status",
|
|
104
106
|
signal,
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
return await readProviderJsonResponse(res, "voyage-batch-status", { maxBytes: VOYAGE_BATCH_RESPONSE_MAX_BYTES });
|
|
108
|
-
}
|
|
109
|
-
})),
|
|
107
|
+
parse: (res) => readProviderJsonResponse(res, "voyage-batch-status", { maxBytes: VOYAGE_BATCH_RESPONSE_MAX_BYTES })
|
|
108
|
+
}),
|
|
110
109
|
resolveTimeoutMs: () => resolveProviderOperationTimeoutMs({
|
|
111
110
|
deadline,
|
|
112
111
|
defaultTimeoutMs: timeoutMs
|
|
@@ -123,5 +122,4 @@ async function runVoyageEmbeddingBatches(params) {
|
|
|
123
122
|
}
|
|
124
123
|
});
|
|
125
124
|
}
|
|
126
|
-
//#endregion
|
|
127
125
|
export { runVoyageEmbeddingBatches };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { voyageMemoryEmbeddingProviderAdapter } from "./memory-embedding-adapter.js";
|
|
2
2
|
import { definePluginEntry } from "openclaw/plugin-sdk/plugin-entry";
|
|
3
|
-
|
|
3
|
+
// extensions/voyage/index.ts
|
|
4
4
|
var voyage_default = definePluginEntry({
|
|
5
5
|
id: "voyage",
|
|
6
6
|
name: "Voyage Embeddings",
|
|
@@ -9,5 +9,4 @@ var voyage_default = definePluginEntry({
|
|
|
9
9
|
api.registerEmbeddingProvider(voyageMemoryEmbeddingProviderAdapter);
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
//#endregion
|
|
13
12
|
export { voyage_default as default };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { runVoyageEmbeddingBatches } from "./embedding-batch.js";
|
|
2
|
-
import {
|
|
2
|
+
import { mapBatchEmbeddingsByIndex, sanitizeEmbeddingCacheHeaders } from "openclaw/plugin-sdk/embedding-provider-adapter";
|
|
3
3
|
import { createRemoteEmbeddingProvider, normalizeEmbeddingModelWithPrefixes, resolveRemoteEmbeddingClient } from "openclaw/plugin-sdk/memory-core-host-engine-embeddings";
|
|
4
|
-
|
|
4
|
+
// extensions/voyage/memory-embedding-adapter.ts
|
|
5
5
|
const DEFAULT_VOYAGE_EMBEDDING_MODEL = "voyage-4-large";
|
|
6
6
|
const DEFAULT_VOYAGE_BASE_URL = "https://api.voyageai.com/v1";
|
|
7
7
|
const VOYAGE_MAX_INPUT_TOKENS = {
|
|
@@ -15,8 +15,6 @@ const voyageMemoryEmbeddingProviderAdapter = {
|
|
|
15
15
|
transport: "remote",
|
|
16
16
|
authProviderId: "voyage",
|
|
17
17
|
autoSelectPriority: 40,
|
|
18
|
-
allowExplicitWhenConfiguredAuto: true,
|
|
19
|
-
shouldContinueAutoSelection: isMissingEmbeddingApiKeyError,
|
|
20
18
|
create: async (options) => {
|
|
21
19
|
const preparedOptions = {
|
|
22
20
|
...options,
|
|
@@ -65,5 +63,4 @@ const voyageMemoryEmbeddingProviderAdapter = {
|
|
|
65
63
|
};
|
|
66
64
|
}
|
|
67
65
|
};
|
|
68
|
-
//#endregion
|
|
69
66
|
export { voyageMemoryEmbeddingProviderAdapter };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/voyage-provider",
|
|
3
|
-
"version": "2026.11.
|
|
3
|
+
"version": "2026.11.10-beta.2",
|
|
4
4
|
"description": "OpenClaw Voyage embedding provider plugin.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
"minHostVersion": ">=2026.7.2"
|
|
19
19
|
},
|
|
20
20
|
"compat": {
|
|
21
|
-
"pluginApi": ">=2026.11.
|
|
21
|
+
"pluginApi": ">=2026.11.10-beta.2"
|
|
22
22
|
},
|
|
23
23
|
"build": {
|
|
24
|
-
"openclawVersion": "2026.11.
|
|
24
|
+
"openclawVersion": "2026.11.10-beta.2",
|
|
25
25
|
"bundledDist": false
|
|
26
26
|
},
|
|
27
27
|
"release": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"assets/activity.svg"
|
|
41
41
|
],
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"openclaw": ">=2026.11.
|
|
43
|
+
"openclaw": ">=2026.11.10-beta.2"
|
|
44
44
|
},
|
|
45
45
|
"peerDependenciesMeta": {
|
|
46
46
|
"openclaw": {
|