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



246
247
248
249
250
251
# File 'lib/activeagents/telemetry/ruby_llm.rb', line 246

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



240
241
242
243
244
# File 'lib/activeagents/telemetry/ruby_llm.rb', line 240

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