From 01b1080b6e3b1f26696f040a7b30e0a45f21dfe5 Mon Sep 17 00:00:00 2001 From: Eugene Yurtsev Date: Thu, 5 Dec 2024 17:26:55 -0500 Subject: [PATCH] x --- docs/docs/concepts/human_in_the_loop.md | 12 ++++++++---- docs/docs/concepts/low_level.md | 3 +-- libs/langgraph/langgraph/types.py | 1 - 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/docs/docs/concepts/human_in_the_loop.md b/docs/docs/concepts/human_in_the_loop.md index 32cf7582b..cffa910a6 100644 --- a/docs/docs/concepts/human_in_the_loop.md +++ b/docs/docs/concepts/human_in_the_loop.md @@ -18,17 +18,21 @@ Persistence allows pausing graph execution so that a human can review and / or e ## Breakpoints -Breakpoints allow **pausing** graph execution to allow for human review before **resuming** execution. This functionality is enabled by LangGraph's built-in [checkpointer](./persistence.md#checkpointer), which writes a checkpoint of the graph state at each step. +Breakpoints allow **pausing** graph execution to allow for human review before **resuming** execution. This functionality is enabled by LangGraph's built-in [checkpointer](./persistence.md), which writes a checkpoint of the graph state at each step. -There are two types of breakpoints: +You have a few options for setting breakpoints: -1. [**Static breakpoints**](#static-breakpoints): Pause the graph **before** or **after** a node executes. -2. [**Dynamic breakpoints**](#dynamic-breakpoints): Pause the graph from **inside** a node often based on some condition. +1. [**Using the `interrupt` function**](./#interrupts): Pause the graph **inside** a node. +2. [**Static breakpoints**](#static-breakpoints): Pause the graph **before** or **after** a node executes. +3. [**Dynamic breakpoints**](#dynamic-breakpoints): Pause the graph from **inside** typically based on a condition. !!! important "Checkpointer Required" You must compile your graph with a checkpointer to use breakpoints. + +### `Interrupt` function + ### Static Breakpoints Use static breakpoints if you want to **ALWAYS** pause the graph either **before** or **after** one or more nodes execute. diff --git a/docs/docs/concepts/low_level.md b/docs/docs/concepts/low_level.md index 6080c7d58..b05867cd6 100644 --- a/docs/docs/concepts/low_level.md +++ b/docs/docs/concepts/low_level.md @@ -458,8 +458,7 @@ There are two types of breakpoints: 1. **Static breakpoints**: Pause the graph **before** or **after** a node executes. This is achieved by specifying the `interrupt_before` and `interrupt_after` keys when [compiling your graph](#compiling-your-graph). 2. **Dynamic breakpoints**: Pause the graph from **inside** a node. This is achieved by using the `interrupt` function or raising a `NodeInterrupt` exception. -Please see the [Human-in-the-Loop guide](../human_in_the_loop) for conceptual information about breakpoints. - +Please see the [Human-in-the-Loop guide](../human_in_the_loop) for information about breakpoints. ## Subgraphs diff --git a/libs/langgraph/langgraph/types.py b/libs/langgraph/langgraph/types.py index 8853a501d..0b0bf83a0 100644 --- a/libs/langgraph/langgraph/types.py +++ b/libs/langgraph/langgraph/types.py @@ -412,7 +412,6 @@ def interrupt(value: Any) -> Any: {'node': {'human_value': 'some input from a human!!!'}} ``` - Args: value: The value to surface to the client when the graph is interrupted.