Node for the coder agent that executes Python code.
(state: State)
| 41 | |
| 42 | |
| 43 | def 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 | |
| 64 | def browser_node(state: State) -> Command[Literal["supervisor"]]: |
nothing calls this directly
no outgoing calls
no test coverage detected