From d38a90d50ba7bd9d68d0c9688a407fa8d53a62d9 Mon Sep 17 00:00:00 2001 From: "open-swe[bot]" Date: Tue, 29 Jul 2025 20:06:07 +0000 Subject: [PATCH] Apply patch --- .../langgraph/prebuilt/chat_agent_executor.py | 37 +------------------ 1 file changed, 1 insertion(+), 36 deletions(-) diff --git a/libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py b/libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py index eb2cf71a9..223a99780 100644 --- a/libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py +++ b/libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py @@ -111,42 +111,6 @@ def _get_state_value(state: StateSchema, key: str, default: Any = None) -> Any: ) -def _get_prompt_runnable(prompt: Optional[Prompt]) -> Runnable: - prompt_runnable: Runnable - if prompt is None: - prompt_runnable = RunnableCallable( - lambda state: _get_state_value(state, "messages"), name=PROMPT_RUNNABLE_NAME - ) - elif isinstance(prompt, str): - _system_message: BaseMessage = SystemMessage(content=prompt) - prompt_runnable = RunnableCallable( - lambda state: [_system_message] + _get_state_value(state, "messages"), - name=PROMPT_RUNNABLE_NAME, - ) - elif isinstance(prompt, SystemMessage): - 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: @@ -1194,3 +1158,4 @@ __all__ = [ ] +