diff --git a/docs/docs/concepts/breakpoints.md b/docs/docs/concepts/breakpoints.md index f3111d9f8..df510efc0 100644 --- a/docs/docs/concepts/breakpoints.md +++ b/docs/docs/concepts/breakpoints.md @@ -191,7 +191,7 @@ Graph execution can be resumed using the [Command](../reference/types.md#langgra The `Command` primitive provides several options to control and modify the graph's state during resumption: -1. **Pass a value to the `interrupt`**: Provide data, such as a user's response, to the graph using `Command(resume=value)`. Execution resumes from the beginning of the node where the `interrupt` was used, however, this time the `interrupt(...)` call will return the value passed in the `Command(resume=value)` instead of pausing the graph. THe `resume` value is only used when using `interrupt` as a breakpoint. +1. **Pass a value to the `interrupt`**: Provide data, such as a user's response, to the graph using `Command(resume=value)`. Execution resumes from the beginning of the node where the `interrupt` was used, however, this time the `interrupt(...)` call will return the value passed in the `Command(resume=value)` instead of pausing the graph. The `resume` value is only used when using `interrupt` as a breakpoint. ```python # Resume graph execution with the user's input. diff --git a/docs/docs/concepts/human_in_the_loop.md b/docs/docs/concepts/human_in_the_loop.md index 74b6906c8..fd895bece 100644 --- a/docs/docs/concepts/human_in_the_loop.md +++ b/docs/docs/concepts/human_in_the_loop.md @@ -2,7 +2,7 @@ !!! tip "This guide uses the new `interrupt` function." - As of LangGraph 0.2.57, the recommended way to set breakpoints is using the [interrupt](../reference/types.md#langgraph.types.interrupt) function as it significantly simpifies **human-in-the-loop** patterns. Please see the [Breakpoints](breakpoints.md) guide for more information. + As of LangGraph 0.2.57, the recommended way to set breakpoints is using the [interrupt](../reference/types.md#langgraph.types.interrupt) function as it significantly simplifies **human-in-the-loop** patterns. Please see the [Breakpoints](breakpoints.md) guide for more information. If you're looking for the previous version of this conceptual guide, which relied on static breakpoints and `NodeInterrupt` exception, it is available [here](v0-human-in-the-loop.md). @@ -164,15 +164,15 @@ def human_review_node(state) -> Command[Literal["call_llm", "run_tool"]]: review_action, review_data = human_review # Approve the tool call and continue - if review_data == "approve": + if review_action == "continue": return Command(goto="run_tool") # Modify the tool call manually and then continue elif review_action == "update": ... updated_msg = get_updated_msg(review_data) - # Remember that modify an existing message you will need - # pass the message with a matching ID. + # Remember that to modify an existing message you will need + # to pass the message with a matching ID. return Command(goto="run_tool", update={"messages": [updated_message]}) # Give natural language feedback, and then pass that back to the agent diff --git a/docs/docs/how-tos/human_in_the_loop/review-tool-calls.ipynb b/docs/docs/how-tos/human_in_the_loop/review-tool-calls.ipynb index 1c36ca285..d87ee13e5 100644 --- a/docs/docs/how-tos/human_in_the_loop/review-tool-calls.ipynb +++ b/docs/docs/how-tos/human_in_the_loop/review-tool-calls.ipynb @@ -47,7 +47,7 @@ " review_action, review_data = human_review\n", " \n", " # Approve the tool call and continue\n", - " if review_data == \"approve\":\n", + " if review_action == \"continue\":\n", " return Command(goto=\"run_tool\")\n", " \n", " # Modify the tool call manually and then continue\n", @@ -101,7 +101,7 @@ "metadata": {}, "outputs": [ { - "name": "stdin", + "name": "stdout", "output_type": "stream", "text": [ "ANTHROPIC_API_KEY: ········\n" diff --git a/docs/docs/how-tos/human_in_the_loop/wait-user-input.ipynb b/docs/docs/how-tos/human_in_the_loop/wait-user-input.ipynb index 6142030cd..5805447bc 100644 --- a/docs/docs/how-tos/human_in_the_loop/wait-user-input.ipynb +++ b/docs/docs/how-tos/human_in_the_loop/wait-user-input.ipynb @@ -177,7 +177,7 @@ "id": "ce0fe2bc-86fc-465f-956c-729805d50404", "metadata": {}, "source": [ - "Run until our breakpoint at `human_feedback` - " + "Run until our breakpoint at `human_feedback`:" ] }, { @@ -219,7 +219,7 @@ "id": "28a7d545-ab19-4800-985b-62837d060809", "metadata": {}, "source": [ - "Now, we can just manually update our graph state with with the user input - " + "Now, we can manually update our graph state with the user input:" ] }, { @@ -485,8 +485,6 @@ } ], "source": [ - "from langchain_core.messages import HumanMessage\n", - "\n", "config = {\"configurable\": {\"thread_id\": \"2\"}}\n", "for event in app.stream(\n", " {\n",