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

include generated images in req

This commit is contained in:
Laura
2025-11-30 21:31:26 +01:00
parent 55757989cb
commit 33acc3f402
2 changed files with 16 additions and 5 deletions

19
chat.go
View File

@@ -36,10 +36,11 @@ type TextFile struct {
}
type Message struct {
Role string `json:"role"`
Text string `json:"text"`
Tool *ToolCall `json:"tool"`
Files []TextFile `json:"files"`
Role string `json:"role"`
Text string `json:"text"`
Tool *ToolCall `json:"tool"`
Files []TextFile `json:"files"`
Images []string `json:"images"`
}
type Reasoning struct {
@@ -308,6 +309,16 @@ func (r *Request) Parse() (*openrouter.ChatCompletionRequest, error) {
},
}
for index, image := range message.Images {
msg.Images = append(msg.Images, openrouter.ChatCompletionImage{
Index: index,
Type: openrouter.StreamImageTypeImageURL,
ImageURL: openrouter.ChatCompletionImageURL{
URL: image,
},
})
}
tool := message.Tool
if tool != nil {
msg = tool.AsAssistantToolCall(message.Text)

View File

@@ -876,7 +876,7 @@
}
}
if (this.#images.length && full) {
if (this.#images.length) {
data.images = this.#images;
}