Update Knowledge Base via API
# support
t
when using the 'update assistant' api call, is it possible to only update one element? in my case the file id's for the kb? it seems like it wants the whole string from me, even tho i only want to update the kb. thx
@User @User @User
v
You can continue this conversation by mentioning me in the message.
@tom Yes, when using the 'Update Assistant' API call, you can update just a single element, such as the file IDs for the knowledge base (KB). The API typically allows partial updates, so you should be able to send only the data you want to change. To update only the KB file IDs, you would send a request with the specific fields you want to update. Make sure to follow the API's documentation for the correct format and fields required for updating the KB file IDs. If you need assistance with the specific parameters or the request format, please let me know, and I can help guide you through the process.
j
I'm not sure if you can just update a single part. If not, maybe try using Get Assistant, then adjusting the part you need
t
that's clever man
is this the exact structure i need for the update call?
j
not sure, I don't use that endpoint so can't help much unfortunately
t
alright thanks bro, will try
a
Yea use GET assistant, edit the values of that json and then use that json to UPDATE the assistant.
If you are having trouble post your code in here.
c
Your goal is update a knowledge base to an assistant? You just change ID for the file. Also if you use a transient assistant you would have this problem . Doing a GET to a PATCH gets tiring for every update you want.
t
@Alexi @Chowderr thx for your help. the goal is that users can update the kb themselves with new files. so the old file ids need to stay, only adding the new one. i work in Make. i attached a screenshot of the scenario. now the question is how to modify the GET output to include the new file id https://cdn.discordapp.com/attachments/1280574016641568861/1280597497303138304/image.png?ex=66d8a8db&is=66d7575b&hm=4202b01f5052600718c7ca96773b1d1dc2581bf30e89e17ad2dcb1a7ea7e971e& https://cdn.discordapp.com/attachments/1280574016641568861/1280597497596608595/image.png?ex=66d8a8db&is=66d7575b&hm=50b5a70e3699a13c86e60a1dc41655a28f381312dc0f5780274af8b5c27e5bb7&
c
I can't say off the top of my head. I don't use dashboard assistants. So all I have to do is changed the JSON and ID the fileID to the assistant.
t
appreciate u anyway. sorry i'm new to Vapi and don't have a coding background. you mentioned transient and dashboard assistant. what's the difference?
c
I am not a coder either. Long story short you dont have all the features in the dashboard. You need to use the API.
t
good to know
c
You just helped me finish creating an automation for this and you don't even know it. Thanks. I can use this in the video I am creating as an example.
s
yes you can update few fields but in case of KB you have to pass all of the file ids.
t
glad to hear that lol. feel free to send me the vid
can u think of any smart solution to only add the new file id ?
probably possible with some formatting / regex in Make but i can't see how
Use the JSON. - it looks like you are doing it the simple way.
Hmm it seems you don't get the same JSON from the back end which looks like below = formatting. Inside of Make if you parse the response you don't get this either - so you are going to have to use a GPT module and then paste the example of the formatted JSON - with that response you can the use that to update the assistant. and include the new file in the JSON. https://cdn.discordapp.com/attachments/1280574016641568861/1280787505385570325/message.txt?ex=66d959d1&is=66d80851&hm=964e085754a78aaa5657f123998ee6a7c4c2ee8f9fbe0fee86f7510f11a09fce&
s
you have to figure it out by yourself.
t
i watched ur vid, that's great. i basically got the same functionality but in make. the tricky thing is to assign the file to an assistant after. good idea to use gpt for that. appreciate u
haha yeah i will
c
well the main trouble is that you dont have the JSON to make the change.
2 Views