Skip to content

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

[fix] use config.stream inside BaseLLM other than global

Wei-Jiananf31d2a198e90
diff --git a/metagpt/provider/base_llm.py b/metagpt/provider/base_llm.py
index f444e32ba..aae00f60d 100644
--- a/metagpt/provider/base_llm.py
+++ b/metagpt/provider/base_llm.py
@@ -22,7 +22,6 @@ from tenacity import (
wait_random_exponential,
)
-from metagpt.config2 import config
from metagpt.configs.llm_config import LLMConfig
from metagpt.const import LLM_API_TIMEOUT, USE_CONFIG_TIMEOUT
from metagpt.logs import logger
@@ -148,7 +147,7 @@ class BaseLLM(ABC):
else:
message.extend(msg)
if stream is None:
- stream = config.llm.stream
+ stream = self.config.stream
logger.debug(message)
rsp = await self.acompletion_text(message, stream=stream, timeout=self.get_timeout(timeout))
return rsp