diff --git a/morpheus/llm/nodes/langchain_agent_node.py b/morpheus/llm/nodes/langchain_agent_node.py index 3fbb018df0..5a18e72f01 100644 --- a/morpheus/llm/nodes/langchain_agent_node.py +++ b/morpheus/llm/nodes/langchain_agent_node.py @@ -66,7 +66,10 @@ async def _run_single(self, **kwargs: dict[str, typing.Any]) -> dict[str, typing return results # We are not dealing with a list, so run single - return await self._agent_executor.arun(**kwargs) + try: + return await self._agent_executor.arun(**kwargs) + except Exception as e: + logger.exception("Error running agent: %s: %s", kwargs, e) async def execute(self, context: LLMContext) -> LLMContext: