[Python] Human in the loop to work in both Langgraph studio and CLI based

Discussão em 'Python' iniciado por Stack, Julho 22, 2025.

  1. Stack

    Stack Membro Participativo

    I have a LangGraph agent from a Python shell script, and I expose it as a Typer command to be executed from the command line. Everything works fine. But now I want to add a human in the loop as one node. The problem is if I add input("Enter yes or no"), then it works in CLI but not in LangGraph Studio. And if I use from langgraph.types import interrupt, interrupt("Enter yes or no"), it works in LangGraph Studio but not in CLI. Is there any way I can make it work in both modes?

    Continue reading...

Compartilhe esta Página