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

This commit is contained in:
Wei-Jianan 2024-05-17 11:42:57 +08:00
parent 8f209bfeb5
commit f31d2a198e

View file

@ -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