CaIon
5b5b97eb30
feat: 完善格式抓换,修复gemini渠道和openai渠道在claude code中使用的问题
2025-08-08 16:45:37 +08:00
CaIon
a4b02107dd
feat: update MaxTokens handling
2025-08-07 16:15:59 +08:00
CaIon
2e41362f2e
fix: update budget calculation logic in relay-gemini to use clamping function
Publish Docker image (Multi Registries) / Push Docker image to multiple registries (push) Has been cancelled
Linux Release / release (push) Has been cancelled
macOS Release / release (push) Has been cancelled
Windows Release / release (push) Has been cancelled
2025-08-06 16:25:48 +08:00
CaIon
6960a06322
feat: enhance ThinkingAdaptor with effort-based budget clamping and extra body handling
2025-08-06 16:20:38 +08:00
Xyfacai
bb08de0b11
fix: 修复gemini2openai 没有返回 usage
2025-08-04 09:06:57 +08:00
creamlike1024
502c5dde9c
Merge remote-tracking branch 'origin/alpha' into ConvertGeminiRequest
2025-08-01 22:42:48 +08:00
creamlike1024
689dbfe71a
feat: convert gemini format to openai chat completions
2025-08-01 22:23:35 +08:00
CaIon
2578c39c7d
refactor: simplify streamResponseGeminiChat2OpenAI by removing hasImage return value and optimizing response text handling
2025-08-01 17:58:21 +08:00
CaIon
de23f66785
fix: handle case where no response is received from Gemini API
2025-08-01 17:04:16 +08:00
CaIon
2db71673a5
fix: auto ban
2025-07-30 18:39:19 +08:00
CaIon
360012bed2
feat: support claude convert to gemini
2025-07-26 13:31:33 +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
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
ae586e1be9
✨ feat: add CloseResponseBodyGracefully function to handle HTTP response body closure
2025-06-27 21:37:13 +08:00
CaIon
7de52a0c0d
✨ feat(gemini): enhance ThinkingAdapter and model handling
...
- Introduced `isNoThinkingRequest` and `trimModelThinking` functions to manage model names and thinking configurations.
- Updated `GeminiHelper` to conditionally adjust the model name based on the thinking budget and request settings.
- Refactored `ThinkingAdaptor` to streamline the integration of thinking capabilities into Gemini requests.
- Cleaned up commented-out code in `FetchUpstreamModels` for clarity.
These changes improve the handling of model configurations and enhance the adaptability of the Gemini relay system.
2025-06-21 21:50:03 +08:00
CaIon
d244915111
✨ feat(relay-gemini): conditionally set ThinkingBudget based on MaxOutputTokens
2025-06-21 17:51:13 +08:00
Calcium-Ion
c60d87067d
Merge pull request #1248 from RedwindA/update-gemini-ratio
...
feat(model-ratio): add default ratios for new Gemini models and refine flash model handling
2025-06-21 04:51: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
RedwindA
50907a5758
Merge remote-tracking branch 'upstream/alpha' into update-gemini-ratio
2025-06-19 20:02:27 +08:00
tbphp
173594446e
fix: Gemini & Vertex empty content error
2025-06-19 11:25:59 +08:00
RedwindA
9bc9d40891
feat(gemini): update audio input pricing and adjust model handling logic
2025-06-18 03:25:59 +08:00
RedwindA
a004db93c9
feat(Gemini): enhance budget clamping logic for Gemini models
2025-06-18 00:49:35 +08:00
CaIon
d4e20df7a6
fix(relay): refine error message for unsupported MIME types and enhance error handling in OpenAI wrapper
2025-06-17 22:44:57 +08:00
CaIon
8d0b54bf6e
fix(relay): improve error handling for unsupported MIME types by sanitizing URLs
2025-06-17 22:40:41 +08:00
Calcium-Ion
71fe637d2a
Merge pull request #1231 from RedwindA/feat/gemini-budget-in-name
...
feat(Gemini): implement thinking budget control in model name
2025-06-17 00:03:53 +08:00
CaIon
288f279379
🔧 refactor(relay): replace UUID generation with helper function for response IDs
2025-06-16 21:02:27 +08:00
RedwindA
1e1a6aae55
feat: implement thinking budget control in model name
2025-06-15 23:20:41 +08:00
Calcium-Ion
f95feae571
Merge pull request #1180 from RedwindA/fix/gemini-tool
...
🐛 fix(Gemini): improve JSON parsing for tool content handling
2025-06-09 20:51:28 +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
CaIon
fcb9647aeb
fix(relay-gemini): remove outdated unsupported models from CovertGemini2OpenAI function
2025-06-08 16:22:39 +08:00
Calcium-Ion
5d7e688bfe
Merge pull request #1174 from QuantumNous/refactor/message
...
refactor: message content 改成 any
2025-06-08 16:22:20 +08:00
CaIon
7469446a20
fix(relay-gemini): add unsupported models to CovertGemini2OpenAI function
2025-06-08 16:04:31 +08:00
RedwindA
da41545139
🐛 fix(Gemini): improve JSON parsing for tool content handling
2025-06-08 14:35:56 +08:00
Xyfacai
8343fe0740
refactor: message content 改成 any
...
refactor: message content 改成 any
2025-06-07 23:47:22 +08:00
creamlike1024
0e9a193ed8
feat: gemini audio input billing
2025-06-07 12:26:23 +08:00
RedwindA
eb23dffa04
修复2.5-pro的预算范围
2025-06-06 01:58:02 +08:00
RedwindA
8add0b1592
解决合并冲突
2025-06-06 01:29:06 +08:00
RedwindA
2c3464c2c6
清理注释
2025-06-06 01:09:51 +08:00
RedwindA
f24e2b0d40
Fix: Correctly relay FunctionResponse content for Gemini API
2025-06-06 00:56:38 +08:00
Calcium-Ion
c668362f9d
Merge pull request #1139 from RedwindA/gemini-fix
...
Publish Docker image (amd64) / Push Docker image to multiple registries (push) Has been cancelled
Publish Docker image (arm64) / Push Docker image to multiple registries (push) Has been cancelled
Linux Release / release (push) Has been cancelled
macOS Release / release (push) Has been cancelled
Windows Release / release (push) Has been cancelled
feat: 增加对Gemini MimeType类型的验证
2025-06-02 22:33:01 +08:00
RedwindA
088abcdedc
feat: 增加对GeminiMIME类型的验证
2025-06-02 19:00:55 +08:00
RedwindA
7aad5b0479
refactor: enhance cleanFunctionParameters for improved handling of JSON schema, including support for $defs and conditional keywords
2025-06-01 02:08:13 +08:00
xqx121
efd4a46a97
Fix: Gemini2.5pro ThinkingConfig
2025-05-31 17:50:00 +08:00
CaIon
6436a165af
feat: enhance Gemini response handling by adding reasoning content and updating JSON decoding method
Publish Docker image (amd64) / Push Docker image to multiple registries (push) Has been cancelled
Publish Docker image (arm64) / Push Docker image to multiple registries (push) Has been cancelled
Linux Release / release (push) Has been cancelled
macOS Release / release (push) Has been cancelled
Windows Release / release (push) Has been cancelled
2025-05-22 16:11:50 +08:00
CaIon
526b7e6048
feat: add Thought field to GeminiPart and update response handling in streamResponseGeminiChat2OpenAI
Publish Docker image (amd64) / Push Docker image to multiple registries (push) Has been cancelled
Publish Docker image (arm64) / Push Docker image to multiple registries (push) Has been cancelled
Linux Release / release (push) Has been cancelled
macOS Release / release (push) Has been cancelled
Windows Release / release (push) Has been cancelled
2025-05-22 15:52:23 +08:00
Alex Liu
7ecd9d053e
fix: gemini response json schema
2025-05-07 18:08:56 +08:00
CaIon
d309727e99
fix: gemini thinking tokens count #1014
Publish Docker image (amd64) / Push Docker image to multiple registries (push) Has been cancelled
Publish Docker image (arm64) / Push Docker image to multiple registries (push) Has been cancelled
Linux Release / release (push) Has been cancelled
macOS Release / release (push) Has been cancelled
Windows Release / release (push) Has been cancelled
2025-04-29 16:21:54 +08:00
CaIon
fdd349c909
refactor: update GeminiThinkingConfig initialization
Publish Docker image (amd64) / Push Docker image to multiple registries (push) Has been cancelled
Publish Docker image (arm64) / Push Docker image to multiple registries (push) Has been cancelled
Linux Release / release (push) Has been cancelled
macOS Release / release (push) Has been cancelled
Windows Release / release (push) Has been cancelled
2025-04-18 23:13:28 +08:00
CaIon
ace677b3e7
refactor: remove unsupported 'exclusiveMinimum' field from cleanFunctionParameters
2025-04-18 22:40:05 +08:00