mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-07-14 16:32:16 +02:00
[fix] stream field in llmconfig not work
This commit is contained in:
parent
f201b2f5f3
commit
8f209bfeb5
3 changed files with 11 additions and 6 deletions
|
|
@ -22,6 +22,7 @@ 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
|
||||
|
|
@ -132,7 +133,7 @@ class BaseLLM(ABC):
|
|||
format_msgs: Optional[list[dict[str, str]]] = None,
|
||||
images: Optional[Union[str, list[str]]] = None,
|
||||
timeout=USE_CONFIG_TIMEOUT,
|
||||
stream=True,
|
||||
stream=None,
|
||||
) -> str:
|
||||
if system_msgs:
|
||||
message = self._system_msgs(system_msgs)
|
||||
|
|
@ -146,6 +147,8 @@ class BaseLLM(ABC):
|
|||
message.append(self._user_msg(msg, images=images))
|
||||
else:
|
||||
message.extend(msg)
|
||||
if stream is None:
|
||||
stream = config.llm.stream
|
||||
logger.debug(message)
|
||||
rsp = await self.acompletion_text(message, stream=stream, timeout=self.get_timeout(timeout))
|
||||
return rsp
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue