circlestarzero / EX-chatGPT

Let ChatGPT truly learn how to go online and call APIs! 'EX-ChatGPT' can rival and even surpass NewBing
MIT License
2.01k stars 331 forks source link

上下文记忆 #2

Closed CALMCRAZY closed 1 year ago

CALMCRAZY commented 1 year ago

请教一下,虽然实现了调用API的功能,但失去了上下文记忆?变成单次问答了?

ProblemFactory commented 1 year ago

看起来是这个样子的。我觉得可以在每次prompt里插入之前的对话历史来保留上下文能力。

CALMCRAZY commented 1 year ago

看起来是这个样子的。我觉得可以在每次prompt里插入之前的对话历史来保留上下文能力。

确实,看别人调用gpt-3.5-turbo API的demo也是这么做的。但模型最多处理4096 token,包括输入和输出,这个项目里光是引导chatgpt调用API的prompt已经占用了很多token了,再插入对话历史留给输出的token就寥寥无几了

JamesFlare1212 commented 1 year ago

一种办法是超出token之后把前面的对话概括后再发送,不过这样API燃烧地很快吧。

circlestarzero commented 1 year ago

84B0063BBD491FB5DC75F4E0A331E72C

circlestarzero commented 1 year ago

这个问题解决了

circlestarzero commented 1 year ago

看起来是这个样子的。我觉得可以在每次prompt里插入之前的对话历史来保留上下文能力。

是的,已经这样实现了