MetaGPT icon indicating copy to clipboard operation
MetaGPT copied to clipboard

stream field in LLMConfig does not work

Open Wei-Jianan opened this issue 1 year ago • 0 comments

Bug description ~/.metagpt/config2.yaml

llm:  
  stream: False

does not affect the way to call llm.aask. Bug solved method

class BaseLLM(ABC):
    async def aask(
        self,
        msg: Union[str, list[dict[str, str]]],
        system_msgs: Optional[list[str]] = None,
        format_msgs: Optional[list[dict[str, str]]] = None,
        images: Optional[Union[str, list[str]]] = None,
        timeout=USE_CONFIG_TIMEOUT,
        stream=None,
    ) -> str:

        if stream is None:
            stream = config.llm.stream
        rsp = await self.acompletion_text(message, stream=stream, timeout=self.get_timeout(timeout))
       

Wei-Jianan avatar May 09 '24 13:05 Wei-Jianan