firm-tan•2y ago
Create new document in the document library
Hi, I want to create and upload a new entry to my KB library based on text messages from the chat. I am following this documentation, but I cannot get it to work. From what I see this is built for uploading documents whereas what I want is to create a new document from text and then insert it into the KB.
https://developer.voiceflow.com/reference/post_v3alpha-knowledge-base-docs-upload
5 Replies
To create and upload a new entry to your Knowledge Base (KB) library, you can use the
POST
method at https://api.voiceflow.com/v3alpha/knowledge-base/docs/upload
. This endpoint allows you to upload a document to the Knowledge Base. The limit is one file per call.
However, it's important to note that this endpoint is designed for uploading existing documents, not for creating new documents from text. The accepted source document types for this endpoint are PDF, text, or DOCX.
If you want to create a new document from text, you would need to first create a text file (.txt) or a Word document (.docx) containing your text, and then upload that file using the aforementioned endpoint.
Remember, all requests to any Knowledge Base APIs require a Dialog Manager API Key. You can obtain this key by going to the Integration tab on the project you uploaded data sources to and clicking the "Copy API key" button.
For more details, you can refer to the following documentation:
- Upload Document (non-url)
- Replace Document (non-url)
- Upload Document (url)firm-tanOP•2y ago
How do i create a .txt file?
Check out the vf-crawler-uploader sample code on our repo, we are using the KB API to upload a text.
https://github.com/voiceflow/demos-n-examples
GitHub
GitHub - voiceflow/demos-n-examples
Contribute to voiceflow/demos-n-examples development by creating an account on GitHub.
@bamelement @effervescentia has the text option been added to the api?
Not yet but we are sharing a way to use it in the shared code.