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:
19
chat.go
19
chat.go
@@ -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)
|
||||
|
||||
@@ -876,7 +876,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
if (this.#images.length && full) {
|
||||
if (this.#images.length) {
|
||||
data.images = this.#images;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user