Upload documents to your knowledge base for personas to reference during conversations.
POST
request to tavusapi.com/v2/documents
.document_id
- a unique identifier for your uploaded document. When creating a conversation, you may include all document_id
values that you would like the persona to have access to.Currently, we support the following file formats: .pdf, .txt, .docx, .doc, .png, .jpg, .pptx, .csv, and .xlsx.callback_url
in the Create Document request body, you will receive periodic callbacks with status updates.
You may also use the Get Document endpoint to poll the most recent status of your documents.document_id
from Step 2 as part of the Create Conversation request.You can add multiple documents to a conversation within the document_ids
object.speed
: Optimizes for faster retrieval times for minimal latency.balanced
(default): Provides a balance between retrieval speed and quality.quality
: Prioritizes finding the most relevant information, which may take slightly longer but can provide more accurate responses.document_id
values can get tricky.
Instead of using distinct document_ids
, you can also group documents together with shared tag values.
During the Create Document API call, you may specify a value for tags
for your document.
Then, when you create a conversation, you may specify the tags
value instead of passing in discrete document_id
values.
For example, if you are uploading course material, you could add the tag "lesson-1"
to all documents that you want accessible in the first lesson.
lesson-1
to document_tags
instead of individual document_id
values.