MCPcopy Create free account
hub / github.com/BUPT-GAMMA/MASFactory / set_forward

Method set_forward

masfactory/components/custom_node.py:53–67  ·  view source on GitHub ↗

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]])

Source from the content-addressed store, hash-verified

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]):

Callers 6

buildMethod · 0.80
build_gaia_graphFunction · 0.80
create_classroom_graphFunction · 0.80
main.pyFile · 0.80
main.pyFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected