fix: 无tool导致的报错 #239

This commit is contained in:
Soulter
2025-01-15 11:16:31 +08:00
parent e6c985ce4e
commit 2ee4b431d4
3 changed files with 8 additions and 2 deletions

View File

@@ -83,7 +83,9 @@ class LLMTunerModelLoader(Provider):
"system": system_prompt,
}
if func_tool:
conf["tools"] = func_tool
tool_list = func_tool.get_func_desc_openai_style()
if tool_list:
conf['tools'] = tool_list
responses = await self.model.achat(**conf)