Skip to content

Commit 6201390

Browse files
committed
Make example for streaming responses in real-time more prominent in README and documentation
1 parent 49f174a commit 6201390

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ class Weather < RubyLLM::Tool
7575
end
7676

7777
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
7883
```
7984

8085
## Installation

docs/index.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,11 @@ class Weather < RubyLLM::Tool
9595
end
9696

9797
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
98103
```
99104

100105
## Quick start

0 commit comments

Comments
 (0)