diff --git a/pkg/agent/agent_media.go b/pkg/agent/agent_media.go index a773d2ebb..866f7dc24 100644 --- a/pkg/agent/agent_media.go +++ b/pkg/agent/agent_media.go @@ -75,6 +75,14 @@ func resolveMediaRefs(messages []providers.Message, store media.MediaStore, maxS continue } + if strings.HasPrefix(mime, "audio/") { + dataURL := encodeImageToDataURL(localPath, mime, info, maxSize) + if dataURL != "" { + result[i].Audio = append(result[i].Audio, dataURL) + } + continue + } + pathTags = append(pathTags, buildPathTag(mime, localPath)) } diff --git a/pkg/providers/protocoltypes/types.go b/pkg/providers/protocoltypes/types.go index f3553f8b0..07aa086e0 100644 --- a/pkg/providers/protocoltypes/types.go +++ b/pkg/providers/protocoltypes/types.go @@ -76,6 +76,7 @@ type Message struct { Content string `json:"content"` Media []string `json:"media,omitempty"` Attachments []Attachment `json:"attachments,omitempty"` + Audio []string `json:"audio,omitempty"` ReasoningContent string `json:"reasoning_content,omitempty"` SystemParts []ContentBlock `json:"system_parts,omitempty"` // structured system blocks for cache-aware adapters ToolCalls []ToolCall `json:"tool_calls,omitempty"` @@ -91,4 +92,4 @@ type ToolFunctionDefinition struct { Name string `json:"name"` Description string `json:"description"` Parameters map[string]any `json:"parameters"` -} +} \ No newline at end of file