Class: DSPy::Events::ModuleEvent
- Inherits:
-
T::Struct
- Object
- T::Struct
- DSPy::Events::ModuleEvent
- Defined in:
- lib/dspy/events/types.rb
Overview
DSPy module execution events
Instance Method Summary collapse
-
#initialize(name:, module_name:, timestamp: Time.now, signature_name: nil, input_fields: nil, output_fields: nil, duration_ms: nil, success: nil) ⇒ ModuleEvent
constructor
A new instance of ModuleEvent.
- #to_attributes ⇒ Object
Constructor Details
#initialize(name:, module_name:, timestamp: Time.now, signature_name: nil, input_fields: nil, output_fields: nil, duration_ms: nil, success: nil) ⇒ ModuleEvent
Returns a new instance of ModuleEvent.
115 116 117 118 119 120 121 122 123 124 125 126 |
# File 'lib/dspy/events/types.rb', line 115 def initialize(name:, module_name:, timestamp: Time.now, signature_name: nil, input_fields: nil, output_fields: nil, duration_ms: nil, success: nil) super( name: name, timestamp: , module_name: module_name, signature_name: signature_name, input_fields: input_fields, output_fields: output_fields, duration_ms: duration_ms, success: success ) end |
Instance Method Details
#to_attributes ⇒ Object
128 129 130 131 132 133 134 135 136 137 |
# File 'lib/dspy/events/types.rb', line 128 def to_attributes result = { timestamp: } result[:module_name] = module_name result[:signature_name] = signature_name if signature_name result[:input_fields] = input_fields if input_fields result[:output_fields] = output_fields if output_fields result[:duration_ms] = duration_ms if duration_ms result[:success] = success if success result end |