From 2f83b60fb3be02a8ed56a9b11ee35d47bb954ce3 Mon Sep 17 00:00:00 2001 From: binary-husky Date: Wed, 6 Sep 2023 12:36:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=90=9C=E7=B4=A2=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E6=97=B6=E7=9A=84=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crazy_functions/联网的ChatGPT.py | 6 +++++- crazy_functions/联网的ChatGPT_bing版.py | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/crazy_functions/联网的ChatGPT.py b/crazy_functions/联网的ChatGPT.py index 6a7d118..4ed9aeb 100644 --- a/crazy_functions/联网的ChatGPT.py +++ b/crazy_functions/联网的ChatGPT.py @@ -75,7 +75,11 @@ def 连接网络回答问题(txt, llm_kwargs, plugin_kwargs, chatbot, history, s proxies, = get_conf('proxies') urls = google(txt, proxies) history = [] - + if len(urls) == 0: + chatbot.append((f"结论:{txt}", + "[Local Message] 受到google限制,无法从google获取信息!")) + yield from update_ui(chatbot=chatbot, history=history) # 刷新界面 # 由于请求gpt需要一段时间,我们先及时地做一次界面更新 + return # ------------- < 第2步:依次访问网页 > ------------- max_search_result = 5 # 最多收纳多少个网页的结果 for index, url in enumerate(urls[:max_search_result]): diff --git a/crazy_functions/联网的ChatGPT_bing版.py b/crazy_functions/联网的ChatGPT_bing版.py index 93a84a0..db5adb7 100644 --- a/crazy_functions/联网的ChatGPT_bing版.py +++ b/crazy_functions/联网的ChatGPT_bing版.py @@ -75,7 +75,11 @@ def 连接bing搜索回答问题(txt, llm_kwargs, plugin_kwargs, chatbot, histor proxies, = get_conf('proxies') urls = bing_search(txt, proxies) history = [] - + if len(urls) == 0: + chatbot.append((f"结论:{txt}", + "[Local Message] 受到bing限制,无法从bing获取信息!")) + yield from update_ui(chatbot=chatbot, history=history) # 刷新界面 # 由于请求gpt需要一段时间,我们先及时地做一次界面更新 + return # ------------- < 第2步:依次访问网页 > ------------- max_search_result = 8 # 最多收纳多少个网页的结果 for index, url in enumerate(urls[:max_search_result]):