Skip to content

Commit a74d065

Browse files
Set default value an empty array
Signed-off-by: Luis Valdes <[email protected]>
1 parent 5c7a1ca commit a74d065

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

typescript-sdk/integrations/langgraph/examples/python/agents/agentic_chat/agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ async def chat_node(state: AgentState, config: Optional[RunnableConfig] = None):
4141
# 2. Bind the tools to the model
4242
model_with_tools = model.bind_tools(
4343
[
44-
*state["tools"],
44+
*state.get("tools", []),
4545
# your_tool_here
4646
],
4747

typescript-sdk/integrations/langgraph/examples/python/agents/agentic_chat_reasoning/agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ async def chat_node(state: AgentState, config: Optional[RunnableConfig] = None):
5252
# 2. Bind the tools to the model
5353
model_with_tools = model.bind_tools(
5454
[
55-
*state["tools"],
55+
*state.get("tools", []),
5656
# your_tool_here
5757
],
5858
)

typescript-sdk/integrations/langgraph/examples/python/agents/agentic_generative_ui/agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ async def chat_node(state: AgentState, config: Optional[RunnableConfig] = None):
9999
# Bind the tools to the model
100100
model_with_tools = model.bind_tools(
101101
[
102-
*state["tools"],
102+
*state.get("tools", []),
103103
generate_task_steps_generative_ui
104104
],
105105
# Disable parallel tool calls to avoid race conditions

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ async def chat_node(state: AgentState, config: Optional[RunnableConfig] = None):
9191
# Bind the tools to the model
9292
model_with_tools = model.bind_tools(
9393
[
94-
*state["tools"],
94+
*state.get("tools", []),
9595
plan_execution_steps
9696
],
9797
# Disable parallel tool calls to avoid race conditions

typescript-sdk/integrations/langgraph/examples/python/agents/predictive_state_updates/agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ async def chat_node(state: AgentState, config: Optional[RunnableConfig] = None):
8383
# Bind the tools to the model
8484
model_with_tools = model.bind_tools(
8585
[
86-
*state["tools"],
86+
*state.get("tools", []),
8787
write_document_local
8888
],
8989
# Disable parallel tool calls to avoid race conditions

typescript-sdk/integrations/langgraph/examples/python/agents/shared_state/agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ async def chat_node(state: Dict[str, Any], config: RunnableConfig):
177177
# Bind the tools to the model
178178
model_with_tools = model.bind_tools(
179179
[
180-
*state["tools"],
180+
*state.get("tools", []),
181181
generate_recipe
182182
],
183183
# Disable parallel tool calls to avoid race conditions

0 commit comments

Comments
 (0)