The problem is likely that you are not giving time for the AI to respond.
A 20 second timeout terminates a non-streaming response before you receive any text, even if the AI is still generating. Then that setting retries uses the internal openai python library retry method to do the same thing (at your expense) and again hang up on the connection before the response is complete.
Besides setting the timeout higher to 120 seconds+:
You should try out, employ, and parse stream:true
API parameter so you can see responses as they are generated and know what the AI is doing.