1
0
mirror of https://github.com/coalaura/whiskr.git synced 2025-12-02 20:22:52 +00:00

image generation wip

This commit is contained in:
Laura
2025-09-11 23:25:58 +02:00
parent 27dbd0e642
commit 1c4ff26378
10 changed files with 105 additions and 24 deletions

View File

@@ -105,6 +105,14 @@ func (r *Request) Parse() (*openrouter.ChatCompletionRequest, error) {
request.Model = r.Model
request.Modalities = []openrouter.ChatCompletionModality{
openrouter.ModalityText,
}
if env.Settings.ImageGeneration && model.Images {
request.Modalities = append(request.Modalities, openrouter.ModalityImage)
}
if r.Iterations < 1 || r.Iterations > 50 {
return nil, fmt.Errorf("invalid iterations (1-50): %d", r.Iterations)
}