Set the user forward callable used by this CustomNode. Args: forward: Callable implementing node logic. Supported signatures are: - `(input) -> output` - `(input, attributes) -> output` - `(input, attributes, memories) -> output`
(self,forward:Callable[...,dict[str,object]])
| 51 | self._tools = tools |
| 52 | self._retrievers = retrievers |
| 53 | def set_forward(self,forward:Callable[...,dict[str,object]]): |
| 54 | """Set the user forward callable used by this CustomNode. |
| 55 | |
| 56 | Args: |
| 57 | forward: Callable implementing node logic. Supported signatures are: |
| 58 | - `(input) -> output` |
| 59 | - `(input, attributes) -> output` |
| 60 | - `(input, attributes, memories) -> output` |
| 61 | - `(input, attributes, memories, tools) -> output` |
| 62 | - `(input, attributes, memories, tools, retrievers) -> output` |
| 63 | - `(input, attributes, memories, tools, retrievers, node) -> output` |
| 64 | |
| 65 | Where `input` and `output` are `dict[str, object]`. |
| 66 | """ |
| 67 | self._forward_function = forward |
| 68 | |
| 69 | @masf_hook(Node.Hook.FORWARD) |
| 70 | def _forward(self,input:dict[str,object]): |
no outgoing calls
no test coverage detected