haystack/releasenotes/notes/component-greedy-d6630af901e96a4c.yaml
Silvano Cerza f1a6b2a78a
feat: Add is_greedy argument in @component decorator (#7016)
* Add is_greedy argument in @component decorator

* Log warning if Component is greedy and non variadic
2024-02-19 12:43:40 +01:00

13 lines
551 B
YAML

---
features:
- |
Add `is_greedy` argument to `@component` decorator.
This flag will change the behaviour of `Component`s with inputs that have a `Variadic` type
when running inside a `Pipeline`.
Variadic `Component`s that are marked as greedy will run as soon as they receive their first input.
If not marked as greedy instead they'll wait as long as possible before running to make sure they
receive as many inputs as possible from their senders.
It will be ignored for all other `Component`s even if set explicitly.