langchain-ai/langgraph · error · ValueError
Got unexpected type for `prompt`: {type}
Error message
Got unexpected type for `prompt`: {type} What it means
Error "Got unexpected type for `prompt`: {type}" thrown in langchain-ai/langgraph.
Source
Thrown at libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py:168
prompt_runnable = RunnableCallable(
lambda state: [prompt] + _get_state_value(state, "messages"),
name=PROMPT_RUNNABLE_NAME,
)
elif inspect.iscoroutinefunction(prompt):
prompt_runnable = RunnableCallable(
None,
prompt,
name=PROMPT_RUNNABLE_NAME,
)
elif callable(prompt):
prompt_runnable = RunnableCallable(
prompt,
name=PROMPT_RUNNABLE_NAME,
)
elif isinstance(prompt, Runnable):
prompt_runnable = prompt
else:
raise ValueError(f"Got unexpected type for `prompt`: {type(prompt)}")
return prompt_runnable
def _should_bind_tools(
model: LanguageModelLike, tools: Sequence[BaseTool], num_builtin: int = 0
) -> bool:
if isinstance(model, RunnableSequence):
model = next(
(
step
for step in model.steps
if isinstance(step, (RunnableBinding, BaseChatModel))
),
model,
)
if not isinstance(model, RunnableBinding):View on GitHub (pinned to 38031739e5)
When it happens
Trigger: Thrown at libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py:168 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of langchain-ai/langgraph@38031739e5 (2026-08-26).
Data as JSON: /api/errors/1f9fd09548a59f9e.
Report an issue: GitHub.