Commit Graph

7 Commits

Author SHA1 Message Date
yinpeng
8c9b802016 feat: 添加Web验证页面并优化密钥管理功能 2025-02-11 20:45:49 +08:00
yinpeng
cd45f4b5ab refactor: 重构Gemini和OpenAI聊天服务以支持工具和安全设置
- 将 `_build_payload`、`_build_tools`、`_get_safety_settings` 和 `_has_image_parts` 函数从 `OpenAIChatService` 和 `GeminiChatService` 类中提取为独立的函数。
- 将 `_handle_stream_response` 和 `_handle_normal_response` 函数从 `GeminiResponseHandler` 和 `OpenAIResponseHandler` 类中提取为独立的函数。
- 将 `_extract_text` 函数从 `OpenAIResponseHandler` 类中提取为独立的函数, 并在 `GeminiResponseHandler` 中复用。
- 将 `_convert_image` 函数从 `OpenAIMessageConverter` 类中提取为独立的函数。
- 优化 `OpenAIChatService` 和 `GeminiChatService` 中的代码结构, 使其更清晰。
- 优化 `app/api/openai_routes.py` 和 `app/api/gemini_routes.py` 中的路由函数, 移除不必要的参数。
2025-02-06 21:35:19 +08:00
yinpeng
9578704cfd feat: 为API添加统一的鉴权token 2024-12-25 01:26:39 +08:00
yinpeng
8dfe617468 feat: 将 Gemini API 调用迁移至 ChatService 并支持 API Key 验证 2024-12-18 21:35:49 +08:00
yinpeng
d9229cced9 feat: 支持 Gemini 格式请求,并优化日志和配置 2024-12-18 19:54:43 +08:00
yinpeng
56a069dbac 新增自定义日志模块,替换全局logging实现;优化日志输出格式与颜色支持 2024-12-16 16:20:53 +08:00
yinpeng
c56bea0b25 添加API密钥管理、模型服务和安全服务,并优化FastAPI应用程序配置 2024-12-15 11:08:35 +08:00