Class: Riffer::StreamEvents::WebSearchStatus
- Defined in:
- lib/riffer/stream_events/web_search_status.rb
Overview
A web search status notification, emitted as a server-side web search progresses.
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
18 19 20 21 22 23 |
# File 'lib/riffer/stream_events/web_search_status.rb', line 18 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).
14 15 16 |
# File 'lib/riffer/stream_events/web_search_status.rb', line 14 def query @query end |
#status ⇒ Object (readonly)
The web search status (“in_progress”, “searching”, “completed”, “open_page”).
8 9 10 |
# File 'lib/riffer/stream_events/web_search_status.rb', line 8 def status @status end |
#url ⇒ Object (readonly)
The URL being fetched (present for “open_page” status).
11 12 13 |
# File 'lib/riffer/stream_events/web_search_status.rb', line 11 def url @url end |
Instance Method Details
#to_h ⇒ Object
– : () -> Hash[Symbol, untyped]
27 28 29 30 31 32 |
# File 'lib/riffer/stream_events/web_search_status.rb', line 27 def to_h h = {role: @role, status: @status} #: Hash[Symbol, untyped] h[:url] = @url if @url h[:query] = @query if @query h end |