Merge branch 'pr/Inblac/132'

This commit is contained in:
snaily
2025-05-25 02:39:03 +08:00

View File

@@ -83,8 +83,13 @@ def _build_tools(
names, functions = set(), []
for fc in function_declarations:
if fc.get("name") not in names:
names.add(fc.get("name"))
functions.append(fc)
if fc.get("name")=="googleSearch":
# cherry开启内置搜索时添加googleSearch工具
tool["googleSearch"] = {}
else:
# 其他函数添加到functionDeclarations中
names.add(fc.get("name"))
functions.append(fc)
tool["functionDeclarations"] = functions