jina-ai / thinkgpt

Agent techniques to augment your LLM and push it beyong its limits
Apache License 2.0
1.53k stars 134 forks source link

Allow the user to override request_timeout #6

Closed muellerberndt closed 1 year ago

muellerberndt commented 1 year ago

ChatOpenAI has an argument called request_timeout that's set to 60 seconds per default. This is too little for complex GPT-4 responses. Consequently MicroGPT runs into timeouts.

% python microgpt.py "Create a 3D animation of the Earth using an Earth map downloaded from the Internet as a texture." 
Working directory is /Users/bernhardmueller/microgpt
MicroGPT: Search for an Earth map texture to be used in the 3D animation.
Cmd: web_search, Arg: "Earth map texture"
Press enter to perform this action or abort by typing feedback: 
MicroGPT: Found a high-resolution Earth texture map.
Cmd: web_scrape, Arg: "http://planetpixelemporium.com/earth8081.html"
Press enter to perform this action or abort by typing feedback: 
/Retrying langchain.chat_models.openai.ChatOpenAI.completion_with_retry.<locals>._completion_with_retry in 1.0 seconds as it raised Timeout: Request timed out: HTTPSConnectionPool(host='api.openai.com', port=443): Read timed out. (read timeout=60).
-Retrying langchain.chat_models.openai.ChatOpenAI.completion_with_retry.<locals>._completion_with_retry in 2.0 seconds as it raised Timeout: Request timed out: HTTPSConnectionPool(host='api.openai.com', port=443): Read timed out. (read timeout=60).
\Retrying langchain.chat_models.openai.ChatOpenAI.completion_with_retry.<locals>._completion_with_retry in 4.0 seconds as it raised Timeout: Request timed out: HTTPSConnectionPool(host='api.openai.com', port=443): Read timed out. (read timeout=60).

Desired behaviour

Allow the user to override request_timeout when initializing the ThinkGPT instance.

alaeddine-13 commented 1 year ago

should be fixed by commit https://github.com/alaeddine-13/thinkgpt/commit/95e2792d71e0b4418b0cf0cc8c39ab5be326474f