Commit Graph

255 Commits

Author SHA1 Message Date
Seefs
2cf3c1836c fix: preserve explicit zero values in native relay requests 2026-03-01 15:47:03 +08:00
Seefs
3d0c75f42c Merge branch 'feature/messages2responses' into upstream-main
# Conflicts:
#	service/openaicompat/chat_to_responses.go
2026-02-08 00:16:35 +08:00
Seefs
8f52072f53 feat: /v1/messages -> /v1/responses 2026-02-06 15:22:32 +08:00
Seefs
d5f0ab01df fix: add paragraph breaks between reasoning summary chunks in chat2responses stream 2026-02-06 14:46:29 +08:00
Seefs
a0574ae516 fix reasoning_effort log 2026-02-05 00:31:52 +08:00
Seefs
25f88050d3 fix: map Responses reasoning stream to chat completion deltas
fix: default summary = detailed

fix ReasoningContent

fix ReasoningContent

fix ReasoningContent

fix ReasoningContent

Revert "fix ReasoningContent"

This reverts commit 45a88f78b91ce2376bca68745d19374bb9e95e88.

fix ReasoningContent

fix ReasoningContent
2026-02-05 00:12:16 +08:00
Seefs
cf114ca7d6 feat: openai response /v1/response/compact (#2644)
* feat: openai response /v1/response/compact

* feat: /v1/response/compact bill

* feat: /v1/response/compact

* feat: /v1/responses/compact -> codex channel

* feat: /v1/responses/compact -> codex channel

* feat: /v1/responses/compact -> codex channel

* feat: codex channel default models

* feat: compact model price

* feat: /v1/responses/comapct test
2026-01-26 20:20:16 +08:00
Calcium-Ion
57c65c2782 Merge pull request #2742 from seefs001/fix/pr-2540
feat(gemini): 支持 tool_choice 参数转换,优化多个渠道错误处理
2026-01-26 15:12:09 +08:00
Seefs
7eaa80583b Revert "feat: xai refusal reason"
This reverts commit 2548eaf8d3.
2026-01-25 16:38:58 +08:00
Seefs
2548eaf8d3 feat: xai refusal reason 2026-01-25 16:07:37 +08:00
Seefs
68e1e635e9 feat: logs show reject reason 2026-01-25 14:52:18 +08:00
Li-Xingyu
36b0f4b0ae feat: enhance Authorization header handling with Header Override support 2026-01-25 14:36:37 +08:00
Li-Xingyu
0dfa607147 feat: enhance Authorization header handling with Header Override support 2026-01-25 04:28:11 +08:00
Seefs
2a15e3b152 feat: codex channel (#2652)
* feat: codex channel

* feat: codex channel

* feat: codex oauth flow

* feat: codex refresh cred

* feat: codex usage

* fix: codex err message detail

* fix: codex setting ui

* feat: codex refresh cred task

* fix: import err

* fix: codex store must be false

* fix: chat -> responses tool call

* fix: chat -> responses tool call
2026-01-14 22:29:43 +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
John Chen
6a2da31946 fix: 修复智普、Moonshot渠道在stream=true时无法拿到cachePrompt的统计数据。
根本原因:
1. 在OaiStreamHandler流式处理函数中,调用applyUsagePostProcessing(info, usage, nil)时传入的responseBody为nil,导致无法从响应体中提取缓存tokens。
2. 两个渠道的cached_tokens位置不同:
  - 智普:标准位置 usage.prompt_tokens_details.cached_tokens
  - Moonshot:非标准位置 choices[].usage.cached_tokens

处理方案:
1. 传递body信息到applyUsagePostProcessing中
2. 拆分智普和Moonshot的解析,并为Moonshot单独写一个解析方法。
2025-12-30 17:38:32 +08:00
Seefs
6526976453 fix: glm 4.7 finish reason (#2545) 2025-12-29 19:41:15 +08:00
John Chen
6dbe89f1cf 为Moonshot添加缓存tokens读取逻辑
为Moonshot添加缓存tokens读取逻辑。其与智普V4的逻辑相同,所以共用逻辑
2025-12-22 17:05:16 +08:00
CaIon
3822f4577c fix(audio): correct TotalTokens calculation for accurate usage reporting 2025-12-13 17:49:57 +08:00
CaIon
be2a863b9b feat(audio): enhance audio request handling with token type detection and streaming support 2025-12-13 17:24:23 +08:00
Calcium-Ion
2a01d1c996 Merge pull request #2429 from QuantumNous/feat/xhigh
feat(adaptor): add '-xhigh' suffix to reasoning effort options
2025-12-12 22:06:19 +08:00
CaIon
27dd42718b feat(adaptor): add '-xhigh' suffix to reasoning effort options for model parsing 2025-12-12 20:53:48 +08:00
Calcium-Ion
3c5edc54b7 Merge pull request #2426 from QuantumNous/feat/auto-cross-group-retry
feat(token): add cross-group retry option for token processing
2025-12-12 20:45:54 +08:00
CaIon
c87deaa7d9 feat(token): add cross-group retry option for token processing 2025-12-12 17:59:21 +08:00
Seefs
cf243588fa Merge pull request #2229 from HynoR/chore/v1
fix: Set default to unsupported value for gpt-5 model series requests
2025-12-08 20:59:30 +08:00
CaIon
1fededceb3 feat: refactor token estimation logic
- Introduced new OpenAI text models in `common/model.go`.
- Added `IsOpenAITextModel` function to check for OpenAI text models.
- Refactored token estimation methods across various channels to use estimated prompt tokens instead of direct prompt token counts.
- Updated related functions and structures to accommodate the new token estimation approach, enhancing overall token management.
2025-12-02 21:34:39 +08:00
CaIon
c8bbf7bed8 feat: Add ContextKeyLocalCountTokens and update ResponseText2Usage to use context in multiple channels 2025-11-21 18:17:01 +08:00
HynoR
601d257b80 fix: Set default to unsupported value for gpt-5 model series requests 2025-11-15 13:28:38 +08:00
CaIon
7827828abf fix(adaptor): Add '-none' suffix to effortSuffixes for model parsing 2025-11-14 14:04:34 +08:00
Seefs
fd55ba7f2c feat: ShouldPreserveThinkingSuffix (#2189) 2025-11-07 17:43:33 +08:00
IcedTangerine
961af95ec4 fix: openai 音频模型流模式未正确计费 (#2160) 2025-11-04 01:43:04 +08:00
CaIon
5d12755798 refactor(relay): enhance error logging and improve multipart form handling in audio requests #2127 2025-10-29 23:33:55 +08:00
CaIon
a00c6393c5 feat: implement audio duration retrieval without ffmpeg dependencies 2025-10-28 15:50:45 +08:00
feitianbubu
f617ff8741 feat: openai tts support streaming realtime audio 2025-10-22 13:33:01 +08:00
feitianbubu
a2d34b9e47 feat: add minimax api adaptor 2025-10-20 16:26:50 +08:00
Seefs
5010f2d004 format: package name -> github.com/QuantumNous/new-api (#2017) 2025-10-11 15:30:09 +08:00
RedwindA
efdb1c5b46 fix(openai): account cached tokens for
zhipu_v4 usage
2025-10-08 16:52:49 +08:00
RedwindA
78f34bd095 fix(openai): add nil checks for web_search streaming to prevent panic 2025-10-01 22:19:22 +08:00
CaIon
6f8edd49c4 fix: streamline error handling in OpenRouter response processing 2025-09-28 15:29:01 +08:00
CaIon
6682842cbb feat: enhance OpenRouter enterprise support with new settings and response handling 2025-09-28 15:23:27 +08:00
creamlike1024
f6984272bf fix: openai responses api 未统计图像生成调用计费 2025-09-16 12:47:59 +08:00
HynoR
23a82b9646 fix: enhance tool usage parsing with additional nil checks and error logging 2025-09-07 07:42:25 +08:00
HynoR
ab5351c270 fix: add error handling for missing built-in tools and validate response in stream handler 2025-09-05 13:58:24 +08:00
feitianbubu
69e76dae34 feat: use audio token usage if return 2025-09-02 10:58:10 +08:00
CaIon
906f797be5 refactor: replace json.Marshal with common.Marshal for consistency and error handling 2025-08-28 13:51:07 +08:00
CaIon
b0f86bd82e fix: update PromptTokens assignment logic in relay_responses 2025-08-26 14:21:10 +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
f249cf9acc fix: ensure reasoning is not nil before setting effort in OpenAI responses 2025-08-25 22:46:45 +08:00
CaIon
858585d974 fix: update response body handling in OpenAI relay format 2025-08-22 17:33:20 +08:00
Calcium-Ion
d09b99c1f0 Merge pull request #1606 from funnycups/patch-1
fix: prompt calculation
2025-08-22 17:30:53 +08:00