修复非流式模式下移除代码执行工具的逻辑

This commit is contained in:
yinpeng
2024-12-16 23:28:23 +08:00
parent 16a2f64cd3
commit 1913a3c909

View File

@@ -172,7 +172,8 @@ class ChatService:
if not stream:
# 非流式模式下,移除代码执行工具
tools.remove({"code_execution": {}})
if {"code_execution": {}} in tools:
tools.remove({"code_execution": {}})
payload = {
"contents": gemini_messages,
"generationConfig": {"temperature": temperature},