Class: DSPy::HistoryEntry

Inherits:
T::Struct
  • Object
show all
Defined in:
lib/dspy/re_act.rb

Overview

Define a simple struct for history entries with proper type annotations

Instance Method Summary collapse

Instance Method Details

#to_hObject

Custom serialization to ensure compatibility with the rest of the code



21
22
23
24
25
26
27
28
29
# File 'lib/dspy/re_act.rb', line 21

def to_h
  {
    step: step,
    thought: thought,
    action: action,
    action_input: action_input,
    observation: observation
  }.compact
end