@openclaw/deepinfra-provider 2026.8.1-beta.2 → 2026.9.1-beta.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/doctor-contract-api.js +12 -7
- package/dist/embedding-adapter.js +24 -17
- package/dist/provider-models.js +7 -5
- package/package.json +4 -4
|
@@ -37,18 +37,23 @@ function normalizeBaseUrlValue(value) {
|
|
|
37
37
|
return trimmed ? trimmed : void 0;
|
|
38
38
|
}
|
|
39
39
|
function normalizeCompatibilityConfig({ cfg }) {
|
|
40
|
-
const models =
|
|
41
|
-
const providers =
|
|
42
|
-
const provider =
|
|
40
|
+
const models = cfg.models;
|
|
41
|
+
const providers = models?.providers;
|
|
42
|
+
const provider = providers?.deepinfra;
|
|
43
43
|
if (!provider) return {
|
|
44
44
|
config: cfg,
|
|
45
45
|
changes: []
|
|
46
46
|
};
|
|
47
47
|
const changes = [];
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
const providerRecord = asObjectRecord(provider) ?? {};
|
|
49
|
+
const { nativeBaseUrl, ...providerWithoutLegacyNativeBaseUrl } = providerRecord;
|
|
50
|
+
const next = {
|
|
51
|
+
...providerWithoutLegacyNativeBaseUrl,
|
|
52
|
+
baseUrl: provider.baseUrl,
|
|
53
|
+
models: provider.models
|
|
54
|
+
};
|
|
55
|
+
if (Object.hasOwn(providerRecord, "nativeBaseUrl")) {
|
|
56
|
+
const legacyNative = normalizeBaseUrlValue(nativeBaseUrl);
|
|
52
57
|
if (normalizeBaseUrlValue(next.baseUrl)) changes.push(`${PROVIDER_PATH}.nativeBaseUrl: removed (baseUrl is already configured)`);
|
|
53
58
|
else if (legacyNative && !isDeepInfraApiHost(legacyNative)) {
|
|
54
59
|
next.baseUrl = CANONICAL_BASE_URL;
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
+
import { DEEPINFRA_BASE_URL } from "./provider-models.js";
|
|
1
2
|
import { DEFAULT_DEEPINFRA_EMBEDDING_MODEL, createDeepInfraEmbeddingProvider } from "./embedding-provider.js";
|
|
3
|
+
import { embeddingProviderOwnsDestination, sanitizeEmbeddingCacheHeaders } from "openclaw/plugin-sdk/memory-core-host-engine-embeddings";
|
|
2
4
|
//#region extensions/deepinfra/embedding-adapter.ts
|
|
5
|
+
const EXCLUDED_EMBEDDING_HEADERS = [
|
|
6
|
+
"authorization",
|
|
7
|
+
"content-type",
|
|
8
|
+
"x-api-key",
|
|
9
|
+
"api-key"
|
|
10
|
+
];
|
|
3
11
|
function textFromEmbeddingInput(input) {
|
|
4
12
|
return typeof input === "string" ? input : input.text;
|
|
5
13
|
}
|
|
@@ -13,21 +21,6 @@ function adaptMemoryEmbeddingProvider(provider) {
|
|
|
13
21
|
...provider.close ? { close: async () => await provider.close?.() } : {}
|
|
14
22
|
};
|
|
15
23
|
}
|
|
16
|
-
function buildMemoryCreateOptions(options) {
|
|
17
|
-
return {
|
|
18
|
-
config: options.config,
|
|
19
|
-
agentDir: options.agentDir,
|
|
20
|
-
provider: "deepinfra",
|
|
21
|
-
fallback: "none",
|
|
22
|
-
remote: options.remote,
|
|
23
|
-
model: options.model,
|
|
24
|
-
inputType: options.inputType,
|
|
25
|
-
queryInputType: options.queryInputType,
|
|
26
|
-
documentInputType: options.documentInputType,
|
|
27
|
-
outputDimensionality: options.dimensions,
|
|
28
|
-
taskType: options.taskType
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
24
|
function buildDeepInfraEmbeddingAdapter(options) {
|
|
32
25
|
const defaultModel = options?.embedModels?.[0]?.id ?? DEFAULT_DEEPINFRA_EMBEDDING_MODEL;
|
|
33
26
|
return {
|
|
@@ -36,17 +29,31 @@ function buildDeepInfraEmbeddingAdapter(options) {
|
|
|
36
29
|
transport: "remote",
|
|
37
30
|
authProviderId: "deepinfra",
|
|
38
31
|
create: async (createOptions) => {
|
|
32
|
+
const { dimensions, ...memoryOptions } = createOptions;
|
|
39
33
|
const { provider, client } = await createDeepInfraEmbeddingProvider({
|
|
40
|
-
...
|
|
34
|
+
...memoryOptions,
|
|
35
|
+
provider: "deepinfra",
|
|
36
|
+
fallback: "none",
|
|
37
|
+
outputDimensionality: dimensions,
|
|
38
|
+
taskType: createOptions.taskType,
|
|
41
39
|
defaultModel
|
|
42
40
|
});
|
|
41
|
+
const headers = sanitizeEmbeddingCacheHeaders(client.headers, EXCLUDED_EMBEDDING_HEADERS);
|
|
42
|
+
const usesDefaultIdentity = headers.length === 0 && embeddingProviderOwnsDestination({
|
|
43
|
+
baseUrl: client.baseUrl,
|
|
44
|
+
providerBaseUrl: DEEPINFRA_BASE_URL
|
|
45
|
+
});
|
|
43
46
|
return {
|
|
44
47
|
provider: provider ? adaptMemoryEmbeddingProvider(provider) : null,
|
|
45
48
|
runtime: {
|
|
46
49
|
id: "deepinfra",
|
|
47
50
|
cacheKeyData: {
|
|
48
51
|
provider: "deepinfra",
|
|
49
|
-
model: client.model
|
|
52
|
+
model: client.model,
|
|
53
|
+
...usesDefaultIdentity ? {} : {
|
|
54
|
+
baseUrl: client.baseUrl,
|
|
55
|
+
headers
|
|
56
|
+
}
|
|
50
57
|
}
|
|
51
58
|
}
|
|
52
59
|
};
|
package/dist/provider-models.js
CHANGED
|
@@ -202,13 +202,15 @@ function buildDeepInfraModelDefinition(model) {
|
|
|
202
202
|
};
|
|
203
203
|
}
|
|
204
204
|
function chatSurfaceModelToModelDefinition(model) {
|
|
205
|
+
const manifestModel = DEEPINFRA_MODEL_CATALOG.find((entry) => entry.id === model.id);
|
|
205
206
|
const input = model.tags.includes("vlm") ? ["text", "image"] : ["text"];
|
|
206
207
|
const reasoning = model.tags.includes("reasoning") || model.tags.includes("reasoning_effort");
|
|
207
208
|
return buildDeepInfraModelDefinition({
|
|
208
209
|
id: model.id,
|
|
209
210
|
name: model.name,
|
|
210
|
-
reasoning,
|
|
211
|
+
reasoning: manifestModel?.reasoning ?? reasoning,
|
|
211
212
|
input,
|
|
213
|
+
...manifestModel?.compat ? { compat: manifestModel.compat } : {},
|
|
212
214
|
contextWindow: model.contextWindow ?? DEEPINFRA_DEFAULT_CONTEXT_WINDOW,
|
|
213
215
|
maxTokens: model.maxTokens ?? DEEPINFRA_DEFAULT_MAX_TOKENS,
|
|
214
216
|
cost: {
|
|
@@ -277,11 +279,11 @@ async function discoverDeepInfraModels(options) {
|
|
|
277
279
|
if (chatModels.length === 0) return DEEPINFRA_MODEL_CATALOG.map(buildDeepInfraModelDefinition);
|
|
278
280
|
const liveModels = chatModels.map(chatSurfaceModelToModelDefinition);
|
|
279
281
|
const seen = new Set(liveModels.map((model) => model.id));
|
|
280
|
-
const manifestModels = DEEPINFRA_MODEL_CATALOG.
|
|
281
|
-
|
|
282
|
+
const manifestModels = DEEPINFRA_MODEL_CATALOG.filter((model) => {
|
|
283
|
+
const unseen = !seen.has(model.id);
|
|
282
284
|
seen.add(model.id);
|
|
283
|
-
return
|
|
284
|
-
});
|
|
285
|
+
return unseen;
|
|
286
|
+
}).map(buildDeepInfraModelDefinition);
|
|
285
287
|
return [...liveModels, ...manifestModels];
|
|
286
288
|
}
|
|
287
289
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/deepinfra-provider",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.9.1-beta.1",
|
|
4
4
|
"description": "OpenClaw DeepInfra provider plugin.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
"minHostVersion": ">=2026.6.8"
|
|
19
19
|
},
|
|
20
20
|
"compat": {
|
|
21
|
-
"pluginApi": ">=2026.
|
|
21
|
+
"pluginApi": ">=2026.9.1-beta.1"
|
|
22
22
|
},
|
|
23
23
|
"build": {
|
|
24
|
-
"openclawVersion": "2026.
|
|
24
|
+
"openclawVersion": "2026.9.1-beta.1",
|
|
25
25
|
"bundledDist": false
|
|
26
26
|
},
|
|
27
27
|
"release": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"README.md"
|
|
39
39
|
],
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"openclaw": ">=2026.
|
|
41
|
+
"openclaw": ">=2026.9.1-beta.1"
|
|
42
42
|
},
|
|
43
43
|
"peerDependenciesMeta": {
|
|
44
44
|
"openclaw": {
|