mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-08 15:05:17 +02:00
Merge pull request #1258 from Wei-Jianan/fix/cstream_not_work
[fix] stream field in llmconfig not work
This commit is contained in:
commit
c20073e4bb
2 changed files with 4 additions and 2 deletions
|
|
@ -74,7 +74,7 @@ class LLMConfig(YamlModel):
|
|||
frequency_penalty: float = 0.0
|
||||
best_of: Optional[int] = None
|
||||
n: Optional[int] = None
|
||||
stream: bool = False
|
||||
stream: bool = True
|
||||
# https://cookbook.openai.com/examples/using_logprobs
|
||||
logprobs: Optional[bool] = None
|
||||
top_logprobs: Optional[int] = None
|
||||
|
|
|
|||
|
|
@ -132,7 +132,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 +146,8 @@ class BaseLLM(ABC):
|
|||
message.append(self._user_msg(msg, images=images))
|
||||
else:
|
||||
message.extend(msg)
|
||||
if stream is None:
|
||||
stream = self.config.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