mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-13 18:21:27 +00:00
feat: add music generation tooling
This commit is contained in:
@@ -3,6 +3,10 @@ import {
|
||||
generateImage as generateRuntimeImage,
|
||||
listRuntimeImageGenerationProviders,
|
||||
} from "../../image-generation/runtime.js";
|
||||
import {
|
||||
generateMusic as generateRuntimeMusic,
|
||||
listRuntimeMusicGenerationProviders,
|
||||
} from "../../music-generation/runtime.js";
|
||||
import { resolveGlobalSingleton } from "../../shared/global-singleton.js";
|
||||
import {
|
||||
createLazyRuntimeMethod,
|
||||
@@ -73,6 +77,13 @@ function createRuntimeVideoGeneration(): PluginRuntime["videoGeneration"] {
|
||||
};
|
||||
}
|
||||
|
||||
function createRuntimeMusicGeneration(): PluginRuntime["musicGeneration"] {
|
||||
return {
|
||||
generate: (params) => generateRuntimeMusic(params),
|
||||
listProviders: (params) => listRuntimeMusicGenerationProviders(params),
|
||||
};
|
||||
}
|
||||
|
||||
function createRuntimeModelAuth(): PluginRuntime["modelAuth"] {
|
||||
const getApiKeyForModel = createLazyRuntimeMethod(
|
||||
loadModelAuthRuntime,
|
||||
@@ -211,12 +222,24 @@ export function createPluginRuntime(_options: CreatePluginRuntimeOptions = {}):
|
||||
taskFlow,
|
||||
} satisfies Omit<
|
||||
PluginRuntime,
|
||||
"tts" | "mediaUnderstanding" | "stt" | "modelAuth" | "imageGeneration" | "videoGeneration"
|
||||
| "tts"
|
||||
| "mediaUnderstanding"
|
||||
| "stt"
|
||||
| "modelAuth"
|
||||
| "imageGeneration"
|
||||
| "videoGeneration"
|
||||
| "musicGeneration"
|
||||
> &
|
||||
Partial<
|
||||
Pick<
|
||||
PluginRuntime,
|
||||
"tts" | "mediaUnderstanding" | "stt" | "modelAuth" | "imageGeneration" | "videoGeneration"
|
||||
| "tts"
|
||||
| "mediaUnderstanding"
|
||||
| "stt"
|
||||
| "modelAuth"
|
||||
| "imageGeneration"
|
||||
| "videoGeneration"
|
||||
| "musicGeneration"
|
||||
>
|
||||
>;
|
||||
|
||||
@@ -228,6 +251,7 @@ export function createPluginRuntime(_options: CreatePluginRuntimeOptions = {}):
|
||||
defineCachedValue(runtime, "modelAuth", createRuntimeModelAuth);
|
||||
defineCachedValue(runtime, "imageGeneration", createRuntimeImageGeneration);
|
||||
defineCachedValue(runtime, "videoGeneration", createRuntimeVideoGeneration);
|
||||
defineCachedValue(runtime, "musicGeneration", createRuntimeMusicGeneration);
|
||||
|
||||
return runtime as PluginRuntime;
|
||||
}
|
||||
|
||||
@@ -86,6 +86,10 @@ export type PluginRuntimeCore = {
|
||||
generate: typeof import("../../video-generation/runtime.js").generateVideo;
|
||||
listProviders: typeof import("../../video-generation/runtime.js").listRuntimeVideoGenerationProviders;
|
||||
};
|
||||
musicGeneration: {
|
||||
generate: typeof import("../../music-generation/runtime.js").generateMusic;
|
||||
listProviders: typeof import("../../music-generation/runtime.js").listRuntimeMusicGenerationProviders;
|
||||
};
|
||||
webSearch: {
|
||||
listProviders: typeof import("../../web-search/runtime.js").listWebSearchProviders;
|
||||
search: typeof import("../../web-search/runtime.js").runWebSearch;
|
||||
|
||||
Reference in New Issue
Block a user