Skip to content

feat: 修复 Gemini 生图接口并新增前端生图测试能力#930

Merged
Wei-Shaw merged 3 commits intoWei-Shaw:mainfrom
GuangYiDing:feat/gemini-25-flash-image-support
Mar 12, 2026
Merged

feat: 修复 Gemini 生图接口并新增前端生图测试能力#930
Wei-Shaw merged 3 commits intoWei-Shaw:mainfrom
GuangYiDing:feat/gemini-25-flash-image-support

Conversation

@GuangYiDing
Copy link
Copy Markdown
Contributor

@GuangYiDing GuangYiDing commented Mar 11, 2026

变更说明

  • 修复 Gemini 生图接口链路,补齐 gemini-2.5-flash-image / gemini-3.1-flash-image 在原生 fallback、管理端 curated 模型列表、Antigravity 默认映射和持久化 model_mapping 中的支持
  • 新增 migration,同步已有账号的模型映射,避免 gemini 分组 mixed scheduling 场景下图片模型无法命中
  • 在前端账号测试弹窗中新增 Gemini 生图测试能力:选择图片模型后可直接输入提示词、发起真实生图请求,并在弹窗内预览返回图片
  • 调整前端模型排序,让新的 Gemini 图片模型优先展示,便于直接验证和使用
  • 补充后端与前端定向测试,覆盖图片模型暴露、图片事件解析、前端预览与排序逻辑

测试

  • GOCACHE=/tmp/go-cache GOMODCACHE=/tmp/go-mod-cache go test -tags=unit ./internal/domain ./internal/pkg/gemini ./internal/pkg/geminicli ./internal/pkg/antigravity ./internal/service -run "TestDefaultAntigravityModelMapping_ImageCompatibilityAliases|TestDefaultModels_ContainsImageModels|TestDefaultModels_ContainsNewAndLegacyImageModels|TestIsImageGenerationModel|TestExtractImageSize"
  • GOCACHE=/tmp/go-cache GOMODCACHE=/tmp/go-mod-cache go test -tags=unit ./internal/service ./internal/handler/admin -run "TestCreateGeminiTestPayload_ImageModel|TestProcessGeminiStream_EmitsImageEvent"
  • pnpm --dir ./frontend exec vitest run src/components/admin/account/__tests__/AccountTestModal.spec.ts src/composables/__tests__/useModelWhitelist.spec.ts src/components/account/__tests__/AccountUsageCell.spec.ts src/components/account/__tests__/BulkEditAccountModal.spec.ts

@GuangYiDing GuangYiDing changed the title feat: 补齐 Gemini 2.5 Flash Image 支持 feat: 修复 Gemini 生图接口并新增前端生图测试能力 Mar 11, 2026
@Wei-Shaw Wei-Shaw merged commit f0e08e7 into Wei-Shaw:main Mar 12, 2026
4 checks passed
liafonx pushed a commit to liafonx/sub2api that referenced this pull request Mar 20, 2026
…-image-support

feat: 修复 Gemini 生图接口并新增前端生图测试能力
qyhfrank pushed a commit to qyhfrank/sub2api that referenced this pull request Mar 24, 2026
…-image-support

feat: 修复 Gemini 生图接口并新增前端生图测试能力
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants