Using Cloudglue’s Chat Completion API, you can have natural conversations about your video content. The API enables you to ask questions, get summaries, and extract insights from your video collections. When you make a chat request, Cloudglue intelligently searches through your video transcripts, scene descriptions, and detected text to provide accurate, context-aware responses with relevant citations.To chat with your videos, you’ll need to:
Create a rich transcript collection
Add the videos to your collection
Start chatting!
Here’s how to do it:
Copy
Ask AI
from cloudglue import CloudGlue# Initialize client (API key will be loaded from environment)client = CloudGlue()# Create a rich transcript collectioncollection = client.collections.create( name='my-video-collection', collection_type='rich-transcripts')# Upload two video filesvideo1 = client.files.upload( 'path/to/first/video.mp4', wait_until_finish=True)video2 = client.files.upload( 'path/to/second/video.mp4', wait_until_finish=True)# Add videos to collection (waits for processing to complete)client.collections.add_video( collection_id=collection.id, file_id=video1.id, wait_until_finish=True)client.collections.add_video( collection_id=collection.id, file_id=video2.id, wait_until_finish=True)# Chat with your videos!messages = [ {"role": "user", "content": "Who let the dogs out?"}]response = client.chat.completions.create( messages=messages, model="nimbus-001", collections=[collection.id], force_search=True, include_citations=True)print(response.choices[0].message.content)