TypeError: Cannot read properties of undefined (reading 'content') at ToolCallingAgentOutputParser._baseMessageToString (/usr/local/lib/node_modules/n8n/node_modules/@langchain/core/dist/output_parsers/base.cjs:24:31) at ToolCallingAgentOutputParser._callWithConfig (/usr/local/lib/node_modules/n8n/node_modules/@langchain/core/dist/output_parsers/base.cjs:49:32) at ToolCallingAgentOutputParser._callWithConfig (/usr/local/lib/node_modules/n8n/node_modules/@langchain/core/dist/runnables/base.cjs:223:34) at processTicksAndRejections (node:internal/process/task_queues:95:5) at ToolCallingAgentOutputParser._streamIterator (/usr/local/lib/node_modules/n8n/node_modules/@langchain/core/dist/runnables/base.cjs:165:9) at ToolCallingAgentOutputParser.transform (/usr/local/lib/node_modules/n8n/node_modules/@langchain/core/dist/runnables/base.cjs:402:9) at RunnableSequence._streamIterator (/usr/local/lib/node_modules/n8n/node_modules/@langchain/core/dist/runnables/base.cjs:1320:30) at RunnableSequence.transform (/usr/local/lib/node_modules/n8n/node_modules/@langchain/core/dist/runnables/base.cjs:402:9) at wrapInputForTracing (/usr/local/lib/node_modules/n8n/node_modules/@langchain/core/dist/runnables/base.cjs:275:30) at pipeGeneratorWithSetup (/usr/local/lib/node_modules/n8n/node_modules/@langchain/core/dist/utils/stream.cjs:271:19) at RunnableLambda._transformStreamWithConfig (/usr/local/lib/node_modules/n8n/node_modules/@langchain/core/dist/runnables/base.cjs:296:26) at wrapInputForTracing (/usr/local/lib/node_modules/n8n/node_modules/@langchain/core/dist/runnables/base.cjs:275:30) at pipeGeneratorWithSetup (/usr/local/lib/node_modules/n8n/node_modules/@langchain/core/dist/utils/stream.cjs:271:19) at RunnableLambda._transformStreamWithConfig (/usr/local/lib/node_modules/n8n/node_modules/@langchain/core/dist/runnables/base.cjs:296:26) at RunnableSequence._streamIterator (/usr/local/lib/node_modules/n8n/node_modules/@langchain/core/dist/runnables/base.cjs:1320:30)
What is the error message (if any)?
Please share your workflow
Share the output returned by the last node
Information on your n8n setup
n8n version: 1.91.2
Database (default: SQLite): sqlite
n8n EXECUTIONS_PROCESS setting (default: own, main): main
Running n8n via (Docker, npm, n8n cloud, desktop app): docker
I tried to build a self-built agent for chat model, and the aiagent visited the self-built agent, and indirectly visited the chat model of openai or deepseek. The data formats returned by self-built proxy and direct access to chat model are normal, but there is always no content in error. The following is the data returned by our access interface /v1/chat/completions:
The following is the core logic of our proxy service implementation, which will get the response from deepseek and return it directly to the aiagent. :