Skip to content

🌟 The Multi-Agent Framework: First AI Software Company, Towards Natural Language Programming

Update openai_api.py

better629ba1866f7caf5
diff --git a/metagpt/provider/openai_api.py b/metagpt/provider/openai_api.py
index 3a53a4548..b4f99e69f 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)