Class: RobotLab::HistoryCompressor::SUMMARY_STRUCT

Inherits:
Struct
  • Object
show all
Defined in:
lib/robot_lab/history_compressor.rb

Overview

Minimal duck-type for a summary replacement message compatible with RubyLLM::Chat’s message array. Preserves the original message role so user/assistant turn ordering is maintained after compression.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#contentObject

Returns the value of attribute content

Returns:

  • (Object)

    the current value of content



31
32
33
# File 'lib/robot_lab/history_compressor.rb', line 31

def content
  @content
end

#roleObject

Returns the value of attribute role

Returns:

  • (Object)

    the current value of role



31
32
33
# File 'lib/robot_lab/history_compressor.rb', line 31

def role
  @role
end

#stop_reasonObject

Returns the value of attribute stop_reason

Returns:

  • (Object)

    the current value of stop_reason



31
32
33
# File 'lib/robot_lab/history_compressor.rb', line 31

def stop_reason
  @stop_reason
end

#tool_callsObject

Returns the value of attribute tool_calls

Returns:

  • (Object)

    the current value of tool_calls



31
32
33
# File 'lib/robot_lab/history_compressor.rb', line 31

def tool_calls
  @tool_calls
end

Instance Method Details

#assistant?Boolean

Returns:

  • (Boolean)


36
# File 'lib/robot_lab/history_compressor.rb', line 36

def assistant? = role == :assistant

#system?Boolean

Returns:

  • (Boolean)


34
# File 'lib/robot_lab/history_compressor.rb', line 34

def system?    = role == :system

#text?Boolean

Returns:

  • (Boolean)


32
# File 'lib/robot_lab/history_compressor.rb', line 32

def text?      = true

#tool_use?Boolean

Returns:

  • (Boolean)


33
# File 'lib/robot_lab/history_compressor.rb', line 33

def tool_use?  = false

#user?Boolean

Returns:

  • (Boolean)


35
# File 'lib/robot_lab/history_compressor.rb', line 35

def user?      = role == :user