acheong08 / ChatGPT

Reverse engineered ChatGPT API
GNU General Public License v2.0
28.01k stars 4.48k forks source link

[Feature Request]: 希望项目能将是否发送历史记录作为一个初始的,或者每次ask的接口暴露出来 #1417

Closed yungangwu closed 1 year ago

yungangwu commented 1 year ago

Is there an existing issue for this?

What would your feature do ?

我在调用chatgpt-api时处理数据时,发小token消耗数量异常,经查发现是每次都将之前的历史记录发送过去,但是在我的处理场景中并不需要发送这些历史数据,因此,希望最后能将是否发送历史记录作为一个可选择的接口暴露出来,这样能大大减少不必要的token消耗。

Proposed workflow

  1. 在初始化,或者ask函数中添加一个forget_history参数,默认是False,可选为True

Additional information

acheong08 commented 1 year ago

I'm assuming this is for V3. This is how the official API operates. You can reset the conversation after every call to clear the history

yungangwu commented 1 year ago

是的,针对v3,我目前的解决办法是手动reset,但是感觉官方把这个选项暴露出来更好-

---原始邮件--- 发件人: "Antonio @.> 发送时间: 2023年6月13日(周二) 晚上7:01 收件人: @.>; 抄送: @.**@.>; 主题: Re: [acheong08/ChatGPT] [Feature Request]: 希望项目能将是否发送历史记录作为一个初始的,或者每次ask的接口暴露出来 (Issue #1417)

I'm assuming this is for V3. This is how the official API operates. You can reset the conversation after every call to clear the history

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

cx9208 commented 1 year ago

你可以用openai官方库openai-python,那个不会附带历史消息