Class: Cadenya::Types::AgentVariationSpec_CompactionConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/cadenya/types.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(trigger_threshold: nil, summarization: nil, tool_result_clearing: nil) ⇒ AgentVariationSpec_CompactionConfig

Returns a new instance of AgentVariationSpec_CompactionConfig.



723
724
725
726
727
# File 'lib/cadenya/types.rb', line 723

def initialize(trigger_threshold: nil, summarization: nil, tool_result_clearing: nil)
  @trigger_threshold = trigger_threshold
  @summarization = summarization
  @tool_result_clearing = tool_result_clearing
end

Instance Attribute Details

#summarizationObject (readonly)

Returns the value of attribute summarization.



721
722
723
# File 'lib/cadenya/types.rb', line 721

def summarization
  @summarization
end

#tool_result_clearingObject (readonly)

Returns the value of attribute tool_result_clearing.



721
722
723
# File 'lib/cadenya/types.rb', line 721

def tool_result_clearing
  @tool_result_clearing
end

#trigger_thresholdObject (readonly)

Returns the value of attribute trigger_threshold.



721
722
723
# File 'lib/cadenya/types.rb', line 721

def trigger_threshold
  @trigger_threshold
end

Class Method Details

.from_json(data) ⇒ Object



729
730
731
732
733
734
735
# File 'lib/cadenya/types.rb', line 729

def self.from_json(data)
  new(
    trigger_threshold: data["triggerThreshold"],
    summarization: data["summarization"].nil? ? nil : Types::CompactionConfig_SummarizationStrategy.from_json(data["summarization"]),
    tool_result_clearing: data["toolResultClearing"].nil? ? nil : Types::CompactionConfig_ToolResultClearingStrategy.from_json(data["toolResultClearing"]),
  )
end

Instance Method Details

#to_hObject



737
738
739
740
741
742
743
# File 'lib/cadenya/types.rb', line 737

def to_h
  {
    trigger_threshold: Util.plain(@trigger_threshold),
    summarization: Util.plain(@summarization),
    tool_result_clearing: Util.plain(@tool_result_clearing),
  }.reject { |_k, v| v.nil? }
end