bubble up the mime type
This commit is contained in:
@@ -90,7 +90,7 @@ func (a anthropic) requestToAnthropicRequest(req Request) anth.MessagesRequest {
|
||||
// Check if image size exceeds 5MiB (5242880 bytes)
|
||||
if len(raw) >= 5242880 {
|
||||
|
||||
compressed, err := utils.CompressImage(img.Base64, 5*1024*1024)
|
||||
compressed, mime, err := utils.CompressImage(img.Base64, 5*1024*1024)
|
||||
|
||||
// just replace the image with the compressed one
|
||||
if err != nil {
|
||||
@@ -98,6 +98,7 @@ func (a anthropic) requestToAnthropicRequest(req Request) anth.MessagesRequest {
|
||||
}
|
||||
|
||||
img.Base64 = compressed
|
||||
img.ContentType = mime
|
||||
}
|
||||
|
||||
m.Content = append(m.Content, anth.NewImageMessageContent(
|
||||
|
Reference in New Issue
Block a user