Commit Graph

1217 Commits

Author SHA1 Message Date
Deadwalk
bfadc4e2e0 fix(anthropic): improve MCP tool message handling and error resilience
修复Anthropic协议中MCP工具消息处理问题,增强错误恢复能力:
- 改进MessageContent的JSON解析,支持原始JSON数据保留
- 移除对空内容的过滤,避免丢失MCP工具消息
- 增加详细调试日志,便于问题排查
- 优化错误响应处理,保留响应体信息
- 修复路由转发时可能的数据丢失问题

fix(anthropic): improve MCP tool message handling and error resilience
- Enhance MessageContent JSON parsing to preserve raw JSON data
- Remove empty content filtering to prevent MCP tool message loss
- Add detailed debug logging for troubleshooting
- Optimize error response handling with response body preservation
- Fix potential data loss during routing

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-30 08:29:38 +08:00
Deadwalk
a587ac145a feat(anthropic): support both string and array content formats
- 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解析错误
2025-09-29 16:52:19 +08:00
Deadwalk
7b9631408f fix(anthropic): filter empty content messages to prevent API errors
- Add message content validation in getAndValidateAnthropicRequest
- Filter out messages with empty content to prevent 'all messages must have non-empty content' errors
- Support both text and non-text content validation (images, tool_use, tool_result)
- Add detailed logging for filtered messages
- Ensure at least one valid message remains after filtering

修复Anthropic协议空消息内容问题:
- 在getAndValidateAnthropicRequest中添加消息内容验证
- 过滤空内容消息以防止'all messages must have non-empty content'错误
- 支持文本和非文本内容验证(图片、工具调用、工具结果)
- 为被过滤的消息添加详细日志记录
- 确保过滤后至少保留一条有效消息
2025-09-29 16:51:55 +08:00
Deadwalk
290931b506 fix: improve Dockerfile build configuration for ARM64 compatibility
- Add comprehensive npm mirror configuration for faster package downloads
- Use parallel npm install and build processes for better performance
- Configure Go proxy and Alpine package mirrors for network reliability
- Fix frontend dependency issues that caused blank page display

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-28 16:48:24 +08:00
Deadwalk
48396d3f33 fix: 修复CodeReview发现的安全问题和代码质量问题 | fix security and code quality issues identified by CodeReview
- 修复JSON注入漏洞:使用json.Marshal()安全转义字符串内容
- 定义常量CHARS_PER_TOKEN替换硬编码的token估算数字4
- 处理UnmarshalJSON错误,避免静默失败并记录错误日志
- 定义常量替换硬编码的API端点路径,提高可维护性

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-28 16:41:48 +08:00
Deadwalk
e27612a620 refactor: 优化Anthropic协议日志输出 | optimize Anthropic protocol log output
- 清理不必要的调试日志,减少生产环境噪音
- 将详细日志从Infof降级为Debugf级别
- 保留关键错误日志和重要流程信息
- 优化日志结构,提高可读性和维护性

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-28 16:22:18 +08:00
Deadwalk
008ffe4662 feat: 支持Anthropic API协议 | support Anthropic API protocol
- 添加Anthropic适配器实现 | Add Anthropic adaptor implementation
- 支持Anthropic消息格式转换 | Support Anthropic message format conversion
- 添加Vertex AI Claude适配器支持 | Add Vertex AI Claude adapter support
- 更新Anthropic的中继模式定义 | Update relay mode definitions for Anthropic
- 添加Anthropic控制器和路由 | Add Anthropic controller and routing

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: zgdmemail@gmail.com
2025-09-28 11:13:55 +08:00
JustSong
8df4a2670b docs: update ByteDance Doubao model link in README
Some checks failed
CI / Unit tests (push) Has been cancelled
CI / commit_lint (push) Has been cancelled
2025-02-21 19:30:16 +08:00
longkeyy
7ac553541b feat: update openrouter models and price 20250213 (#2084)
Some checks failed
CI / Unit tests (push) Has been cancelled
CI / commit_lint (push) Has been cancelled
v0.6.11-alpha.22
2025-02-16 18:01:59 +08:00
longkeyy
a5c517c27a feat: update ali models and price 20250213 (#2086) 2025-02-16 18:01:24 +08:00
JustSong
3f421c4f04 feat: support Gemini openai compatible api v0.6.11-preview.7 2025-02-16 17:59:39 +08:00
JustSong
1ce6a226f6 chore: update prompt 2025-02-16 17:42:20 +08:00
JustSong
cafd0a0327 feat: add OpenAI compatible channel (close #2091) 2025-02-16 17:38:06 +08:00
JustSong
8b8cd03e85 feat: add balance not supported message in ChannelsTable
Some checks failed
CI / Unit tests (push) Has been cancelled
CI / commit_lint (push) Has been cancelled
2025-02-12 01:20:28 +08:00
JustSong
54c38de813 style: improve code formatting and structure in ChannelsTable and render helpers v0.6.11-alpha.21 2025-02-12 01:15:45 +08:00
JustSong
d6284bf6b0 feat: enhance error handling for utils.js 2025-02-12 00:46:13 +08:00
DobyAsa
df5d2ca93d docs: fix README typo (#2060) 2025-02-12 00:35:29 +08:00
Laisky.Cai
fef7ae048b feat: support gemini-2.0-flash (#2055)
* feat: support gemini-2.0-flash

- Enhance model support by adding new entries and refining checks for system instruction compatibility.
- Update logging display behavior and adjust default quotas for better user experience.
- Revamp pricing structures in the billing system to reflect current model values and deprecate outdated entries.
- Streamline code by replacing hardcoded values with configurations for maintainability.

* feat: add new Gemini 2.0 flash models to adapter and billing ratio

* fix: update GetRequestURL to support gemini-1.5 model in versioning
2025-02-12 00:34:25 +08:00
JustSong
6916debf66 feat: update TestPrompt to specify output format for model name v0.6.11-preview.6 2025-02-12 00:28:23 +08:00
JustSong
53da209134 feat: add AliBailian adaptor and update channel options 2025-02-12 00:15:43 +08:00
JustSong
517f6ad211 feat: update date range to display at least 7 days of data in Dashboard
Some checks are pending
CI / Unit tests (push) Waiting to run
CI / commit_lint (push) Waiting to run
v0.6.11-preview.5
2025-02-11 01:48:26 +08:00
JustSong
10aba11f18 style: improve code formatting in ChannelsTable component 2025-02-11 00:38:15 +08:00
JustSong
4d011c5f98 feat: add OpenRouter balance update functionality and improve code formatting v0.6.11-alpha.20 2025-02-11 00:35:06 +08:00
JustSong
eb96aa635e feat: update OpenRouter channel name and add model list for OpenRouter adaptor 2025-02-11 00:20:55 +08:00
JustSong
c715f2bc1d feat: add new models for xai
Some checks are pending
CI / Unit tests (push) Waiting to run
CI / commit_lint (push) Waiting to run
2025-02-09 21:21:28 +08:00
JustSong
aed090dd55 fix: fix cannot select test model when searching
Some checks are pending
CI / Unit tests (push) Waiting to run
CI / commit_lint (push) Waiting to run
v0.6.11-preview.4
2025-02-09 19:09:53 +08:00
JustSong
696265774e feat: add MiniMax model constants to the adaptor 2025-02-09 18:55:32 +08:00
JustSong
974729426d feat: refactor Xunfei API version handling and update model list 2025-02-09 18:50:51 +08:00
JustSong
57c1367ec8 feat: add Xunfei V2 channel support and update related configurations 2025-02-09 18:31:54 +08:00
JustSong
44233d5c04 feat: add completion tokens details and reasoning effort fields to model (close #2050) 2025-02-09 18:14:01 +08:00
JustSong
bf45a955c3 fix: update system prompt handling by renaming field and ensuring proper usage in request processing (close #2069) 2025-02-09 14:41:42 +08:00
JustSong
20435fcbfc fix: simplify Docker build configuration by removing unnecessary platform and architecture settings v0.6.11-preview.3 2025-02-09 14:33:25 +08:00
JustSong
6e7a1c2323 fix: format channel options for consistency and improve tips for user guidance 2025-02-09 12:42:31 +08:00
JustSong
dd65b997dd feat: add Baidu V2 channel support and improve model handling 2025-02-09 12:37:26 +08:00
JustSong
0b6d03d6c6 fix: update channel name from '火山引擎' to '字节火山引擎' for consistency 2025-02-09 12:08:40 +08:00
JustSong
4375246e24 feat: enhance channel options with tips and descriptions for better user guidance 2025-02-09 12:03:31 +08:00
longkeyy
3e3b8230ac fix: add read/write locks for ModelRatio and GroupRatio to prevent concurrent map read/write issues (#2067)
Some checks are pending
CI / Unit tests (push) Waiting to run
CI / commit_lint (push) Waiting to run
v0.6.11-preview.2
2025-02-09 11:02:45 +08:00
JustSong
07808122a6 fix: fix Debugf not using DebugEnabled (close #2068) 2025-02-09 10:57:22 +08:00
牡丹凤凰
c96895e35b docs: add related project CherryStudio (#2059)
Some checks failed
CI / Unit tests (push) Has been cancelled
CI / commit_lint (push) Has been cancelled
* Update README.md

增加相关项目CherryStudio

* Update README.en.md

* Update README.ja.md
2025-02-08 00:07:55 +08:00
JustSong
2552c68249 fix: update doubao channel name
Some checks are pending
CI / Unit tests (push) Waiting to run
CI / commit_lint (push) Waiting to run
v0.6.11-alpha.18
2025-02-07 01:51:28 +08:00
JustSong
5c81e40612 fix: update Dockerfile and workflow for improved multi-architecture support v0.6.11-preview.1 2025-02-07 01:35:53 +08:00
JustSong
0d5318b1b7 revert: fix: revert sqlite build related changes
This reverts commit db65db2807.
2025-02-07 01:15:33 +08:00
JustSong
db65db2807 fix: revert sqlite build related changes 2025-02-07 00:48:23 +08:00
JustSong
e0b7e6a9e2 fix: unify version retrieval in Dockerfile build commands 2025-02-07 00:39:55 +08:00
JustSong
27c2abe80f fix: update Docker setup actions to latest versions 2025-02-07 00:33:15 +08:00
JustSong
2c867251b5 fix: improve code formatting and readability in Dashboard component 2025-02-07 00:23:13 +08:00
JustSong
108111ebd3 fix: exclude preview tags from release workflows 2025-02-07 00:19:23 +08:00
JustSong
293ba93ad6 fix: remove outdated model from ModelList and add new deepseek models v0.6.11-alpha.17 2025-02-07 00:13:57 +08:00
JustSong
faced40d5b fix: update Docker image workflow to conditionally include arm64 platform 2025-02-07 00:06:32 +08:00
JustSong
2ae9997f29 fix: enhance error handling for Gemini API key validation v0.6.11-alpha.16 2025-02-07 00:03:00 +08:00