From 0271cd7f7715351ce4c9dd4fd38ad37a6064934f Mon Sep 17 00:00:00 2001 From: yzlin Date: Fri, 15 Mar 2024 15:30:42 +0800 Subject: [PATCH] fix repeated api call bug --- 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 8f3b71c42..e99707ab9 100644 --- a/metagpt/provider/openai_api.py +++ b/metagpt/provider/openai_api.py @@ -142,7 +142,7 @@ class OpenAILLM(BaseLLM): async def acompletion_text(self, messages: list[dict], stream=False, timeout=3) -> str: """when streaming, print each token in place.""" if stream: - await self._achat_completion_stream(messages, timeout=timeout) + return await self._achat_completion_stream(messages, timeout=timeout) rsp = await self._achat_completion(messages, timeout=timeout) return self.get_choice_text(rsp)