chatgpt-web icon indicating copy to clipboard operation
chatgpt-web copied to clipboard

连续对话时存在大量重复的上下文消耗token

Open tastypear opened this issue 2 years ago • 11 comments

环境:本地Docker + 服务器自建BASE_URL

改造代理接口时,通过 PHP file_get_contents("php://input");获取 chatgpt-web 的 POST 信息,通过打印发现,从第三句对话开始出现大量重复的上下文。

21426 21235

tastypear avatar Mar 12 '23 18:03 tastypear

_20230313100821 把这个点掉就好了,

tjsky avatar Mar 13 '23 02:03 tjsky

#553 可以增加个这个功能

devyujie avatar Mar 13 '23 03:03 devyujie

_20230313100821 把这个点掉就好了,

我知道是连续对话触发的,但为什么会包含那么多次?

tastypear avatar Mar 13 '23 03:03 tastypear

_20230313100821 把这个点掉就好了,

不是这个问题,打开了连续对话,每条历史记录应该只携带一次,不应该在一次对话请求中重复这么多次。

Cp0204 avatar Mar 13 '23 03:03 Cp0204

#553 可以增加个这个功能

这个issue提的不是system prompt问题,是Cp0204说的,连续对话时重复携带历史记录。 不止是消耗几十倍的token,还刷掉了旧的上下文记忆。

tastypear avatar Mar 13 '23 05:03 tastypear

这个问题我清楚,因为使用了 access_token 的原因,不能对 API 形式做最大的优化,只能使用 chatgpt 折中的办法,但是现在又不能把这个模式去掉,不然对话要做大量的判断。

Chanzhaoyu avatar Mar 14 '23 00:03 Chanzhaoyu

这个问题我清楚,因为使用了 access_token 的原因,不能对 API 形式做最大的优化,只能使用 chatgpt 折中的办法,但是现在又不能把这个模式去掉,不然对话要做大量的判断。

不是很理解逻辑上有什么难度,分开判断可以吗。用API的时候,只携带prompt+最后x条对话。

Cp0204 avatar Mar 14 '23 02:03 Cp0204

access_token模式也要消耗token了吗?

crosys avatar Mar 14 '23 02:03 crosys

access_token模式也要消耗token了吗?

不用

Chanzhaoyu avatar Mar 14 '23 02:03 Chanzhaoyu

https://github.com/WenJing95/chatgpt-web 这个大佬的实现还挺好的,希望作者后期可以升级加入改进功能!

wejudging avatar Mar 14 '23 03:03 wejudging

这个问题我清楚,因为使用了 access_token 的原因,不能对 API 形式做最大的优化,只能使用 chatgpt 折中的办法,但是现在又不能把这个模式去掉,不然对话要做大量的判断。

问题是从结果上看,发送第3条内容时,第1条user prompt已经不在上下文中了,也就说只”连续对话“了1句。

tastypear avatar Mar 14 '23 04:03 tastypear