From f77c4538433ecb15349511a7b8e5ce31cf22dd55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=B8=A6=E7=BE=BD?= Date: Tue, 10 Jun 2025 00:20:35 +0000 Subject: [PATCH] fix: clean code --- astrbot/core/provider/sources/gemini_source.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/astrbot/core/provider/sources/gemini_source.py b/astrbot/core/provider/sources/gemini_source.py index 12736532a..c16b39415 100644 --- a/astrbot/core/provider/sources/gemini_source.py +++ b/astrbot/core/provider/sources/gemini_source.py @@ -162,7 +162,7 @@ class ProviderGoogleGenAI(Provider): if url_context: if hasattr(types, "UrlContext"): - tool_list.append(types.Tool(web_context=types.UrlContext())) + tool_list.append(types.Tool(url_context=types.UrlContext())) else: logger.warning( "当前 SDK 版本不支持 URL 上下文工具,已忽略该设置,请升级 google-genai 包" @@ -185,7 +185,7 @@ class ProviderGoogleGenAI(Provider): if url_context and not native_coderunner: if hasattr(types, "UrlContext"): - tool_list.append(types.Tool(web_context=types.UrlContext())) + tool_list.append(types.Tool(url_context=types.UrlContext())) else: logger.warning( "当前 SDK 版本不支持 URL 上下文工具,已忽略该设置,请升级 google-genai 包"