mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-15 11:02:36 +02:00
stop llm stream report if task done
This commit is contained in:
parent
021060d526
commit
ec36d298f0
1 changed files with 2 additions and 2 deletions
|
|
@ -146,14 +146,14 @@ class ResourceReporter(BaseModel):
|
|||
|
||||
async def __aexit__(self, *args, **kwargs):
|
||||
"""Exit the asynchronous streaming callback context."""
|
||||
await self.async_report(None, END_MARKER_NAME)
|
||||
self.is_chunk = False
|
||||
if self.enable_llm_stream:
|
||||
self._llm_task.cancel()
|
||||
self._llm_task = None
|
||||
await self.async_report(None, END_MARKER_NAME)
|
||||
|
||||
async def _llm_stream_report(self, queue: asyncio.Queue):
|
||||
while True:
|
||||
while self.is_chunk:
|
||||
await self.async_report(await queue.get(), "content")
|
||||
|
||||
async def wait_llm_stream_report(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue