Commit Graph

23 Commits

Author SHA1 Message Date
CaIon
a4b02107dd feat: update MaxTokens handling 2025-08-07 16:15:59 +08:00
creamlike1024
689dbfe71a feat: convert gemini format to openai chat completions 2025-08-01 22:23:35 +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
creamlike1024
8ea4c76f2b feat: support /v1/responses API 2025-05-02 13:59:46 +08:00
CalciumIon
5021000c5d refactor: Simplify OpenAI handler function signature and remove unused TextResponseWithError struct; introduce common_handler for rerank functionality 2025-03-14 17:31:05 +08:00
1808837298@qq.com
47c297794d feat: 初步兼容流模式下openai渠道类型转为claude格式访问 #862 2025-03-13 19:32:08 +08:00
1808837298@qq.com
78fc3a191c feat: claude relay 2025-03-12 21:31:46 +08:00
Jerry
fcc32ffbc9 Fix M3E not working 2025-01-23 05:54:39 +08:00
1808837298@qq.com
9e4133a890 feat: realtime
(cherry picked from commit a5529df3e1a4c08a120e8c05203a7d885b0fe8d8)
2024-11-05 19:24:14 +08:00
CalciumIon
d06018cd3f chore: gopool 2024-07-19 01:07:37 +08:00
CalciumIon
ee0e1c9736 refactor: audio relay 2024-07-16 22:07:10 +08:00
CalciumIon
22ed887350 chore: openai stream 2024-07-15 22:07:50 +08:00
CalciumIon
7b20b4ed3d fix: azure stream options 2024-07-15 16:05:30 +08:00
CalciumIon
22bc0bf773 feat: support stream_options 2024-07-08 01:27:57 +08:00
CalciumIon
c7ba4a245b feat: support cohere rerank 2024-07-06 17:09:22 +08:00
CalciumIon
6e92f1f2d1 feat: 记录流模式首字时间 (close #323) 2024-06-26 18:04:49 +08:00
Jiayun Shen
3f6aeaa0e3 Update Perplexity and 01 models
更新Perplexity和01万物模型,增加相关模型价格。对于模型价格,从one-api引入了 价格 * 系数 的方式,目前仅对新模型使用了新方式,待进一步测试。
2024-05-17 19:37:18 +08:00
CaIon
86ab64ec67 feat: 完善函数计费 2024-04-23 23:01:06 +08:00
CaIon
54c18dc89e fix: remove sensitive check on completion (close #157) 2024-03-29 22:20:14 +08:00
CaIon
1004e3a1d5 fix: fix embedding 2024-03-21 17:39:05 +08:00
CaIon
580f2894ac feat: 初步兼容生成内容检查 2024-03-20 19:00:51 +08:00
CaIon
14892a6582 feat: 初步兼容敏感词过滤 2024-03-20 17:07:42 +08:00
CaIon
865816c8e1 feat: support perplexity 2024-03-18 18:00:19 +08:00