feat: add audio input support to v2 providers
Add Audio struct alongside Image for sending audio attachments to multimodal LLMs. OpenAI uses input_audio content parts (wav/mp3), Google Gemini uses genai.NewPartFromBytes, and Anthropic skips audio gracefully since it's not supported. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -204,6 +204,8 @@ func (p *Provider) buildRequest(req provider.Request) anth.MessagesRequest {
|
||||
}
|
||||
}
|
||||
|
||||
// Audio is not supported by Anthropic — skip silently.
|
||||
|
||||
// Merge consecutive same-role messages (Anthropic requires alternating)
|
||||
if len(msgs) > 0 && msgs[len(msgs)-1].Role == role {
|
||||
msgs[len(msgs)-1].Content = append(msgs[len(msgs)-1].Content, m.Content...)
|
||||
|
||||
Reference in New Issue
Block a user