Module: RubyLLM::Providers::OpenAIResponses::MessageExtension
- Defined in:
- lib/ruby_llm/providers/openai_responses/message_extension.rb
Overview
Extends RubyLLM::Message to support response_id for stateful conversations and built_in_tool_events for server-side tool calls (web_search, code_interpreter, etc.) that should fire on_tool_call/on_tool_result.
Instance Attribute Summary collapse
-
#built_in_tool_events ⇒ Object
Returns the value of attribute built_in_tool_events.
-
#response_id ⇒ Object
Returns the value of attribute response_id.
Class Method Summary collapse
Instance Attribute Details
#built_in_tool_events ⇒ Object
Returns the value of attribute built_in_tool_events.
10 11 12 |
# File 'lib/ruby_llm/providers/openai_responses/message_extension.rb', line 10 def built_in_tool_events @built_in_tool_events end |
#response_id ⇒ Object
Returns the value of attribute response_id.
10 11 12 |
# File 'lib/ruby_llm/providers/openai_responses/message_extension.rb', line 10 def response_id @response_id end |
Class Method Details
.included(base) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/ruby_llm/providers/openai_responses/message_extension.rb', line 12 def self.included(base) base.class_eval do alias_method :original_initialize, :initialize define_method(:initialize) do | = {}| original_initialize() @response_id = [:response_id] @built_in_tool_events = [:built_in_tool_events] end alias_method :original_to_h, :to_h define_method(:to_h) do original_to_h.merge(response_id: response_id).compact end end end |