mirror of
https://github.com/snailyp/gemini-balance.git
synced 2026-05-12 02:19:59 +08:00
feat: 在OpenAI chat服务中,适配googleSearch内置工具调用支持
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user