TypeError: StateGraph.add_node() got an unexpected keyword argument 'input_schema' in langgraph/prebuilt/chat_agent_executor.py: #755

Closed
opened 2026-02-20 17:41:36 -05:00 by yindo · 5 comments
Owner

Originally created by @harupy on GitHub (Jun 30, 2025).

Checked other resources

  • This is a bug, not a usage question. For questions, please use GitHub Discussions.
  • I added a clear and detailed title that summarizes the issue.
  • I read what a minimal reproducible example is (https://stackoverflow.com/help/minimal-reproducible-example).
  • I included a self-contained, minimal example that demonstrates the issue INCLUDING all the relevant imports. The code run AS IS to reproduce the issue.

Example Code

-

Error Message and Stack Trace (if applicable)


Description

        # Define a new graph
        workflow = StateGraph(state_schema or AgentState, config_schema=config_schema)
    
        # Define the two nodes we will cycle between
>       workflow.add_node(
            "agent",
            RunnableCallable(call_model, acall_model),
            input_schema=input_schema,
        )
E       TypeError: StateGraph.add_node() got an unexpected keyword argument 'input_schema'

_are_more_steps_needed = <function create_react_agent.<locals>._are_more_steps_needed at 0x7f6c989ff400>
_get_model_input_state = <function create_react_agent.<locals>._get_model_input_state at 0x7f6c989fecb0>
acall_model = <function create_react_agent.<locals>.acall_model at 0x7f6c989fdf30>
agenerate_structured_response = <function create_react_agent.<locals>.agenerate_structured_response at 0x7f6c989fe440>
call_model = <function create_react_agent.<locals>.call_model at 0x7f6c989ffc70>
checkpointer = None
config_schema = None
debug      = False
generate_structured_response = <function create_react_agent.<locals>.generate_structured_response at 0x7f6c989fedd0>
input_schema = <class 'langgraph.prebuilt.chat_agent_executor.AgentState'>
interrupt_after = None
interrupt_before = None
llm_builtin_tools = []
model      = RunnableBinding(bound=FakeOpenAI(client=<openai.resources.chat.completions.completions.Completions object at 0x7f6c988...'enum': ['nyc', 'sf'], 'type': 'string'}}, 'required': ['city'], 'type': 'object'}}}]}, config={}, config_factories=[])
model_runnable = Prompt(tags=None, recurse=True, explode_args=False, func_accepts_config=False, func_accepts={})
| RunnableBinding(boun...'enum': ['nyc', 'sf'], 'type': 'string'}}, 'required': ['city'], 'type': 'object'}}}]}, config={}, config_factories=[])
name       = None
post_model_hook = None
pre_model_hook = None
prompt     = None
response_format = None
should_continue = <function create_react_agent.<locals>.should_continue at 0x7f6c989ff520>
should_return_direct = set()
state_schema = <class 'langgraph.prebuilt.chat_agent_executor.AgentState'>
store      = None
tool_calling_enabled = True
tool_classes = [StructuredTool(name='get_weather', description='Use this to get weather information.', args_schema=<class 'langchain_core.utils.pydantic.get_weather'>, func=<function get_weather at 0x7f6c980bab90>)]
tool_node  = tools(tags=None, recurse=True, explode_args=False, func_accepts_config=True, func_accepts={'store': ('__pregel_store',...te_args={'get_weather': {}}, tool_to_store_arg={'get_weather': None}, handle_tool_errors=True, messages_key='messages')
tools      = [StructuredTool(name='get_weather', description='Use this to get weather information.', args_schema=<class 'langchain_core.utils.pydantic.get_weather'>, func=<function get_weather at 0x7f6c980bab90>)]
version    = 'v2'
workflow   = <langgraph.graph.state.StateGraph object at 0x7f6c986929b0>

/opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/site-packages/langgraph/prebuilt/chat_agent_executor.py:663: TypeError

System Info

Originally created by @harupy on GitHub (Jun 30, 2025). ### Checked other resources - [x] This is a bug, not a usage question. For questions, please use GitHub Discussions. - [x] I added a clear and detailed title that summarizes the issue. - [x] I read what a minimal reproducible example is (https://stackoverflow.com/help/minimal-reproducible-example). - [x] I included a self-contained, minimal example that demonstrates the issue INCLUDING all the relevant imports. The code run AS IS to reproduce the issue. ### Example Code ```python - ``` ### Error Message and Stack Trace (if applicable) ```shell ``` ### Description ``` # Define a new graph workflow = StateGraph(state_schema or AgentState, config_schema=config_schema) # Define the two nodes we will cycle between > workflow.add_node( "agent", RunnableCallable(call_model, acall_model), input_schema=input_schema, ) E TypeError: StateGraph.add_node() got an unexpected keyword argument 'input_schema' _are_more_steps_needed = <function create_react_agent.<locals>._are_more_steps_needed at 0x7f6c989ff400> _get_model_input_state = <function create_react_agent.<locals>._get_model_input_state at 0x7f6c989fecb0> acall_model = <function create_react_agent.<locals>.acall_model at 0x7f6c989fdf30> agenerate_structured_response = <function create_react_agent.<locals>.agenerate_structured_response at 0x7f6c989fe440> call_model = <function create_react_agent.<locals>.call_model at 0x7f6c989ffc70> checkpointer = None config_schema = None debug = False generate_structured_response = <function create_react_agent.<locals>.generate_structured_response at 0x7f6c989fedd0> input_schema = <class 'langgraph.prebuilt.chat_agent_executor.AgentState'> interrupt_after = None interrupt_before = None llm_builtin_tools = [] model = RunnableBinding(bound=FakeOpenAI(client=<openai.resources.chat.completions.completions.Completions object at 0x7f6c988...'enum': ['nyc', 'sf'], 'type': 'string'}}, 'required': ['city'], 'type': 'object'}}}]}, config={}, config_factories=[]) model_runnable = Prompt(tags=None, recurse=True, explode_args=False, func_accepts_config=False, func_accepts={}) | RunnableBinding(boun...'enum': ['nyc', 'sf'], 'type': 'string'}}, 'required': ['city'], 'type': 'object'}}}]}, config={}, config_factories=[]) name = None post_model_hook = None pre_model_hook = None prompt = None response_format = None should_continue = <function create_react_agent.<locals>.should_continue at 0x7f6c989ff520> should_return_direct = set() state_schema = <class 'langgraph.prebuilt.chat_agent_executor.AgentState'> store = None tool_calling_enabled = True tool_classes = [StructuredTool(name='get_weather', description='Use this to get weather information.', args_schema=<class 'langchain_core.utils.pydantic.get_weather'>, func=<function get_weather at 0x7f6c980bab90>)] tool_node = tools(tags=None, recurse=True, explode_args=False, func_accepts_config=True, func_accepts={'store': ('__pregel_store',...te_args={'get_weather': {}}, tool_to_store_arg={'get_weather': None}, handle_tool_errors=True, messages_key='messages') tools = [StructuredTool(name='get_weather', description='Use this to get weather information.', args_schema=<class 'langchain_core.utils.pydantic.get_weather'>, func=<function get_weather at 0x7f6c980bab90>)] version = 'v2' workflow = <langgraph.graph.state.StateGraph object at 0x7f6c986929b0> /opt/hostedtoolcache/Python/3.10.16/x64/lib/python3.10/site-packages/langgraph/prebuilt/chat_agent_executor.py:663: TypeError ``` ### System Info -
yindo added the bugpending labels 2026-02-20 17:41:36 -05:00
yindo closed this issue 2026-02-20 17:41:36 -05:00
Author
Owner

@harupy commented on GitHub (Jun 30, 2025):

Never mind.

@harupy commented on GitHub (Jun 30, 2025): Never mind.
Author
Owner

@lsimone commented on GitHub (Jun 30, 2025):

Never mind.

@harupy I run into the same problem: how did you solve?

@lsimone commented on GitHub (Jun 30, 2025): > Never mind. @harupy I run into the same problem: how did you solve?
Author
Owner

@johnfrommartin commented on GitHub (Jun 30, 2025):

@harupy am facing the same issue, could you elaborate what you did to resolve this?

@johnfrommartin commented on GitHub (Jun 30, 2025): @harupy am facing the same issue, could you elaborate what you did to resolve this?
Author
Owner

@johnfrommartin commented on GitHub (Jun 30, 2025):

@lsimone try upgrading your langgraph version to 0.5.0, there are some code clean up changes related to the ìnput_schema`key.

@johnfrommartin commented on GitHub (Jun 30, 2025): @lsimone try upgrading your langgraph version to `0.5.0`, there are some code clean up changes related to the ìnput_schema`key.
Author
Owner

@lsimone commented on GitHub (Jul 1, 2025):

@lsimone try upgrading your langgraph version to 0.5.0, there are some code clean up changes related to the ìnput_schema`key.

@johnfrommartin thanks a lot!

@lsimone commented on GitHub (Jul 1, 2025): > [@lsimone](https://github.com/lsimone) try upgrading your langgraph version to `0.5.0`, there are some code clean up changes related to the ìnput_schema`key. @johnfrommartin thanks a lot!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraph#755