Currently, input sockets are read from the set_input_types call only, and therefore all count as mandatory. However, one may want to still specify defaults for non-dynamic inputs, such as what PromptBuilder does now:
This PR makes the signature above work by reading the signature of run() even when __canals_inputs__ already exists, and makes sure to add additional sockets and to check whether they have defaults.
It also adds a sample component showing this signature (FString, similar to PromptBuilder), unit tests for it, and a small integration test with a Pipeline using such component.
Follow up of https://github.com/deepset-ai/canals/pull/148
Currently, input sockets are read from the
set_input_types
call only, and therefore all count as mandatory. However, one may want to still specify defaults for non-dynamic inputs, such as what PromptBuilder does now:This PR makes the signature above work by reading the signature of
run()
even when__canals_inputs__
already exists, and makes sure to add additional sockets and to check whether they have defaults.It also adds a sample component showing this signature (
FString
, similar toPromptBuilder
), unit tests for it, and a small integration test with a Pipeline using such component.