mirror of
https://github.com/snailyp/gemini-balance.git
synced 2026-09-08 17:36:37 +08:00
fix: adapt gemini format
This commit is contained in:
@@ -31,6 +31,12 @@ def _build_tools(model: str, payload: Dict[str, Any]) -> List[Dict[str, Any]]:
|
|||||||
tools.append({"code_execution": {}})
|
tools.append({"code_execution": {}})
|
||||||
if model.endswith("-search"):
|
if model.endswith("-search"):
|
||||||
tools.append({"googleSearch": {}})
|
tools.append({"googleSearch": {}})
|
||||||
|
|
||||||
|
if payload and isinstance(payload, dict) and "tools" in payload:
|
||||||
|
items = payload.get("tools", [])
|
||||||
|
if items and isinstance(items, list):
|
||||||
|
tools.extend(items)
|
||||||
|
|
||||||
return tools
|
return tools
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user