mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-08-17 21:25:46 +02:00
docs: Fix Example Code Snippet in HITL (#5999)
Description: Fixing the example code snippet at this [url](https://langchain-ai.github.io/langgraph/how-tos/human_in_the_loop/add-human-in-the-loop/#resume-multiple-interrupts-with-one-invocation). Fixes: - i.interrupt_id -> i.id, since interrupt_id is deprecrated - f"human input for prompt {i.value}" -> f"edited text for {i.value['text_to_revise']}", to match the output statement - parent.get_state -> graph.get_state, no variable named parent - get_state(thread_config) -> get_state(config), no variable named thread_config
This commit is contained in:
@@ -366,8 +366,8 @@ result = graph.invoke(
|
||||
|
||||
# Resume with mapping of interrupt IDs to values
|
||||
resume_map = {
|
||||
i.interrupt_id: f"human input for prompt {i.value}"
|
||||
for i in parent.get_state(thread_config).interrupts
|
||||
i.id: f"edited text for {i.value['text_to_revise']}"
|
||||
for i in graph.get_state(config).interrupts
|
||||
}
|
||||
print(graph.invoke(Command(resume=resume_map), config=config))
|
||||
# > {'text_1': 'edited text for original text 1', 'text_2': 'edited text for original text 2'}
|
||||
|
||||
Reference in New Issue
Block a user