Deeptrain-Community / chatnio

🚀 Next Generation AI One-Stop Internationalization Solution. 🚀 下一代 AI 一站式 B/C 端解决方案,支持 OpenAI,Midjourney,Claude,讯飞星火,Stable Diffusion,DALL·E,ChatGLM,通义千问,腾讯混元,360 智脑,百川 AI,火山方舟,新必应,Gemini,Moonshot 等模型,支持对话分享,自定义预设,云端同步,模型市场,支持弹性计费和订阅计划模式,支持图片解析,支持联网搜索,支持模型缓存,丰富美观的后台管理与仪表盘数据统计。
https://chatnio.com
Apache License 2.0
2.71k stars 446 forks source link

Implement Timeout Configuration for Response and Stream Waiting #175

Closed xgen20 closed 5 days ago

xgen20 commented 2 months ago

I suggest implementing the ability to configure the timeout for waiting for a response and waiting for a response stream. Because in my case, it's not always enough to receive a response from GPT-4 (chat to API version). The response sometimes takes 2+ minutes to write, and the Сhat Nio stops processing the stream after 1-2 minutes. And if the API doesn't send anything at all, it resets the request after 20+ seconds and makes a new attempt. I would like to have the ability to adjust this parameter for each channel, as well as the parameter for the maximum waiting time for the stream.

zmh-program commented 2 months ago

good suggestion, consider implementing

zmh-program commented 1 week ago

The Chat Nio Pro is already supported, waiting for @Sh1n3zZ to release the open source version.

Support Setting Http Timeout: set env MAX_TIMEOUT=30 to set http timeout to 30s.

https://github.com/Deeptrain-Community/chatnio-pro/commit/0bec4a78ec275fb9abd52ac87b38e44a5aae086d

Sh1n3zZ commented 5 days ago

Hi,

Completed.

Regards, Junhai Deng