Class: DSPy::Instrumentation::ChainOfThoughtEvent

Inherits:
T::Struct
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/dspy/instrumentation/event_payloads.rb

Overview

Chain of Thought event payload

Instance Method Summary collapse

Instance Method Details

#to_hObject



193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
# File 'lib/dspy/instrumentation/event_payloads.rb', line 193

def to_h
  hash = {
    timestamp: timestamp,
    duration_ms: duration_ms,
    cpu_time_ms: cpu_time_ms,
    status: status,
    signature_class: signature_class,
    module_name: module_name,
    model: model,
    provider: provider
  }
  hash[:reasoning_length] = reasoning_length if reasoning_length
  hash[:answer_length] = answer_length if answer_length
  hash[:error_type] = error_type if error_type
  hash[:error_message] = error_message if error_message
  hash
end