Blank assistant message content in Chat Completion API call when using AI Agent node

Describe the problem/error/question : N8n AI agent node unable to use tools efficiently

What is the error message (if any)? : No tool_calls defined in assistant message for Chat Completion API call when using AI Agent node. This confuse Model to understand what has been requested in tool call.

Please share your workflow

Blank assistant message content in Chat Completion API call

{
“model”: “qwen2.5:32b”,
“options”: {
“num_ctx”: 30000
},
“tools”: [
{
“type”: “function”,
“function”: {
“name”: “Splunk_search_vulnerable_software_version1”,
“description”: “Call this tool check in splunk about how many assets are vulnerable using a software name and version.”,
“parameters”: {
“type”: “object”,
“properties”: {
“keyword”: {
“type”: “string”,
“description”: “provide ip or a software name as a keyword to check in splunk”
},
“software_version”: {
“type”: “string”,
“description”: “provide the specific software version to check in splunk. This is an optional field”
}
},
“required”: [
“keyword”,
“software_version”
],
“additionalProperties”: false,
“$schema”: “http://json-schema.org/draft-07/schema#
}
}
},
{
“type”: “function”,
“function”: {
“name”: “Splunk_search_using_CVE”,
“description”: “Call this tool check in splunk about how many assets are vulnerable using a CVE ID”,
“parameters”: {
“type”: “object”,
“properties”: {
“CVE_ID”: {
“type”: “string”,
“description”: “provide CVE ID to check in splunk”
}
},
“required”: [
“CVE_ID”
],
“additionalProperties”: false,
“$schema”: “http://json-schema.org/draft-07/schema#
}
}
}
],
“messages”: [
{
“role”: “system”,
“content”: “You are a helpful assistant. You must call tool one by one. You must NOT respond with multiple tool_calls in your response.”
},
{
“role”: “user”,
“content”: “Am I running any of below software?\n\n# Vulnerable softwre and version \nvulnerable software : Google chrome\nvulnerable versions : 137.0.7151.67 and 137.0.7151.66 and 137.0.7151.65\n\n\n”
},
{
“role”: “assistant”,
“content”: “”
},
{
“role”: “tool”,
“content”: “[{"exitCode":0,"stderr":"","stdout":"Number of vulnerable assets : 0"}]”
},
{
“role”: “assistant”,
“content”: “”
},
{
“role”: “tool”,
“content”: “[{"exitCode":0,"stderr":"","stdout":"Number of vulnerable assets : 0"}]”
}
],
“stream”: true
}Information on your n8n setup

  • n8n version: N8n hosted setup with version 1.106.3.
  • Database (default: SQLite): default
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Ubuntu
  • AI Agent node version 2.2 (Latest)
  • Chat model is set to Ollama
1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.