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

Function _materialize_node

masfactory/compatibility/langflow/materialize.py:159–187  ·  view source on GitHub ↗
(
    owner: OwnerGraph,
    ext,
    options: LangflowCompileOptions,
    *,
    graph_name: str,
)

Source from the content-addressed store, hash-verified

157
158
159def _materialize_node(
160 owner: OwnerGraph,
161 ext,
162 options: LangflowCompileOptions,
163 *,
164 graph_name: str,
165) -> Node:
166 kind = ext.kind
167 if kind in CHAT_INPUT_KINDS:
168 forward = _make_chat_input_forward(ext.id, ext, owner)
169 elif kind in CHAT_OUTPUT_KINDS:
170 forward = _make_chat_output_forward(ext.id, owner)
171 elif kind in PROMPT_KINDS:
172 forward = _make_prompt_forward(ext.id, ext, owner)
173 elif kind in LLM_KINDS:
174 forward = _make_llm_forward(ext.id, ext, owner, options)
175 else:
176 forward = _make_passthrough_forward(ext.id, owner)
177
178 return owner.create_node(
179 CustomNode,
180 name=graph_name,
181 forward=forward,
182 attributes={
183 "langflow_id": ext.id,
184 "langflow_kind": kind,
185 "langflow_label": ext.label,
186 },
187 )
188
189
190def _wire_subgraph(

Callers 2

_compile_loop_subgraphFunction · 0.70

Calls 6

_make_chat_input_forwardFunction · 0.85
_make_prompt_forwardFunction · 0.85
create_nodeMethod · 0.80
_make_llm_forwardFunction · 0.70

Tested by

no test coverage detected