acheong08/ChatGPT

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

yungangwu opened this issue · 3 comments

Is there an existing issue for this?

  • I have searched the existing issues and checked the recent builds/commits

What would your feature do ?

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

Proposed workflow

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

Additional information

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

cx9208 commented

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