镜像自地址
https://github.com/binary-husky/gpt_academic.git
已同步 2025-12-06 06:26:47 +00:00
update web search functionality
这个提交包含在:
@@ -274,7 +274,7 @@ GROBID_URLS = [
|
|||||||
|
|
||||||
|
|
||||||
# Searxng互联网检索服务
|
# Searxng互联网检索服务
|
||||||
SEARXNG_URL = "https://cloud-1.agent-matrix.com/"
|
SEARXNG_URLS = [ f"https://hamercity-ai-search-{x}.hf.space/" for x in range(1, 9) ]
|
||||||
|
|
||||||
|
|
||||||
# 是否允许通过自然语言描述修改本页的配置,该功能具有一定的危险性,默认关闭
|
# 是否允许通过自然语言描述修改本页的配置,该功能具有一定的危险性,默认关闭
|
||||||
@@ -403,7 +403,7 @@ DAAS_SERVER_URL = "https://hamercity-bbdown.hf.space/stream"
|
|||||||
插件在线服务配置依赖关系示意图
|
插件在线服务配置依赖关系示意图
|
||||||
│
|
│
|
||||||
├── 互联网检索
|
├── 互联网检索
|
||||||
│ └── SEARXNG_URL
|
│ └── SEARXNG_URLS
|
||||||
│
|
│
|
||||||
├── 语音功能
|
├── 语音功能
|
||||||
│ ├── ENABLE_AUDIO
|
│ ├── ENABLE_AUDIO
|
||||||
|
|||||||
@@ -115,7 +115,8 @@ def get_auth_ip():
|
|||||||
|
|
||||||
def searxng_request(query, proxies, categories='general', searxng_url=None, engines=None):
|
def searxng_request(query, proxies, categories='general', searxng_url=None, engines=None):
|
||||||
if searxng_url is None:
|
if searxng_url is None:
|
||||||
url = get_conf("SEARXNG_URL")
|
urls = get_conf("SEARXNG_URLS")
|
||||||
|
url = random.choice(urls)
|
||||||
else:
|
else:
|
||||||
url = searxng_url
|
url = searxng_url
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
|
import random
|
||||||
from toolbox import get_conf
|
from toolbox import get_conf
|
||||||
from crazy_functions.Internet_GPT import 连接网络回答问题
|
from crazy_functions.Internet_GPT import 连接网络回答问题
|
||||||
from crazy_functions.plugin_template.plugin_class_template import GptAcademicPluginTemplate, ArgProperty
|
from crazy_functions.plugin_template.plugin_class_template import GptAcademicPluginTemplate, ArgProperty
|
||||||
@@ -20,6 +20,9 @@ class NetworkGPT_Wrap(GptAcademicPluginTemplate):
|
|||||||
第三个参数,名称`allow_cache`,参数`type`声明这是一个下拉菜单,下拉菜单上方显示`title`+`description`,下拉菜单的选项为`options`,`default_value`为下拉菜单默认值;
|
第三个参数,名称`allow_cache`,参数`type`声明这是一个下拉菜单,下拉菜单上方显示`title`+`description`,下拉菜单的选项为`options`,`default_value`为下拉菜单默认值;
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
urls = get_conf("SEARXNG_URLS")
|
||||||
|
url = random.choice(urls)
|
||||||
|
|
||||||
gui_definition = {
|
gui_definition = {
|
||||||
"main_input":
|
"main_input":
|
||||||
ArgProperty(title="输入问题", description="待通过互联网检索的问题,会自动读取输入框内容", default_value="", type="string").model_dump_json(), # 主输入,自动从输入框同步
|
ArgProperty(title="输入问题", description="待通过互联网检索的问题,会自动读取输入框内容", default_value="", type="string").model_dump_json(), # 主输入,自动从输入框同步
|
||||||
@@ -30,7 +33,7 @@ class NetworkGPT_Wrap(GptAcademicPluginTemplate):
|
|||||||
"optimizer":
|
"optimizer":
|
||||||
ArgProperty(title="搜索优化", options=["关闭", "开启", "开启(增强)"], default_value="关闭", description="是否使用搜索增强。注意这可能会消耗较多token", type="dropdown").model_dump_json(),
|
ArgProperty(title="搜索优化", options=["关闭", "开启", "开启(增强)"], default_value="关闭", description="是否使用搜索增强。注意这可能会消耗较多token", type="dropdown").model_dump_json(),
|
||||||
"searxng_url":
|
"searxng_url":
|
||||||
ArgProperty(title="Searxng服务地址", description="输入Searxng的地址", default_value=get_conf("SEARXNG_URL"), type="string").model_dump_json(), # 主输入,自动从输入框同步
|
ArgProperty(title="Searxng服务地址", description="输入Searxng的地址", default_value=url, type="string").model_dump_json(), # 主输入,自动从输入框同步
|
||||||
|
|
||||||
}
|
}
|
||||||
return gui_definition
|
return gui_definition
|
||||||
|
|||||||
@@ -29,8 +29,18 @@ graph TD
|
|||||||
E --> B
|
E --> B
|
||||||
D --> F[Save Image and Code]
|
D --> F[Save Image and Code]
|
||||||
F --> B
|
F --> B
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary><b>My section header in bold</b></summary>
|
||||||
|
|
||||||
|
Any folded content here. It requires an empty line just above it.
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
"""
|
"""
|
||||||
def validate_path():
|
def validate_path():
|
||||||
import os, sys
|
import os, sys
|
||||||
@@ -44,8 +54,8 @@ def validate_path():
|
|||||||
validate_path() # validate path so you can run from base directory
|
validate_path() # validate path so you can run from base directory
|
||||||
from toolbox import markdown_convertion
|
from toolbox import markdown_convertion
|
||||||
from shared_utils.advanced_markdown_format import markdown_convertion_for_file
|
from shared_utils.advanced_markdown_format import markdown_convertion_for_file
|
||||||
with open("gpt_log/default_user/shared/2024-04-22-01-27-43.zip.extract/translated_markdown.md", "r", encoding="utf-8") as f:
|
# with open("gpt_log/default_user/shared/2024-04-22-01-27-43.zip.extract/translated_markdown.md", "r", encoding="utf-8") as f:
|
||||||
md = f.read()
|
# md = f.read()
|
||||||
html = markdown_convertion_for_file(md)
|
html = markdown_convertion_for_file(md)
|
||||||
# print(html)
|
# print(html)
|
||||||
with open("test.html", "w", encoding="utf-8") as f:
|
with open("test.html", "w", encoding="utf-8") as f:
|
||||||
|
|||||||
在新工单中引用
屏蔽一个用户