Class: Riffer::StreamEvents::WebSearchStatus
- Defined in:
- lib/riffer/stream_events/web_search_status.rb
Overview
Represents a web search status notification during streaming.
Emitted when the LLM performs a server-side web search and its status changes.
Instance Attribute Summary collapse
-
#query ⇒ Object
readonly
The search query (present when available during status changes).
-
#status ⇒ Object
readonly
The web search status (“in_progress”, “searching”, “completed”, “open_page”).
-
#url ⇒ Object
readonly
The URL being fetched (present for “open_page” status).
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(status, url: nil, query: nil, role: :assistant) ⇒ WebSearchStatus
constructor
– : (String, ?url: String?, ?query: String?, ?role: Symbol) -> void.
-
#to_h ⇒ Object
– : () -> Hash[Symbol, untyped].
Constructor Details
#initialize(status, url: nil, query: nil, role: :assistant) ⇒ WebSearchStatus
– : (String, ?url: String?, ?query: String?, ?role: Symbol) -> void
19 20 21 22 23 24 |
# File 'lib/riffer/stream_events/web_search_status.rb', line 19 def initialize(status, url: nil, query: nil, role: :assistant) super(role: role) @status = status @url = url @query = query end |
Instance Attribute Details
#query ⇒ Object (readonly)
The search query (present when available during status changes).
15 16 17 |
# File 'lib/riffer/stream_events/web_search_status.rb', line 15 def query @query end |
#status ⇒ Object (readonly)
The web search status (“in_progress”, “searching”, “completed”, “open_page”).
9 10 11 |
# File 'lib/riffer/stream_events/web_search_status.rb', line 9 def status @status end |
#url ⇒ Object (readonly)
The URL being fetched (present for “open_page” status).
12 13 14 |
# File 'lib/riffer/stream_events/web_search_status.rb', line 12 def url @url end |
Instance Method Details
#to_h ⇒ Object
– : () -> Hash[Symbol, untyped]
28 29 30 31 32 33 |
# File 'lib/riffer/stream_events/web_search_status.rb', line 28 def to_h h = {role: @role, status: @status} h[:url] = @url if @url h[:query] = @query if @query h end |