Class: DSPy::Instrumentation::CodeActCodeExecutionEvent

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

Overview

CodeAct code execution event payload

Instance Method Summary collapse

Instance Method Details

#to_hObject



403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
# File 'lib/dspy/instrumentation/event_payloads.rb', line 403

def to_h
  hash = {
    timestamp: timestamp,
    duration_ms: duration_ms,
    cpu_time_ms: cpu_time_ms,
    status: status,
    iteration: iteration,
    code_type: code_type,
    code_length: code_length,
    execution_success: execution_success
  }
  hash[:error_type] = error_type if error_type
  hash[:error_message] = error_message if error_message
  hash
end