MCPcopy Create free account
hub / github.com/Darwin-lfl/langmanus / code_node

Function code_node

src/graph/nodes.py:43–61  ·  view source on GitHub ↗

Node for the coder agent that executes Python code.

(state: State)

Source from the content-addressed store, hash-verified

41
42
43def code_node(state: State) -> Command[Literal["supervisor"]]:
44 """Node for the coder agent that executes Python code."""
45 logger.info("Code agent starting task")
46 result = coder_agent.invoke(state)
47 logger.info("Code agent completed task")
48 logger.debug(f"Code agent response: {result['messages'][-1].content}")
49 return Command(
50 update={
51 "messages": [
52 HumanMessage(
53 content=RESPONSE_FORMAT.format(
54 "coder", result["messages"][-1].content
55 ),
56 name="coder",
57 )
58 ]
59 },
60 goto="supervisor",
61 )
62
63
64def browser_node(state: State) -> Command[Literal["supervisor"]]:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected