Class: Rubyagents::PlanningStep

Inherits:
Data
  • Object
show all
Defined in:
lib/rubyagents/memory.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#duration ⇒ Object (readonly)

Returns the value of attribute duration

Returns:

  • (Object) —

    the current value of duration



21
22
23
# File 'lib/rubyagents/memory.rb', line 21

def duration
  @duration
end

#plan ⇒ Object (readonly)

Returns the value of attribute plan

Returns:

  • (Object) —

    the current value of plan



21
22
23
# File 'lib/rubyagents/memory.rb', line 21

def plan
  @plan
end

#token_usage ⇒ Object (readonly)

Returns the value of attribute token_usage

Returns:

  • (Object) —

    the current value of token_usage



21
22
23
# File 'lib/rubyagents/memory.rb', line 21

def token_usage
  @token_usage
end

Instance Method Details

#to_h ⇒ Object



22
23
24
25
26
# File 'lib/rubyagents/memory.rb', line 22

def to_h
  h = { type: "planning", plan: plan, duration: duration }
  h[:token_usage] = token_usage.to_h if token_usage
  h
end