Class: DSPy::Events::Event
- Inherits:
-
T::Struct
- Object
- T::Struct
- DSPy::Events::Event
- Defined in:
- lib/dspy/events/types.rb
Overview
Base event structure using Sorbet T::Struct
Instance Method Summary collapse
-
#initialize(name:, timestamp: Time.now, attributes: {}) ⇒ Event
constructor
A new instance of Event.
- #to_attributes ⇒ Object
Constructor Details
#initialize(name:, timestamp: Time.now, attributes: {}) ⇒ Event
Returns a new instance of Event.
13 14 15 |
# File 'lib/dspy/events/types.rb', line 13 def initialize(name:, timestamp: Time.now, attributes: {}) super(name: name, timestamp: , attributes: attributes) end |
Instance Method Details
#to_attributes ⇒ Object
17 18 19 20 21 |
# File 'lib/dspy/events/types.rb', line 17 def to_attributes result = attributes.dup result[:timestamp] = result end |