Grt1228 / chatgpt-steam-output

Open AI ChatGPT流式输出。Open AI Stream output. ChatGPT Stream output.GPT-3.5
458 stars 172 forks source link

流式问答如何做上下文关联,要关联AI的回答 #6

Closed niray closed 1 year ago

niray commented 1 year ago

流式问答如何做上下文关联,要关联AI的回答?

Grt1228 commented 1 year ago

项目支持上下文关联,默认保持连接5分钟,默认上下文保持10个,5分钟无请求上下文会话销毁。 可以自己修改代码,我这个只是个简单的示例项目。可以看下代码: https://github.com/Grt1228/chatgpt-steam-output/blob/main/src/main/java/com/unfbx/chatgptsteamoutput/controller/ChatController.java

niray commented 1 year ago

感谢回答,看见这段代码了,但是这只记录了用户提问的问题,并没有记载AI的回答,所以上下文的效果不好,我想问的是如何记录EventSource生成的回答在Cache中

Grt1228 commented 1 year ago

感谢回答,看见这段代码了,但是这只记录了用户提问的问题,并没有记载AI的回答,所以上下文的效果不好,我想问的是如何记录EventSource生成的回答在Cache中

在linster中自己实现下