"No binary data set." when trying to upload .png to Claude 3.5 API

Hi there, trie

Describe the problem/error/question

In a simple Chat Trigger connected to LLM Chain and the Anthropic Claude 3.5 Model I try to allow chatting with Images, as this is something Claude 3.5 typically excels at.

I allowed field uploads on the Chat. However then I ask
“transcribe the screenshot” and attach a screenshot.png file, I get a base response from the LLM as this:

INPUT:

[
{
"sessionId": 
"test-40c05195-b89c-4b90-9813-342c15e199a8",
"action": 
"sendMessage",
"chatInput": 
"transcribe this screenshot",
"files": 
[
{
"fileName": 
"screenshot.png",
"fileSize": 
"44724 bytes",
"fileExtension": 
"png",
"fileType": 
"image",
"mimeType": 
"image/png"
}
]
}
]

OUTPUT:

[
  {
    "text": "I apologize, but I don't actually see any screenshot or image attached to this conversation. Without being able to see the content you're referring to, I'm not able to transcribe or describe anything. If you intended to include an image, it seems it may not have uploaded successfully. Feel free to try uploading the image again, and I'll do my best to assist you once I can see it. Let me know if you have any other questions!"
  }
]

I also tried different files (smaller/larger screenshots from the n8n homepage).

Any help is greatly appreciated :pray:

What is the error message (if any)?

Either

just a chat response that it doesn’t have the image

or the following when specifying the binary input.

[ERROR: No binary data set.]

Please share your workflow

I also tried adding the file via a User Message in the LLM Chain Node of Type Image “Binary” and using this expression:

{{ $input.item.binary.data0.data }}

I also tried

{{ $input.item.binary.data0 }}

{{ $input.item.binary }}

as well as base64 en-&decoding. The expression result also shows the long binary string, but always end always with the same result.

Share the output returned by the last node

{
  "errorMessage": "No binary data set.",
  "errorDetails": {},
  "n8nDetails": {
    "nodeName": "Transcribe Image",
    "nodeType": "@n8n/n8n-nodes-langchain.chainLlm",
    "nodeVersion": 1.4,
    "time": "9.9.2024, 15:23:58",
    "n8nVersion": "1.56.2 (Self Hosted)",
    "binaryDataMode": "default",
    "stackTrace": [
      "NodeOperationError: No binary data set.",
      "    at getImageMessage (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/nodes/chains/ChainLLM/ChainLlm.node.js:37:15)",
      "    at /usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/nodes/chains/ChainLLM/ChainLlm.node.js:74:36",
      "    at Array.map (<anonymous>)",
      "    at getChainPromptTemplate (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/nodes/chains/ChainLLM/ChainLlm.node.js:62:109)",
      "    at getChain (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/nodes/chains/ChainLLM/ChainLlm.node.js:105:32)",
      "    at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/nodes/chains/ChainLLM/ChainLlm.node.js:423:41)",
      "    at processTicksAndRejections (node:internal/process/task_queues:95:5)",
      "    at Workflow.runNode (/usr/local/lib/node_modules/n8n/node_modules/n8n-workflow/dist/Workflow.js:728:19)",
      "    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:673:51",
      "    at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:1104:20"
    ]
  }
}

Information on your n8n setup

I also tried this on the n8n cloud with the same result.

  • n8n version: 1.56.2 (Self Hosted)
  • Database (default: SQLite): postgreSQL
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Self-hosted on VPS via Docker & Coolify
  • Operating system: Ubuntu 24.02

Have you tried sending as a base64 encoded string instead of the raw data?

Hi Jay,
many thanks for your response.

Yes I did with this input
{{ $input.item.binary.data0.data.base64Encode() }} but the result remains the same:

Any other angles you could imagine?

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