Commit Graph

121 Commits

Author SHA1 Message Date
RedwindA
bc65c82745 🎨 feat(channel-test): Enhance request conversion for Embedding models and update input type 2025-07-14 16:59:48 +08:00
CaIon
9fd92977c7 feat(channel): improve channel cache handling and add error checks for disabled channels 2025-07-12 14:20:59 +08:00
CaIon
dc5e4be403 feat(channel): implement thread-safe polling 2025-07-12 11:17:08 +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
CaIon
4a9ca4209a refactor: Introduce standardized API error
This commit refactors the application's error handling mechanism by introducing a new standardized error type, `types.NewAPIError`. It also renames common JSON utility functions for better clarity.

Previously, internal error handling was tightly coupled to the `dto.OpenAIError` format. This change decouples the internal logic from the external API representation.

Key changes:
- A new `types.NewAPIError` struct is introduced to serve as a canonical internal representation for all API errors.
- All relay adapters (OpenAI, Claude, Gemini, etc.) are updated to return `*types.NewAPIError`.
- Controllers now convert the internal `NewAPIError` to the client-facing `OpenAIError` format at the API boundary, ensuring backward compatibility.
- Channel auto-disable/enable logic is updated to use the new standardized error type.
- JSON utility functions are renamed to align with Go's standard library conventions (e.g., `UnmarshalJson` -> `Unmarshal`, `EncodeJson` -> `Marshal`).
2025-07-10 15:02:40 +08:00
CaIon
60bfadb84d 🔧 refactor(channel): add validation for CHANNEL_TEST_FREQUENCY in automatic tests 2025-07-10 11:31:07 +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
Calcium-Ion
5cb4c4e644 Merge pull request #1314 from vickyyd/main
修复使用gemini-balance作为上游时,测试gemini2.5pro模型时出现的错误问题
2025-07-03 15:53:32 +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
kikii16
400a7e6e5b 修复gemini-balance测试gemini2.5pro的错误问题 2025-06-29 13:36:19 +08:00
skynono
221d2b5552 feat: add video channel jimeng 2025-06-27 17:08:20 +08:00
CaIon
32366d1e1b refactor: streamline price calculation in RelaySwapFace and RelayMidjourneySubmit functions 2025-06-22 17:52:48 +08:00
Calcium-Ion
e8da9d7dd7 Merge pull request #1270 from QuantumNous/refactor_model_mapping
feat: implement new handlers for relay processing
2025-06-20 16:12:41 +08:00
CaIon
13277cf838 feat: implement new handlers for audio, image, embedding, and responses processing
- Added new handlers: AudioHelper, ImageHelper, EmbeddingHelper, and ResponsesHelper to manage respective requests.
- Updated ModelMappedHelper to accept request parameters for better model mapping.
- Enhanced error handling and validation across new handlers to ensure robust request processing.
- Introduced support for new relay formats in relay_info and updated relevant functions accordingly.
2025-06-20 16:02:23 +08:00
skynono
5d9cf11466 feat: add unsupported test case for kling channel 2025-06-19 11:53:47 +08:00
CaIon
4ec7012974 feat: enhance group ratio handling in pricing calculations 2025-06-17 21:05:35 +08:00
Calcium-Ion
158d621fd7 Merge pull request #1207 from QuantumNous/user_group_ratio
feat: 分组特殊倍率
2025-06-13 01:25:46 +08:00
creamlike1024
2a0bf7f991 feat: 分组特殊倍率 2025-06-11 23:46:59 +08:00
CaIon
b23416bbb4 🔧 fix(channel-test): ensure proper state reset to prevent deadlocks 2025-06-10 03:54:18 +08:00
Xyfacai
8343fe0740 refactor: message content 改成 any
refactor: message content 改成 any
2025-06-07 23:47:22 +08:00
creamlike1024
b16c05ead4 fix: remove apikey from test channel log, close #1000 2025-04-25 17:08:26 +08:00
CaIon
b364e9e3b1 refactor: simplify model prefix checks and update message role for o-series models 2025-04-17 16:50:52 +08:00
CaIon
c40404a8c1 Update MaxTokens for gemini model to 300 in test request 2025-04-08 17:37:25 +08:00
Calcium-Ion
950572b02e Set MaxTokens to 50 for gemini 2025-04-08 17:33:10 +08:00
zkp
93d9f141fe fix: gemini test MaxTokens 2025-04-06 23:24:47 +08:00
CaIon
f0925dc105 feat: Enhance user settings and notification options 2025-04-03 17:32:48 +08:00
1808837298@qq.com
18b5122a9b fix: Adjust MaxTokens logic for non-Claude models in test request 2025-03-17 23:44:32 +08:00
1808837298@qq.com
47c297794d feat: 初步兼容流模式下openai渠道类型转为claude格式访问 #862 2025-03-13 19:32:08 +08:00
1808837298@qq.com
0db072de86 feat(error): Enhance error handling with optional detailed error messages 2025-03-11 17:25:06 +08:00
1808837298@qq.com
6f9412ead3 feat: Introduce configurable docs link and remove hardcoded chat links
- Added a new GeneralSetting struct to manage configurable docs link
- Removed hardcoded ChatLink and ChatLink2 variables across multiple files
- Updated frontend components to dynamically render docs link from status
- Simplified chat and link-related logic in various components
- Added a warning modal for quota per unit setting in operation settings
2025-03-09 18:31:16 +08:00
1808837298@qq.com
61da6c3664 fix: Refine embedding model detection in channel test 2025-03-09 15:03:07 +08:00
1808837298@qq.com
f8a8dbec6e feat: Add column visibility settings for Channels and Logs tables
- Implemented dynamic column visibility for ChannelsTable and LogsTable
- Added localStorage persistence for column preferences
- Introduced column selector modal with select all/reset functionality
- Supported role-based default column visibility
- Added column settings button to table interfaces
2025-03-08 19:53:07 +08:00
1808837298@qq.com
b640118d74 feat: Implement cache token ratio for more precise token pricing 2025-03-08 01:30:50 +08:00
1808837298@qq.com
208824451a fix: #810 2025-03-05 16:39:42 +08:00
1808837298@qq.com
62542b0b84 fix: #810 2025-03-05 16:34:08 +08:00
1808837298@qq.com
4208ecb92c fix: channel test model mapped 2025-03-02 23:53:10 +08:00
1808837298@qq.com
574e28bad8 fix: Use channel group in model testing log record 2025-03-02 15:59:39 +08:00
1808837298@qq.com
1665fcee3c refactor: Improve channel testing and model price handling 2025-03-02 15:47:12 +08:00
1808837298@qq.com
485face2c0 feat: Add self-use mode for model ratio and price configuration
- Introduce `SelfUseModeEnabled` setting to allow flexible model ratio configuration
- Update error handling to provide more informative messages when model ratios are not set
- Modify pricing and relay logic to support self-use mode
- Add UI toggle for enabling self-use mode in operation settings
- Implement fallback mechanism for model ratios when self-use mode is enabled
2025-03-01 21:13:48 +08:00
1808837298@qq.com
3f7d9c4b0f fix: Improve error handling for model ratio and price validation #800 2025-03-01 15:27:32 +08:00
1808837298@qq.com
3447df85c4 feat: add new GPT-4.5 preview model ratios 2025-02-28 19:17:15 +08:00
1808837298@qq.com
bf9f5e59b5 chore: Update Azure OpenAI API version and embedding model detection
- Enhance channel test to detect more embedding models
- Update Azure OpenAI default API version to 2024-12-01-preview
- Remove redundant default API version setting in channel edit
- Add user cache writing in channel test
2025-02-27 16:49:32 +08:00
1808837298@qq.com
83e161a1d4 refactor: Simplify root user notification and remove global email variable
- Remove global `RootUserEmail` variable
- Modify channel testing and user notification methods to use `GetRootUser()`
- Update user cache and notification service to use more consistent user base type
- Add new channel test notification type
2025-02-18 15:59:17 +08:00
1808837298@qq.com
025b6d1226 feat: Add automatic channel disabling based on configurable keywords
- Introduce AutomaticDisableKeywords setting to dynamically control channel disabling
- Implement AC search for matching error messages against disable keywords
- Add frontend UI for configuring automatic disable keywords
- Update localization with new keyword-based channel disabling feature
- Refactor sensitive word and AC search logic to support multiple keyword lists
2025-02-13 16:39:17 +08:00
Calcium-Ion
b21ba28167 Merge pull request #723 from kuwork/main
Support for MokaAI M3E
2025-02-11 22:16:18 +07:00
1808837298@qq.com
86d93c4694 fix: adjust max tokens configuration in test request builder
- Update max tokens default value to 10
2025-02-11 20:00:05 +08:00
zjjxwhh
5bebd3760a fix: always use modelMapping in channel test 2025-02-10 22:39:56 +08:00
kuwork
fdebb6e6e8 Merge branch 'main' into main 2025-02-04 22:52:37 +08:00
1808837298@qq.com
c81e23b0e4 f*** o3-mini 2025-02-01 14:11:34 +08:00