Hk-Gosuto / ChatGPT-Next-Web-LangChain

一键拥有你自己的 ChatGPT 网页服务。 One-Click to deploy your own ChatGPT web UI.(基于 langchain 实现的插件版本 Plugin version implemented based on langchain)
https://n3xt.chat
MIT License
1.16k stars 384 forks source link

[Feature Request] 增加两个功能 #313

Open qingyuan0o0 opened 1 month ago

qingyuan0o0 commented 1 month ago

🥰 需求描述

1.以前谷歌搜索是用api,现在是类似ddg,希望可以自行修改url地址 2.希望可以更新模型列表,昨天更新后发现使用自定义后端,到gptweb端看到用的还是3.5模型,测试自定义gpt-4o-mini无效

🧐 解决方案

1.g009le的url使用镜像站,参考项目,后续参数一模一样,在有参数的时候启用

📝 补充信息

No response

Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically.


Title: [Feature Request] Add two functions

🥰 Description of requirements

  1. In the past, Google search used API, but now it is similar to DDG. I hope I can modify the URL address by myself.
  2. I hope that the model list can be updated. After updating yesterday, I found that a custom backend was used. When I went to gptweb, I saw that the 3.5 model was still used. The test of the custom gpt-4o-mini was invalid.

🧐 Solution

  1. The URL of g009le uses the mirror site, [Reference Project] (https://51.ruyo.net/4880.html), the subsequent parameters are exactly the same, and are enabled when there are parameters.

📝 Supplementary information

No response

Hk-Gosuto commented 1 month ago

👌 晚一些处理

Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically.


👌 Process it later

qingyuan0o0 commented 1 month ago

因为其他搜索站点AD太多,我喜欢用这个不能登录的搜索镜像,已经稳定用了挺长时间😀

Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically.


Because there are too many ADs on other search sites, I like to use this search mirror that cannot be logged in. I have been using it stably for a long time😀

Hk-Gosuto commented 1 month ago

google 搜索的插件指的是 GoogleCustomSearch 还是 ChooseSearchEngine 中的 google 选项? 自定义模型可以通过环境变量 CUSTOM_MODELS 来配置,是配置后后端接口调用无效?

Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically.


Does the google search plug-in refer to GoogleCustomSearch or the google option in ChooseSearchEngine? Custom models can be configured through the environment variable CUSTOM_MODELS. Is the backend interface call invalid after configuration?

qingyuan0o0 commented 1 month ago

google 搜索的插件指的是 GoogleCustomSearch 还是 ChooseSearchEngine 中的 google 选项? 自定义模型可以通过环境变量 CUSTOM_MODELS 来配置,是配置后后端接口调用无效?

非api模式,是代替vvvvvv.9009Ie.com的网址 其实如果指定了正确api的地址做镜像,一样可以作为api的镜像,api镜像应该用cloudflare实现,非api模式用cf会触发验证

Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically.


Does the google search plug-in refer to GoogleCustomSearch or the google option in ChooseSearchEngine? Custom models can be configured through the environment variable CUSTOM_MODELS. Is the backend interface call invalid after configuration?

Non-api mode is the URL that replaces vvvvvv.9009Ie.com

Hk-Gosuto commented 1 month ago

没听懂具体需要修改什么

Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically.


I don’t understand what exactly needs to be modified.

qingyuan0o0 commented 1 month ago

没听懂具体需要修改什么

你访问下iw.mk/google搜索试试?

Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically.


I don’t understand what exactly needs to be modified.

Can you visit iw.mk/google and try searching?

Hk-Gosuto commented 1 month ago

是想给 google 搜索插件增加类似 DDG_API_PROXY_PREFIX 的参数?

Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically.


Do you want to add parameters like DDG_API_PROXY_PREFIX to the google search plug-in?

qingyuan0o0 commented 1 month ago

是想给 google 搜索插件增加类似 DDG_API_PROXY_PREFIX 的参数?

不是的,直接代替www.google.com

Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically.


Do you want to add parameters similar to DDG_API_PROXY_PREFIX to the google search plug-in?

No, directly replace www.google.com

Hk-Gosuto commented 1 month ago

只是替换的话只能作用在 ChooseSearchEngine 插件的 google 模式下

Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically.


If you just replace it, it can only be used in the google mode of the ChooseSearchEngine plug-in.

qingyuan0o0 commented 1 month ago

只是替换的话只能作用在 ChooseSearchEngine 插件的 google 模式下 不知道我之前提供的ddg变量方式是否会被谷歌屏蔽,如果不会ddg的方案可用

Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically.


If it is just a replacement, it can only be used in the google mode of the ChooseSearchEngine plug-in. I don’t know if the ddg variable method I provided before will be blocked by Google. If not, the ddg solution is available.

Hk-Gosuto commented 1 month ago

增加了 GOOGLE_PLUGIN_API_PROXY_PREFIX 环境变量,与 DDG_API_PROXY_PREFIX 使用方法一致,同时作用在 GoogleCustomSearchChooseSearchEngine 两个插件。

Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically.


Added the GOOGLE_PLUGIN_API_PROXY_PREFIX environment variable, which is consistent with the usage of DDG_API_PROXY_PREFIX and affects both the GoogleCustomSearch and ChooseSearchEngine plug-ins.

qingyuan0o0 commented 1 month ago

增加了 GOOGLE_PLUGIN_API_PROXY_PREFIX 环境变量,与 DDG_API_PROXY_PREFIX 使用方法一致,同时作用在 GoogleCustomSearchChooseSearchEngine 两个插件。

作者你访问下iw.mk/ceshi

Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically.


Added the GOOGLE_PLUGIN_API_PROXY_PREFIX environment variable, which is consistent with the usage of DDG_API_PROXY_PREFIX and affects both the GoogleCustomSearch and ChooseSearchEngine plug-ins.

Author, please visit iw.mj/ceshi

Hk-Gosuto commented 1 month ago

我理解你的意思,你是想反代 www.google.com 是吧。 不过只有 ChooseSearchEngine 是直接请求的 www.google.com,插件 GoogleCustomSearch 请求的地址是 www.googleapis.com,都走同一个反代并不通用。

Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically.


I understand what you mean, you want to rebel against www.google.com, right? However, only ChooseSearchEngine directly requests www.google.com, and the plug-in GoogleCustomSearch requests the address www.googleapis.com. It is not universal to use the same reverse generation.

qingyuan0o0 commented 1 month ago

我理解你的意思,你是想反代 www.google.com 是吧。 不过只有 ChooseSearchEngine 是直接请求的 www.google.com,插件 GoogleCustomSearch 请求的地址是 www.googleapis.com,都走同一个反代并不通用。

好的,我明白了,谢谢,我找下解决方案

Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically.


I understand what you mean, you want to rebel against www.google.com, right? However, only ChooseSearchEngine directly requests www.google.com, and the plug-in GoogleCustomSearch requests the address www.googleapis.com. It is not universal to use the same reverse generation.

Okay, I understand, thank you, I'll find a solution

Hk-Gosuto commented 1 month ago

我理解你的意思,你是想反代 www.google.com 是吧。 不过只有 ChooseSearchEngine 是直接请求的 www.google.com,插件 GoogleCustomSearch 请求的地址是 www.googleapis.com,都走同一个反代并不通用。

好的,我明白了,谢谢,我找下解决方案

两个插件的代码在这里,你直接修改插件替换也可以,或者你可以告诉我你用的是哪个插件,我加个完全替代 URL 的变量: https://github.com/Hk-Gosuto/ChatGPT-Next-Web-LangChain/blob/40b673054b66703763f8441a55fb9c6720433599/app/api/langchain-tools/google_search.ts#L36 https://github.com/Hk-Gosuto/ChatGPT-Next-Web-LangChain/blob/40b673054b66703763f8441a55fb9c6720433599/app/api/langchain-tools/google_custom_search.ts#L62

Issues-translate-bot commented 1 month ago

Bot detected the issue body's language is not English, translate it automatically.


I understand what you mean, you want to rebel against www.google.com, right? But only ChooseSearchEngine is directly requested www.google.com, plug-in The requested address of GoogleCustomSearch is [www.googleapis.com. It is not universal to use the same reverse generation. ](http://www.googleapis.com%EF%BC%8C%E9%83%BD%E8%B5%B0%E5%90%8C%E4%B8%80%E4%B8%AA%E5% 8F%8D%E4%BB%A3%E5%B9%B6%E4%B8%8D%E9%80%9A%E7%94%A8%E3%80%82)

Okay, I understand, thank you, I will find a solution

The codes of the two plug-ins are here. You can directly modify the plug-in and replace it, or you can tell me which plug-in you are using, and I will add a variable that completely replaces the URL: https://github.com/Hk-Gosuto/ChatGPT-Next-Web-LangChain/blob/40b673054b66703763f8441a55fb9c6720433599/app/api/langchain-tools/google_search.ts#L36 https://github.com/Hk-Gosuto/ChatGPT-Next-Web-LangChain/blob/40b673054b66703763f8441a55fb9c6720433599/app/api/langchain-tools/google_custom_search.ts#L62