MCPcopy
hub / github.com/OpenBMB/ChatDev / execute

Method execute

runtime/node/executor/literal_executor.py:14–28  ·  view source on GitHub ↗
(self, node: Node, inputs: List[Message])

Source from the content-addressed store, hash-verified

12 """Emit the configured literal message whenever triggered."""
13
14 def execute(self, node: Node, inputs: List[Message]) -> List[Message]:
15 if node.node_type != "literal":
16 raise ValueError(f"Node {node.id} is not a literal node")
17
18 config = node.as_config(LiteralNodeConfig)
19 if config is None:
20 raise ValueError(f"Node {node.id} missing literal configuration")
21
22 self._ensure_not_cancelled()
23 return [self._build_message(
24 role=config.role,
25 content=config.content,
26 source=node.id,
27 preserve_role=True,
28 )]
29

Callers

nothing calls this directly

Calls 3

_ensure_not_cancelledMethod · 0.80
_build_messageMethod · 0.80
as_configMethod · 0.45

Tested by

no test coverage detected