feat(qwen): add qwen provider and video generation

This commit is contained in:
Peter Steinberger
2026-04-04 17:43:15 +01:00
parent 759373e887
commit e3ac0f43df
104 changed files with 2477 additions and 483 deletions

View File

@@ -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;
}

View File

@@ -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;