Try out the answer function on a sample index in the Answer playground
Setup
1
Create an API key
First create an API key using the instructions in API keys
2
3
Create an index
Next, create an index. For this tutorial, we will use an index with the name ‘test_index’
4
Add some videos
Next, add some videos to the index. Now we are ready to get started with getting answers!
Answer a question
Answer modes
Specific videos
Instead of using all the videos in the index, you can also specify the video_ids variable to limit the videos used in synthesizing the answer.Retrieval Augmented Generation (RAG)
AskVideos also supports RAG to synthesize answers from the video. Using embeddings to find the relevant parts of the video before generating tokens helps to reduce cost and provide more accurate answers. In addition, if the text in the index exceeds the input token limit, RAG can help overcome this limitation by selecting only the most relevant parts for the context. In order to specify RAG mode, simply update the mode variable as follows.System prompt
The system prompt is customizable and can unlock powerful capabilities in the answer engine. Here are some examples of useful system prompts.Cited answers
Cited answers
Note: The strings
{query}
and {transcripts}
have to be present in the system prompt.Tabular answers
Tabular answers
Note: The strings
{query}
and {transcripts}
have to be present in the system prompt.