From ec4c773c8033261c307320e2eb8caf3bb87d31a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=90=8C=E8=B4=B5?= Date: Tue, 8 Aug 2023 18:26:15 +0800 Subject: [PATCH] adjust "timeout" config param into _cons_kwargs --- metagpt/provider/openai_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metagpt/provider/openai_api.py b/metagpt/provider/openai_api.py index 20013edf4..b842eb54b 100644 --- a/metagpt/provider/openai_api.py +++ b/metagpt/provider/openai_api.py @@ -149,7 +149,6 @@ class OpenAIGPTAPI(BaseGPTAPI, RateLimiter): async def _achat_completion_stream(self, messages: list[dict]) -> str: response = await openai.ChatCompletion.acreate( **self._cons_kwargs(messages), - timeout=3, stream=True ) @@ -189,6 +188,7 @@ class OpenAIGPTAPI(BaseGPTAPI, RateLimiter): "stop": None, "temperature": 0.3 } + kwargs["timeout"] = 3 return kwargs async def _achat_completion(self, messages: list[dict]) -> dict: