@openclaw/deepinfra-provider 2026.10.10-beta.5 → 2026.11.5-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/.setup/{openclaw.plugin-5ywdmEQ1.mjs → openclaw.plugin-DMCTN2sM.mjs} +1 -2
- package/dist/.source-module-urls/e47411ce0a5b380d6718c7048f00db584c526b307735b67498f0ef6f921381f5.json +1 -0
- package/dist/capability-catalog.js +1 -2
- package/dist/doctor-contract-api.js +7 -13
- package/dist/embedding-adapter.js +44 -38
- package/dist/image-generation-provider.js +1 -2
- package/dist/index.js +25 -17
- package/dist/media-models.js +14 -61
- package/dist/media-understanding-provider.js +22 -26
- package/dist/onboard.js +1 -2
- package/dist/pricing-api.js +1 -2
- package/dist/provider-catalog.js +1 -2
- package/dist/provider-discovery.js +1 -2
- package/dist/provider-models.js +22 -80
- package/dist/provider-policy-api.js +1 -2
- package/dist/provider-static-catalog.js +2 -3
- package/dist/speech-provider.js +3 -4
- package/dist/surface-model-catalogs.js +6 -12
- package/dist/video-generation-provider.js +47 -87
- package/package.json +4 -4
- package/dist/.source-module-urls/71572d2835c363d07e5d187f2ff7fea2022daa8218b56741ea92229bfa58e619.json +0 -1
- package/dist/cache-wrapper.js +0 -19
- package/dist/embedding-provider.js +0 -27
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// extensions/deepinfra/openclaw.plugin.json
|
|
2
2
|
var openclaw_plugin_default = {
|
|
3
3
|
id: "deepinfra",
|
|
4
4
|
categories: ["models"],
|
|
@@ -204,5 +204,4 @@ var openclaw_plugin_default = {
|
|
|
204
204
|
"properties": {}
|
|
205
205
|
}
|
|
206
206
|
};
|
|
207
|
-
//#endregion
|
|
208
207
|
export { openclaw_plugin_default as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"entries":[{"output":"api.js","source":"extensions/deepinfra/api.ts"},{"output":"capability-catalog.js","source":"extensions/deepinfra/capability-catalog.ts"},{"output":"doctor-contract-api.js","source":"extensions/deepinfra/doctor-contract-api.ts"},{"output":"embedding-adapter.js","source":"extensions/deepinfra/embedding-adapter.ts"},{"output":"image-generation-provider.js","source":"extensions/deepinfra/image-generation-provider.ts"},{"output":"index.js","source":"extensions/deepinfra/index.ts"},{"output":"media-models.js","source":"extensions/deepinfra/media-models.ts"},{"output":"media-understanding-provider.js","source":"extensions/deepinfra/media-understanding-provider.ts"},{"output":"onboard.js","source":"extensions/deepinfra/onboard.ts"},{"output":"pricing-api.js","source":"extensions/deepinfra/pricing-api.ts"},{"output":"provider-catalog.js","source":"extensions/deepinfra/provider-catalog.ts"},{"output":"provider-discovery.js","source":"extensions/deepinfra/provider-discovery.ts"},{"output":"provider-models.js","source":"extensions/deepinfra/provider-models.ts"},{"output":"provider-policy-api.js","source":"extensions/deepinfra/provider-policy-api.ts"},{"output":"provider-static-catalog.js","source":"extensions/deepinfra/provider-static-catalog.ts"},{"output":"speech-provider.js","source":"extensions/deepinfra/speech-provider.ts"},{"output":"surface-model-catalogs.js","source":"extensions/deepinfra/surface-model-catalogs.ts"},{"output":"video-generation-provider.js","source":"extensions/deepinfra/video-generation-provider.ts"}],"chunks":[{"output":".setup/openclaw.plugin-DMCTN2sM.mjs","sha256":"53d0f886f6e92dad4c9f8b0eb8a8c3a5774a9eafb900bce282b708a2b17e217b","facadeSource":null,"sources":["extensions/deepinfra/openclaw.plugin.json"]},{"output":"api.js","sha256":"438836f453467ae64fad54a72be481c489e621e13373b8130b5a4668d1faeea5","facadeSource":"extensions/deepinfra/api.ts","sources":[]},{"output":"capability-catalog.js","sha256":"634d2237ba508a9808231c18bdd954e2d62d62bfe2b1e42027922f1e80f0003b","facadeSource":"extensions/deepinfra/capability-catalog.ts","sources":["extensions/deepinfra/capability-catalog.ts"]},{"output":"doctor-contract-api.js","sha256":"b7279947e9bdf6e16777182b104f8368cc715932bfefb5d79dc18591c980e4b7","facadeSource":"extensions/deepinfra/doctor-contract-api.ts","sources":["extensions/deepinfra/doctor-contract-api.ts","packages/normalization-core/src/record-coerce.ts","src/config/channel-config-normalization.ts","src/plugin-sdk/legacy-webhook-listener-migration.ts"]},{"output":"embedding-adapter.js","sha256":"24aa2f4660d04ffaf3f2c5b74de73e497834ce98e86b3f1a02e6ca8484f5596b","facadeSource":"extensions/deepinfra/embedding-adapter.ts","sources":["extensions/deepinfra/embedding-adapter.ts"]},{"output":"image-generation-provider.js","sha256":"962bd65a9b6bccce47f2477d41d39a6ef5141bda6fa5d51bb615b93c52690766","facadeSource":"extensions/deepinfra/image-generation-provider.ts","sources":["extensions/deepinfra/image-generation-provider.ts"]},{"output":"index.js","sha256":"caf701dbc4cc7cc8b39d9dc8b0f07252d4cbbabd9f875e07e1090846a12650d8","facadeSource":"extensions/deepinfra/index.ts","sources":["extensions/deepinfra/index.ts"]},{"output":"media-models.js","sha256":"be54e421d8a5e58f7f1d01397c63f3f9029fea3a0fbbbeebb3119da9fecdab15","facadeSource":"extensions/deepinfra/media-models.ts","sources":["extensions/deepinfra/media-models.ts"]},{"output":"media-understanding-provider.js","sha256":"a6999b9be895411065f43b2a3a3c7218a49131e34dab0c78bca47b72bf6b3602","facadeSource":"extensions/deepinfra/media-understanding-provider.ts","sources":["extensions/deepinfra/media-understanding-provider.ts"]},{"output":"onboard.js","sha256":"0ab163225d2b6fce8820e7f33445d81bc06497f9c449a16a2a6f92c476d9e6f0","facadeSource":"extensions/deepinfra/onboard.ts","sources":["extensions/deepinfra/onboard.ts"]},{"output":"pricing-api.js","sha256":"6ef309604845da991d8bb83420fa1297d706d3df0bfee01b8989eee4f1603410","facadeSource":"extensions/deepinfra/pricing-api.ts","sources":["extensions/deepinfra/pricing-api.ts"]},{"output":"provider-catalog.js","sha256":"c3e6141c00be6baa211f66041298e98339667b6de016d31e84f2bd53233ec285","facadeSource":"extensions/deepinfra/provider-catalog.ts","sources":["extensions/deepinfra/provider-catalog.ts"]},{"output":"provider-discovery.js","sha256":"89311266003d0ace1f64f2c50e5071484621d677d10f73949bccae16c0d633fd","facadeSource":"extensions/deepinfra/provider-discovery.ts","sources":["extensions/deepinfra/provider-discovery.ts"]},{"output":"provider-models.js","sha256":"781ba1aa5b14d89a2bdaf86969c5686af688f65ee216773e139960160cc2e32c","facadeSource":"extensions/deepinfra/provider-models.ts","sources":["extensions/deepinfra/provider-models.ts"]},{"output":"provider-policy-api.js","sha256":"80fa44885d8a7b89b092aae1e55a43a9fab85552da7e572e6689b517f8f2da4a","facadeSource":"extensions/deepinfra/provider-policy-api.ts","sources":["extensions/deepinfra/provider-policy-api.ts"]},{"output":"provider-static-catalog.js","sha256":"fa0cb267b8cf0ac776f5add95e6bfc2fc99c67442dc4a7e62f7d0e8a08efefc4","facadeSource":"extensions/deepinfra/provider-static-catalog.ts","sources":["extensions/deepinfra/provider-static-catalog.ts"]},{"output":"speech-provider.js","sha256":"775820d7602f6c1635e6d5f355a8dd4821b4b3d42a031728d124fdac448638c4","facadeSource":"extensions/deepinfra/speech-provider.ts","sources":["extensions/deepinfra/speech-provider.ts"]},{"output":"surface-model-catalogs.js","sha256":"efc314d4432fe4b7f978e72475b86e8405b6f63307433feccec889d4cf78f5f5","facadeSource":"extensions/deepinfra/surface-model-catalogs.ts","sources":["extensions/deepinfra/surface-model-catalogs.ts"]},{"output":"video-generation-provider.js","sha256":"9ee876c9a3b550450aa5898b49ff666741f4b4eba4c72a7b0116af4f2cb74ee6","facadeSource":"extensions/deepinfra/video-generation-provider.ts","sources":["extensions/deepinfra/video-generation-provider.ts"]}],"unrenderedSources":["extensions/deepinfra/api.ts"]}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { buildDeepInfraSpeechProvider } from "./speech-provider.js";
|
|
2
|
-
|
|
2
|
+
// extensions/deepinfra/capability-catalog.ts
|
|
3
3
|
var capability_catalog_default = { speechProviders: [buildDeepInfraSpeechProvider()] };
|
|
4
|
-
//#endregion
|
|
5
4
|
export { capability_catalog_default as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as openclaw_plugin_default } from "./.setup/openclaw.plugin-
|
|
2
|
-
|
|
1
|
+
import { t as openclaw_plugin_default } from "./.setup/openclaw.plugin-DMCTN2sM.mjs";
|
|
2
|
+
// \0rolldown/runtime.js
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -24,8 +24,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
24
24
|
return to;
|
|
25
25
|
};
|
|
26
26
|
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
27
|
-
|
|
28
|
-
//#region packages/normalization-core/src/record-coerce.ts
|
|
27
|
+
// packages/normalization-core/src/record-coerce.ts
|
|
29
28
|
/** Type guard for non-array object records at browser-safe boundaries. */
|
|
30
29
|
function isRecord(value) {
|
|
31
30
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
@@ -34,8 +33,7 @@ function isRecord(value) {
|
|
|
34
33
|
function asNullableRecord(value) {
|
|
35
34
|
return isRecord(value) ? value : null;
|
|
36
35
|
}
|
|
37
|
-
|
|
38
|
-
//#region src/config/channel-config-normalization.ts
|
|
36
|
+
// src/config/channel-config-normalization.ts
|
|
39
37
|
/** Applies one channel-specific doctor migration to every object-shaped account. */
|
|
40
38
|
function normalizeChannelAccounts(params) {
|
|
41
39
|
const rawAccounts = asNullableRecord(params.entry.accounts);
|
|
@@ -111,8 +109,7 @@ function normalizeChannelConfigEntries(params) {
|
|
|
111
109
|
changes
|
|
112
110
|
};
|
|
113
111
|
}
|
|
114
|
-
|
|
115
|
-
//#region src/plugin-sdk/legacy-webhook-listener-migration.ts
|
|
112
|
+
// src/plugin-sdk/legacy-webhook-listener-migration.ts
|
|
116
113
|
/** Preserve explicitly configured webhook listeners while moving ingress onto Gateway routes. */
|
|
117
114
|
function createLegacyWebhookListenerDoctorContract(params) {
|
|
118
115
|
const portKey = params.portKey ?? "webhookPort";
|
|
@@ -182,13 +179,11 @@ function createLegacyWebhookListenerDoctorContract(params) {
|
|
|
182
179
|
}
|
|
183
180
|
};
|
|
184
181
|
}
|
|
185
|
-
|
|
186
|
-
//#region \0openclaw:bundled-sdk:openclaw/plugin-sdk/runtime-doctor-migrations
|
|
182
|
+
// \0openclaw:bundled-sdk:openclaw/plugin-sdk/runtime-doctor-migrations
|
|
187
183
|
var runtime_doctor_migrations_exports = /* @__PURE__ */ __exportAll({ createLegacyWebhookListenerDoctorContract: () => createLegacyWebhookListenerDoctorContract });
|
|
188
184
|
import * as import_openclaw_plugin_sdk_runtime_doctor_migrations from "openclaw/plugin-sdk/runtime-doctor-migrations";
|
|
189
185
|
__reExport(runtime_doctor_migrations_exports, import_openclaw_plugin_sdk_runtime_doctor_migrations);
|
|
190
|
-
|
|
191
|
-
//#region extensions/deepinfra/doctor-contract-api.ts
|
|
186
|
+
// extensions/deepinfra/doctor-contract-api.ts
|
|
192
187
|
const PROVIDER_PATH = "models.providers.deepinfra";
|
|
193
188
|
const NATIVE_INFERENCE_PATH = "/v1/inference";
|
|
194
189
|
const OPENAI_COMPAT_PATH = "/v1/openai";
|
|
@@ -269,5 +264,4 @@ function normalizeCompatibilityConfig({ cfg }) {
|
|
|
269
264
|
changes
|
|
270
265
|
};
|
|
271
266
|
}
|
|
272
|
-
//#endregion
|
|
273
267
|
export { legacyConfigRules, normalizeCompatibilityConfig };
|
|
@@ -1,48 +1,54 @@
|
|
|
1
|
-
import { DEEPINFRA_BASE_URL } from "./media-models.js";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { DEEPINFRA_BASE_URL, DEEPINFRA_EMBED_FALLBACK_MODELS, normalizeDeepInfraModelRef } from "./media-models.js";
|
|
2
|
+
import { createRemoteEmbeddingProvider, embeddingProviderOwnsDestination, resolveRemoteEmbeddingClient, sanitizeEmbeddingCacheHeaders } from "openclaw/plugin-sdk/memory-core-host-engine-embeddings";
|
|
3
|
+
// extensions/deepinfra/embedding-adapter.ts
|
|
4
|
+
const DEFAULT_DEEPINFRA_EMBEDDING_MODEL = DEEPINFRA_EMBED_FALLBACK_MODELS[0];
|
|
5
5
|
const EXCLUDED_EMBEDDING_HEADERS = [
|
|
6
6
|
"authorization",
|
|
7
7
|
"content-type",
|
|
8
8
|
"x-api-key",
|
|
9
9
|
"api-key"
|
|
10
10
|
];
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
const deepinfraEmbeddingProviderAdapter = {
|
|
12
|
+
id: "deepinfra",
|
|
13
|
+
defaultModel: DEFAULT_DEEPINFRA_EMBEDDING_MODEL,
|
|
14
|
+
transport: "remote",
|
|
15
|
+
authProviderId: "deepinfra",
|
|
16
|
+
create: async (createOptions) => {
|
|
17
|
+
const client = await resolveRemoteEmbeddingClient({
|
|
18
|
+
provider: "deepinfra",
|
|
19
|
+
options: {
|
|
20
20
|
...createOptions,
|
|
21
21
|
provider: "deepinfra",
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
22
|
+
model: normalizeDeepInfraModelRef(createOptions.model, DEFAULT_DEEPINFRA_EMBEDDING_MODEL)
|
|
23
|
+
},
|
|
24
|
+
defaultBaseUrl: DEEPINFRA_BASE_URL,
|
|
25
|
+
normalizeModel: (model) => normalizeDeepInfraModelRef(model, DEFAULT_DEEPINFRA_EMBEDDING_MODEL)
|
|
26
|
+
});
|
|
27
|
+
const provider = createRemoteEmbeddingProvider({
|
|
28
|
+
id: "deepinfra",
|
|
29
|
+
client,
|
|
30
|
+
errorPrefix: "DeepInfra embeddings API error",
|
|
31
|
+
batchQueryInputs: true
|
|
32
|
+
});
|
|
33
|
+
const headers = sanitizeEmbeddingCacheHeaders(client.headers, EXCLUDED_EMBEDDING_HEADERS);
|
|
34
|
+
const usesDefaultIdentity = headers.length === 0 && embeddingProviderOwnsDestination({
|
|
35
|
+
baseUrl: client.baseUrl,
|
|
36
|
+
providerBaseUrl: DEEPINFRA_BASE_URL
|
|
37
|
+
});
|
|
38
|
+
return {
|
|
39
|
+
provider,
|
|
40
|
+
runtime: {
|
|
41
|
+
id: "deepinfra",
|
|
42
|
+
cacheKeyData: {
|
|
43
|
+
provider: "deepinfra",
|
|
44
|
+
model: client.model,
|
|
45
|
+
...usesDefaultIdentity ? {} : {
|
|
46
|
+
baseUrl: client.baseUrl,
|
|
47
|
+
headers
|
|
40
48
|
}
|
|
41
49
|
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
//#endregion
|
|
48
|
-
export { buildDeepInfraEmbeddingAdapter, deepinfraEmbeddingProviderAdapter };
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
export { deepinfraEmbeddingProviderAdapter };
|
|
@@ -2,7 +2,7 @@ import { DEEPINFRA_BASE_URL, DEEPINFRA_IMAGE_FALLBACK_MODELS, normalizeDeepInfra
|
|
|
2
2
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
import { bufferToBlobPart } from "openclaw/plugin-sdk/blob-runtime";
|
|
4
4
|
import { createOpenAiCompatibleImageGenerationProvider, imageSourceUploadFileName } from "openclaw/plugin-sdk/image-generation";
|
|
5
|
-
|
|
5
|
+
// extensions/deepinfra/image-generation-provider.ts
|
|
6
6
|
const DEEPINFRA_IMAGE_SIZES = [
|
|
7
7
|
"512x512",
|
|
8
8
|
"1024x1024",
|
|
@@ -83,5 +83,4 @@ function buildDeepInfraImageGenerationProvider(options) {
|
|
|
83
83
|
}
|
|
84
84
|
});
|
|
85
85
|
}
|
|
86
|
-
//#endregion
|
|
87
86
|
export { buildDeepInfraImageGenerationProvider };
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { buildDeepInfraEmbeddingAdapter } from "./embedding-adapter.js";
|
|
1
|
+
import { t as openclaw_plugin_default } from "./.setup/openclaw.plugin-DMCTN2sM.mjs";
|
|
2
|
+
import { deepinfraEmbeddingProviderAdapter } from "./embedding-adapter.js";
|
|
4
3
|
import { buildDeepInfraImageGenerationProvider } from "./image-generation-provider.js";
|
|
5
|
-
import {
|
|
4
|
+
import { deepinfraMediaUnderstandingProvider } from "./media-understanding-provider.js";
|
|
6
5
|
import { DEEPINFRA_DEFAULT_MODEL_REF, buildStaticDeepInfraProvider } from "./provider-static-catalog.js";
|
|
7
6
|
import { applyDeepInfraConfig } from "./onboard.js";
|
|
8
|
-
import { getDeepInfraSurfaceFallbackCatalog } from "./provider-models.js";
|
|
9
7
|
import { buildDeepInfraApiKeyCatalog } from "./provider-catalog.js";
|
|
10
8
|
import { buildDeepInfraSpeechProvider } from "./speech-provider.js";
|
|
11
9
|
import { listDeepInfraImageGenCatalog, listDeepInfraVideoGenCatalog } from "./surface-model-catalogs.js";
|
|
@@ -13,7 +11,8 @@ import { buildDeepInfraVideoGenerationProvider } from "./video-generation-provid
|
|
|
13
11
|
import { defineSingleProviderPluginEntry } from "openclaw/plugin-sdk/provider-entry";
|
|
14
12
|
import { applyModelCompatPatch, buildProviderReplayFamilyHooks } from "openclaw/plugin-sdk/provider-model-shared";
|
|
15
13
|
import { createOpenRouterWrapper, isProxyReasoningUnsupported } from "openclaw/plugin-sdk/provider-stream";
|
|
16
|
-
|
|
14
|
+
import { applyAnthropicEphemeralCacheControlMarkers, applyCompletionsAnthropicCacheControl, createPayloadPatchStreamWrapper } from "openclaw/plugin-sdk/provider-stream-shared";
|
|
15
|
+
// extensions/deepinfra/index.ts
|
|
17
16
|
const PROVIDER_ID = "deepinfra";
|
|
18
17
|
var deepinfra_default = defineSingleProviderPluginEntry({
|
|
19
18
|
id: PROVIDER_ID,
|
|
@@ -41,26 +40,36 @@ var deepinfra_default = defineSingleProviderPluginEntry({
|
|
|
41
40
|
}) : model,
|
|
42
41
|
wrapStreamFn: (ctx) => {
|
|
43
42
|
const thinkingLevel = isProxyReasoningUnsupported(ctx.modelId) ? void 0 : ctx.thinkingLevel;
|
|
44
|
-
|
|
43
|
+
const baseStreamFn = createOpenRouterWrapper(ctx.streamFn, thinkingLevel);
|
|
44
|
+
const extraParams = ctx.extraParams;
|
|
45
|
+
return (model, context, options) => {
|
|
46
|
+
if (!model.id.toLowerCase().startsWith("anthropic/")) return baseStreamFn(model, context, options);
|
|
47
|
+
const isCompletions = model.api === "openai-completions";
|
|
48
|
+
const configured = options?.cacheRetention ?? extraParams?.cacheRetention;
|
|
49
|
+
const cacheRetention = configured === "none" || configured === "long" ? configured : "short";
|
|
50
|
+
return createPayloadPatchStreamWrapper(baseStreamFn, ({ payload }) => {
|
|
51
|
+
if (isCompletions) applyCompletionsAnthropicCacheControl(payload, cacheRetention === "none" ? null : { type: "ephemeral" });
|
|
52
|
+
else applyAnthropicEphemeralCacheControlMarkers(payload);
|
|
53
|
+
})(model, context, isCompletions ? {
|
|
54
|
+
...options,
|
|
55
|
+
cacheRetention
|
|
56
|
+
} : options);
|
|
57
|
+
};
|
|
45
58
|
},
|
|
46
59
|
isModernModelRef: () => true,
|
|
47
60
|
isCacheTtlEligible: (ctx) => ctx.modelId.toLowerCase().startsWith("anthropic/")
|
|
48
61
|
},
|
|
49
62
|
register(api) {
|
|
50
|
-
|
|
51
|
-
api.registerImageGenerationProvider(buildDeepInfraImageGenerationProvider({ imageGenModels: catalog.imageGen }));
|
|
63
|
+
api.registerImageGenerationProvider(buildDeepInfraImageGenerationProvider());
|
|
52
64
|
api.registerModelCatalogProvider({
|
|
53
65
|
provider: PROVIDER_ID,
|
|
54
66
|
kinds: ["image_generation"],
|
|
55
67
|
liveCatalog: listDeepInfraImageGenCatalog
|
|
56
68
|
});
|
|
57
|
-
api.registerMediaUnderstandingProvider(
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
api.registerEmbeddingProvider(buildDeepInfraEmbeddingAdapter({ embedModels: catalog.embed }));
|
|
62
|
-
api.registerSpeechProvider(buildDeepInfraSpeechProvider({ ttsModels: catalog.tts }));
|
|
63
|
-
api.registerVideoGenerationProvider(buildDeepInfraVideoGenerationProvider({ videoGenModels: catalog.videoGen }));
|
|
69
|
+
api.registerMediaUnderstandingProvider(deepinfraMediaUnderstandingProvider);
|
|
70
|
+
api.registerEmbeddingProvider(deepinfraEmbeddingProviderAdapter);
|
|
71
|
+
api.registerSpeechProvider(buildDeepInfraSpeechProvider());
|
|
72
|
+
api.registerVideoGenerationProvider(buildDeepInfraVideoGenerationProvider());
|
|
64
73
|
api.registerModelCatalogProvider({
|
|
65
74
|
provider: PROVIDER_ID,
|
|
66
75
|
kinds: ["video_generation"],
|
|
@@ -68,5 +77,4 @@ var deepinfra_default = defineSingleProviderPluginEntry({
|
|
|
68
77
|
});
|
|
69
78
|
}
|
|
70
79
|
});
|
|
71
|
-
//#endregion
|
|
72
80
|
export { deepinfra_default as default };
|
package/dist/media-models.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { t as openclaw_plugin_default } from "./.setup/openclaw.plugin-
|
|
1
|
+
import { t as openclaw_plugin_default } from "./.setup/openclaw.plugin-DMCTN2sM.mjs";
|
|
2
2
|
import { normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
|
-
|
|
3
|
+
// extensions/deepinfra/media-models.ts
|
|
4
4
|
const DEEPINFRA_BASE_URL = openclaw_plugin_default.modelCatalog.providers.deepinfra.baseUrl;
|
|
5
5
|
const DEFAULT_DEEPINFRA_IMAGE_SIZE = "1024x1024";
|
|
6
6
|
const DEFAULT_DEEPINFRA_TTS_VOICE = "af_bella";
|
|
@@ -12,64 +12,18 @@ const DEEPINFRA_VIDEO_ASPECT_RATIOS = [
|
|
|
12
12
|
"9:16"
|
|
13
13
|
];
|
|
14
14
|
const DEEPINFRA_VIDEO_DURATIONS = [5, 8];
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
{
|
|
27
|
-
id: "Qwen/Qwen-Image-Max",
|
|
28
|
-
price: .075,
|
|
29
|
-
iterations: 28
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
id: "stabilityai/sdxl-turbo",
|
|
33
|
-
price: 2e-4,
|
|
34
|
-
iterations: 4
|
|
35
|
-
}
|
|
36
|
-
].map(({ id, price, iterations }) => ({
|
|
37
|
-
id,
|
|
38
|
-
name: id,
|
|
39
|
-
tags: ["image-gen"],
|
|
40
|
-
pricing: { per_image_unit: price },
|
|
41
|
-
defaultWidth: 1024,
|
|
42
|
-
defaultHeight: 1024,
|
|
43
|
-
defaultIterations: iterations
|
|
44
|
-
}));
|
|
45
|
-
const DEEPINFRA_IMAGE_FALLBACK_MODELS = DEEPINFRA_IMAGE_FALLBACK_CATALOG.map(({ id }) => id);
|
|
46
|
-
const DEEPINFRA_TTS_FALLBACK_CATALOG = [
|
|
47
|
-
{
|
|
48
|
-
id: "hexgrad/Kokoro-82M",
|
|
49
|
-
name: "hexgrad/Kokoro-82M",
|
|
50
|
-
tags: ["tts"],
|
|
51
|
-
pricing: { input_characters: .65 }
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
id: "Qwen/Qwen3-TTS",
|
|
55
|
-
name: "Qwen/Qwen3-TTS",
|
|
56
|
-
tags: ["tts"],
|
|
57
|
-
pricing: { input_characters: .65 }
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
id: "ResembleAI/chatterbox-turbo",
|
|
61
|
-
name: "ResembleAI/chatterbox-turbo",
|
|
62
|
-
tags: ["tts"],
|
|
63
|
-
pricing: { input_characters: 1 }
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
id: "sesame/csm-1b",
|
|
67
|
-
name: "sesame/csm-1b",
|
|
68
|
-
tags: ["tts"],
|
|
69
|
-
pricing: { input_characters: 7 }
|
|
70
|
-
}
|
|
15
|
+
const DEEPINFRA_IMAGE_FALLBACK_MODELS = [
|
|
16
|
+
"black-forest-labs/FLUX-1-schnell",
|
|
17
|
+
"black-forest-labs/FLUX-1-dev",
|
|
18
|
+
"Qwen/Qwen-Image-Max",
|
|
19
|
+
"stabilityai/sdxl-turbo"
|
|
20
|
+
];
|
|
21
|
+
const DEEPINFRA_TTS_FALLBACK_MODELS = [
|
|
22
|
+
"hexgrad/Kokoro-82M",
|
|
23
|
+
"Qwen/Qwen3-TTS",
|
|
24
|
+
"ResembleAI/chatterbox-turbo",
|
|
25
|
+
"sesame/csm-1b"
|
|
71
26
|
];
|
|
72
|
-
const DEEPINFRA_TTS_FALLBACK_MODELS = DEEPINFRA_TTS_FALLBACK_CATALOG.map(({ id }) => id);
|
|
73
27
|
const DEEPINFRA_VIDEO_FALLBACK_MODELS = [
|
|
74
28
|
"Pixverse/Pixverse-T2V",
|
|
75
29
|
"Pixverse/Pixverse-T2V-HD",
|
|
@@ -86,5 +40,4 @@ function normalizeDeepInfraModelRef(model, fallback) {
|
|
|
86
40
|
function normalizeDeepInfraBaseUrl(value, fallback = DEEPINFRA_BASE_URL) {
|
|
87
41
|
return (normalizeOptionalString(value) ?? fallback).replace(/\/+$/u, "");
|
|
88
42
|
}
|
|
89
|
-
|
|
90
|
-
export { DEEPINFRA_BASE_URL, DEEPINFRA_EMBED_FALLBACK_MODELS, DEEPINFRA_IMAGE_FALLBACK_CATALOG, DEEPINFRA_IMAGE_FALLBACK_MODELS, DEEPINFRA_STT_FALLBACK_MODELS, DEEPINFRA_TTS_FALLBACK_CATALOG, DEEPINFRA_TTS_FALLBACK_MODELS, DEEPINFRA_VIDEO_ASPECT_RATIOS, DEEPINFRA_VIDEO_DURATIONS, DEEPINFRA_VIDEO_FALLBACK_MODELS, DEEPINFRA_VLM_FALLBACK_MODELS, DEFAULT_DEEPINFRA_IMAGE_SIZE, DEFAULT_DEEPINFRA_TTS_VOICE, normalizeDeepInfraBaseUrl, normalizeDeepInfraModelRef };
|
|
43
|
+
export { DEEPINFRA_BASE_URL, DEEPINFRA_EMBED_FALLBACK_MODELS, DEEPINFRA_IMAGE_FALLBACK_MODELS, DEEPINFRA_STT_FALLBACK_MODELS, DEEPINFRA_TTS_FALLBACK_MODELS, DEEPINFRA_VIDEO_ASPECT_RATIOS, DEEPINFRA_VIDEO_DURATIONS, DEEPINFRA_VIDEO_FALLBACK_MODELS, DEEPINFRA_VLM_FALLBACK_MODELS, DEFAULT_DEEPINFRA_IMAGE_SIZE, DEFAULT_DEEPINFRA_TTS_VOICE, normalizeDeepInfraBaseUrl, normalizeDeepInfraModelRef };
|
|
@@ -1,28 +1,24 @@
|
|
|
1
1
|
import { DEEPINFRA_BASE_URL, DEEPINFRA_STT_FALLBACK_MODELS, DEEPINFRA_VLM_FALLBACK_MODELS } from "./media-models.js";
|
|
2
2
|
import { describeImageWithModel, describeImagesWithModel, transcribeOpenAiCompatibleAudio } from "openclaw/plugin-sdk/media-understanding";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
const deepinfraMediaUnderstandingProvider = buildDeepInfraMediaUnderstandingProvider();
|
|
27
|
-
//#endregion
|
|
28
|
-
export { buildDeepInfraMediaUnderstandingProvider, deepinfraMediaUnderstandingProvider };
|
|
3
|
+
// extensions/deepinfra/media-understanding-provider.ts
|
|
4
|
+
const deepinfraMediaUnderstandingProvider = {
|
|
5
|
+
id: "deepinfra",
|
|
6
|
+
capabilities: ["image", "audio"],
|
|
7
|
+
defaultModels: {
|
|
8
|
+
image: DEEPINFRA_VLM_FALLBACK_MODELS[0],
|
|
9
|
+
audio: DEEPINFRA_STT_FALLBACK_MODELS[0]
|
|
10
|
+
},
|
|
11
|
+
autoPriority: {
|
|
12
|
+
image: 45,
|
|
13
|
+
audio: 45
|
|
14
|
+
},
|
|
15
|
+
transcribeAudio: (params) => transcribeOpenAiCompatibleAudio({
|
|
16
|
+
...params,
|
|
17
|
+
provider: "deepinfra",
|
|
18
|
+
defaultBaseUrl: DEEPINFRA_BASE_URL,
|
|
19
|
+
defaultModel: DEEPINFRA_STT_FALLBACK_MODELS[0]
|
|
20
|
+
}),
|
|
21
|
+
describeImage: describeImageWithModel,
|
|
22
|
+
describeImages: describeImagesWithModel
|
|
23
|
+
};
|
|
24
|
+
export { deepinfraMediaUnderstandingProvider };
|
package/dist/onboard.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { DEEPINFRA_DEFAULT_MODEL_REF } from "./provider-static-catalog.js";
|
|
2
2
|
import { createAliasOnlyPresetAppliers } from "openclaw/plugin-sdk/provider-onboard";
|
|
3
|
-
|
|
3
|
+
// extensions/deepinfra/onboard.ts
|
|
4
4
|
function applyDeepInfraConfig(cfg, modelRef = DEEPINFRA_DEFAULT_MODEL_REF) {
|
|
5
5
|
return createAliasOnlyPresetAppliers({
|
|
6
6
|
modelRef,
|
|
7
7
|
alias: "DeepInfra"
|
|
8
8
|
}).applyConfig(cfg);
|
|
9
9
|
}
|
|
10
|
-
//#endregion
|
|
11
10
|
export { applyDeepInfraConfig };
|
package/dist/pricing-api.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { asFiniteNumberInRange, asOptionalRecord, asPositiveSafeInteger } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
2
2
|
import { normalizeModelPricingCatalog } from "openclaw/plugin-sdk/model-catalog-pricing";
|
|
3
|
-
|
|
3
|
+
// extensions/deepinfra/pricing-api.ts
|
|
4
4
|
function normalizeDeepInfraTokenPricing(value) {
|
|
5
5
|
const row = asOptionalRecord(value);
|
|
6
6
|
if (!row || row.type !== void 0 && row.type !== "tokens") return;
|
|
@@ -47,5 +47,4 @@ function parseDeepInfraPricingCatalog(payload) {
|
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
|
-
//#endregion
|
|
51
50
|
export { parseDeepInfraPricingCatalog };
|
package/dist/provider-catalog.js
CHANGED
|
@@ -2,7 +2,7 @@ import { DEEPINFRA_BASE_URL } from "./media-models.js";
|
|
|
2
2
|
import { discoverDeepInfraModels } from "./provider-models.js";
|
|
3
3
|
import { runLiveProviderCatalog } from "openclaw/plugin-sdk/provider-catalog-live-runtime";
|
|
4
4
|
import { buildSingleProviderApiKeyCatalog } from "openclaw/plugin-sdk/provider-catalog-shared";
|
|
5
|
-
|
|
5
|
+
// extensions/deepinfra/provider-catalog.ts
|
|
6
6
|
async function buildDeepInfraProvider(options) {
|
|
7
7
|
const models = await discoverDeepInfraModels({
|
|
8
8
|
...options,
|
|
@@ -29,5 +29,4 @@ function buildDeepInfraApiKeyCatalog(ctx) {
|
|
|
29
29
|
})
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
|
-
//#endregion
|
|
33
32
|
export { buildDeepInfraApiKeyCatalog, buildDeepInfraProvider };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { buildStaticDeepInfraProvider } from "./provider-static-catalog.js";
|
|
2
|
-
|
|
2
|
+
// extensions/deepinfra/provider-discovery.ts
|
|
3
3
|
const deepinfraProviderDiscovery = {
|
|
4
4
|
id: "deepinfra",
|
|
5
5
|
label: "DeepInfra",
|
|
@@ -17,5 +17,4 @@ const deepinfraProviderDiscovery = {
|
|
|
17
17
|
run: async () => ({ provider: buildStaticDeepInfraProvider() })
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
//#endregion
|
|
21
20
|
export { deepinfraProviderDiscovery as default };
|
package/dist/provider-models.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { DEEPINFRA_BASE_URL
|
|
1
|
+
import { DEEPINFRA_BASE_URL } from "./media-models.js";
|
|
2
2
|
import { DEEPINFRA_MODEL_CATALOG, buildDeepInfraModelDefinition } from "./provider-static-catalog.js";
|
|
3
3
|
import { parseDeepInfraPricingCatalog } from "./pricing-api.js";
|
|
4
4
|
import { asPositiveSafeInteger, isRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
5
5
|
import { fetchLiveProviderModelRows } from "openclaw/plugin-sdk/provider-catalog-live-runtime";
|
|
6
6
|
import { getCachedLiveCatalogValue } from "openclaw/plugin-sdk/provider-catalog-shared";
|
|
7
|
+
import { isStringArray } from "openclaw/plugin-sdk/collection-input-runtime";
|
|
7
8
|
import { withTrustedEnvProxyGuardedFetchMode } from "openclaw/plugin-sdk/fetch-runtime";
|
|
8
9
|
import { isProviderApiKeyConfiguredAsync } from "openclaw/plugin-sdk/provider-auth";
|
|
9
10
|
import { createSubsystemLogger } from "openclaw/plugin-sdk/runtime-env";
|
|
10
11
|
import { fetchWithSsrFGuard } from "openclaw/plugin-sdk/ssrf-runtime";
|
|
11
|
-
|
|
12
|
+
// extensions/deepinfra/provider-models.ts
|
|
12
13
|
const log = createSubsystemLogger("deepinfra-models");
|
|
13
14
|
const DEEPINFRA_MODELS_URL = `${DEEPINFRA_BASE_URL}/models?sort_by=openclaw&filter=with_meta`;
|
|
14
15
|
const DEEPINFRA_PRICING_URL = "https://api.deepinfra.com/models/list";
|
|
@@ -21,86 +22,15 @@ function entryToSurfaceModel(entry) {
|
|
|
21
22
|
if (!id) return null;
|
|
22
23
|
const metadata = entry.metadata;
|
|
23
24
|
if (metadata === null) return null;
|
|
24
|
-
if (!isRecord(metadata) || !
|
|
25
|
-
const pricing = metadata.pricing ?? {};
|
|
25
|
+
if (!isRecord(metadata) || !isStringArray(metadata.tags)) throw new Error("DeepInfra model metadata discovery unavailable.");
|
|
26
26
|
return {
|
|
27
27
|
id,
|
|
28
28
|
name: id,
|
|
29
|
-
description: typeof metadata.description === "string" ? metadata.description : void 0,
|
|
30
29
|
tags: metadata.tags,
|
|
31
30
|
contextWindow: asPositiveSafeInteger(metadata.context_length),
|
|
32
|
-
maxTokens: asPositiveSafeInteger(metadata.max_tokens)
|
|
33
|
-
pricing,
|
|
34
|
-
defaultWidth: asPositiveSafeInteger(metadata.default_width),
|
|
35
|
-
defaultHeight: asPositiveSafeInteger(metadata.default_height),
|
|
36
|
-
defaultIterations: asPositiveSafeInteger(metadata.default_iterations)
|
|
31
|
+
maxTokens: asPositiveSafeInteger(metadata.max_tokens)
|
|
37
32
|
};
|
|
38
33
|
}
|
|
39
|
-
function bucketBySurface(models) {
|
|
40
|
-
const catalog = {
|
|
41
|
-
chat: [],
|
|
42
|
-
vlm: [],
|
|
43
|
-
embed: [],
|
|
44
|
-
imageGen: [],
|
|
45
|
-
videoGen: [],
|
|
46
|
-
tts: [],
|
|
47
|
-
stt: [],
|
|
48
|
-
live: true
|
|
49
|
-
};
|
|
50
|
-
const buckets = /* @__PURE__ */ new Map([
|
|
51
|
-
["chat", catalog.chat],
|
|
52
|
-
["vlm", catalog.vlm],
|
|
53
|
-
["embed", catalog.embed],
|
|
54
|
-
["image-gen", catalog.imageGen],
|
|
55
|
-
["video-gen", catalog.videoGen],
|
|
56
|
-
["tts", catalog.tts],
|
|
57
|
-
["stt", catalog.stt]
|
|
58
|
-
]);
|
|
59
|
-
for (const model of models) for (const tag of new Set(model.tags)) buckets.get(tag)?.push(model);
|
|
60
|
-
return catalog;
|
|
61
|
-
}
|
|
62
|
-
function manifestChatEntryToSurfaceModel(entry) {
|
|
63
|
-
const { cost } = entry;
|
|
64
|
-
const pricing = {
|
|
65
|
-
input_tokens: cost.input,
|
|
66
|
-
output_tokens: cost.output,
|
|
67
|
-
...cost.cacheRead > 0 ? { cache_read_tokens: cost.cacheRead } : {}
|
|
68
|
-
};
|
|
69
|
-
const tags = ["chat"];
|
|
70
|
-
if (entry.input.includes("image")) tags.push("vlm");
|
|
71
|
-
if (entry.reasoning) tags.push("reasoning");
|
|
72
|
-
return {
|
|
73
|
-
id: entry.id,
|
|
74
|
-
name: entry.name,
|
|
75
|
-
tags,
|
|
76
|
-
contextWindow: entry.contextWindow,
|
|
77
|
-
maxTokens: entry.maxTokens,
|
|
78
|
-
pricing
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
const STATIC_NON_CHAT_FALLBACK = [
|
|
82
|
-
...DEEPINFRA_IMAGE_FALLBACK_CATALOG,
|
|
83
|
-
...DEEPINFRA_TTS_FALLBACK_CATALOG,
|
|
84
|
-
{
|
|
85
|
-
id: "openai/whisper-large-v3-turbo",
|
|
86
|
-
name: "openai/whisper-large-v3-turbo",
|
|
87
|
-
tags: ["stt"],
|
|
88
|
-
pricing: { input_seconds: 4e-5 }
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
id: "BAAI/bge-m3",
|
|
92
|
-
name: "BAAI/bge-m3",
|
|
93
|
-
tags: ["embed"],
|
|
94
|
-
pricing: { input_tokens: .01 },
|
|
95
|
-
maxTokens: 8192,
|
|
96
|
-
contextWindow: 8192
|
|
97
|
-
}
|
|
98
|
-
];
|
|
99
|
-
function getDeepInfraSurfaceFallbackCatalog() {
|
|
100
|
-
const catalog = bucketBySurface([...DEEPINFRA_MODEL_CATALOG.map(manifestChatEntryToSurfaceModel), ...STATIC_NON_CHAT_FALLBACK]);
|
|
101
|
-
catalog.live = false;
|
|
102
|
-
return catalog;
|
|
103
|
-
}
|
|
104
34
|
function chatSurfaceModelToModelDefinition(model) {
|
|
105
35
|
const manifestModel = DEEPINFRA_MODEL_CATALOG.find((entry) => entry.id === model.id);
|
|
106
36
|
const input = model.tags.includes("vlm") ? ["text", "image"] : ["text"];
|
|
@@ -118,7 +48,7 @@ function chatSurfaceModelToModelDefinition(model) {
|
|
|
118
48
|
async function canDiscoverDeepInfra(options) {
|
|
119
49
|
if (options?.hasApiKey !== void 0) return options.hasApiKey;
|
|
120
50
|
const fromEnv = (options?.env ?? process.env).DEEPINFRA_API_KEY;
|
|
121
|
-
return
|
|
51
|
+
return Boolean(fromEnv?.trim()) || await isProviderApiKeyConfiguredAsync({
|
|
122
52
|
provider: "deepinfra",
|
|
123
53
|
agentDir: options?.agentDir
|
|
124
54
|
});
|
|
@@ -129,7 +59,7 @@ async function discoverDeepInfraSurfaces(options) {
|
|
|
129
59
|
} catch (error) {
|
|
130
60
|
log.warn(`Model metadata discovery unavailable: ${String(error)}`);
|
|
131
61
|
}
|
|
132
|
-
return
|
|
62
|
+
return null;
|
|
133
63
|
}
|
|
134
64
|
async function loadDeepInfraSurfaces() {
|
|
135
65
|
return getCachedLiveCatalogValue({
|
|
@@ -156,7 +86,20 @@ async function loadDeepInfraSurfaces() {
|
|
|
156
86
|
surfaceModels.push(model);
|
|
157
87
|
}
|
|
158
88
|
if (data.length > 0 && surfaceModels.length === 0) throw new Error("DeepInfra model metadata discovery unavailable.");
|
|
159
|
-
|
|
89
|
+
const catalog = {
|
|
90
|
+
chat: [],
|
|
91
|
+
vlm: [],
|
|
92
|
+
imageGen: [],
|
|
93
|
+
videoGen: []
|
|
94
|
+
};
|
|
95
|
+
const buckets = /* @__PURE__ */ new Map([
|
|
96
|
+
["chat", catalog.chat],
|
|
97
|
+
["vlm", catalog.vlm],
|
|
98
|
+
["image-gen", catalog.imageGen],
|
|
99
|
+
["video-gen", catalog.videoGen]
|
|
100
|
+
]);
|
|
101
|
+
for (const model of surfaceModels) for (const tag of new Set(model.tags)) buckets.get(tag)?.push(model);
|
|
102
|
+
return catalog;
|
|
160
103
|
}
|
|
161
104
|
});
|
|
162
105
|
}
|
|
@@ -216,5 +159,4 @@ async function discoverDeepInfraModels(options) {
|
|
|
216
159
|
}
|
|
217
160
|
}));
|
|
218
161
|
}
|
|
219
|
-
|
|
220
|
-
export { discoverDeepInfraModels, discoverDeepInfraSurfaces, getDeepInfraSurfaceFallbackCatalog };
|
|
162
|
+
export { discoverDeepInfraModels, discoverDeepInfraSurfaces };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as openclaw_plugin_default } from "./.setup/openclaw.plugin-
|
|
1
|
+
import { t as openclaw_plugin_default } from "./.setup/openclaw.plugin-DMCTN2sM.mjs";
|
|
2
2
|
import { DEEPINFRA_BASE_URL } from "./media-models.js";
|
|
3
3
|
import { buildManifestModelProviderConfig } from "openclaw/plugin-sdk/provider-model-metadata";
|
|
4
|
-
|
|
4
|
+
// extensions/deepinfra/provider-static-catalog.ts
|
|
5
5
|
const DEEPINFRA_MANIFEST_PROVIDER = buildManifestModelProviderConfig({
|
|
6
6
|
providerId: "deepinfra",
|
|
7
7
|
catalog: openclaw_plugin_default.modelCatalog.providers.deepinfra
|
|
@@ -29,5 +29,4 @@ function buildStaticDeepInfraProvider() {
|
|
|
29
29
|
models: DEEPINFRA_MODEL_CATALOG.map(buildDeepInfraModelDefinition)
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
//#endregion
|
|
33
32
|
export { DEEPINFRA_DEFAULT_MODEL_REF, DEEPINFRA_MODEL_CATALOG, buildDeepInfraModelDefinition, buildStaticDeepInfraProvider };
|
package/dist/speech-provider.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { DEEPINFRA_BASE_URL,
|
|
1
|
+
import { DEEPINFRA_BASE_URL, DEEPINFRA_TTS_FALLBACK_MODELS, DEFAULT_DEEPINFRA_TTS_VOICE, normalizeDeepInfraModelRef } from "./media-models.js";
|
|
2
2
|
import { asOptionalRecord } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
3
3
|
import { createOpenAiCompatibleSpeechProvider } from "openclaw/plugin-sdk/speech-provider";
|
|
4
|
-
|
|
4
|
+
// extensions/deepinfra/speech-provider.ts
|
|
5
5
|
const DEEPINFRA_TTS_RESPONSE_FORMATS = [
|
|
6
6
|
"mp3",
|
|
7
7
|
"opus",
|
|
@@ -11,7 +11,7 @@ const DEEPINFRA_TTS_RESPONSE_FORMATS = [
|
|
|
11
11
|
];
|
|
12
12
|
function buildDeepInfraSpeechProvider(options) {
|
|
13
13
|
const ids = options?.ttsModels && options.ttsModels.length > 0 ? options.ttsModels.map((model) => model.id) : [...DEEPINFRA_TTS_FALLBACK_MODELS];
|
|
14
|
-
const defaultModel = ids[0] ??
|
|
14
|
+
const defaultModel = ids[0] ?? DEEPINFRA_TTS_FALLBACK_MODELS[0];
|
|
15
15
|
return createOpenAiCompatibleSpeechProvider({
|
|
16
16
|
id: "deepinfra",
|
|
17
17
|
label: "DeepInfra",
|
|
@@ -37,5 +37,4 @@ function buildDeepInfraSpeechProvider(options) {
|
|
|
37
37
|
}]
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
|
-
//#endregion
|
|
41
40
|
export { buildDeepInfraSpeechProvider };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DEEPINFRA_VIDEO_ASPECT_RATIOS, DEEPINFRA_VIDEO_DURATIONS } from "./media-models.js";
|
|
2
2
|
import { discoverDeepInfraSurfaces } from "./provider-models.js";
|
|
3
|
-
|
|
3
|
+
// extensions/deepinfra/surface-model-catalogs.ts
|
|
4
4
|
const PROVIDER_ID = "deepinfra";
|
|
5
5
|
function buildDeepInfraVideoModelCapabilities() {
|
|
6
6
|
return {
|
|
@@ -28,16 +28,17 @@ async function listDeepInfraGenerationCatalog(ctx, kind) {
|
|
|
28
28
|
hasApiKey: true,
|
|
29
29
|
env: ctx.env
|
|
30
30
|
});
|
|
31
|
+
if (!catalog) return null;
|
|
31
32
|
const models = kind === "image_generation" ? catalog.imageGen : catalog.videoGen;
|
|
32
|
-
if (
|
|
33
|
+
if (models.length === 0) return null;
|
|
33
34
|
return models.map((model) => {
|
|
34
35
|
const entry = {
|
|
35
36
|
kind,
|
|
36
37
|
provider: PROVIDER_ID,
|
|
37
38
|
model: model.id,
|
|
38
|
-
source: "live"
|
|
39
|
+
source: "live",
|
|
40
|
+
label: model.name
|
|
39
41
|
};
|
|
40
|
-
if (model.name) entry.label = model.name;
|
|
41
42
|
if (kind === "video_generation") entry.capabilities = buildDeepInfraVideoModelCapabilities();
|
|
42
43
|
return entry;
|
|
43
44
|
});
|
|
@@ -48,11 +49,4 @@ function listDeepInfraImageGenCatalog(ctx) {
|
|
|
48
49
|
function listDeepInfraVideoGenCatalog(ctx) {
|
|
49
50
|
return listDeepInfraGenerationCatalog(ctx, "video_generation");
|
|
50
51
|
}
|
|
51
|
-
|
|
52
|
-
const rawId = typeof ctx.model === "string" ? ctx.model : "";
|
|
53
|
-
const normalized = rawId.startsWith(`${PROVIDER_ID}/`) ? rawId.slice(10) : rawId;
|
|
54
|
-
const catalog = await discoverDeepInfraSurfaces({ env: process.env });
|
|
55
|
-
return catalog.videoGen.find((m) => m.id === normalized) ?? catalog.videoGen.find((m) => m.id === rawId) ? buildDeepInfraVideoModelCapabilities() : void 0;
|
|
56
|
-
}
|
|
57
|
-
//#endregion
|
|
58
|
-
export { buildDeepInfraVideoModelCapabilities, listDeepInfraImageGenCatalog, listDeepInfraVideoGenCatalog, resolveDeepInfraVideoModelCapabilities };
|
|
52
|
+
export { buildDeepInfraVideoModelCapabilities, listDeepInfraImageGenCatalog, listDeepInfraVideoGenCatalog };
|
|
@@ -1,20 +1,15 @@
|
|
|
1
1
|
import { DEEPINFRA_BASE_URL, DEEPINFRA_VIDEO_FALLBACK_MODELS, normalizeDeepInfraBaseUrl, normalizeDeepInfraModelRef } from "./media-models.js";
|
|
2
|
-
import { buildDeepInfraVideoModelCapabilities
|
|
2
|
+
import { buildDeepInfraVideoModelCapabilities } from "./surface-model-catalogs.js";
|
|
3
3
|
import { asSafeIntegerInRange, normalizeOptionalString } from "openclaw/plugin-sdk/string-coerce-runtime";
|
|
4
4
|
import { isProviderApiKeyConfiguredAsync } from "openclaw/plugin-sdk/provider-auth";
|
|
5
5
|
import { resolveGeneratedMediaMaxBytes } from "openclaw/plugin-sdk/media-generation-runtime";
|
|
6
6
|
import { detectMime, extensionForMime, mediaKindFromMime, normalizeMimeType } from "openclaw/plugin-sdk/media-mime";
|
|
7
7
|
import { canonicalizeBase64, estimateBase64DecodedBytes } from "openclaw/plugin-sdk/media-runtime";
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
//#region extensions/deepinfra/video-generation-provider.ts
|
|
8
|
+
import { createProviderOperationDeadline, pollProviderOperationJson, postJsonResponse, resolveProviderApiKeyHttpRequestConfig, resolveProviderOperationTimeoutMs, sanitizeConfiguredModelProviderRequest } from "openclaw/plugin-sdk/provider-http";
|
|
9
|
+
// extensions/deepinfra/video-generation-provider.ts
|
|
11
10
|
const DEFAULT_HTTP_TIMEOUT_MS = 6e4;
|
|
12
11
|
const POLL_INTERVAL_MS = 5e3;
|
|
13
12
|
const MAX_POLL_ATTEMPTS = 120;
|
|
14
|
-
function normalizeDeepInfraVideoUrl(url, baseUrl) {
|
|
15
|
-
if (url.startsWith("http://") || url.startsWith("https://") || url.startsWith("data:")) return url;
|
|
16
|
-
return new URL(url, baseUrl).href;
|
|
17
|
-
}
|
|
18
13
|
async function parseVideoDataUrl(url, maxBytes) {
|
|
19
14
|
if (!url.startsWith("data:")) return;
|
|
20
15
|
const match = /^data:([^;,]+);base64,(.*)$/su.exec(url);
|
|
@@ -35,55 +30,6 @@ async function parseVideoDataUrl(url, maxBytes) {
|
|
|
35
30
|
fileName: `video-1.${extensionForMime(detectedMime)?.slice(1) ?? "mp4"}`
|
|
36
31
|
};
|
|
37
32
|
}
|
|
38
|
-
function resolveDurationSeconds(value) {
|
|
39
|
-
if (typeof value !== "number" || !Number.isFinite(value)) return;
|
|
40
|
-
return value <= 6.5 ? 5 : 8;
|
|
41
|
-
}
|
|
42
|
-
function buildDeepInfraVideoBody(req, model) {
|
|
43
|
-
const options = req.providerOptions ?? {};
|
|
44
|
-
const body = {
|
|
45
|
-
model,
|
|
46
|
-
prompt: req.prompt
|
|
47
|
-
};
|
|
48
|
-
const aspectRatio = normalizeOptionalString(req.aspectRatio);
|
|
49
|
-
if (aspectRatio) body.aspect_ratio = aspectRatio;
|
|
50
|
-
const duration = resolveDurationSeconds(req.durationSeconds);
|
|
51
|
-
if (duration) body.seconds = duration;
|
|
52
|
-
const seed = asSafeIntegerInRange(options.seed, {
|
|
53
|
-
min: 0,
|
|
54
|
-
max: 4294967295
|
|
55
|
-
});
|
|
56
|
-
if (seed != null) body.seed = seed;
|
|
57
|
-
const negativePrompt = normalizeOptionalString(options.negative_prompt) ?? normalizeOptionalString(options.negativePrompt);
|
|
58
|
-
if (negativePrompt) body.negative_prompt = negativePrompt;
|
|
59
|
-
const style = normalizeOptionalString(options.style);
|
|
60
|
-
if (style) body.style = style;
|
|
61
|
-
return body;
|
|
62
|
-
}
|
|
63
|
-
function firstDeepInfraVideoUrl(job) {
|
|
64
|
-
for (const entry of job.data ?? []) {
|
|
65
|
-
const videoUrl = entry ? normalizeOptionalString(entry.url) : void 0;
|
|
66
|
-
if (videoUrl) return videoUrl;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
async function extractDeepInfraVideoAsset(job, baseUrl, maxBytes) {
|
|
70
|
-
const videoUrl = firstDeepInfraVideoUrl(job);
|
|
71
|
-
if (!videoUrl) throw new Error("DeepInfra video response missing video URL");
|
|
72
|
-
const normalizedUrl = normalizeDeepInfraVideoUrl(videoUrl, baseUrl);
|
|
73
|
-
const dataAsset = await parseVideoDataUrl(normalizedUrl, maxBytes);
|
|
74
|
-
if (dataAsset) return dataAsset;
|
|
75
|
-
return {
|
|
76
|
-
url: normalizedUrl,
|
|
77
|
-
mimeType: "video/mp4",
|
|
78
|
-
fileName: "video-1.mp4"
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
function resolveDeepInfraVideoBaseUrl(req) {
|
|
82
|
-
const providerConfig = req.cfg?.models?.providers?.deepinfra;
|
|
83
|
-
const baseUrl = normalizeDeepInfraBaseUrl(providerConfig?.baseUrl, DEEPINFRA_BASE_URL);
|
|
84
|
-
if (baseUrl.includes("/v1/inference")) throw new Error("DeepInfra video generation requires an OpenAI-compatible endpoint, but models.providers.deepinfra.baseUrl targets the retired native /v1/inference surface. Run \"openclaw doctor --fix\" (api.deepinfra.com migrates automatically; custom hosts must set baseUrl to an OpenAI-compatible videos endpoint).");
|
|
85
|
-
return baseUrl;
|
|
86
|
-
}
|
|
87
33
|
function buildDeepInfraVideoGenerationProvider(options) {
|
|
88
34
|
const ids = options?.videoGenModels && options.videoGenModels.length > 0 ? options.videoGenModels.map((model) => model.id) : [...DEEPINFRA_VIDEO_FALLBACK_MODELS];
|
|
89
35
|
const defaultModel = ids[0] ?? DEEPINFRA_VIDEO_FALLBACK_MODELS[0];
|
|
@@ -93,7 +39,6 @@ function buildDeepInfraVideoGenerationProvider(options) {
|
|
|
93
39
|
label: "DeepInfra",
|
|
94
40
|
defaultModel,
|
|
95
41
|
models: ids,
|
|
96
|
-
resolveModelCapabilities: resolveDeepInfraVideoModelCapabilities,
|
|
97
42
|
isConfiguredAsync: (ctx) => isProviderApiKeyConfiguredAsync({
|
|
98
43
|
provider: "deepinfra",
|
|
99
44
|
...ctx
|
|
@@ -108,49 +53,54 @@ function buildDeepInfraVideoGenerationProvider(options) {
|
|
|
108
53
|
async generateVideo(req) {
|
|
109
54
|
if ((req.inputImages?.length ?? 0) > 0) throw new Error("DeepInfra video generation currently supports text-to-video only.");
|
|
110
55
|
if ((req.inputVideos?.length ?? 0) > 0) throw new Error("DeepInfra video generation does not support video reference inputs.");
|
|
111
|
-
const
|
|
56
|
+
const model = normalizeDeepInfraModelRef(req.model, defaultModel);
|
|
57
|
+
const providerConfig = req.cfg?.models?.providers?.deepinfra;
|
|
58
|
+
const configuredBaseUrl = normalizeDeepInfraBaseUrl(providerConfig?.baseUrl, DEEPINFRA_BASE_URL);
|
|
59
|
+
if (configuredBaseUrl.includes("/v1/inference")) throw new Error("DeepInfra video generation requires an OpenAI-compatible endpoint, but models.providers.deepinfra.baseUrl targets the retired native /v1/inference surface. Run \"openclaw doctor --fix\" (api.deepinfra.com migrates automatically; custom hosts must set baseUrl to an OpenAI-compatible videos endpoint).");
|
|
60
|
+
const { baseUrl, allowPrivateNetwork, headers, dispatcherPolicy } = await resolveProviderApiKeyHttpRequestConfig({
|
|
61
|
+
req,
|
|
62
|
+
missingApiKeyMessage: "DeepInfra API key missing",
|
|
63
|
+
baseUrl: configuredBaseUrl,
|
|
64
|
+
defaultBaseUrl: DEEPINFRA_BASE_URL,
|
|
112
65
|
provider: "deepinfra",
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
store: req.authStore
|
|
66
|
+
capability: "video",
|
|
67
|
+
request: sanitizeConfiguredModelProviderRequest(req.cfg?.models?.providers?.deepinfra?.request)
|
|
116
68
|
});
|
|
117
|
-
if (!auth.apiKey) throw new Error("DeepInfra API key missing");
|
|
118
|
-
const model = normalizeDeepInfraModelRef(req.model, defaultModel);
|
|
119
69
|
const deadline = createProviderOperationDeadline({
|
|
120
70
|
timeoutMs: req.timeoutMs,
|
|
121
71
|
label: "DeepInfra video generation"
|
|
122
72
|
});
|
|
123
|
-
const
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
73
|
+
const bodyOptions = req.providerOptions ?? {};
|
|
74
|
+
const body = {
|
|
75
|
+
model,
|
|
76
|
+
prompt: req.prompt
|
|
77
|
+
};
|
|
78
|
+
const aspectRatio = normalizeOptionalString(req.aspectRatio);
|
|
79
|
+
if (aspectRatio) body.aspect_ratio = aspectRatio;
|
|
80
|
+
const duration = req.durationSeconds;
|
|
81
|
+
if (typeof duration === "number" && Number.isFinite(duration)) body.seconds = duration <= 6.5 ? 5 : 8;
|
|
82
|
+
const seed = asSafeIntegerInRange(bodyOptions.seed, {
|
|
83
|
+
min: 0,
|
|
84
|
+
max: 4294967295
|
|
134
85
|
});
|
|
135
|
-
|
|
86
|
+
if (seed != null) body.seed = seed;
|
|
87
|
+
const negativePrompt = normalizeOptionalString(bodyOptions.negative_prompt) ?? normalizeOptionalString(bodyOptions.negativePrompt);
|
|
88
|
+
if (negativePrompt) body.negative_prompt = negativePrompt;
|
|
89
|
+
const style = normalizeOptionalString(bodyOptions.style);
|
|
90
|
+
if (style) body.style = style;
|
|
91
|
+
const submitted = await postJsonResponse({
|
|
136
92
|
url: `${baseUrl}/videos`,
|
|
137
93
|
headers,
|
|
138
|
-
body
|
|
94
|
+
body,
|
|
139
95
|
timeoutMs: resolveProviderOperationTimeoutMs({
|
|
140
96
|
deadline,
|
|
141
97
|
defaultTimeoutMs: DEFAULT_HTTP_TIMEOUT_MS
|
|
142
98
|
}),
|
|
143
99
|
fetchFn: fetch,
|
|
144
100
|
allowPrivateNetwork,
|
|
145
|
-
dispatcherPolicy
|
|
101
|
+
dispatcherPolicy,
|
|
102
|
+
errorLabel: "DeepInfra video generation failed"
|
|
146
103
|
});
|
|
147
|
-
let submitted;
|
|
148
|
-
try {
|
|
149
|
-
await assertOkOrThrowHttpError(response, "DeepInfra video generation failed");
|
|
150
|
-
submitted = await readProviderJsonResponse(response, "DeepInfra video generation failed");
|
|
151
|
-
} finally {
|
|
152
|
-
await release();
|
|
153
|
-
}
|
|
154
104
|
const jobId = normalizeOptionalString(submitted.id);
|
|
155
105
|
if (!jobId) throw new Error("DeepInfra video generation response missing job id");
|
|
156
106
|
if (submitted.status === "failed") throw new Error(normalizeOptionalString(submitted.error) ?? "DeepInfra video generation failed");
|
|
@@ -170,8 +120,19 @@ function buildDeepInfraVideoGenerationProvider(options) {
|
|
|
170
120
|
isComplete: (payload) => payload.status === "succeeded",
|
|
171
121
|
getFailureMessage: (payload) => payload.status === "failed" ? normalizeOptionalString(payload.error) ?? "DeepInfra video generation failed" : void 0
|
|
172
122
|
});
|
|
123
|
+
let videoUrl;
|
|
124
|
+
for (const entry of completed.data ?? []) {
|
|
125
|
+
videoUrl = entry ? normalizeOptionalString(entry.url) : void 0;
|
|
126
|
+
if (videoUrl) break;
|
|
127
|
+
}
|
|
128
|
+
if (!videoUrl) throw new Error("DeepInfra video response missing video URL");
|
|
129
|
+
const normalizedUrl = videoUrl.startsWith("http://") || videoUrl.startsWith("https://") || videoUrl.startsWith("data:") ? videoUrl : new URL(videoUrl, baseUrl).href;
|
|
173
130
|
return {
|
|
174
|
-
videos: [await
|
|
131
|
+
videos: [await parseVideoDataUrl(normalizedUrl, resolveGeneratedMediaMaxBytes(req.cfg, "video")) ?? {
|
|
132
|
+
url: normalizedUrl,
|
|
133
|
+
mimeType: "video/mp4",
|
|
134
|
+
fileName: "video-1.mp4"
|
|
135
|
+
}],
|
|
175
136
|
model: normalizeOptionalString(completed.model) ?? model,
|
|
176
137
|
metadata: {
|
|
177
138
|
jobId,
|
|
@@ -181,5 +142,4 @@ function buildDeepInfraVideoGenerationProvider(options) {
|
|
|
181
142
|
}
|
|
182
143
|
};
|
|
183
144
|
}
|
|
184
|
-
//#endregion
|
|
185
145
|
export { buildDeepInfraVideoGenerationProvider };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openclaw/deepinfra-provider",
|
|
3
|
-
"version": "2026.
|
|
3
|
+
"version": "2026.11.5-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.11.5-beta.1"
|
|
22
22
|
},
|
|
23
23
|
"build": {
|
|
24
|
-
"openclawVersion": "2026.
|
|
24
|
+
"openclawVersion": "2026.11.5-beta.1",
|
|
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.
|
|
43
|
+
"openclaw": ">=2026.11.5-beta.1"
|
|
44
44
|
},
|
|
45
45
|
"peerDependenciesMeta": {
|
|
46
46
|
"openclaw": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"entries":[{"output":"api.js","source":"extensions/deepinfra/api.ts"},{"output":"cache-wrapper.js","source":"extensions/deepinfra/cache-wrapper.ts"},{"output":"capability-catalog.js","source":"extensions/deepinfra/capability-catalog.ts"},{"output":"doctor-contract-api.js","source":"extensions/deepinfra/doctor-contract-api.ts"},{"output":"embedding-adapter.js","source":"extensions/deepinfra/embedding-adapter.ts"},{"output":"embedding-provider.js","source":"extensions/deepinfra/embedding-provider.ts"},{"output":"image-generation-provider.js","source":"extensions/deepinfra/image-generation-provider.ts"},{"output":"index.js","source":"extensions/deepinfra/index.ts"},{"output":"media-models.js","source":"extensions/deepinfra/media-models.ts"},{"output":"media-understanding-provider.js","source":"extensions/deepinfra/media-understanding-provider.ts"},{"output":"onboard.js","source":"extensions/deepinfra/onboard.ts"},{"output":"pricing-api.js","source":"extensions/deepinfra/pricing-api.ts"},{"output":"provider-catalog.js","source":"extensions/deepinfra/provider-catalog.ts"},{"output":"provider-discovery.js","source":"extensions/deepinfra/provider-discovery.ts"},{"output":"provider-models.js","source":"extensions/deepinfra/provider-models.ts"},{"output":"provider-policy-api.js","source":"extensions/deepinfra/provider-policy-api.ts"},{"output":"provider-static-catalog.js","source":"extensions/deepinfra/provider-static-catalog.ts"},{"output":"speech-provider.js","source":"extensions/deepinfra/speech-provider.ts"},{"output":"surface-model-catalogs.js","source":"extensions/deepinfra/surface-model-catalogs.ts"},{"output":"video-generation-provider.js","source":"extensions/deepinfra/video-generation-provider.ts"}],"chunks":[{"output":".setup/openclaw.plugin-5ywdmEQ1.mjs","sha256":"d886336558c66de379832139f1279b29f472f5ab0553f9cd5bfcbd8d32a29556","facadeSource":null,"sources":["extensions/deepinfra/openclaw.plugin.json"]},{"output":"api.js","sha256":"438836f453467ae64fad54a72be481c489e621e13373b8130b5a4668d1faeea5","facadeSource":"extensions/deepinfra/api.ts","sources":[]},{"output":"cache-wrapper.js","sha256":"2ef6c3c1c69d5c9b34196be70fa6fc6dbb18844dc6329aea93dbb97d06dd929f","facadeSource":"extensions/deepinfra/cache-wrapper.ts","sources":["extensions/deepinfra/cache-wrapper.ts"]},{"output":"capability-catalog.js","sha256":"652b9dbcc865f6c6422128640d9d8b482007bf8c8925e2151daf3b6f5b340dc5","facadeSource":"extensions/deepinfra/capability-catalog.ts","sources":["extensions/deepinfra/capability-catalog.ts"]},{"output":"doctor-contract-api.js","sha256":"5624ca2cfee48bd49bfd4422c4c48fed2553a42de770ed399cdd34027423de7a","facadeSource":"extensions/deepinfra/doctor-contract-api.ts","sources":["extensions/deepinfra/doctor-contract-api.ts","packages/normalization-core/src/record-coerce.ts","src/config/channel-config-normalization.ts","src/plugin-sdk/legacy-webhook-listener-migration.ts"]},{"output":"embedding-adapter.js","sha256":"3e110bace6661b1547bc4d98cc11d1eea4a29f195534d15f527d017db53ff779","facadeSource":"extensions/deepinfra/embedding-adapter.ts","sources":["extensions/deepinfra/embedding-adapter.ts"]},{"output":"embedding-provider.js","sha256":"e0e76b697517c95d74191207813805c78fc7da1e9d4266087334d87e5754033b","facadeSource":"extensions/deepinfra/embedding-provider.ts","sources":["extensions/deepinfra/embedding-provider.ts"]},{"output":"image-generation-provider.js","sha256":"baf39611a1fbc1fd7f097a83ed184a88197bb44d19f5b7d8b98d91a7dcf95d86","facadeSource":"extensions/deepinfra/image-generation-provider.ts","sources":["extensions/deepinfra/image-generation-provider.ts"]},{"output":"index.js","sha256":"5f550720b04e926a835936fb94f97c4d42df55f798b5a01b740eb6ff6f2a173f","facadeSource":"extensions/deepinfra/index.ts","sources":["extensions/deepinfra/index.ts"]},{"output":"media-models.js","sha256":"6fe995977ca0839cf942bd8c92460afe141b9d54814fffb513a712f62abbcc85","facadeSource":"extensions/deepinfra/media-models.ts","sources":["extensions/deepinfra/media-models.ts"]},{"output":"media-understanding-provider.js","sha256":"a53a3e477e2e258f1514d47a56497e2acea9c7801af70a41e4ed86f59a37f2a5","facadeSource":"extensions/deepinfra/media-understanding-provider.ts","sources":["extensions/deepinfra/media-understanding-provider.ts"]},{"output":"onboard.js","sha256":"89eb2e93f3f175df13b36d0907f84ec76a99efc76e1e8f2ac9aae9c7fbd80699","facadeSource":"extensions/deepinfra/onboard.ts","sources":["extensions/deepinfra/onboard.ts"]},{"output":"pricing-api.js","sha256":"cbaa06b6effaa3974bd58136be88c19e50595847736fd9c157f70f2f0dc3e2e5","facadeSource":"extensions/deepinfra/pricing-api.ts","sources":["extensions/deepinfra/pricing-api.ts"]},{"output":"provider-catalog.js","sha256":"6b2122854ffcfbeb405e9363e757c0c37f5de85e39a752ef0bcd4a2252e79830","facadeSource":"extensions/deepinfra/provider-catalog.ts","sources":["extensions/deepinfra/provider-catalog.ts"]},{"output":"provider-discovery.js","sha256":"73391b0c584877d01c72249587fb00bd7c0fed10699446b1bd5772758fbfd343","facadeSource":"extensions/deepinfra/provider-discovery.ts","sources":["extensions/deepinfra/provider-discovery.ts"]},{"output":"provider-models.js","sha256":"9723d1322bc9c390b82315e7eb858115213f0f24a9f33e1b0aa945b35658876f","facadeSource":"extensions/deepinfra/provider-models.ts","sources":["extensions/deepinfra/provider-models.ts"]},{"output":"provider-policy-api.js","sha256":"090ba6961fb3d7af446553e4066aa7252279b5ed375c4e6dc56371a14fe25d27","facadeSource":"extensions/deepinfra/provider-policy-api.ts","sources":["extensions/deepinfra/provider-policy-api.ts"]},{"output":"provider-static-catalog.js","sha256":"d63150533e69b8b9e39bf4bbba64aac4736874c3dee8ee0156772caa9722d09b","facadeSource":"extensions/deepinfra/provider-static-catalog.ts","sources":["extensions/deepinfra/provider-static-catalog.ts"]},{"output":"speech-provider.js","sha256":"cd0cd24b728694346069fa874f46884f1199f0bc3bd3728f55e9da59ca20e438","facadeSource":"extensions/deepinfra/speech-provider.ts","sources":["extensions/deepinfra/speech-provider.ts"]},{"output":"surface-model-catalogs.js","sha256":"6fd1abd88751ed9ee8461b15e8055d45245e63ecdf43dd33cecd19b797e3fa23","facadeSource":"extensions/deepinfra/surface-model-catalogs.ts","sources":["extensions/deepinfra/surface-model-catalogs.ts"]},{"output":"video-generation-provider.js","sha256":"bd2a853b08db8523add942270faacf786f9ac1b11e72e261c7d9c2890dece7a8","facadeSource":"extensions/deepinfra/video-generation-provider.ts","sources":["extensions/deepinfra/video-generation-provider.ts"]}],"unrenderedSources":["extensions/deepinfra/api.ts"]}
|
package/dist/cache-wrapper.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { applyAnthropicEphemeralCacheControlMarkers, applyCompletionsAnthropicCacheControl, createPayloadPatchStreamWrapper } from "openclaw/plugin-sdk/provider-stream-shared";
|
|
2
|
-
//#region extensions/deepinfra/cache-wrapper.ts
|
|
3
|
-
function createDeepInfraAnthropicCacheWrapper(baseStreamFn, extraParams) {
|
|
4
|
-
return (model, context, options) => {
|
|
5
|
-
if (!model.id.toLowerCase().startsWith("anthropic/")) return baseStreamFn(model, context, options);
|
|
6
|
-
const isCompletions = model.api === "openai-completions";
|
|
7
|
-
const configured = options?.cacheRetention ?? extraParams?.cacheRetention;
|
|
8
|
-
const cacheRetention = configured === "none" || configured === "long" ? configured : "short";
|
|
9
|
-
return createPayloadPatchStreamWrapper(baseStreamFn, ({ payload }) => {
|
|
10
|
-
if (isCompletions) applyCompletionsAnthropicCacheControl(payload, cacheRetention === "none" ? null : { type: "ephemeral" });
|
|
11
|
-
else applyAnthropicEphemeralCacheControlMarkers(payload);
|
|
12
|
-
})(model, context, isCompletions ? {
|
|
13
|
-
...options,
|
|
14
|
-
cacheRetention
|
|
15
|
-
} : options);
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
//#endregion
|
|
19
|
-
export { createDeepInfraAnthropicCacheWrapper };
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { DEEPINFRA_BASE_URL, DEEPINFRA_EMBED_FALLBACK_MODELS, normalizeDeepInfraModelRef } from "./media-models.js";
|
|
2
|
-
import { createRemoteEmbeddingProvider, resolveRemoteEmbeddingClient } from "openclaw/plugin-sdk/memory-core-host-engine-embeddings";
|
|
3
|
-
//#region extensions/deepinfra/embedding-provider.ts
|
|
4
|
-
const DEFAULT_DEEPINFRA_EMBEDDING_MODEL = DEEPINFRA_EMBED_FALLBACK_MODELS[0];
|
|
5
|
-
async function createDeepInfraEmbeddingProvider(options) {
|
|
6
|
-
const defaultModel = options.defaultModel ?? DEFAULT_DEEPINFRA_EMBEDDING_MODEL;
|
|
7
|
-
const client = await resolveRemoteEmbeddingClient({
|
|
8
|
-
provider: "deepinfra",
|
|
9
|
-
options: {
|
|
10
|
-
...options,
|
|
11
|
-
model: normalizeDeepInfraModelRef(options.model, defaultModel)
|
|
12
|
-
},
|
|
13
|
-
defaultBaseUrl: DEEPINFRA_BASE_URL,
|
|
14
|
-
normalizeModel: (model) => normalizeDeepInfraModelRef(model, defaultModel)
|
|
15
|
-
});
|
|
16
|
-
return {
|
|
17
|
-
provider: createRemoteEmbeddingProvider({
|
|
18
|
-
id: "deepinfra",
|
|
19
|
-
client,
|
|
20
|
-
errorPrefix: "DeepInfra embeddings API error",
|
|
21
|
-
batchQueryInputs: true
|
|
22
|
-
}),
|
|
23
|
-
client
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
//#endregion
|
|
27
|
-
export { DEFAULT_DEEPINFRA_EMBEDDING_MODEL, createDeepInfraEmbeddingProvider };
|