If I create an assistant via POST, how to add a kn...
# support
m
I am now creating an assistant using this POST request when I receive a call. It gets created for every call, and the prompt and some settings are different depending on who the caller is https://docs.vapi.ai/api-reference/assistants/create-assistant How can I add a knowledge base to it? I see that I can add a file in Vapi dashboard, but how can I add it to a new assistant? And must the file be sent every time or can I use one of the previously uploaded files?
v
Hi @MILANCHeJ, I'm an AI assistant for Vapi. I'll analyze available sources and get back to you shortly.
----------------------------- **While I generate an answer, here are some sources that might be helpful**: * [Web Calling]() * [Switch assistant mid call]() -----------------------------
### Answer As of now, there isn't a documented method for directly adding a knowledge base to an assistant via the POST request when creating it dynamically for each call. The option to add files is available through the Vapi dashboard, but there isn't a specified API endpoint for attaching these files to dynamically created assistants. For now, you would need to manually manage the knowledge base through the dashboard and ensure that your dynamically created assistants have access to the same data. For more detailed information on customizing the assistant's configuration, you can refer to the [Web Calling Quickstart Guide]() [(1)]() . : [Web Calling]()
Got it. Tagging @User for additional help.
s
Simply add a knowledge base directly through the dashboard and use /assistant and get the configuration about your assistant and use it on your POST request.
m
But I also have some dynamic data in the prompt, that is why I am creating a new assistant for every call.
s
you mean different knowledge for each user as well?
m
Depending on who the user is, yes. It can be the same or different
s
Oh, I see can then you can use this endpoint to upload the file https://docs.vapi.ai/api-reference/files/upload-file and you will get a fileID you can directly pass it into the assistant and it will fix the issue.
6 Views