Class: DSPy::CodeActHistoryEntry

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

Overview

Define a simple struct for CodeAct 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



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

def to_h
  {
    step: step,
    thought: thought,
    ruby_code: ruby_code,
    execution_result: execution_result,
    error_message: error_message
  }.compact
end