manateelazycat / mind-wave

Emacs AI plugin based on ChatGPT API
GNU General Public License v3.0
159 stars 25 forks source link

[Enhancement] Can configure to send only latest # history ask/answer to GPT ? #25

Open xqliu opened 1 year ago

xqliu commented 1 year ago

Can configure to send only latest # history ask/answer to GPT ?

To avoid the conversion exceed 4000 token, for example, can have an configuration to send only latest 4 ask/answer info to GTP, and not all the content of a chat file?

Thanks for the package, really very helpful :)

manateelazycat commented 1 year ago

我平常也有很长的回复, 我的理解是 token 只会对最新问的那一条问题有限制。

这个会对所有内容有限制?

倒不是不能做, 而是这样做, 会导致丢失上下文, 这样 ChatGPT 回答的结果就不会很好。

carlos-wong commented 1 year ago

我平常也有很长的回复, 我的理解是 token 只会对最新问的那一条问题有限制。

这个会对所有内容有限制?

倒不是不能做, 而是这样做, 会导致丢失上下文, 这样 ChatGPT 回答的结果就不会很好。

我的用法就是每天有一个 chat 文件,然后就会触发这个问题。因为 mind-wave-get-buffer-string 发送的是整个 buffer 的内容

manateelazycat commented 1 year ago

我平常也有很长的回复, 我的理解是 token 只会对最新问的那一条问题有限制。 这个会对所有内容有限制? 倒不是不能做, 而是这样做, 会导致丢失上下文, 这样 ChatGPT 回答的结果就不会很好。

我的用法就是每天有一个 chat 文件,然后就会触发这个问题。因为 mind-wave-get-buffer-string 发送的是整个 buffer 的内容

  1. 如果只取后面几个问题, 容易丢失前面上下文, 影响 ChatGPT 对上下文的分析
  2. https://github.com/manateelazycat/mind-wave/pull/31#pullrequestreview-1393701882 这样暴力切, 会导致 ‘问题’ 的那里语法破坏掉, chat_parse_content 无法把 buffer content 转换成正常的 json 内容

ChatGPT 网页版太长了也会出问题, 建议正确的做法是:

  1. 新开一个 Chat 文件继续问
  2. 或者编辑当前 Buffer, 去掉一些中间没必要的内容再发送给 ChatGPT