Class: Riffer::StreamEvents::SkillActivation

Inherits:
Base
  • Object
show all
Defined in:
lib/riffer/stream_events/skill_activation.rb

Overview

Emitted when a skill is activated during streaming.

Fired by the on_activate callback on Riffer::Skills::Context when the LLM calls the skill activation tool.

Instance Attribute Summary collapse

Attributes inherited from Base

#role

Instance Method Summary collapse

Constructor Details

#initialize(name, role: :system) ⇒ SkillActivation

– : (String, ?role: Symbol) -> void



14
15
16
17
# File 'lib/riffer/stream_events/skill_activation.rb', line 14

def initialize(name, role: :system)
  super(role: role)
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

The activated skill name.



10
11
12
# File 'lib/riffer/stream_events/skill_activation.rb', line 10

def name
  @name
end

Instance Method Details

#to_hObject

– : () -> Hash[Symbol, untyped]



21
22
23
# File 'lib/riffer/stream_events/skill_activation.rb', line 21

def to_h
  {role: @role, name: @name}
end