Maxuss / chatgpt_rs

OpenAI's ChatGPT API wrapper for Rust 🦀
MIT License
151 stars 39 forks source link

use connect_timeout instead of timeout #74

Closed bagindo closed 11 months ago

bagindo commented 11 months ago

timeout is applied from when the request starts connecting until the response body has finished.

this will break streaming response that takes longer than the default 10s timeout.

bagindo commented 11 months ago

although this will leave the request hanging if the internet is turned off after the connection is made. I've tried using both connect_timeout and pool_idle_timeout, and it doesn't work.

seems the only solution is to increase the default timeout to afford a long gpt response.