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:
11
chat.go
11
chat.go
@@ -40,6 +40,7 @@ type Message struct {
|
|||||||
Text string `json:"text"`
|
Text string `json:"text"`
|
||||||
Tool *ToolCall `json:"tool"`
|
Tool *ToolCall `json:"tool"`
|
||||||
Files []TextFile `json:"files"`
|
Files []TextFile `json:"files"`
|
||||||
|
Images []string `json:"images"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Reasoning struct {
|
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
|
tool := message.Tool
|
||||||
if tool != nil {
|
if tool != nil {
|
||||||
msg = tool.AsAssistantToolCall(message.Text)
|
msg = tool.AsAssistantToolCall(message.Text)
|
||||||
|
|||||||
@@ -876,7 +876,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.#images.length && full) {
|
if (this.#images.length) {
|
||||||
data.images = this.#images;
|
data.images = this.#images;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user