Skip to content

Commit

Permalink
mark system prompt configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
hwchase17 committed Dec 23, 2024
1 parent e137dab commit b36234a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions libs/langgraph/langgraph/prebuilt/chat_agent_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,8 @@ def _get_state_modifier_runnable(
lambda state: state["messages"], name=STATE_MODIFIER_RUNNABLE_NAME
)
elif isinstance(state_modifier, str):
_system_message: BaseMessage = SystemMessage(content=state_modifier)
state_modifier_runnable = RunnableCallable(
lambda state: [_system_message] + state["messages"],
lambda state, config: [SystemMessage(config['configurable'].get('system_prompt', state_modifier))] + state["messages"],
name=STATE_MODIFIER_RUNNABLE_NAME,
)
elif isinstance(state_modifier, SystemMessage):
Expand Down

0 comments on commit b36234a

Please sign in to comment.