Skip to content

Commit e2832bb

Browse files
committed
Address review: consistent v2 API, unique thread_id, SDK prereq note
1 parent ee781cd commit e2832bb

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

langgraph_plugin/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ Samples are organized by API style:
1919

2020
## Prerequisites
2121

22+
> **Note:** These samples require the LangGraph plugin from [sdk-python#1448](https://github.com/temporalio/sdk-python/pull/1448), which has not been released yet. They will not be runnable until the SDK is published with the `temporalio[langgraph]` extra.
23+
2224
1. Install dependencies:
2325

2426
```bash

langgraph_plugin/graph_api/human_in_the_loop/workflow.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ def get_draft(self) -> str | None:
6060
@workflow.run
6161
async def run(self, user_message: str) -> str:
6262
g = graph("chatbot").compile(checkpointer=InMemorySaver())
63-
config = RunnableConfig({"configurable": {"thread_id": "1"}})
63+
config = RunnableConfig(
64+
{"configurable": {"thread_id": workflow.info().workflow_id}}
65+
)
6466

6567
# First invocation: runs generate_draft, then pauses at interrupt()
6668
result = await g.ainvoke(user_message, config, version="v2")
@@ -72,4 +74,7 @@ async def run(self, user_message: str) -> str:
7274
await workflow.wait_condition(lambda: self._human_input is not None)
7375

7476
# Resume the graph with the human's feedback
75-
return await g.ainvoke(Command(resume=self._human_input), config)
77+
resumed = await g.ainvoke(
78+
Command(resume=self._human_input), config, version="v2"
79+
)
80+
return resumed.value

0 commit comments

Comments
 (0)