mirror of
https://github.com/Zippland/Snap-Solver.git
synced 2026-01-19 01:21:13 +08:00
更新Gemini模型版本,修复中转API配置
This commit is contained in:
@@ -79,7 +79,7 @@ graph TD
|
||||
<li><b>Claude-3.7</b>:Anthropic的高级理解与解释</li>
|
||||
<li><b>DeepSeek-v3/r1</b>:专为中文场景优化的模型</li>
|
||||
<li><b>QVQ-MAX/Qwen-VL-MAX</b>:以视觉推理闻名的国产AI</li>
|
||||
<li><b>Gemini-2.5-Pro/2.0-flash</b>:智商130的非推理AI</li>
|
||||
<li><b>Gemini-2.5-Pro/2.5-flash</b>:智商130的非推理AI</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -189,7 +189,7 @@ python app.py
|
||||
| **QVQ-MAX** | 多模态支持,推理支持 | 复杂问题,视觉分析 |
|
||||
| **Qwen-VL-MAX** | 多模态支持 | 简单问题,视觉分析 |
|
||||
| **Gemini-2.5-Pro** | 多模态支持 | 复杂问题,视觉分析 |
|
||||
| **Gemini-2.0-Flash** | 多模态支持 | 简单问题,视觉分析 |
|
||||
| **Gemini-2.5-Flash** | 多模态支持 | 简单问题,视觉分析 |
|
||||
|
||||
|
||||
### 🛠️ 可调参数
|
||||
@@ -247,4 +247,4 @@ python app.py
|
||||
|
||||
## 📜 开源协议
|
||||
|
||||
本项目采用 [Apache 2.0](LICENSE) 协议。
|
||||
本项目采用 [Apache 2.5](LICENSE) 协议。
|
||||
|
||||
@@ -104,13 +104,13 @@
|
||||
"version": "latest",
|
||||
"description": "Google最强大的Gemini 2.5 Pro模型,支持图像理解(需要付费API密钥)"
|
||||
},
|
||||
"gemini-2.0-flash": {
|
||||
"name": "Gemini 2.0 Flash",
|
||||
"gemini-2.5-flash": {
|
||||
"name": "Gemini 2.5 Flash",
|
||||
"provider": "google",
|
||||
"supportsMultimodal": true,
|
||||
"isReasoning": false,
|
||||
"version": "latest",
|
||||
"description": "Google更快速的Gemini 2.0 Flash模型,支持图像理解,有免费配额"
|
||||
"description": "Google更快速的Gemini 2.5 Flash模型,支持图像理解,有免费配额"
|
||||
},
|
||||
"doubao-seed-1-6-250615": {
|
||||
"name": "Doubao-Seed-1.6",
|
||||
|
||||
@@ -30,10 +30,17 @@ class GoogleModel(BaseModel):
|
||||
|
||||
# 配置Google API
|
||||
if api_base_url:
|
||||
# 如果提供了自定义API基础URL,设置genai的api_url
|
||||
genai.configure(api_key=api_key, transport="rest", client_options={"api_endpoint": api_base_url})
|
||||
# 配置中转API - 使用环境变量方式
|
||||
# 移除末尾的斜杠以避免重复路径问题
|
||||
clean_base_url = api_base_url.rstrip('/')
|
||||
# 设置环境变量来指定API端点
|
||||
os.environ['GOOGLE_AI_API_ENDPOINT'] = clean_base_url
|
||||
genai.configure(api_key=api_key)
|
||||
else:
|
||||
# 使用默认API端点
|
||||
# 清除可能存在的自定义端点环境变量
|
||||
if 'GOOGLE_AI_API_ENDPOINT' in os.environ:
|
||||
del os.environ['GOOGLE_AI_API_ENDPOINT']
|
||||
genai.configure(api_key=api_key)
|
||||
|
||||
def get_default_system_prompt(self) -> str:
|
||||
@@ -46,7 +53,7 @@ class GoogleModel(BaseModel):
|
||||
|
||||
def get_model_identifier(self) -> str:
|
||||
"""返回默认的模型标识符"""
|
||||
return "gemini-2.0-flash" # 使用有免费配额的模型作为默认值
|
||||
return "gemini-2.5-flash" # 使用有免费配额的模型作为默认值
|
||||
|
||||
def analyze_text(self, text: str, proxies: dict = None) -> Generator[dict, None, None]:
|
||||
"""流式生成文本响应"""
|
||||
|
||||
Reference in New Issue
Block a user