Closed ZanSara closed 1 year ago
I think this should be an utility function, not a method of the class. Same goes for draw
FWIW.
@masci I like having them as methods for a bit of added discoverability (code completion basically) and on top of it, this syntax is identical to Haystack 1.x which can help the users. But I have no problem moving it out. If you confirm I'll move it out.
I slightly changed the style of this PR. I made two methods, one that returns the machine-readable version and one that prints to stdout. Methods implementations was moved into the validation.py
file, because I'm now using the string representation to add information to some error messages as well.
Happy to remove/refactor everything as we see fit, let me know :slightly_smiling_face:
Example of the error message raised by a pipeline that received wrong input:
ValueError: Missing input: comp1.value
This pipeline expects the following inputs:
- comp1:
- value: int
- add: Optional[int]
Related issues
https://github.com/deepset-ai/canals/issues/117
What
Pipeline.inputs()
that describes the input expected by the pipeline both in a human- and machine-friendly way.Example:
For this RAG pipeline, the function returns this dictionary:
and in error messages it prints the following