diff --git a/libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py b/libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py index dc8e62bb9..2248e9b24 100644 --- a/libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py +++ b/libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py @@ -69,7 +69,7 @@ INVALID_TOOL_NAME_ERROR_TEMPLATE = ( TOOL_CALL_ERROR_TEMPLATE = "Error: {error}\n Please fix your mistakes." -def _msg_content_output(output: Any) -> Union[str, list[dict]]: +def _msg_content_output(output: Any) -> Union[str, list[Union[str, dict[str, Any]]]]: """Convert tool output to valid message content format.""" if isinstance(output, str): return output @@ -1400,3 +1400,4 @@ __all__ = [ "AgentStateWithStructuredResponse", "AgentStateWithStructuredResponsePydantic", ] +