Module: RubyLLM::Providers::OpenAIResponses::ChatExtension

Defined in:
lib/ruby_llm/providers/openai_responses/chat_extension.rb

Overview

Extends RubyLLM::Chat to fire on_tool_call / on_tool_result for built-in server-side tools (web_search, code_interpreter, file_search, etc.) carried on the assistant message. This lets users observe built-in tool activity through the same callback API as locally executed function tools (issue #1).

Instance Method Summary collapse

Instance Method Details

#add_message(message_or_attributes) ⇒ Object



12
13
14
15
16
# File 'lib/ruby_llm/providers/openai_responses/chat_extension.rb', line 12

def add_message(message_or_attributes)
  message = super
  dispatch_built_in_tool_events(message) if dispatch_built_in_tool_events?(message)
  message
end