File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -606,7 +606,7 @@ async def append_message_stream(self, message: Iterable[Any] | AsyncIterable[Any
606606 # Run the stream in the background to get non-blocking behavior
607607 @reactive .extended_task
608608 async def _stream_task ():
609- await self ._append_message_stream (message )
609+ return await self ._append_message_stream (message )
610610
611611 _stream_task ()
612612
@@ -619,6 +619,8 @@ async def _handle_error():
619619 await self ._raise_exception (e )
620620 _handle_error .destroy () # type: ignore
621621
622+ return _stream_task
623+
622624 async def _append_message_stream (self , message : AsyncIterable [Any ]):
623625 id = _utils .private_random_id ()
624626
@@ -628,6 +630,7 @@ async def _append_message_stream(self, message: AsyncIterable[Any]):
628630 try :
629631 async for msg in message :
630632 await self ._append_message (msg , chunk = True , stream_id = id )
633+ return self ._current_stream_message
631634 finally :
632635 await self ._append_message (empty , chunk = "end" , stream_id = id )
633636 await self ._flush_pending_messages ()
You can’t perform that action at this time.
0 commit comments