Fix genimage action

This commit is contained in:
mudler
2025-03-01 16:02:01 +01:00
parent a57f990576
commit 3790ad3666
5 changed files with 92 additions and 6 deletions

View File

@@ -31,13 +31,16 @@ func (a *GenImageAction) Run(ctx context.Context, params action.ActionParams) (s
}{}
err := params.Unmarshal(&result)
if err != nil {
fmt.Printf("error: %v", err)
return "", err
}
if result.Prompt == "" {
return "", fmt.Errorf("prompt is required")
}
req := openai.ImageRequest{
Prompt: result.Prompt,
Model: a.imageModel,
}
switch result.Size {