mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-13 02:01:16 +00:00
feat(qwen): add qwen provider and video generation
This commit is contained in:
@@ -58,6 +58,12 @@ type RuntimeImageGenerationModule = Pick<
|
||||
>;
|
||||
let cachedRuntimeImageGenerationModule: RuntimeImageGenerationModule | null = null;
|
||||
|
||||
type RuntimeVideoGenerationModule = Pick<
|
||||
typeof import("../../plugin-sdk/video-generation-runtime.js"),
|
||||
"generateVideo" | "listRuntimeVideoGenerationProviders"
|
||||
>;
|
||||
let cachedRuntimeVideoGenerationModule: RuntimeVideoGenerationModule | null = null;
|
||||
|
||||
function loadRuntimeImageGenerationModule(): RuntimeImageGenerationModule {
|
||||
cachedRuntimeImageGenerationModule ??=
|
||||
loadBundledPluginPublicSurfaceModuleSync<RuntimeImageGenerationModule>({
|
||||
@@ -75,6 +81,23 @@ function createRuntimeImageGeneration(): PluginRuntime["imageGeneration"] {
|
||||
};
|
||||
}
|
||||
|
||||
function loadRuntimeVideoGenerationModule(): RuntimeVideoGenerationModule {
|
||||
cachedRuntimeVideoGenerationModule ??=
|
||||
loadBundledPluginPublicSurfaceModuleSync<RuntimeVideoGenerationModule>({
|
||||
dirName: "video-generation-core",
|
||||
artifactBasename: "runtime-api.js",
|
||||
});
|
||||
return cachedRuntimeVideoGenerationModule;
|
||||
}
|
||||
|
||||
function createRuntimeVideoGeneration(): PluginRuntime["videoGeneration"] {
|
||||
return {
|
||||
generate: (params) => loadRuntimeVideoGenerationModule().generateVideo(params),
|
||||
listProviders: (params) =>
|
||||
loadRuntimeVideoGenerationModule().listRuntimeVideoGenerationProviders(params),
|
||||
};
|
||||
}
|
||||
|
||||
function createRuntimeModelAuth(): PluginRuntime["modelAuth"] {
|
||||
const getApiKeyForModel = createLazyRuntimeMethod(
|
||||
loadModelAuthRuntime,
|
||||
@@ -213,10 +236,13 @@ export function createPluginRuntime(_options: CreatePluginRuntimeOptions = {}):
|
||||
taskFlow,
|
||||
} satisfies Omit<
|
||||
PluginRuntime,
|
||||
"tts" | "mediaUnderstanding" | "stt" | "modelAuth" | "imageGeneration"
|
||||
"tts" | "mediaUnderstanding" | "stt" | "modelAuth" | "imageGeneration" | "videoGeneration"
|
||||
> &
|
||||
Partial<
|
||||
Pick<PluginRuntime, "tts" | "mediaUnderstanding" | "stt" | "modelAuth" | "imageGeneration">
|
||||
Pick<
|
||||
PluginRuntime,
|
||||
"tts" | "mediaUnderstanding" | "stt" | "modelAuth" | "imageGeneration" | "videoGeneration"
|
||||
>
|
||||
>;
|
||||
|
||||
defineCachedValue(runtime, "tts", createRuntimeTts);
|
||||
@@ -226,6 +252,7 @@ export function createPluginRuntime(_options: CreatePluginRuntimeOptions = {}):
|
||||
}));
|
||||
defineCachedValue(runtime, "modelAuth", createRuntimeModelAuth);
|
||||
defineCachedValue(runtime, "imageGeneration", createRuntimeImageGeneration);
|
||||
defineCachedValue(runtime, "videoGeneration", createRuntimeVideoGeneration);
|
||||
|
||||
return runtime as PluginRuntime;
|
||||
}
|
||||
|
||||
@@ -82,6 +82,10 @@ export type PluginRuntimeCore = {
|
||||
generate: typeof import("../../plugin-sdk/image-generation-runtime.js").generateImage;
|
||||
listProviders: typeof import("../../plugin-sdk/image-generation-runtime.js").listRuntimeImageGenerationProviders;
|
||||
};
|
||||
videoGeneration: {
|
||||
generate: typeof import("../../plugin-sdk/video-generation-runtime.js").generateVideo;
|
||||
listProviders: typeof import("../../plugin-sdk/video-generation-runtime.js").listRuntimeVideoGenerationProviders;
|
||||
};
|
||||
webSearch: {
|
||||
listProviders: typeof import("../../web-search/runtime.js").listWebSearchProviders;
|
||||
search: typeof import("../../web-search/runtime.js").runWebSearch;
|
||||
|
||||
Reference in New Issue
Block a user