Class: Riffer::StreamEvents::WebSearchDone
- Defined in:
- lib/riffer/stream_events/web_search_done.rb
Overview
Represents the result of a web search during streaming.
Emitted when the LLM has finished a server-side web search.
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
16 17 18 19 20 |
# File 'lib/riffer/stream_events/web_search_done.rb', line 16 def initialize(query, sources: [], role: :assistant) super(role: role) @query = query @sources = sources end |
Instance Attribute Details
#query ⇒ Object (readonly)
The search query used.
9 10 11 |
# File 'lib/riffer/stream_events/web_search_done.rb', line 9 def query @query end |
#sources ⇒ Object (readonly)
The search result sources with title and url.
12 13 14 |
# File 'lib/riffer/stream_events/web_search_done.rb', line 12 def sources @sources end |
Instance Method Details
#to_h ⇒ Object
– : () -> Hash[Symbol, untyped]
24 25 26 |
# File 'lib/riffer/stream_events/web_search_done.rb', line 24 def to_h {role: @role, query: @query, sources: @sources} end |