API access to check box for knowledgebase file
# support
k
The attached picture is part of the web interface for the assistants page. It is where the KB files are listed. There is no checkmark for conversationMemory.txt, but there is for the other file. What is the significance of the check mark which appears for resumeOfPersonTalking.pdf? If the check box is set, then the JSON for the assistant shows the file ID in the list is present. If the check box is not present, the assistant does not seem to be able to see the file ID. This means I need a way to set the check box because I have to get the assistant to see the file. What is the API call to do this? https://cdn.discordapp.com/attachments/1307175312840196188/1307175313528197153/Clipboard01.jpg?ex=67395960&is=673807e0&hm=aad7f20bf13f430e8865a6c306e529adba74734cab8746cf0f95555c6bd71f5a&
v
@keiichi_m The checkmark next to the file "resumeOfPersonTalking.pdf" likely indicates that the file is currently selected or enabled for use by the assistant. When a file is selected, its ID is included in the assistant's configuration, allowing the assistant to access and utilize the content of the file during its operations. To set the checkmark and enable the "conversationMemory.txt" file for the assistant, you would typically need to update the assistant's configuration by making an API call that modifies its settings. This would involve sending a JSON payload to the appropriate endpoint of the Voice API. However, as I am a support bot for VAPI, I don't have the capability to directly execute or provide the exact API call without the specific details of the API's endpoints and methods. You would need to refer to the VAPI documentation for the exact API call to update the assistant's configuration. If you have access to the documentation or the API interface, look for an endpoint related to updating the assistant's settings or files. The API call would generally be a PUT or PATCH request where you send a JSON payload with the updated configuration, including the file ID you want to set. If you need further assistance with the exact API call, please ask support for more info on this.
You can continue this conversation by mentioning me in the message.
k
I need the specific API call to set or clear the check box. That's all.
Interesting - the "ask for help" button generates a message, "This interaction failed."
s
Hey @keiichi_m you can do it using dashboard obviously and then using Update Assistant API. In the Update Assistant API, enter the file ids which required to be used by the assistant.
example
Copy code
curl -X PATCH https://api.vapi.ai/assistant/id \
     -H "Authorization: Bearer " \
     -H "Content-Type: application/json" \
     -d '{
  "model": {
    "provider": "openai",
    "model": "gpt-4o-2024-08-06",
    "knowledgeBase": {
      "provider": "canonical",
      "fileIds": [
        "insert-file-id-here",
        "insert-another-file-id-here"
      ]
    }
  }
}'
do let me know if you require further help.
k
Thanks. I was hoping to not have to use the dashboard to check the box, so that the process can be automated and the user does not need to access the dashboard after each call. Would it be possible to add an API call to alter the check box? I heard that the KnowledgeBase is about to be changed, possibly this week, and that the API might alter. How can I find out when this is rolled out? Thanks!
s
> Thanks. I was hoping to not have to use the dashboard to check the box, so that the process can be automated and the user does not need to access the dashboard after each call. Would it be possible to add an API call to alter the check box? It is already shared above how to do it using API. > I heard that the KnowledgeBase is about to be changed, possibly this week, and that the API might alter. How can I find out when this is rolled out? You will get to know using annoucements #1211483332496465962
k
When I do that, I see from the web UI for the assistant that the files are present. I can see them in the files box on the right hand side of the page. This always works perfectly. But the check box is not checked. Does that mean that the assistant will not refer to the file?
I'm not sure of the status of a file which is visible in the assistant, but doesn't have the check mark.
s
@keiichi_m as of now we are still working on KB, so these files are of no use for now. So, I suggest to wait for few days until we announce about KB changes.
k
Now that the KB update is operational, I can make this more specific. I understand that trieve is the KB provider and I tried to alter my calls to work with it. Here are my two problems: Creating the KB with trieve as documented here https://docs.vapi.ai/api-reference/knowledge-bases/create does not offer a way to provide fileIDs. Using "canonical" instead of "trieve" as the provider does, but is that not the provider I should be using now? When trying to update the assistant as documented here https://docs.vapi.ai/api-reference/assistants/update it is only possible to use "canonical" as the KB provider. Is there a way to use "trieve" instead?
s
@keiichi_m can you allow me sometime to ge the complete documentation for Knowledge Base, including both transient and permanent knowlede base and how to use it along with the assistants. If I don't reply within 24 hours please ping me.
k
s
@keiichi_m use this for now, currently blocked in other tasks will try to finish it asap https://discord.com/channels/1211482211119796234/1307175312840196188/1313201753432260618
k
sorry, was that ⁠"support⁠API access to check box for kno…" a link to documentation? it seems only to link to this thread.
s
Yeah it is linked to the this thread for the KB docs. You can learn more about it from here https://docs.vapi.ai/knowledgebase