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.14k stars 390 forks source link

[Bug] 无法回复问题 #6

Closed ghost closed 1 year ago

ghost commented 1 year ago

在serpapi.com获取了Private API Key,配置了SERPAPI_API_KEY环境变量。 但是输入问题不能得到回复,一直显示加载中,切换模型不使用gpt-3.5-turbo-0613后就可以正常回复,但不能联网查询了。

ct
Issues-translate-bot commented 1 year ago

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


Title: [Bug] Unable to reply to questions

Get the Private API Key from serpapi.com, and configure the SERPAPI_API_KEY environment variable. But I can’t get a reply to the input question. It keeps showing that it’s loading. After switching the model without using gpt-3.5-turbo-0613, I can reply normally, but I can’t query it online.

ct
Hk-Gosuto commented 1 year ago

image

无法复现该问题,请尝试更新代码到最新或者检查网络是否可以正常访问到 serpapi,也可以尝试不配置 SERPAPI_API_KEY 使用 duckduckgo 作为网络检索插件。

Issues-translate-bot commented 1 year ago

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


image

This problem cannot be reproduced, please try to update the code to the latest or check whether the network can access serpapi normally, or try not configuring SERPAPI_API_KEY to use duckduckgo as a network search plugin.

crypticatul commented 1 year ago

I was also experiencing the same bug. And as rightly pointed out by @Hk-Gosuto , This has something to do with the SERP API. I removed SERP APKI Key from the env vars and the DuckDuckGo search started working. However, it works sometimes but sometimes it gets stucked like this:

image

Below is the snap of Console in Inspect Element if this can help

image
ghost commented 1 year ago

image

无法复现该问题,请尝试更新代码到最新或者检查网络是否可以正常访问到 serpapi,也可以尝试不配置 SERPAPI_API_KEY 使用 duckduckgo 作为网络检索插件。

不配置 SERPAPI_API_KEY 也是这个样子,我的 BASE_URL 是 https://api.chatanywhere.cn ,是转发 api ,和这个有关系吗?

Hk-Gosuto commented 1 year ago

image 无法复现该问题,请尝试更新代码到最新或者检查网络是否可以正常访问到 serpapi,也可以尝试不配置 SERPAPI_API_KEY 使用 duckduckgo 作为网络检索插件。

不配置 SERPAPI_API_KEY 也是这个样子,我的 BASE_URL 是 https://api.chatanywhere.cn ,是转发 api ,和这个有关系吗?

本项目暂时不支持配置 BASE_URL,主要是因为 openai-node 项目目前没支持,建议使用 vercel 部署一个试试。

Hk-Gosuto commented 1 year ago

I was also experiencing the same bug. And as rightly pointed out by @Hk-Gosuto , This has something to do with the SERP API. I removed SERP APKI Key from the env vars and the DuckDuckGo search started working. However, it works sometimes but sometimes it gets stucked like this:

image

Below is the snap of Console in Inspect Element if this can help

image

This problem is caused by the token being too long. You can try using the gpt-3.5-turbo-16k-0613 model. At the same time, I have made some adjustments to the two plugins, duckduckgo and RequestsGetTool, so that they will not call RequestsGetTool to retrieve webpage details during searches.

thlearns commented 1 year ago

您好,回答字数多尤其是使用搜索的时候,回答会截断,后一部分回答未输出显示,是什么原因呢?我尝试过,即使是gpt-3.5-turbo-16k-0613也是如此。

Issues-translate-bot commented 1 year ago

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


Hello, the answer has a lot of words, especially when using search, the answer will be truncated, and the latter part of the answer is not displayed. What is the reason?

Hk-Gosuto commented 1 year ago

您好,回答字数多尤其是使用搜索的时候,回答会截断,后一部分回答未输出显示,是什么原因呢?我尝试过,即使是gpt-3.5-turbo-16k-0613也是如此。

确实是一个偶发的问题,我在正常使用的时候也有遇到,但调试时重试了十几次也没再复现。 如果有可以必现该问题的 prompt 也可以发给我进行复现和修复。

Issues-translate-bot commented 1 year ago

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


Hello, the answer has a lot of words, especially when using search, the answer will be truncated, and the latter part of the answer is not output and displayed. What is the reason? I tried it, even with gpt-3.5-turbo-16k-0613.

It is indeed an occasional problem, and I also encountered it during normal use, but it did not reproduce after retrying a dozen times during debugging. If there is a prompt that can show the problem, you can also send it to me for reproduction and repair.

Hk-Gosuto commented 1 year ago

您好,回答字数多尤其是使用搜索的时候,回答会截断,后一部分回答未输出显示,是什么原因呢?我尝试过,即使是gpt-3.5-turbo-16k-0613也是如此。

我找到了这个问题的原因,由于现在 duckduckgo 插件是基于 duck-duck-scrape 包实现的,而该包依赖一些 nodejs 核心函数。所以上次更新时我将 agent 的 api 运行时修改为了 nodejs,而 vercel hobby 订阅的账号对 nodejs 的函数有运行时间限制导致当回复时间超过10秒时会被强制终止。 可以使用 docker 部署来规避这个问题,或者等待后续更新解决。

参考:https://vercel.com/guides/what-can-i-do-about-vercel-serverless-functions-timing-out

Issues-translate-bot commented 1 year ago

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


Hello, the answer has a lot of words, especially when using search, the answer will be truncated, and the latter part of the answer is not output and displayed. What is the reason? I tried it, even with gpt-3.5-turbo-16k-0613.

I found the reason for this problem, because now the duckduckgo plugin is implemented based on the duck-duck-scrape package, which depends on some nodejs core functions. So in the last update, I changed the runtime of the agent's api to nodejs, and the account subscribed by vercel hobby has a running time limit for nodejs functions, so when the response time exceeds 10 seconds, it will be forcibly terminated. This issue can be circumvented by using docker deployment, or waiting for a subsequent update to resolve it.

Reference: https://vercel.com/guides/what-can-i-do-about-vercel-serverless-functions-timing-out

ghost commented 1 year ago

您好,回答字数多尤其是使用搜索的时候,回答会截断,后一部分回答未输出显示,是什么原因呢?我尝试过,即使是gpt-3.5-turbo-16k-0613也是如此。

我找到了这个问题的原因,由于现在 duckduckgo 插件是基于 duck-duck-scrape 包实现的,而该包依赖一些 nodejs 核心函数。所以上次更新时我将 agent 的 api 运行时修改为了 nodejs,而 vercel hobby 订阅的账号对 nodejs 的函数有运行时间限制导致当回复时间超过10秒时会被强制终止。 可以使用 docker 部署来规避这个问题,或者等待后续更新解决。

参考:https://vercel.com/guides/what-can-i-do-about-vercel-serverless-functions-timing-out

是的,我用docker部署就解决了这个问题,现在用 serpapi 也可以正常输出内容了~

Issues-translate-bot commented 1 year ago

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


Hello, the answer has a lot of words, especially when using search, the answer will be truncated, and the latter part of the answer is not output and displayed. What is the reason? I tried it, even with gpt-3.5-turbo-16k-0613.

I found the reason for this problem, because now the duckduckgo plugin is implemented based on the duck-duck-scrape package, which depends on some nodejs core functions. So in the last update, I changed the runtime of the agent's api to nodejs, and the account subscribed by vercel hobby has a running time limit for nodejs functions, so when the response time exceeds 10 seconds, it will be forcibly terminated. This issue can be circumvented by using docker deployment, or waiting for a subsequent update to resolve it.

Reference: https://vercel.com/guides/what-can-i-do-about-vercel-serverless-functions-timing-out

Yes, I solved this problem with docker deployment, and now I can output content normally with serpapi~

ghost commented 1 year ago

弱弱的问一句,联网功能,模型目前只支持 gpt-3.5-turbo-0613 吗?gpt-4 是否支持呢?

Issues-translate-bot commented 1 year ago

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


A weak question, the networking function, does the model currently only support gpt-3.5-turbo-0613? Does gpt-4 support it?

Hk-Gosuto commented 1 year ago

弱弱的问一句,联网功能,模型目前只支持 gpt-3.5-turbo-0613 吗?gpt-4 是否支持呢?

目前插件功能是基于 OpenAI 的 0613 版本模型的 Function calling 功能实现的,所有 OpenAI 的 0613 版本模型(包括:gpt-4-0613 gpt-4-32k-0613 gpt-3.5-turbo-0613 等等)均支持该功能。 后面会使用 LangChain 的其它类型 Agent 来实现非 0613 模型的插件调用,不过考虑到效果和 Token 消耗,还是推荐使用 0613 版本模型来使用插件。

可以参考该文章:https://openai.com/blog/function-calling-and-other-api-updates

Hk-Gosuto commented 1 year ago

相关问题均已解决,请更新代码到最新。

Issues-translate-bot commented 1 year ago

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


Related issues have been resolved, please update the code to the latest.