Skip to content

Commit 2a4ffa4

Browse files
committed
Fix hitl for fastapi langgraph
1 parent f1c4a28 commit 2a4ffa4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

typescript-sdk/integrations/langgraph/python/ag_ui_langgraph/examples/agents/human_in_the_loop.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
DEFINE_TASK_TOOL = {
2020
"type": "function",
2121
"function": {
22-
"name": "generate_task_steps",
22+
"name": "plan_execution_steps",
2323
"description": "Make up 10 steps (only a couple of words per step) that are required for a task. The step should be in imperative form (i.e. Dig hole, Open door, ...)",
2424
"parameters": {
2525
"type": "object",
@@ -79,7 +79,7 @@ async def chat_node(state: Dict[str, Any], config: RunnableConfig):
7979
"""
8080
system_prompt = """
8181
You are a helpful assistant that can perform any task.
82-
You MUST call the `generate_task_steps` function when the user asks you to perform a task.
82+
You MUST call the `plan_execution_steps` function when the user asks you to perform a task.
8383
Always make sure you will provide tasks based on the user query
8484
"""
8585

@@ -93,7 +93,7 @@ async def chat_node(state: Dict[str, Any], config: RunnableConfig):
9393
# Use "predict_state" metadata to set up streaming for the write_document tool
9494
config["metadata"]["predict_state"] = [{
9595
"state_key": "steps",
96-
"tool": "generate_task_steps",
96+
"tool": "plan_execution_steps",
9797
"tool_argument": "steps"
9898
}]
9999

@@ -130,7 +130,7 @@ async def chat_node(state: Dict[str, Any], config: RunnableConfig):
130130
args = tool_call.get("args", {})
131131
tool_call_args = args if not isinstance(args, str) else json.loads(args)
132132

133-
if tool_call_name == "generate_task_steps":
133+
if tool_call_name == "plan_execution_steps":
134134
# Get the steps from the tool call
135135
steps_raw = tool_call_args.get("steps", [])
136136

@@ -181,7 +181,7 @@ async def chat_node(state: Dict[str, Any], config: RunnableConfig):
181181
}
182182
)
183183

184-
# If no tool calls or not generate_task_steps, return to END with the updated messages
184+
# If no tool calls or not plan_execution_steps, return to END with the updated messages
185185
return Command(
186186
goto=END,
187187
update={

0 commit comments

Comments
 (0)