fix(channel-test): auto-detect image generation models#6122
Open
lichengzhe wants to merge 1 commit into
Open
Conversation
Contributor
WalkthroughGPT image model detection now covers the ChangesImage endpoint detection
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Important
📝 变更描述 / Description
渠道测试使用「自动检测」时,
gpt-image-2会被当成聊天模型,请求发到/v1/chat/completions,导致上游报错(#6121)。本 PR 做了这些调整:
gpt-image-1的精确匹配改为匹配整个gpt-image-*系列,同时支持openai/gpt-image-3这类带命名空间的名称。/v1/images/generations和dto.ImageRequest,避免请求路径与请求体不一致。Seedream-4.0也能正常识别。自动检测会对所有渠道类型生效。
dall-e、flux、imagen等已知图像模型也会自动走图像端点。如果个别上游通过聊天接口代理图像模型,仍可手动指定端点覆盖。定价页复用同一个分类器,因此
gpt-image-2的端点类型也会显示为[image-generation, openai]。本 PR 在 AI 辅助下完成,实现、测试、影响范围与本描述均经本人复核。
🚀 变更类型 / Type of change
🔗 关联任务 / Related Issue
✅ 提交前检查项 / Checklist
Bug fix,我已提交或关联对应 Issue,且不会将设计取舍、预期不一致或理解偏差直接归类为 bug。📸 运行证明 / Proof of Work
以下测试已通过:
回归测试覆盖:
gpt-image-1、gpt-image-2、带命名空间及未来的gpt-image-*名称dto.ImageRequest保持一致Seedream-4.0的大小写场景[image-generation, openai]其余 Go 包的测试也已通过。只有仓库根目录的 setup 因本地缺少生成产物
web/classic/dist无法运行,与本次改动无关。Summary by CodeRabbit
New Features
Bug Fixes