Class: DSPy::Instrumentation::ReactIterationEvent

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

Overview

ReAct iteration event payload

Instance Method Summary collapse

Instance Method Details

#to_hObject



233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
# File 'lib/dspy/instrumentation/event_payloads.rb', line 233

def to_h
  hash = {
    timestamp: timestamp,
    duration_ms: duration_ms,
    cpu_time_ms: cpu_time_ms,
    status: status,
    iteration: iteration,
    max_iterations: max_iterations,
    history_length: history_length,
    tools_used_so_far: tools_used_so_far
  }
  hash[:error_type] = error_type if error_type
  hash[:error_message] = error_message if error_message
  hash
end