Commit Graph

109 Commits

Author SHA1 Message Date
Sh1n3zZ
af671d34c3 feat: replicate channel flux model 2025-11-08 01:24:45 +08:00
feitianbubu
a2d34b9e47 feat: add minimax api adaptor 2025-10-20 16:26:50 +08:00
CaIon
8ff87ae6c2 feat: add temporary TASK_PRICE_PATCH configuration to environment variables 2025-10-16 21:59:21 +08:00
CaIon
5e1d7ab3b9 feat: add support for Sora channel type and OpenAI video endpoint 2025-10-13 19:21:45 +08:00
feitianbubu
1d1759aaae feat: add sora video submit task 2025-10-09 15:00:02 +08:00
Calcium-Ion
2958114205 Merge pull request #1957 from seefs001/pr/custom-currency-1923
💱 feat(settings): introduce site-wide quota display type
2025-10-03 21:17:16 +08:00
feitianbubu
0e6ccea09b refactor: simplify unsupported test channel types 2025-10-03 12:41:39 +08:00
Seefs
b65e271971 Merge branch 'main-upstream' into pr/custom-currency-1923
# Conflicts:
#	web/src/components/settings/personal/cards/AccountManagement.jsx
#	web/src/components/table/channels/modals/EditChannelModal.jsx
#	web/src/hooks/channels/useChannelsData.jsx
#	web/src/hooks/common/useSidebar.js
#	web/src/i18n/locales/fr.json
#	web/src/pages/Setting/Operation/SettingsGeneral.jsx
2025-10-02 20:30:48 +08:00
feitianbubu
c25ca9a791 feat: add doubao video generate 2025-10-02 04:00:43 +08:00
CaIon
63bbd9e3c3 feat: add endpoint type selection to channel testing functionality 2025-09-30 16:52:14 +08:00
dd
509b23982d Update constant/api_type.go
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-09-29 19:37:04 +08:00
dd
40a6d957b5 Merge branch 'QuantumNous:main' into main 2025-09-29 14:13:50 +08:00
feitianbubu
b183f2f663 feat: vidu video add starEnd and reference gen video 2025-09-19 18:54:45 +08:00
DD
116d070bbf merge 2025-09-10 18:37:55 +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
Nekohy
2d1512096a feats:add custom headers override 2025-08-24 01:02:23 +08:00
CaIon
77b100ba2b refactor: update function signatures to include context and improve file handling #1599 2025-08-15 18:40:54 +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
8907e5cf6d feat: Add ChannelOtherSettings to manage additional channel configurations 2025-08-10 20:21:30 +08:00
CaIon
05af05e449 feat: add system prompt override functionality in channel settings and request handling #1468 2025-08-09 12:53:06 +08:00
CaIon
9682c46cc4 feat: implement moonshot adaptor for request handling and response processing 2025-08-08 17:28:21 +08:00
Xyfacai
15c11bfe51 refactor: 调整模型匹配 2025-08-06 20:09:22 +08:00
Seefs
3b34afa8c9 Revert "feat: add Claude Code channel support with OAuth integration" 2025-07-31 22:08:16 +08:00
Seefs
1389cc7acd feat: add claude code channel 2025-07-26 18:06:46 +08:00
feitianbubu
4378e0f96d feat: add vidu video channel 2025-07-24 10:14:25 +08:00
feitianbubu
b3c4d97286 chore: opt video channel and platform 2025-07-22 20:14:24 +08:00
feitianbubu
43980b3ad1 feat: add jimeng image 2025-07-13 13:36:33 +08:00
CaIon
9881bfc3c9 feat(logs): add multi-key support in LogsTable and enhance log info generation 2025-07-12 15:14:55 +08:00
CaIon
8e11b67ece feat(channel): enhance channel status management 2025-07-10 17:49:53 +08:00
CaIon
1437ceaa56 Merge branch 'alpha' into refactor_error
# Conflicts:
#	controller/channel.go
#	middleware/distributor.go
#	model/channel.go
#	model/user.go
#	model/user_cache.go
#	relay/common/relay_info.go
2025-07-10 15:11:55 +08:00
Xiangyuan-liu
db98c0f4b1 refactor: log params and channel params
refactor: log params and channel params
2025-07-07 14:26:37 +08:00
CaIon
cf11a22c3a 🔧 refactor(auth, channel, context): improve context setup and validation for multi-key channels 2025-07-06 12:37:56 +08:00
Calcium-Ion
aa0edd8dce Merge pull request #1321 from iszcz/main
支持Midjourney视频任务和图片编辑
2025-07-05 15:28:33 +08:00
CaIon
95775a5a52 feat(endpoint types): add support for image generation models in endpoint type handling 2025-07-05 14:14:40 +08:00
CaIon
14cca53ec8 🔧 refactor(endpoint types): comment out unused endpoint types in constants 2025-07-04 15:53:46 +08:00
t0ng7u
dd9a1534e0 🔌 feat(api): extend endpoint type support & expose in pricing UI
* backend
  - constant/endpoint_type.go
    • Add EndpointTypeMidjourney, EndpointTypeSuno, EndpointTypeKling, EndpointTypeJimeng.
  - common/endpoint_type.go
    • Map Midjourney / MidjourneyPlus, SunoAPI, Kling, Jimeng channel types to the new endpoint types.

* frontend
  - ModelPricing.js
    • Add “Supported Endpoint Type” column.
    • Implement renderSupportedEndpoints with `stringToColor` for consistent tag colors.

These changes allow `/api/pricing` and model lists to return accurate
`supported_endpoint_types` covering all non-OpenAI providers and display
them clearly in the UI.

No breaking changes.
2025-07-04 03:15:34 +08:00
CaIon
f14f4eaf1a feat: refactor environment variable initialization and introduce new constant types for API and context keys 2025-07-03 13:10:25 +08:00
iszcz
d4f2f4dbbe 支持Midjourney视频任务和图片编辑 2025-06-30 22:31:12 +08:00
skynono
111dc18d26 feat: video action to constant 2025-06-27 23:19:34 +08:00
skynono
221d2b5552 feat: add video channel jimeng 2025-06-27 17:08:20 +08:00
CaIon
8a1e437ce9 🔧 chore: update STREAMING_TIMEOUT default value to 120 seconds in configuration 2025-06-22 18:47:40 +08:00
CaIon
32366d1e1b refactor: streamline price calculation in RelaySwapFace and RelayMidjourneySubmit functions 2025-06-22 17:52:48 +08:00
skynono
d7ed0214ad feat: add video channel kling 2025-06-19 11:53:42 +08:00
RedwindA
09ffc364f2 🔧 refactor(redis): replace direct constant usage with RedisKeyCacheSeconds function for cache duration 2025-06-17 03:24:39 +08:00
Apple\Apple
28c3aef76f 🔒 feat: Add user-configurable IP logging for consume and error logs
- Add IP field to Log model with database index and default empty value
- Implement conditional IP recording based on user setting in RecordConsumeLog and RecordErrorLog
- Add UserSettingRecordIpLog constant and update user settings API to handle record_ip_log field
- Create dedicated "IP记录" tab in personal settings under "其他设置" section
- Add IP column to logs table with help tooltip explaining recording conditions
- Make IP column visible to all users (not admin-only) with proper filtering for consume/error log types
- Restrict display of use_time and retry columns to consume and error log types only
- Update personal settings UI structure: rename "通知设置" to "其他设置" to accommodate new functionality
- Add proper translation support and maintain consistent styling across components

The IP logging feature is disabled by default and only records client IP addresses
for consume (type 2) and error (type 5) logs when explicitly enabled by users
in their personal settings.
2025-06-13 01:34:01 +08:00
creamlike1024
b843c356c1 feat: change azure default api version to 2025-04-01-preview 2025-05-09 18:11:37 +08:00
CaIon
66cda24386 feat: add AzureNoRemoveDotTime constant and update channel handling #1044
- Introduced a new constant `AzureNoRemoveDotTime` in `constant/azure.go` to manage model name formatting for channels created after May 10, 2025.
- Updated `distributor.go` to set `channel_create_time` in the context.
- Modified `adaptor.go` to conditionally remove dots from model names based on the channel creation time.
- Enhanced `relay_info.go` to include `ChannelCreateTime` in the `RelayInfo` struct.
- Updated English localization files to reflect changes in model name handling for new channels.
2025-05-08 23:19:40 +08:00
CaIon
f5c2fda22a feat: enable error logging configuration in docker-compose and application 2025-04-29 16:26:55 +08:00
wkxu
54c5c3118b refactor: 把common/instants.go里的从Getenv获取的参数,放到init.go的LoadEnv函数里获取
把constant/env.go里的从Getenv获取的参数,放到env.go的InitEnv函数里获取。以避免.env文件配置参数不起作用的情况
2025-04-10 09:02:19 +08:00