Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit 0ba64b5

Browse files
committed
improve so we don't stop replying...
1 parent 21a851d commit 0ba64b5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/ai_bot/chat_streamer.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ def initialize(message:, channel:, guardian:, thread_id:, in_reply_to_id:, force
3939

4040
def <<(partial)
4141
return if partial.to_s.empty?
42+
# we throw away leading spaces prior to message creation for now
43+
# by design
44+
return if partial.to_s.blank? && !@reply
4245

4346
if @client_id
4447
ChatSDK::Channel.stop_reply(
@@ -53,9 +56,7 @@ def <<(partial)
5356
if @reply
5457
@queue << partial
5558
else
56-
# we throw away leading spaces prior to message creation for now
57-
# by design
58-
create_reply(partial) if partial.present?
59+
create_reply(partial)
5960
end
6061
end
6162

0 commit comments

Comments
 (0)