mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-09-22 01:25:06 +02:00
x
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user