File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed
Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,11 @@ chat.ask "Describe this meeting", with: { audio: "meeting.wav" }
5252# Analyze documents
5353chat.ask " Summarize this document" , with: { pdf: " contract.pdf" }
5454
55+ # Stream responses in real-time
56+ chat.ask " Tell me a story about a Ruby programmer" do |chunk |
57+ print chunk.content
58+ end
59+
5560# Generate images
5661RubyLLM .paint " a sunset over mountains in watercolor style"
5762
@@ -75,11 +80,6 @@ class Weather < RubyLLM::Tool
7580end
7681
7782chat.with_tool(Weather ).ask " What's the weather in Berlin? (52.5200, 13.4050)"
78-
79- # Stream responses in real-time
80- chat.ask " Tell me a story about a Ruby programmer" do |chunk |
81- print chunk.content
82- end
8383```
8484
8585## Installation
Original file line number Diff line number Diff line change @@ -72,6 +72,11 @@ chat.ask "Describe this meeting", with: { audio: "meeting.wav" }
7272# Analyze documents
7373chat.ask " Summarize this document" , with: { pdf: " contract.pdf" }
7474
75+ # Stream responses in real-time
76+ chat.ask " Tell me a story about a Ruby programmer" do |chunk |
77+ print chunk.content
78+ end
79+
7580# Generate images
7681RubyLLM .paint " a sunset over mountains in watercolor style"
7782
@@ -95,11 +100,6 @@ class Weather < RubyLLM::Tool
95100end
96101
97102chat.with_tool(Weather ).ask " What's the weather in Berlin? (52.5200, 13.4050)"
98-
99- # Stream responses in real-time
100- chat.ask " Tell me a story about a Ruby programmer" do |chunk |
101- print chunk.content
102- end
103103```
104104
105105## Quick start
You can’t perform that action at this time.
0 commit comments