Check that input socket names passed by the user match the Component's input sockets
(self)
| 158 | self._component.warm_up() |
| 159 | |
| 160 | def _validate_input_sockets(self) -> None: |
| 161 | """Check that input socket names passed by the user match the Component's input sockets""" |
| 162 | # NOTE those are internal attributes, but we expect them be stable. |
| 163 | # reference: https://github.com/deepset-ai/haystack/blob/906177329bcc54f6946af361fcd3d0e334e6ce5f/haystack/core/component/component.py#L371 |
| 164 | component_inputs = self._component.__haystack_input__._sockets_dict.keys() |
| 165 | for socket_name in self._input_socket_mapping.keys(): |
| 166 | if socket_name not in component_inputs: |
| 167 | raise ValueError( |
| 168 | f"Socket `{socket_name}` not found in `Component` inputs: {component_inputs}" |
| 169 | ) |
| 170 | |
| 171 | def _validate_output_sockets(self) -> None: |
| 172 | """Check that output socket names passed by the user match the Component's output sockets""" |