Skip to content

Conversation

@slovx2
Copy link
Contributor

@slovx2 slovx2 commented Jan 27, 2026

Summary

  • 为 Gemini 原生平台(非 Antigravity)添加图片生成计费支持
  • 当响应中包含 inlineData 且 MIME 类型为图片时,统计生成的图片数量
  • 计费逻辑复用现有的 calculateImageCost 方法

Changes

  • backend/internal/service/gemini_messages_compat_service.go: 添加 countGeneratedImages 方法,解析响应并统计图片数量

对齐 Antigravity 平台的图片计费逻辑:
- 添加 extractImageSize() 方法提取图片尺寸
- Forward() 和 ForwardNative() 返回 ImageCount/ImageSize
- 支持分组自定义图片价格和倍率
@Wei-Shaw Wei-Shaw merged commit 2c31bf4 into Wei-Shaw:main Jan 28, 2026
4 checks passed
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