Collections are simple way to organize your uploads. Working with collections is straightforward. This helps in media organization and search efficiency.
Collection search would restrict the query to find information in only that collection, giving developers freedom to manage and organize videos for their RAG applications.
Create a new collection by calling create_collectionfunction in the connection object.
List all the media in a Collection (video/audio/image)
Use get methods to list audios, videos and images in the collection. We have provided individual get methods to make it simple and intuitive for you.
# list videos
videos = new_collection.get_videos()
for v in videos:
print(v)
# list audios
audios = new_collection.get_audios()
for a in audios:
print(a)
# list images
images = new_collection.get_images()
for img in images:
print(img)
Search inside a Collection
The most useful thing about collections is to restrict search to a specific set of videos. This can come really handy in building complex RAG applications.
from videodb import SearchType
# index spoken words
video.index_spoken_words()
# search inside a collection
result = new_collection.search("what is aws?", search_type=SearchType.semantic)