Cannot update a document to the OpenAI Assistant in version

I’m trying to update a document to OpenAI Assistant, it’s already uploaded in the previous node. But in this node, when I selected the document to update to, it shows the error below. I believe the node is missing a parameter for the vector store chosen to process the document.

{
“errorMessage”: “Bad request - please check your parameters”,
“errorDescription”: “Unknown parameter: ‘tool_resources.file_search.vector_stores’.”,
“errorDetails”: {
“rawErrorMessage”: [
“400 - {"error":{"message":"Unknown parameter: ‘tool_resources.file_search.vector_stores’.","type":"invalid_request_error","param":"tool_resources.file_search.vector_stores","code":"unknown_parameter"}}”
],
“httpCode”: “400”
},
“n8nDetails”: {
“nodeName”: “OpenAI3”,
“nodeType”: “@n8n/n8n-nodes-langchain.openAi”,
“nodeVersion”: 1.3,
“resource”: “assistant”,
“operation”: “update”,
“itemIndex”: 0,
“time”: “6/7/2024, 10:14:35 PM”,
“n8nVersion”: “1.44.1 (Self Hosted)”,
“binaryDataMode”: “default”,
“stackTrace”: [
“NodeApiError: Bad request - please check your parameters”,
" at Object.requestWithAuthentication (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/NodeExecuteFunctions.js:1266:19)“,
" at processTicksAndRejections (node:internal/process/task_queues:95:5)”,
" at Object.requestWithAuthentication (/usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/NodeExecuteFunctions.js:1991:20)“,
" at Object.apiRequest (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/nodes/vendors/OpenAi/transport/index.js:17:12)”,
" at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/nodes/vendors/OpenAi/actions/assistant/update.operation.js:173:22)“,
" at Object.router (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/nodes/vendors/OpenAi/actions/router.js:64:34)”,
" at Object.execute (/usr/local/lib/node_modules/n8n/node_modules/@n8n/n8n-nodes-langchain/dist/nodes/vendors/OpenAi/OpenAi.node.js:16:16)“,
" 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:664:51",
" at /usr/local/lib/node_modules/n8n/node_modules/n8n-core/dist/WorkflowExecute.js:1079:20"
]
}
}

1 Like

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:
  • n8n version: 1.44.1
  • Database (default: SQLite): Default
  • n8n EXECUTIONS_PROCESS setting (default: own, main): Default
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker via Easypanel
  • Operating system: Windows 10

@avatarwefa Welcome :wave:

Had a quick look and it does indeed look like a bug with the OpenAI node - "vector_stores" should be "vector_store_ids" according to the official docs.

If you have both assistant vector store ID and file ID, here’s an alternative workaround to upload your file to assistant’s vector store using the API (see last node!).

2 Likes

Hi @Jim_Le & @avatarwefa

thank you guys for posting here and pointing out this bug! :muscle:
We’ll create a ticket for it and will keep you posted once we’ve fixed & released it.

:clinking_glasses: Thanks!

1 Like

I’m facing the exact same issue, but also another that appears to be related. I’m on N8N 1.53.2. Here are the errors I’m seeing.

This one, when I attempt to use a fixed value from the dropdown list to select the files.

{
  "errorMessage": "Bad request - please check your parameters",
  "errorDescription": "Unknown parameter: 'tool_resources.file_search.vector_stores'.",
  "errorDetails": {
    "rawErrorMessage": [
      "400 - {\"error\":{\"message\":\"Unknown parameter: 'tool_resources.file_search.vector_stores'.\",\"type\":\"invalid_request_error\",\"param\":\"tool_resources.file_search.vector_stores\",\"code\":\"unknown_parameter\"}}"
    ],
    "httpCode": "400"
  },
  "n8nDetails": {
    "nodeName": "updateAssistantFiles2",
    "nodeType": "@n8n/n8n-nodes-langchain.openAi",
    "nodeVersion": 1.3,
    "resource": "assistant",
    "operation": "update",
    "itemIndex": 0,
    "time": "13/08/2024, 12:31:28",
    "n8nVersion": "1.53.2 (Self Hosted)",
    "binaryDataMode": "default",
    "stackTrace": [
      "NodeApiError: Bad request - please check your parameters",
      "    at Object.requestWithAuthentication (/Users/mig82/ws/ploio/n8n/node_modules/.pnpm/[email protected]/node_modules/n8n-core/src/NodeExecuteFunctions.ts:1918:10)",
      "    at processTicksAndRejections (node:internal/process/task_queues:95:5)",
      "    at Object.requestWithAuthentication (/Users/mig82/ws/ploio/n8n/node_modules/.pnpm/[email protected]/node_modules/n8n-core/src/NodeExecuteFunctions.ts:3264:11)",
      "    at Object.apiRequest (/Users/mig82/ws/ploio/n8n/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_@azure_abngknv6o7u3ac2x5p7fufgzym/node_modules/@n8n/n8n-nodes-langchain/nodes/vendors/OpenAi/transport/index.ts:36:9)",
      "    at Object.execute (/Users/mig82/ws/ploio/n8n/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_@azure_abngknv6o7u3ac2x5p7fufgzym/node_modules/@n8n/n8n-nodes-langchain/nodes/vendors/OpenAi/actions/assistant/update.operation.ts:226:19)",
      "    at Object.router (/Users/mig82/ws/ploio/n8n/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_@azure_abngknv6o7u3ac2x5p7fufgzym/node_modules/@n8n/n8n-nodes-langchain/nodes/vendors/OpenAi/actions/router.ts:54:25)",
      "    at Object.execute (/Users/mig82/ws/ploio/n8n/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_@azure_abngknv6o7u3ac2x5p7fufgzym/node_modules/@n8n/n8n-nodes-langchain/nodes/vendors/OpenAi/OpenAi.node.ts:15:10)",
      "    at Workflow.runNode (/Users/mig82/ws/ploio/n8n/node_modules/.pnpm/[email protected]/node_modules/n8n-workflow/src/Workflow.ts:1382:8)",
      "    at /Users/mig82/ws/ploio/n8n/node_modules/.pnpm/[email protected]/node_modules/n8n-core/src/WorkflowExecute.ts:1072:27",
      "    at /Users/mig82/ws/ploio/n8n/node_modules/.pnpm/[email protected]/node_modules/n8n-core/src/WorkflowExecute.ts:1776:11"
    ]
  }
}

And this one, when I attempt to use an expression to select the files.

{
  "errorMessage": "The maximum number of files that can be attached to the assistant is 20",
  "errorDetails": {},
  "n8nDetails": {
    "nodeName": "updateAssistantFiles2",
    "nodeType": "@n8n/n8n-nodes-langchain.openAi",
    "nodeVersion": 1.3,
    "resource": "assistant",
    "operation": "update",
    "itemIndex": 0,
    "time": "13/08/2024, 12:45:12",
    "n8nVersion": "1.53.2 (Self Hosted)",
    "binaryDataMode": "default",
    "stackTrace": [
      "NodeOperationError: The maximum number of files that can be attached to the assistant is 20",
      "    at Object.execute (/Users/mig82/ws/ploio/n8n/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_@azure_abngknv6o7u3ac2x5p7fufgzym/node_modules/@n8n/n8n-nodes-langchain/nodes/vendors/OpenAi/actions/assistant/update.operation.ts:145:10)",
      "    at Object.router (/Users/mig82/ws/ploio/n8n/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_@azure_abngknv6o7u3ac2x5p7fufgzym/node_modules/@n8n/n8n-nodes-langchain/nodes/vendors/OpenAi/actions/router.ts:54:39)",
      "    at Object.execute (/Users/mig82/ws/ploio/n8n/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_@azure_abngknv6o7u3ac2x5p7fufgzym/node_modules/@n8n/n8n-nodes-langchain/nodes/vendors/OpenAi/OpenAi.node.ts:15:23)",
      "    at Workflow.runNode (/Users/mig82/ws/ploio/n8n/node_modules/.pnpm/[email protected]/node_modules/n8n-workflow/src/Workflow.ts:1382:31)",
      "    at /Users/mig82/ws/ploio/n8n/node_modules/.pnpm/[email protected]/node_modules/n8n-core/src/WorkflowExecute.ts:1072:42",
      "    at /Users/mig82/ws/ploio/n8n/node_modules/.pnpm/[email protected]/node_modules/n8n-core/src/WorkflowExecute.ts:1776:11"
    ]
  }
}

However, if I hardcode the file ID like this, which should not work because it’s not enclosed in double-quotes (Notice it evaluates to NaN), I get a positive response. However, it’s a false positive because the vector store does not get updated.

I’m running into this same issue. I cannot connect uploaded files to the assistant via n8n. I get the same error message: cannot attach more than 20 files. I only have 4 connected.

Hi @codewulf0 @mig82

Thanks for reporting! I have added this to our internal ticket :pray:

1 Like

Any news on this one?

Hi @Uneerup

Just in time! Sorry, this been a long one…
PR should be released next week

Let us know if this fixes the issue :slight_smile:

New version [email protected] got released which includes the GitHub PR 12042.