How can I upload files on vector store for a specific assistant through api?

Hi, I am trying to create a faq system for my project. I am sharing my flow how I am doing it. I am using Laravel for this.

  1. creating vector store using https://api.openai.com/v1/vector_stores
  2. creating assistant using https://api.openai.com/v1/assistants passing verctor_store_id from previous API
  3. uploading files using https://api.openai.com/v1/files this API
  4. associateFileWithAssistant using this API [https://api.openai.com/v1/assistants/{$assistant_id}/files]
  5. storeFileInVectorStore using this API [https://api.openai.com/v1/vector_stores/{$vectorStoreId}/file_batches]
  6. associateFileWithVectorStore using v1/vector_stores/{$vectorStoreId}/files
  7. then ask the question to assistant using /v1/chat/completions

but the file is not uploading in the assistant. what am I missing? Please help me I am stuck like hell. No clue how can I fix it.

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:

Hi @Sanchita_Paul

Thanks for posting here and welcome to the community! :partying_face:

Can you share your workflow? Are you getting any errors?

Tip for sharing your workflow in the forum

Pasting your n8n workflow


Ensure to copy your n8n workflow and paste it in the code block, that is in between the pairs of triple backticks, which also could be achieved by clicking </> (preformatted text) in the editor and pasting in your workflow.

```
<your workflow>
```

Make sure that you’ve removed any sensitive information from your workflow and include dummy data or pinned data as much as you can!