Commit Graph

90 Commits

Author SHA1 Message Date
Seefs
bb7ad0ce15 feat: gate Claude inference_geo passthrough behind channel setting and add field docs 2026-02-21 14:25:58 +08:00
Seefs
4746b2bf9f feat: add missing OpenAI/Claude/Gemini request fields and responses stream options 2026-02-19 14:16:07 +08:00
CaIon
9ef9e78821 feat(file): unify file handling with a new FileSource abstraction for URL and base64 data 2026-02-04 18:23:17 +08:00
Seefs
b587796929 feat: /v1/responses perplexity 2026-02-02 14:48:45 +08:00
Seefs
5b3c8e8413 feat: /v1/responses qwen3 max 2026-02-02 14:41:27 +08:00
Seefs
71460cba15 feat: /v1/chat/completion -> /v1/response (#2629)
* feat: /v1/chat/completion -> /v1/response
2026-01-11 21:38:07 +08:00
CaIon
b5a0c822d2 feat(adaptor): 新适配百炼多种图片生成模型
- wan2.6系列生图与编辑,适配多图生成计费
- wan2.5系列生图与编辑
- z-image-turbo生图,适配prompt_extend计费
2025-12-29 23:00:17 +08:00
Seefs
41b1499d41 fix: qwen chat_template_kwargs 2025-12-03 00:47:40 +08:00
Seefs
cf27747518 Merge pull request #2224 from jarvis-u/main
fix: 错误解析responses api中的input字段
2025-11-22 00:31:24 +08:00
Seefs
9009a572fe feat: support gpt-5.1 prompt_cache_retention (#2228) 2025-11-15 13:32:24 +08:00
wujiacheng
733e3870e2 fix: 错误解析responses api中的input字段 2025-11-14 09:58:39 +08:00
Seefs
de2501241f add custom tool (#2157) 2025-11-06 20:18:25 +08:00
Seefs
5010f2d004 format: package name -> github.com/QuantumNous/new-api (#2017) 2025-10-11 15:30:09 +08:00
Seefs
1d32327d04 feat: pplx channel 2025-10-10 16:12:15 +08:00
Seefs
d075fbee23 fix: missing field & field control 2025-10-02 00:14:35 +08:00
CaIon
eeac99731b feat: change ParallelToolCalls and Store fields to json.RawMessage type 2025-09-20 13:28:33 +08:00
CaIon
c0574a0e53 feat: add PromptCacheKey field to openai_request struct 2025-09-20 13:27:32 +08:00
CaIon
f7c4eda0f3 Revert "refactor: replace DeepCopy with Copy for request handling consistency"
This reverts commit c21219fcff.
2025-08-28 15:11:55 +08:00
CaIon
c21219fcff refactor: replace DeepCopy with Copy for request handling consistency 2025-08-28 14:57:47 +08:00
CaIon
67719dc087 fix: update web search handling and request structure in adaptor and openai_request 2025-08-26 18:15:18 +08:00
CaIon
3e5bc637de 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
781a708173 feat: support qwen-image-edit 2025-08-25 14:33:12 +08:00
CaIon
1ee3d1cc50 feat: 修复重试后请求结构混乱,修复rerank端点无法使用 2025-08-23 13:12:15 +08:00
CaIon
f6ee0b9791 feat: add checks for non-empty URLs in file metadata processing 2025-08-15 19:10:40 +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
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
nekohy
5478d2fb59 fix: zhipu_v4 thinking 2025-08-11 21:37:10 +08:00
CaIon
4bbdc8e2b2 feat: add verbosity field to OpenAI request #1540 2025-08-09 20:12:27 +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
a4b02107dd feat: update MaxTokens handling 2025-08-07 16:15:59 +08:00
CaIon
2cb7b9ae62 fix: improve error messaging and JSON schema handling in distributor and relay components 2025-07-26 12:11:20 +08:00
CaIon
f610773455 feat: enhance request handling with pass-through options and system prompt support 2025-07-26 11:39:09 +08:00
CaIon
c5ec332ab3 fix: add Think field to OllamaRequest and support extra parameters in GeneralOpenAIRequest. (close #1125
)
2025-07-22 12:06:21 +08:00
Xyfacai
dfc826a388 fix(response): tools 需要处理的参数很少 使用 map 2025-07-20 11:21:57 +08:00
t0ng7u
a66430c82c Merge remote-tracking branch 'origin/multi_keys_channel' into alpha
# Conflicts:
#	web/src/components/table/LogsTable.js
#	web/src/i18n/locales/en.json
#	web/src/pages/Channel/EditChannel.js
2025-07-12 23:47:24 +08:00
RedwindA
98696526d4 feat: 支持 xAI 网络搜索 2025-07-12 02:22:40 +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
e2c34bdeb9 🐛 fix: refactor JSON unmarshalling across multiple handlers to use UnmarshalJson and UnmarshalJsonStr for consistency
This update replaces instances of DecodeJson and DecodeJsonStr with UnmarshalJson and UnmarshalJsonStr in various relay handlers, enhancing code consistency and clarity in JSON processing. The changes improve maintainability and align with recent refactoring efforts in the codebase.
2025-06-28 00:02:07 +08:00
CaIon
e234ad0740 feat: add Function and Container fields to ResponsesToolsCall struct #1305 2025-06-27 16:56:54 +08:00
Calcium-Ion
877529ef6b Merge pull request #1120 from neotf/feat-04
feat: enhance token usage details for upstream OpenRouter
2025-06-22 01:10:49 +08:00
KamiPasi
3247d7a341 透传thinking参数, 豆包模型用来控制是否思考 2025-06-19 12:06:42 +08:00
neotf
c787f59822 Merge branch 'main' into feat-04 2025-06-18 15:20:24 +08:00
CaIon
d26ae9aa77 feat(dto): add VlHighResolutionImages parameter to GeneralOpenAIRequest 2025-06-13 17:29:26 +08:00
neotf
342af15f73 format 2025-06-11 14:00:32 +08:00
neotf
0a3414bf26 format 2025-06-11 13:56:44 +08:00
neotf
1cff048cb7 Merge branch 'main' into feat-04 2025-06-11 13:55:47 +08:00
Calcium-Ion
a8b24bed00 Merge pull request #1184 from QuantumNous/refactor/message
fix: message 转 any 后,ImageUrl判断 panic
2025-06-09 15:51:53 +08:00
Xyfacai
be38aaa80d fix: message 转 any 后,ImageUrl判断 panic 2025-06-09 11:27:24 +08:00
CaIon
2fb222b9a4 refactor(dto): change function and encoding fields to use json.RawMessage for improved flexibility 2025-06-08 16:28:47 +08:00