diff --git a/internal/tools/create_audio.go b/internal/tools/create_audio.go index 182baedb..56380508 100644 --- a/internal/tools/create_audio.go +++ b/internal/tools/create_audio.go @@ -40,7 +40,7 @@ func NewCreateAudioTool(registry *providers.Registry, elevenlabsKey, elevenlabsB func (t *CreateAudioTool) Name() string { return "create_audio" } func (t *CreateAudioTool) Description() string { - return "Generate music, sound effects, or ambient audio from a text description. Returns a MEDIA: path to the generated audio file." + return "Generate music, sound effects, or ambient audio from a text description. Returns a MEDIA: path to the generated audio file. Note: for music, duration is determined by lyrics length — provide longer/shorter lyrics to control length. The 'duration' parameter only applies to sound effects." } func (t *CreateAudioTool) Parameters() map[string]interface{} { @@ -57,7 +57,7 @@ func (t *CreateAudioTool) Parameters() map[string]interface{} { }, "duration": map[string]interface{}{ "type": "integer", - "description": "Duration in seconds.", + "description": "Duration in seconds (only for sound effects). For music, duration is controlled by lyrics length.", }, "lyrics": map[string]interface{}{ "type": "string", @@ -125,9 +125,6 @@ func (t *CreateAudioTool) Execute(ctx context.Context, args map[string]interface chain[i].Params["prompt"] = prompt chain[i].Params["lyrics"] = lyrics chain[i].Params["instrumental"] = instrumental - if duration > 0 { - chain[i].Params["duration"] = duration - } } // Override timeout to 300s for music generation (slow API). diff --git a/internal/tools/create_audio_minimax.go b/internal/tools/create_audio_minimax.go index 51337932..be35cd80 100644 --- a/internal/tools/create_audio_minimax.go +++ b/internal/tools/create_audio_minimax.go @@ -27,7 +27,8 @@ func callMinimaxMusicGen(ctx context.Context, apiKey, apiBase, model, prompt str instrumental = true } - duration := GetParamInt(params, "duration", 0) + // NOTE: MiniMax music API does NOT support a duration parameter. + // Audio length is determined by lyrics length (vocal) or the model's default (~3-4 min for instrumental). body := map[string]interface{}{ "model": model, @@ -44,9 +45,6 @@ func callMinimaxMusicGen(ctx context.Context, apiKey, apiBase, model, prompt str if lyrics != "" { body["lyrics"] = lyrics } - if duration > 0 { - body["duration_seconds"] = duration - } jsonBody, err := json.Marshal(body) if err != nil {