Commit Graph

44 Commits

Author SHA1 Message Date
Xyfacai
09495c8ef6 feat: sora 增加参数校验与计费 2025-10-10 23:56:36 +08:00
creamlike1024
eeef719f3a feat: 支持 gemini-robotics-er-1.5-preview 2025-10-01 17:33:54 +08:00
Seefs
740c46102b Merge pull request #1924 from prnake/claude-4-5
feat: support claude-sonnet-4-5-20250929
2025-09-30 09:26:34 +08:00
papersnake
112ab0b17c feat: support claude-sonnet-4-5-20250929 2025-09-30 09:14:12 +08:00
dd
f9399e279c Merge branch 'QuantumNous:main' into main 2025-09-29 19:15:43 +08:00
RedwindA
71b3c90bc9 解锁deepseek补全倍率;允许deepseek渠道获取模型 2025-09-29 18:32:44 +08:00
dd
40a6d957b5 Merge branch 'QuantumNous:main' into main 2025-09-29 14:13:50 +08:00
CaIon
552d795742 Merge branch 'alpha' 2025-09-19 14:20:15 +08:00
creamlike1024
5cae6be108 feat: 支持 gemini-embedding-001 2025-09-19 00:24:01 +08:00
DD
71d41d6eaa Merge branch 'main' of github.com:danding5/new-api
# Conflicts:
#	relay/relay_adaptor.go
2025-09-15 14:31:06 +08:00
creamlike1024
d21886b9fb Merge branch 'alpha' into imageratio-and-audioratio-edit 2025-09-15 14:12:24 +08:00
CaIon
1a8d781721 Revert "feat: gemini-2.5-flash-image-preview 文本和图片输出计费"
This reverts commit a45513a7a6.
2025-09-13 12:53:28 +08:00
DD
68d30225e5 merge 2025-09-10 19:11:58 +08:00
DD
2fb5fc231d Merge branches 'main' and 'main' of github.com:danding5/new-api
# Conflicts:
#	common/api_type.go
#	constant/api_type.go
#	constant/channel.go
#	relay/relay_adaptor.go
#	web/src/constants/channel.constants.js
2025-09-10 18:33:42 +08:00
DD
cfbc2df3f8 add submodel.ai 2025-09-08 16:21:21 +08:00
Seefs
80cfa0d0df Merge pull request #1677 from QuantumNous/gemini-2.5-flash-image-preview-billing
feat: gemini-2.5-flash-image-preview 文本和图片输出计费
2025-09-07 14:15:24 +08:00
t0ng7u
ed71c9fcf3 🎨 style(go): format entire codebase
- Apply canonical Go formatting to all .go files
- No functional changes; whitespace/import/struct layout only
- Improves consistency, reduces diff noise, and aligns with standard tooling
2025-08-31 13:08:34 +08:00
creamlike1024
ff4b5b3fd2 feat: improve ratio update 2025-08-30 23:53:46 +08:00
creamlike1024
2875dbba10 feat: 图像倍率,音频倍率和音频补全倍率配置 2025-08-30 23:28:09 +08:00
creamlike1024
a45513a7a6 feat: gemini-2.5-flash-image-preview 文本和图片输出计费 2025-08-27 21:30:52 +08:00
CaIon
a102bed25a fix(model_ratio): update return value logic for gemini-2.5-flash-lite 2025-08-26 23:01:00 +08:00
CaIon
79c7d8f477 fix: improve model ratio handling for reserved models in getHardcodedCompletionModelRatio 2025-08-25 11:59:55 +08:00
CaIon
7e513ad06d fix: update model ratio handling for GPT versions 2025-08-25 11:52:45 +08:00
wzxjohn
28dd5f5f0c feat(ratio): add ratio for OpenAI models 2025-08-15 17:12:39 +08:00
CaIon
c9e9a24e99 refactor: centralize logging and update resource initialization
This commit refactors the logging mechanism across the application by replacing direct logger calls with a centralized logging approach using the `common` package. Key changes include:

- Replaced instances of `logger.SysLog` and `logger.FatalLog` with `common.SysLog` and `common.FatalLog` for consistent logging practices.
- Updated resource initialization error handling to utilize the new logging structure, enhancing maintainability and readability.
- Minor adjustments to improve code clarity and organization throughout various modules.

This change aims to streamline logging and improve the overall architecture of the codebase.
2025-08-14 21:10:04 +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
CaIon
c833e07ee3 feat: add support for gpt-5 models and adjust temperature settings
- Updated the model list to include various gpt-5 variants.
- Enhanced the ConvertOpenAIRequest function to handle gpt-5 model temperature settings based on specific model prefixes.
- Adjusted default cache and model ratios for new gpt-5 models.
2025-08-08 10:43:07 +08:00
Calcium-Ion
a5c2539c38 Merge pull request #1525 from HynoR/chore/gpt5
feat: sync gpt-5 model ratio and support new reasoning effort
2025-08-08 10:24:13 +08:00
HynoR
660b129b75 feat: sync gpt-5 model ratio and support new reasoning effort 2025-08-08 09:11:28 +08:00
RedwindA
87cfcf1190 feat: add default model ratio for gemini-2.5-flash-lite-preview-thinking model 2025-08-07 21:39:11 +08:00
RedwindA
2ef6e340a8 feat: update FormatMatchingModelName to handle gemini-2.5-flash-lite model prefix 2025-08-07 21:37:08 +08:00
Xyfacai
15c11bfe51 refactor: 调整模型匹配 2025-08-06 20:09:22 +08:00
neotf
c9bcdc89f0 feat: add support for claude-opus-4-1 model and update ratios 2025-08-06 00:58:46 +08:00
Xyfacai
76855bc28a fix(price): 未设置价格,错误返回模型价格匹配的名字 2025-07-20 10:12:36 +08:00
Calcium-Ion
aa0edd8dce Merge pull request #1321 from iszcz/main
支持Midjourney视频任务和图片编辑
2025-07-05 15:28:33 +08:00
iszcz
d4f2f4dbbe 支持Midjourney视频任务和图片编辑 2025-06-30 22:31:12 +08:00
CaIon
b7776bec62 🐛 fix: update hardcoded completion model ratio for gemini-2.5-flash-lite 2025-06-27 22:36:23 +08:00
CaIon
51086c3ba6 🔧 fix(model_ratio): adjust return values for gemini-2.5-pro and gemini-2.5-flash models 2025-06-24 18:08:42 +08:00
CaIon
32366d1e1b refactor: streamline price calculation in RelaySwapFace and RelayMidjourneySubmit functions 2025-06-22 17:52:48 +08:00
Calcium-Ion
c60d87067d Merge pull request #1248 from RedwindA/update-gemini-ratio
feat(model-ratio): add default ratios for new Gemini models and refine flash model handling
2025-06-21 04:51:41 +08:00
RedwindA
97e51e442f fix gizmo completion ratio 2025-06-19 20:16:04 +08:00
RedwindA
50907a5758 Merge remote-tracking branch 'upstream/alpha' into update-gemini-ratio 2025-06-19 20:02:27 +08:00
Apple\Apple
8748425aa2 🚀 feat(ratio-sync): major refactor & UX overhaul for Upstream Ratio Sync 2025-06-19 08:57:34 +08:00
Apple\Apple
175ea56fdd 🚚 Refactor(ratio_setting): refactor ratio management into standalone ratio_setting package
Summary
• Migrated all ratio-related sources into `setting/ratio_setting/`
  – `model_ratio.go` (renamed from model-ratio.go)
  – `cache_ratio.go`
  – `group_ratio.go`
• Changed package name to `ratio_setting` and relocated initialization (`ratio_setting.InitRatioSettings()` in main).
• Updated every import & call site:
  – Model / cache / completion / image ratio helpers
  – Group ratio helpers (`GetGroupRatio*`, `ContainsGroupRatio`, `CheckGroupRatio`, etc.)
  – JSON-serialization & update helpers (`*Ratio2JSONString`, `Update*RatioByJSONString`)
• Adjusted controllers, middleware, relay helpers, services and models to reference the new package.
• Removed obsolete `setting` / `operation_setting` imports; added missing `ratio_setting` imports.
• Adopted idiomatic map iteration (`for key := range m`) where value is unused.
• Ran static checks to ensure clean build.

This commit centralises all ratio configuration (model, cache and group) in one cohesive module, simplifying future maintenance and improving code clarity.
2025-06-18 18:00:49 +08:00