CaIon
621d2b0b6a
refactor: replace json.Marshal with common.Marshal for consistency and error handling
2025-08-28 13:51:07 +08:00
creamlike1024
edc6679140
Merge branch 'alpha' of github.com:iszcz/new-api into iszcz-alpha
2025-08-27 22:26:15 +08:00
CaIon
7ddf3a112c
fix(relay-gemini): update media handling in candidate content processing
2025-08-27 12:14:50 +08:00
CaIon
6a6edaa7cf
Merge remote-tracking branch 'origin/alpha' into alpha
2025-08-26 20:38:32 +08:00
Calcium-Ion
3e01dc81ec
Merge pull request #1652 from HynoR/feat/ds3.1
...
feat: adapt Volcengine adaptor for deepseek3.1 with thinking mode
2025-08-26 20:35:29 +08:00
CaIon
e087c9fe9e
fix: update web search handling and request structure in adaptor and openai_request
2025-08-26 18:15:18 +08:00
CaIon
eef73e3699
fix: update PromptTokens assignment logic in relay_responses
2025-08-26 14:21:10 +08:00
CaIon
e23f01f8d5
fix: Invalid type for 'input[x].summary': expected an array of objects, but got null instead
2025-08-26 13:17:31 +08:00
CaIon
a3c2b28d6a
fix: ensure reasoning is not nil before setting effort in OpenAI responses
2025-08-25 22:46:45 +08:00
iszcz
289ed24899
task_relay_info
2025-08-25 18:01:10 +08:00
CaIon
d374a22b70
feat: support qwen-image-edit
2025-08-25 14:33:12 +08:00
HynoR
ee6dd9179b
feat: adapt Volcengine adaptor for deepseek3.1 model with thinking suffix
2025-08-25 11:16:43 +08:00
CaIon
de23ccd234
feat: update ali image response handling
2025-08-24 22:50:45 +08:00
CaIon
7fbf9c4851
feat: enhance image request handling and add async support
2025-08-24 21:52:56 +08:00
Nekohy
abcb353793
feats:add custom headers override
2025-08-24 01:02:23 +08:00
Calcium-Ion
e3a38d27f5
Merge pull request #1611 from nekohy/feats-zhipu_4v-anthropic
...
Feats:Standardize ClaudeHandler, add Zhipu_4v Anthropic native channel support
2025-08-23 13:48:18 +08:00
CaIon
e581422810
fix: update response body handling in OpenAI relay format
2025-08-22 17:33:20 +08:00
Calcium-Ion
ad151bb919
Merge pull request #1606 from funnycups/patch-1
...
fix: prompt calculation
2025-08-22 17:30:53 +08:00
creamlike1024
e02e1e8d4a
fix: Guard against negative or zero n from ExtraBody to prevent uint underflow
2025-08-18 23:35:01 +08:00
Sh1n3zZ
974b93a8be
feat: imagen for vertex channel
2025-08-18 21:49:55 +08:00
Nekohy
652d71d799
feats:Standardize ClaudeHandler, add zhipu_4v Anthropic native support
2025-08-18 13:14:48 +08:00
CaIon
0a053ee633
feat: 完善gemini格式转换
2025-08-17 19:08:06 +08:00
CaIon
c18414cbe4
refactor: extract FlushWriter function for improved stream flushing
2025-08-17 15:30:31 +08:00
funnycups
e3473e3c39
fix: prompt calculation
...
User will correctly get estimated prompt usage when upstream returns either zero or nothing.
2025-08-16 22:54:00 +08:00
CaIon
c834694992
fix: update token usage calculation
2025-08-16 19:11:15 +08:00
Calcium-Ion
5829bc69ca
Merge pull request #1597 from wzxjohn/feature/add_openai_models
...
feat(relay): add OpenAI gpt-4.1 o3 o4 gpt-image-1 models
2025-08-16 12:27:20 +08:00
CaIon
0bb43aa464
refactor: update function signatures to include context and improve file handling #1599
2025-08-15 18:40:54 +08:00
wzxjohn
68b7badb80
feat(relay): add OpenAI gpt-4.1 o3 o4 gpt-image-1 models
2025-08-15 17:10:16 +08:00
CaIon
eeb421513b
Merge remote-tracking branch 'origin/alpha' into alpha
2025-08-15 16:47:36 +08:00
Calcium-Ion
ef1e380bbc
Merge pull request #1577 from nekohy/feats-better-adaptor-for-openrouter
...
Fix reasoning adaptor for openrouter
2025-08-15 16:19:24 +08:00
CaIon
d646a922ee
refactor: set prompt tokens when not provided in usage
2025-08-15 15:55:01 +08:00
CaIon
726f1632b0
refactor: ensure graceful closure of response body in relay responses
2025-08-15 15:10:54 +08:00
CaIon
5fe1ce89ec
refactor: improve request type validation and enhance sensitive information masking
2025-08-15 13:20:36 +08:00
CaIon
6748b006b7
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
e2037ad756
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
Nekohy
c1a545ac23
feats:the Openrouter Claude thinking
2025-08-12 22:39:32 +08:00
Nekohy
33925dd313
fix:Delete the excess ReasoningEffort from the Openrouter OpenAI thinking model.
2025-08-12 21:37:12 +08:00
CaIon
e77effaf8b
fix(adaptor): optimize multipart form handling and resource management
2025-08-12 19:57:56 +08:00
Calcium-Ion
38c3349a6a
Merge pull request #1569 from duyazhe/codex/cloudflare-responses
...
feat: add responses support for cloudflare
2025-08-12 14:13:14 +08:00
nekohy
14a9a99e2d
fix: zhipu_v4 thinking
2025-08-11 21:37:10 +08:00
CaIon
e74c6f5de7
✨ feat: Simplify response handling by returning raw response body directly
2025-08-11 20:07:24 +08:00
CaIon
d3170310ff
✨ feat: Refactor Gemini tools handling to support JSON raw message format
2025-08-11 19:48:04 +08:00
CaIon
53fa7255ec
✨ feat: Refactor model handling to use UpstreamModelName for request processing
2025-08-11 17:32:58 +08:00
CaIon
dddf772f19
✨ feat: Update request URL handling for Claude relay format in adaptor #1557
2025-08-11 17:17:56 +08:00
CaIon
c7498b768c
✨ feat: Update Azure responses API version handling in adaptor
2025-08-11 16:34:07 +08:00
duyazhe
c87a741fc9
feat: add responses support for cloudflare
2025-08-11 15:29:16 +08:00
CaIon
7f462a084c
✨ feat: Add ChannelOtherSettings to manage additional channel configurations
2025-08-10 20:21:30 +08:00
Calcium-Ion
02fd80b703
Merge pull request #1537 from RedwindA/feat/support-native-gemini-embedding
...
feat: 支持原生Gemini Embedding格式
2025-08-10 10:26:46 +08:00
CaIon
ea8cac7c10
feat: add AWS invoke error handling and new error code
2025-08-09 19:26:41 +08:00
RedwindA
f242220132
feat: update dto for embeddings
2025-08-09 18:31:56 +08:00