Skip to content

Commit 521179d

Browse files
committed
add read_all method for text streams
1 parent 585a220 commit 521179d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

livekit-rtc/livekit/rtc/data_stream.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@ async def __anext__(self) -> TextStreamUpdate:
9595
def info(self) -> TextStreamInfo:
9696
return self._info
9797

98+
async def read_all(self) -> str:
99+
final_string = ""
100+
async for update in self:
101+
final_string = update.collected
102+
return final_string
103+
98104

99105
@dataclass
100106
class FileStreamInfo(BaseStreamInfo):

0 commit comments

Comments
 (0)