mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-20 07:03:42 +08:00
- Add MessageContent type to handle both string and array content formats - Implement UnmarshalJSON to automatically detect content format - Add ToContentArray() method for unified content processing - Update Message and Response structs to use MessageContent - Fix all content processing logic in main.go and controller - Resolve JSON parsing errors for different content formats 支持Anthropic协议字符串和数组内容格式: - 添加MessageContent类型处理字符串和数组两种内容格式 - 实现UnmarshalJSON自动检测内容格式 - 添加ToContentArray()方法统一内容处理 - 更新Message和Response结构体使用MessageContent - 修复main.go和controller中的所有内容处理逻辑 - 解决不同内容格式的JSON解析错误