prevent audio as image url
This commit is contained in:
parent
3e5b849984
commit
b9ee9b33f5
1 changed files with 8 additions and 6 deletions
|
|
@ -323,6 +323,7 @@ func serializeMessages(messages []Message) []any {
|
|||
})
|
||||
}
|
||||
for _, mediaURL := range m.Media {
|
||||
if strings.HasPrefix(mediaURL, "data:image/") {
|
||||
parts = append(parts, map[string]any{
|
||||
"type": "image_url",
|
||||
"image_url": map[string]any{
|
||||
|
|
@ -330,6 +331,7 @@ func serializeMessages(messages []Message) []any {
|
|||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
msg := map[string]any{
|
||||
"role": m.Role,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue