mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-10 07:55:21 +02:00
Remove stale class
This commit is contained in:
parent
38ee33e9f7
commit
973ba519db
1 changed files with 0 additions and 29 deletions
|
@ -1,29 +0,0 @@
|
|||
class Assistant::ResponseStreamer
|
||||
def initialize(assistant_message, follow_up_streamer: nil)
|
||||
@assistant_message = assistant_message
|
||||
@follow_up_streamer = follow_up_streamer
|
||||
end
|
||||
|
||||
def call(chunk)
|
||||
case chunk.type
|
||||
when "output_text"
|
||||
assistant_message.content += chunk.data
|
||||
assistant_message.save!
|
||||
when "response"
|
||||
response = chunk.data
|
||||
chat.update!(latest_assistant_response_id: response.id)
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
attr_reader :assistant_message, :follow_up_streamer
|
||||
|
||||
def chat
|
||||
assistant_message.chat
|
||||
end
|
||||
|
||||
# If a follow-up streamer is provided, this is the first response to the LLM
|
||||
def first_response?
|
||||
follow_up_streamer.present?
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue