Skip to content

Commit 710c382

Browse files
committed
add documentation in appropriate files; apply review comments
1 parent 4a8a5f5 commit 710c382

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ RubyLLM gives you one beautiful API for all of them. Same interface whether you'
3434

3535
```ruby
3636
# Just ask questions
37-
chat = RubyLLM.chat(model: "gemini-2.0-flash")
37+
chat = RubyLLM.chat
3838
chat.ask "What's the best way to learn Ruby?"
3939
```
4040

4141
```ruby
4242
# Analyze any file type
4343
chat.ask "What's in this image?", with: "ruby_conf.jpg"
44-
chat.ask "What's happening in this video?", with: "presentation.mp4"
44+
chat.ask "What's happening in this video?", with: "video.mp4"
4545
chat.ask "Describe this meeting", with: "meeting.wav"
4646
chat.ask "Summarize this document", with: "contract.pdf"
4747
chat.ask "Explain this code", with: "app.rb"

docs/_core_features/chat.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,31 @@ response = chat.ask "Compare the user interfaces in these two screenshots.", wit
148148
puts response.content
149149
```
150150

151+
### Working with Videos
152+
153+
You can also analyze video files or URLs with vision-capable models. RubyLLM will automatically detect video files and handle them appropriately.
154+
155+
```ruby
156+
# Ask about a local video file
157+
chat = RubyLLM.chat(model: 'gemini-2.0-flash')
158+
response = chat.ask "What happens in this video?", with: "path/to/demo.mp4"
159+
puts response.content
160+
161+
# Ask about a video from a URL
162+
response = chat.ask "Summarize the main events in this video.", with: "https://example.com/demo_video.mp4"
163+
puts response.content
164+
165+
# Combine videos with other file types
166+
response = chat.ask "Analyze these files for visual content.", with: ["diagram.png", "demo.mp4", "notes.txt"]
167+
puts response.content
168+
```
169+
170+
Notes:
171+
172+
Supported video formats include .mp4, .mov, .avi, .webm, and others (provider-dependent).
173+
Only Google Gemini models currently support video input; check the [Available Models Guide]({% link guides/available-models.md %}) for details.
174+
Large video files may be subject to size or duration limits imposed by the provider.
175+
151176
RubyLLM automatically handles image encoding and formatting for each provider's API. Local images are read and encoded as needed, while URLs are passed directly when supported by the provider.
152177

153178
### Working with Audio
@@ -230,6 +255,7 @@ response = chat.ask "What's in this image?", with: { image: "photo.jpg" }
230255

231256
**Supported file types:**
232257
- **Images:** .jpg, .jpeg, .png, .gif, .webp, .bmp
258+
- **Videos:** .mp4, .mov, .avi, .webm
233259
- **Audio:** .mp3, .wav, .m4a, .ogg, .flac
234260
- **Documents:** .pdf, .txt, .md, .csv, .json, .xml
235261
- **Code:** .rb, .py, .js, .html, .css (and many others)

0 commit comments

Comments
 (0)