Class: DSPy::Instrumentation::LMResponseParsedEvent

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

Overview

LM Response parsed event payload

Instance Method Summary collapse

Instance Method Details

#to_hObject



108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/dspy/instrumentation/event_payloads.rb', line 108

def to_h
  hash = {
    timestamp: timestamp,
    duration_ms: duration_ms,
    cpu_time_ms: cpu_time_ms,
    status: status,
    signature_class: signature_class,
    provider: provider,
    success: success,
    response_length: response_length
  }
  hash[:parse_type] = parse_type if parse_type
  hash[:error_type] = error_type if error_type
  hash[:error_message] = error_message if error_message
  hash
end