16 Commits

Author SHA1 Message Date
Silvano Cerza
0df379e6a2
feat: Deprecate @component decorator is_greedy argument (#8400)
* Deprecate @component decorator is_greedy argument

* Fix some typos and docstrings

* Add _is_lazy_variadic test
2024-09-25 11:28:30 +02:00
Madeesh Kannan
b22014b915
fix: Prevent set_output_types from being called when the output_types decorator is used (#8376) 2024-09-18 13:05:31 +02:00
Madeesh Kannan
5071e47843
refactor: Rename Component.async_run to Component.run_async for better readablility (#8370)
Using a suffix will keep names logically sorted, less noisy and relegate the async aspect to an implementation/API detail.
2024-09-17 10:10:34 +00:00
Madeesh Kannan
672bcf7e03
fix: Add constraints to set_input_type(s) based on run method (#8358)
* fix: Prevent the usage of `set_input_type(s)` when the `run` method doesn't have kwargs,
raise if `set_input_type(s)` overrides `run` method parameters

* fix: update components and tests

* reno
2024-09-12 15:58:16 +02:00
Madeesh Kannan
f0b45c873f
feat: Extend core component machinery to support an async run method (experimental) (#8279)
* feat: Extend core component machinery to support an async run method

* Add reno

* Fix incorrect docstring

* Make `async_run` a coroutine

* Make `supports_async` a dunder field
2024-08-27 14:20:13 +02:00
Massimiliano Pippi
10c675d534
chore: add license header to all modules (#7675)
* add license header to modules
* check license header at linting time
2024-05-09 13:40:36 +00:00
Madeesh Kannan
b1760add56
feat: Add support for pipeline deserialization callbacks (#7518)
* feat: Add support for deserialization callbacks

* Lint

* Fix type hint for older Python versions

* Apply suggestions from code review

Co-authored-by: Silvano Cerza <3314350+silvanocerza@users.noreply.github.com>

* Lint

---------

Co-authored-by: Silvano Cerza <3314350+silvanocerza@users.noreply.github.com>
2024-04-10 17:47:14 +02:00
Silvano Cerza
d6597952a2
fix: Update Component protocol to fix some type checking issues (#7270)
* Update Component protocol to fix some type checking issues

* Add release notes

* Fix logline in test

* Fix run type definition
2024-03-01 10:56:47 +01:00
Tobias Wochinger
fe0ac5c4a2
chore: enforce kwarg logging (#7207)
* chore: add logger which eases logging of extras

* chore: start migrating to key value

* fix: import fixes

* tests: temporarily comment out breaking test

* refactor: move to kwarg based logging

* style: fix import order

* chore: implement self-review comments

* test: drop failing test

* chore: fix more import orders

* docs: add changelog

* tests: fix broken tests

* chore: fix getting the frames

* chore: add comment

* chore: cleanup

* chore: adapt remaining `%s` usages
2024-02-29 14:31:20 +01:00
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
Silvano Cerza
2f965fb176
feat: Add __repr__ method to all Components (#6927)
* Add __repr__ to show Component I/O

* Add release notes

* Change Component repr to show full module path and name in Pipeline

* Fix linting
2024-02-08 11:46:10 +01:00
Silvano Cerza
0191b1e6e4
feat: Change Component's I/O dunder type (#6916)
* Add Pipeline.get_component_name() method

* Add utility class to ease discoverability of Component I/O

* Move InputOutput in component package

* Rename InputOutput to _InputOutput

* Raise if inputs or outputs field already exist

* Fix tests

* Add release notes

* Move InputSocket and OutputSocket in types package

* Move _InputOutput in socket package

* Rename _InputOutput class to Sockets

* Simplify Sockets class

* Dictch I/O dunder fields in favour of inputs and outputs fields

* Update Sockets docstrings

* Update release notes

* Fix mypy

* Remove unnecessary assignment

* Remove unused logging

* Change SocketsType to SocketsIOType to avoid confusion

* Change sockets type and name

* Change Sockets.__repr__ to return component instance

* Fix linting

* Fix sockets tests

* Revert to dunder fields for Component IO

* Use singular in IO dunder fields

* Delete release notes

* Update haystack/core/component/types.py

Co-authored-by: Massimiliano Pippi <mpippi@gmail.com>

---------

Co-authored-by: Massimiliano Pippi <mpippi@gmail.com>
2024-02-05 17:46:45 +01:00
Silvano Cerza
f5e61338ba
chore: Remove all mentions of Canals (#6844)
* Remove unnecessary Connection class

* Remove all mentions of canals

* Add release notes
2024-01-29 17:26:11 +01:00
Madeesh Kannan
4647f2a506
fix: ComponentMeta.__call__ handles keyword- and positional-only parameters correctly (#6701)
* fix: `ComponentMeta.__call__` handles keyword- and positional-only parameters correctly

* Update release note
2024-01-12 17:16:03 +01:00
Massimiliano Pippi
9ace6bf63d
feat: store input's default value in InputSocket (#6651)
* track default value in sockets

* remove dead code

* include default value in socket description

* add unit test

* add relnote

* unused import

* clarify
2024-01-09 12:17:46 +01:00
Massimiliano Pippi
00e1dd6eb8
chore: rearrange the core package, move tests and clean up (#6427)
* rearrange code

* fix tests

* relnote

* merge test modules

* remove extra

* rearrange draw tests

* forgot

* remove unused import
2023-11-28 09:58:56 +01:00