You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/_advanced/models.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,7 +42,7 @@ The registry stores crucial information about each model, including:
42
42
***`name`**: A human-friendly name.
43
43
***`context_window`**: Max input tokens (e.g., `128_000`).
44
44
***`max_tokens`**: Max output tokens (e.g., `16_384`).
45
-
***`supports_vision`**: If it can process images.
45
+
***`supports_vision`**: If it can process images and videos.
46
46
***`supports_functions`**: If it can use [Tools]({% link _core_features/tools.md %}).
47
47
***`input_price_per_million`**: Cost in USD per 1 million input tokens.
48
48
***`output_price_per_million`**: Cost in USD per 1 million output tokens.
@@ -323,4 +323,4 @@ image = RubyLLM.paint(
323
323
***Your Responsibility:** Ensure the model ID is correct for the target endpoint.
324
324
***Warning Log:** A warning is logged indicating validation was skipped.
325
325
326
-
Use these features when the standard registry doesn't cover your specific model or endpoint needs. For standard models, rely on the registry for validation and capability awareness. See the [Chat Guide]({% link _core_features/chat.md %}) for more on using the `chat` object.
326
+
Use these features when the standard registry doesn't cover your specific model or endpoint needs. For standard models, rely on the registry for validation and capability awareness. See the [Chat Guide]({% link _core_features/chat.md %}) for more on using the `chat` object.
Copy file name to clipboardExpand all lines: docs/_core_features/chat.md
+26Lines changed: 26 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -148,6 +148,31 @@ response = chat.ask "Compare the user interfaces in these two screenshots.", wit
148
148
puts response.content
149
149
```
150
150
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.5-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
+
151
176
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.
152
177
153
178
### Image Generation with Chat
@@ -258,6 +283,7 @@ response = chat.ask "What's in this image?", with: { image: "photo.jpg" }
0 commit comments