Class: Riffer::StreamEvents::WebSearchDone
- Defined in:
- lib/riffer/stream_events/web_search_done.rb
Overview
The result of a completed server-side web search during streaming.
Instance Attribute Summary collapse
-
#query ⇒ Object
readonly
The search query used.
-
#sources ⇒ Object
readonly
The search result sources with title and url.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(query, sources: [], role: :assistant) ⇒ WebSearchDone
constructor
– : (String, ?sources: Array[Hash[Symbol, String?]], ?role: Symbol) -> void.
-
#to_h ⇒ Object
– : () -> Hash[Symbol, untyped].
Constructor Details
#initialize(query, sources: [], role: :assistant) ⇒ WebSearchDone
– : (String, ?sources: Array[Hash[Symbol, String?]], ?role: Symbol) -> void
14 15 16 17 18 |
# File 'lib/riffer/stream_events/web_search_done.rb', line 14 def initialize(query, sources: [], role: :assistant) super(role: role) @query = query @sources = sources end |
Instance Attribute Details
#query ⇒ Object (readonly)
The search query used.
7 8 9 |
# File 'lib/riffer/stream_events/web_search_done.rb', line 7 def query @query end |
#sources ⇒ Object (readonly)
The search result sources with title and url.
10 11 12 |
# File 'lib/riffer/stream_events/web_search_done.rb', line 10 def sources @sources end |
Instance Method Details
#to_h ⇒ Object
– : () -> Hash[Symbol, untyped]
22 23 24 |
# File 'lib/riffer/stream_events/web_search_done.rb', line 22 def to_h {role: @role, query: @query, sources: @sources} end |