Passing File Identifier from React UI to Vapi AI Assistant

Hey everyone!

I’m working on a cool project with a React frontend, FastAPI backend, and Vapi AI assistant. I’ve got the file upload part working fine - my React app sends files to the FastAPI server, which gives back a file ID. Now I’m scratching my head trying to figure out how to get that file ID over to the Vapi assistant so it can use the file as a knowledge base.

I’ve looked through the docs but can’t seem to find the right way to do this. Has anyone done something similar or have any ideas? I’m not sure if I should be sending the file ID directly from React to Vapi, or if I need to go through the backend again somehow.

Any tips or code snippets would be super helpful. Thanks in advance!

hey swimmin fish, i’ve dealt with similar stuff. you’ll prob wanna send the file ID back to ur backend first. then use vapi’s API from there to associate the file with the assistant. that way u keep ur vapi credentials safe on the server. hope that helps!

ooh, interesting project! have u considered using websockets to stream the file ID from react to ur backend in real-time? Then ur server could instantly notify Vapi. just a thought! curious how others hav tackled this - anyone else tried websockets for AI integration?