chatgpt-web icon indicating copy to clipboard operation
chatgpt-web copied to clipboard

优化建议service中的Content-type

Open diudiudiuu opened this issue 1 year ago • 4 comments

# 现在的
res.setHeader('Content-type', 'application/octet-stream')

# 修改后的
res.setHeader('Content-type', 'text/event-stream; charset=utf-8')

diudiudiuu avatar Mar 07 '23 07:03 diudiudiuu

这样做的好处是不会乱码吗?

ludashi2020 avatar Mar 07 '23 07:03 ludashi2020

application/octet-stream

SSE 稍微好点,后面的流式其实数据返回处理是指数级别的

diudiudiuu avatar Mar 07 '23 07:03 diudiudiuu

感谢提醒,这个计划是要改的~

Chanzhaoyu avatar Mar 07 '23 08:03 Chanzhaoyu

刚刚看了一下,chat.openai.com就是text/event-stream

ludashi2020 avatar Mar 07 '23 08:03 ludashi2020

你好请问下现在能处理返回的SSE了吗

heifree avatar Aug 24 '23 03:08 heifree

@Chanzhaoyu 我看目前 master 代码,还是用的 application/octet-stream,不是 SSE,不用 SSE 的考虑是什么呢,两者有什么差异吗

imcuttle avatar Feb 21 '24 05:02 imcuttle