mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-08-28 10:49:56 +02:00
State modifier
This commit is contained in:
@@ -77,19 +77,8 @@ def _get_state_modifier_runnable(
|
||||
)
|
||||
elif callable(state_modifier):
|
||||
# Inspect the state_modifier signature
|
||||
sig = inspect.signature(state_modifier)
|
||||
|
||||
if store is not None and "store" not in sig.parameters:
|
||||
raise ValueError(
|
||||
"State modifier callable needs to accept 'store' as a parameter when using create_react_agent with a store."
|
||||
)
|
||||
elif store is None and "store" in sig.parameters:
|
||||
raise ValueError(
|
||||
"Please pass 'store' to create_react_agent to use 'store' in state modifier."
|
||||
)
|
||||
|
||||
state_modifier_runnable = RunnableLambda(
|
||||
state_modifier, name=STATE_MODIFIER_RUNNABLE_NAME
|
||||
state_modifier_runnable = RunnableCallable(
|
||||
state_modifier, name=STATE_MODIFIER_RUNNABLE_NAME, trace=True
|
||||
)
|
||||
elif isinstance(state_modifier, Runnable):
|
||||
state_modifier_runnable = state_modifier
|
||||
|
||||
@@ -4841,10 +4841,10 @@
|
||||
"type": "runnable",
|
||||
"data": {
|
||||
"id": [
|
||||
"langchain_core",
|
||||
"runnables",
|
||||
"base",
|
||||
"RunnableLambda"
|
||||
"langgraph",
|
||||
"utils",
|
||||
"runnable",
|
||||
"RunnableCallable"
|
||||
],
|
||||
"name": "agent"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user