Open hedleyroos opened 1 year ago
Calls like https://github.com/minimaxir/simpleaichat/blob/main/simpleaichat/chatgpt.py#L311 may cause us to wait very long for a response. Things go wrong with networks and OpenAI, and the call will only be terminated when the TCP timeout limit is reached and the socket destroyed.
The code already retrieves the OpenAI API key from an env var, so perhaps the same approach can be used for timeouts?
Calls like https://github.com/minimaxir/simpleaichat/blob/main/simpleaichat/chatgpt.py#L311 may cause us to wait very long for a response. Things go wrong with networks and OpenAI, and the call will only be terminated when the TCP timeout limit is reached and the socket destroyed.
The code already retrieves the OpenAI API key from an env var, so perhaps the same approach can be used for timeouts?