diff --git a/anthropic.go b/anthropic.go index 784cc32..b2982dc 100644 --- a/anthropic.go +++ b/anthropic.go @@ -71,6 +71,11 @@ func (a anthropic) requestToAnthropicRequest(req Request) anth.MessagesRequest { } for _, img := range msg.Images { + // anthropic doesn't allow the assistant to send images, so we need to say it's from the user + if m.Role == anth.RoleAssistant { + m.Role = anth.RoleUser + } + if img.Base64 != "" { m.Content = append(m.Content, anth.NewImageMessageContent( anth.NewMessageContentSource(