Skip to content

Commit 6a75f86

Browse files
committed
Move streaming example in a more appropriate position
1 parent 6201390 commit 6a75f86

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ chat.ask "Describe this meeting", with: { audio: "meeting.wav" }
5252
# Analyze documents
5353
chat.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
5661
RubyLLM.paint "a sunset over mountains in watercolor style"
5762

@@ -75,11 +80,6 @@ class Weather < RubyLLM::Tool
7580
end
7681

7782
chat.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

docs/index.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ chat.ask "Describe this meeting", with: { audio: "meeting.wav" }
7272
# Analyze documents
7373
chat.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
7681
RubyLLM.paint "a sunset over mountains in watercolor style"
7782

@@ -95,11 +100,6 @@ class Weather < RubyLLM::Tool
95100
end
96101

97102
chat.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

0 commit comments

Comments
 (0)