Skip to content

Commit a1c26f2

Browse files
committed
Add back in process_stream() changes removed by develop rebase
1 parent 244ff73 commit a1c26f2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

nemoguardrails/rails/llm/buffer.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,9 @@ def format_chunks(self, chunks: List[str]) -> str:
114114
...
115115

116116
@abstractmethod
117-
async def process_stream(self, streaming_handler):
117+
async def process_stream(
118+
self, streaming_handler
119+
) -> AsyncGenerator[ChunkBatch, None]:
118120
"""Process streaming chunks and yield chunk batches.
119121
120122
This is the main method that concrete buffer strategies must implement.
@@ -139,7 +141,8 @@ async def process_stream(self, streaming_handler):
139141
... print(f"Processing: {context_formatted}")
140142
... print(f"User: {user_formatted}")
141143
"""
142-
yield ChunkBatch([], []) # pragma: no cover
144+
raise NotImplementedError
145+
yield
143146

144147
async def __call__(self, streaming_handler):
145148
"""Callable interface that delegates to process_stream.

0 commit comments

Comments
 (0)