15 Commits

Author SHA1 Message Date
Seefs
2cf3c1836c fix: preserve explicit zero values in native relay requests 2026-03-01 15:47:03 +08:00
CaIon
b5a0c822d2 feat(adaptor): 新适配百炼多种图片生成模型
- wan2.6系列生图与编辑,适配多图生成计费
- wan2.5系列生图与编辑
- z-image-turbo生图,适配prompt_extend计费
2025-12-29 23:00:17 +08:00
Seefs
634651b463 feat: zhipu v4 image generations 2025-12-02 22:56:58 +08:00
Seefs
c074ed2eb5 Revert "OAI生图接口支持gemini 3 pro image preview" 2025-11-30 18:49:18 +08:00
feitianbubu
2d6f8fb58f feat: gemini-3-pro-image-preview add extra param 2025-11-26 12:03:24 +08:00
feitianbubu
a4c46e999e feat: doubao-seedream-4-0-250828 image to image 2025-10-23 21:19:32 +08:00
Seefs
5010f2d004 format: package name -> github.com/QuantumNous/new-api (#2017) 2025-10-11 15:30:09 +08:00
CaIon
7b5d406785 refactor(openai_image): replace json.Marshal with common.Marshal for improved serialization #1961 2025-10-03 12:44:33 +08:00
creamlike1024
497fdba3f8 fix: 优化 ImageRequest 的 JSON 序列化,避免覆盖合并 ExtraFields 2025-09-11 12:28:57 +08:00
Xyfacai
00579f2f8d feat: dalle 自定义字段透传 2025-09-10 15:29:07 +08:00
CaIon
781a708173 feat: support qwen-image-edit 2025-08-25 14:33:12 +08:00
CaIon
488f6a2e71 feat: enhance image request handling and add async support 2025-08-24 21:52:56 +08:00
CaIon
1ee3d1cc50 feat: 修复重试后请求结构混乱,修复rerank端点无法使用 2025-08-23 13:12:15 +08:00
CaIon
e0f256506f Merge branch 'alpha' into refactor_relay
# Conflicts:
#	dto/openai_image.go
2025-08-15 13:46:34 +08:00
CaIon
97ea8b6560 refactor: Introduce pre-consume quota and unify relay handlers
This commit introduces a major architectural refactoring to improve quota management, centralize logging, and streamline the relay handling logic.

Key changes:
- **Pre-consume Quota:** Implements a new mechanism to check and reserve user quota *before* making the request to the upstream provider. This ensures more accurate quota deduction and prevents users from exceeding their limits due to concurrent requests.

- **Unified Relay Handlers:** Refactors the relay logic to use generic handlers (e.g., `ChatHandler`, `ImageHandler`) instead of provider-specific implementations. This significantly reduces code duplication and simplifies adding new channels.

- **Centralized Logger:** A new dedicated `logger` package is introduced, and all system logging calls are migrated to use it, moving this responsibility out of the `common` package.

- **Code Reorganization:** DTOs are generalized (e.g., `dalle.go` -> `openai_image.go`) and utility code is moved to more appropriate packages (e.g., `common/http.go` -> `service/http.go`) for better code structure.
2025-08-14 20:05:06 +08:00