Class: DSPy::Instrumentation::ReactToolCallEvent

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

Overview

ReAct tool call event payload

Instance Method Summary collapse

Instance Method Details

#to_hObject



270
271
272
273
274
275
276
277
278
279
280
281
282
283
# File 'lib/dspy/instrumentation/event_payloads.rb', line 270

def to_h
  hash = {
    timestamp: timestamp,
    duration_ms: duration_ms,
    cpu_time_ms: cpu_time_ms,
    status: status,
    iteration: iteration,
    tool_name: tool_name,
    tool_input: tool_input
  }
  hash[:error_type] = error_type if error_type
  hash[:error_message] = error_message if error_message
  hash
end