Skip to content

Commit dcd070b

Browse files
aelisseekibergus
authored andcommitted
Clean-up on window.py re. docstring and unnecessary condition.
PiperOrigin-RevId: 814211589
1 parent 21b27cf commit dcd070b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

genai_processors/core/window.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,8 @@ class Window(Processor):
232232
and mark each as turn_complete.
233233
234234
The output of `window_processor` is propagated to the Window output, but
235-
unlike `LiveProcessor` it is not added to the prompt and not visible to
236-
the consecutive `window_processor` invocations.
235+
unlike `LiveProcessor` it is not kept in the prompt of `window_processor` and
236+
is not visible to the consecutive `window_processor` invocations.
237237
238238
Many instances of `window_processor` may be run concurrently, but their output
239239
will be yielded in order.
@@ -268,7 +268,8 @@ def __init__(
268268
modifies it in place to compress the history.
269269
max_concurrency: The maximum number of concurrent window_processor
270270
invocations. If 0 or less, concurrency is unlimited.
271-
stride: Only process every `stride` window, skipping the rest.
271+
stride: Only process every `stride` window, skipping the rest. Must be
272+
>= 1.
272273
"""
273274
if stride < 1:
274275
raise ValueError('stride must be >= 1')
@@ -310,8 +311,7 @@ async def run_window_processor():
310311

311312
processor.create_task(run_window_processor())
312313

313-
if window_index % self._stride == 0:
314-
await _create_window_task()
314+
await _create_window_task()
315315
window_index += 1
316316

317317
async for part in content:

0 commit comments

Comments
 (0)