From cdfb64631ab8eb38fc70bf486723f3f02b217337 Mon Sep 17 00:00:00 2001 From: Ruochen <1051989940@qq.com> Date: Fri, 6 Jun 2025 09:21:09 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8Ddashscope=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E4=BE=9B=E5=BA=94=E5=95=86=E6=B5=8B=E8=AF=95=E9=97=AE?= =?UTF-8?q?=E9=A2=98=EF=BC=8C=E5=BB=B6=E9=95=BF=E4=BA=86=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E8=B6=85=E6=97=B6=E6=97=B6=E9=97=B4=EF=BC=8C=E6=94=B9=E8=BF=9B?= =?UTF-8?q?prompt=E5=B7=A5=E7=A8=8B=EF=BC=8C=E4=BF=AE=E5=A4=8D=E4=BA=86?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=E5=8F=B0=E6=89=93=E5=8D=B0=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E8=B6=85=E6=97=B6=E6=97=B6=E9=97=B4=E4=B8=8D=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- astrbot/dashboard/routes/config.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/astrbot/dashboard/routes/config.py b/astrbot/dashboard/routes/config.py index f33929c5c..5941e722f 100644 --- a/astrbot/dashboard/routes/config.py +++ b/astrbot/dashboard/routes/config.py @@ -174,6 +174,7 @@ class ConfigRoute(Route): """辅助函数:测试单个 provider 的可用性""" meta = provider.meta() provider_name = provider.provider_config.get("id", "Unknown Provider") + logger.debug(f"Got provider meta: {meta}") if not provider_name and meta: provider_name = meta.id elif not provider_name: @@ -189,7 +190,7 @@ class ConfigRoute(Route): logger.debug(f"Attempting to check provider: {status_info['name']} (ID: {status_info['id']}, Type: {status_info['type']}, Model: {status_info['model']})") try: logger.debug(f"Sending 'Ping' to provider: {status_info['name']}") - response = await asyncio.wait_for(provider.text_chat(prompt="Ping"), timeout=20.0) # 超时 20 秒 + response = await asyncio.wait_for(provider.text_chat(prompt="Connection Check, Ping, REPLY PONG ONLY",contexts = [{ "role": "system", "content": "You are a helpful assisstant."},{ "role": "user", "content": "你好"}]), timeout=45.0) # 超时秒 logger.debug(f"Received response from {status_info['name']}: {response}") # 只要 text_chat 调用成功返回一个 LLMResponse 对象 (即 response 不为 None),就认为可用 if response is not None: @@ -209,7 +210,7 @@ class ConfigRoute(Route): logger.warning(f"Provider {status_info['name']} (ID: {status_info['id']}) test call returned None.") except asyncio.TimeoutError: - status_info["error"] = "Connection timed out after 10 seconds during test call." + status_info["error"] = "Connection timed out after 45 seconds during test call." logger.warning(f"Provider {status_info['name']} (ID: {status_info['id']}) timed out.") except Exception as e: error_message = str(e)