Commit Graph

354 Commits

Author SHA1 Message Date
HynoR
616f41d4c9 feat: 适配o1模型 2024-12-20 23:14:10 +08:00
TAKO
86f5606b83 Merge branch 'Calcium-Ion:main' into feat/o1 2024-12-20 22:12:26 +08:00
HynoR
11408d011d feat: 适配o1模型 2024-12-20 22:07:53 +08:00
CalciumIon
1888a10394 refactor: Enhance error handling in Gemini request conversion
- Updated `CovertGemini2OpenAI` function to return an error alongside the GeminiChatRequest, improving error reporting for image processing.
- Modified `ConvertRequest` methods in both `adaptor.go` files to handle potential errors from the Gemini conversion, ensuring robust request handling.
- Improved clarity and maintainability of the code by explicitly managing error cases during request conversion.
2024-12-20 21:50:58 +08:00
CalciumIon
0725c8aac9 feat: Add GEMINI_VISION_MAX_IMAGE_NUM configuration
- Introduced `GEMINI_VISION_MAX_IMAGE_NUM` to README files for better user guidance.
- Updated `env.go` to retrieve the maximum image number from environment variables, defaulting to 16.
- Modified image handling logic in `relay-gemini.go` to respect the new configuration, allowing disabling of the limit by setting it to -1.
- Removed hardcoded constant for maximum image number in `constant.go` to streamline configuration management.
2024-12-20 21:36:23 +08:00
Calcium-Ion
d083d1ec33 Merge pull request #641 from HynoR/main
chore: 更新遗漏的gemini模型
2024-12-20 20:32:47 +08:00
MartialBE
8504023d03 fix: Fix the issue where Gemini loses content when converting OpenAI format in the stream. 2024-12-20 20:24:49 +08:00
HynoR
105f13b2de chore: 更新gemini模型 2024-12-20 19:17:56 +08:00
HynoR
c4c10d29f9 chore: 更新gemini模型 2024-12-20 19:14:53 +08:00
CalciumIon
1dfdb44d7f feat: Add new experimental Gemini versions to ModelList
- Included additional versions: "gemini-2.0-flash-thinking-exp" and "gemini-2.0-flash-thinking-exp-1219".
- Added comments to categorize versions as old, experimental, and flash experimental for better clarity.
2024-12-20 13:26:51 +08:00
CalciumIon
3a97be9f12 feat: support gemini-2.0-flash-thinking #639 #637 2024-12-20 13:20:07 +08:00
CalciumIon
7569947544 refactor: Improve channel status update logic and clean up code
- Simplified conditional checks in UpdateChannelStatusById function in channel.go to enhance readability.
- Commented out unused image number check in relay-gemini.go for clarity.
- Updated JSON field in en.json for currency consistency, changing "元" from "RMB/CNY" to "CNY" and added a space in "实付金额:" for formatting.
2024-12-17 15:33:16 +08:00
CalciumIon
c6ec3c95ef refactor: Update SystemInstructions type in GeminiChatRequest and adjust handling in CovertGemini2OpenAI
- Changed SystemInstructions from *GeminiPart to *GeminiChatContent in GeminiChatRequest for improved structure.
- Updated CovertGemini2OpenAI function to accommodate the new SystemInstructions type, ensuring proper handling of message content.
2024-12-16 22:41:23 +08:00
CalciumIon
a78bbc0c11 fix: Correct JSON field name for SystemInstructions in GeminiChatRequest
- Updated the JSON field name from "system_instructions" to "system_instruction" to ensure consistency and accuracy in the data structure.
2024-12-16 22:12:56 +08:00
CalciumIon
cd6b3296ed feat: support gemini SystemInstructions #408 2024-12-16 20:19:29 +08:00
CalciumIon
0ad03de153 feat: implement channel settings configuration
fix #620
2024-12-15 15:52:41 +08:00
CalciumIon
e54bb12a96 feat: 兼容OpenAI格式下设置gemini模型联网搜索 #615 2024-12-12 17:58:25 +08:00
CalciumIon
ee03e71e81 feat: add model gemini-2.0-flash-exp 2024-12-12 17:21:37 +08:00
CalciumIon
7ae97088c3 chore: Update dependencies and refactor JSON handling #614
- Removed the `bytedance/sonic` dependency and replaced its usage with the standard `encoding/json` package for JSON marshalling in `relay-text.go`.
- Updated `go.mod` to reflect the removal of `sonic` and adjusted the version of `sonic/loader`.
- Cleaned up `go.sum` to ensure consistency with the updated dependencies.
2024-12-12 14:14:24 +08:00
CalciumIon
52aa31e07d feat: Update model lists and enhance model retrieval in Adaptor
- Refactored ModelList in the gemini constant to include new models and remove outdated ones.
- Modified the GetModelList function in the Adaptor to consolidate model lists from multiple sources, ensuring a comprehensive and updated list is returned.
- Commented out deprecated models in the vertex constants for clarity and future reference.
2024-12-11 21:39:41 +08:00
jochne
94a8c13956 Update relay-xunfei.go
按照讯飞的最新文档,Spark Lite请求地址,对应的domain参数为lite
参考来源:https://www.xfyun.cn/doc/spark/Web.html#_1-接口说明
2024-12-08 01:04:43 +08:00
CalciumIon
246c3fa451 feat: add gemini tool_calls finish reason 2024-12-06 14:31:27 +08:00
CalciumIon
f9cf073a8f feat: add deepseek channel type 2024-12-05 17:50:08 +08:00
Calcium-Ion
bf7e6434ae Merge pull request #590 from iszcz/new512
realtime令牌额度检测和http
2024-12-04 19:49:57 +08:00
iszcz
8a1d16955a 1 2024-12-04 16:20:42 +08:00
Benny
192fc094fc fix: 360智能接口地址更新 2024-12-02 15:59:08 +00:00
CalciumIon
a22a0e8285 refactor: improve validation logic and error handling in relay-text.go
- Simplified validation checks for MaxTokens and Messages fields.
- Enhanced error messages for better clarity.
- Updated goroutine to avoid passing context unnecessarily.
2024-12-01 08:24:41 +08:00
CalciumIon
c0c9b1f670 fix: realtime 2024-11-30 23:32:42 +08:00
Calcium-Ion
20483652e7 Merge pull request #574 from Calcium-Ion/channel-tag
feat: 初步集成渠道标签分组功能
2024-11-30 17:45:16 +08:00
CalciumIon
96e3eeceb1 fix: xAI missing finish_reason #572 2024-11-30 16:57:57 +08:00
papersnake
b485aae026 feat: add claude-3-5-haiku-20241022 2024-11-27 13:33:37 +08:00
CalciumIon
ba6c908fbc fix: stt模型计费 2024-11-25 19:31:59 +08:00
CalciumIon
2ae6060a31 feat: support audio response_format #580 2024-11-24 16:44:27 +08:00
HynoR
1a2e5da179 Chore: support gpt-4o-2024-11-20 2024-11-21 09:14:23 +08:00
CalciumIon
faf4ddc247 feat: 暂时禁用透传功能 2024-11-19 15:06:54 +08:00
CalciumIon
710c88cb26 feat: 暂时禁用透传功能 2024-11-19 15:04:19 +08:00
Calcium-Ion
3ededac185 Merge branch 'main' into main 2024-11-17 16:27:29 +08:00
leezhuuuuu
2af99d0a7e feat: add support for gemini-exp-1114 model / 添加 gemini-exp-1114 模型支持
# feat: add support for gemini-exp-1114 model / 添加 gemini-exp-1114 模型支持

## Changes / 更改内容
- Add gemini-exp-1114 to ModelList in constant.go
- Add gemini-exp-1114 to GeminiModelMap with v1beta API version
- 在 constant.go 的 ModelList 中添加 gemini-exp-1114 模型
- 在 GeminiModelMap 中添加 gemini-exp-1114 的 v1beta API 版本映射

## Testing / 测试情况
- [x] Tested gemini-exp-1114 model API calls / 已测试 gemini-exp-1114 模型的 API 调用
- [x] Verified existing models still work / 验证现有模型仍然正常工作
- [x] Confirmed v1beta API version works correctly / 确认 v1beta API 版本正常工作

## Related Issues / 相关问题
- Fix 404 error when calling gemini-exp-1114 model / 修复调用 gemini-exp-1114 模型时的 404 错误

## Implementation Details / 实现细节
- Use configuration-based approach instead of code modification / 使用基于配置的方式而不是修改代码
- Maintain clean separation of concerns / 保持关注点分离
- Keep backward compatibility / 保持向后兼容性

## Notes / 注意事项
- This PR follows the principle of minimal invasion / 本 PR 遵循最小侵入原则
- Configuration changes only / 仅包含配置更改
2024-11-16 21:52:37 +08:00
leezhuuuuu
c126118b6e 增加对于gemini-exp-1114模型的支持,映射到v1beta
feat(gemini): add support for gemini-exp-1114 model

- Add gemini-exp-1114 to ModelList in constant.go
- Update GetRequestURL in adaptor.go to use v1beta API version for gemini-exp-1114
- Keep backward compatibility for other models

This change enables the use of the experimental gemini-exp-1114 model by correctly routing its requests to the v1beta API endpoint while maintaining existing functionality for other models.
2024-11-16 21:29:35 +08:00
HowieWood
4e531938ee Modify the default gemini API to v1beta 2024-11-16 12:21:50 +00:00
CalciumIon
7ad5a7a15b fix: aws claude 2024-11-14 15:12:34 +08:00
CalciumIon
6bdf5cb380 fix: returnPreConsumedQuota 2024-11-10 02:09:18 +08:00
CalciumIon
37d6925ef6 feat: 完善audio计费 2024-11-07 16:12:09 +08:00
HowieWood
0788a6c25f Continue fixing Ollama embedding return issue 2024-11-06 01:21:02 +00:00
HowieWood
9e550eab00 Modify ollama embed return fields 2024-11-05 20:12:51 +08:00
CalciumIon
75b480d821 chore: 删除无用日志 2024-11-05 19:41:38 +08:00
CalciumIon
a8eecffe38 fix: mistral adaptor 2024-11-05 19:32:51 +08:00
1808837298@qq.com
bacfdbc725 fix: realtime计费
(cherry picked from commit fdfea8726c6d86d3844af1ac18d7b3df908f26a7)
2024-11-05 19:29:06 +08:00
Xyfacai
67bdfea903 fix(realtime): 修复ws 握手失败、计费问题
(cherry picked from commit 618dffc43fd5a5f4065944db87761f9ee18e44d3)
2024-11-05 19:28:46 +08:00
Xyfacai
16f6bdc81e refactor: realtime log
(cherry picked from commit fd24dc467bfc360008b313220e607f0176ee7aa3)
2024-11-05 19:28:09 +08:00