Chat
Video
Use chat + video mpdels (video-as-input
) to generate insightful responses.
Process Video Inputs
Analyze video content and generate responses based on visual context.
Quickstart
Use a chat model with video input to analyze and generate insights.
Streaming
Enable real-time analysis of video content by streaming model responses.
How Streaming Works
To enable streaming, pass true
as the third argument to the model.run()
function. The model will return a stream that you can read incrementally.
javascript
Node.js Version (Using Readable Stream)
javascript
Browser Version (Using getReader())
javascript
Key Points
Node.js
: Convert the Web Stream usingReadable.fromWeb()
for compatibility.Browser
: UsegetReader()
andTextDecoder
to process the stream.Error Handling
: Both methods use try…catch to handle potential errors.Data Handling
: Data chunks are processed as they arrive via data events or.read()
calls.