Class: ActiveAgents::Telemetry::RubyLLM::ChatSubscriber

Inherits:
Object
  • Object
show all
Defined in:
lib/activeagents/telemetry/ruby_llm.rb

Overview

Evented ActiveSupport::Notifications subscriber; finish fires even when the instrumented block raises, with the exception on the payload.

Instance Method Summary collapse

Instance Method Details

#finish(_name, _id, payload) ⇒ Object



311
312
313
314
315
316
# File 'lib/activeagents/telemetry/ruby_llm.rb', line 311

def finish(_name, _id, payload)
  RubyLLM.finish_round(payload)
rescue StandardError => e
  warn "[#{SDK_NAME}] #{e.class}: #{e.message}"
  RubyLLM.clear_state
end

#start(_name, _id, payload) ⇒ Object



305
306
307
308
309
# File 'lib/activeagents/telemetry/ruby_llm.rb', line 305

def start(_name, _id, payload)
  RubyLLM.begin_round(payload)
rescue StandardError => e
  warn "[#{SDK_NAME}] #{e.class}: #{e.message}"
end