Class: Cadenya::Types::AgentVariationInfo

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(tool_count: nil, tool_set_count: nil, sub_agent_count: nil, created_by: nil, model: nil, score: nil, feedback_count: nil, assignments: nil, memory_layer_assignments: nil, memory_layer_count: nil) ⇒ AgentVariationInfo

Returns a new instance of AgentVariationInfo.



638
639
640
641
642
643
644
645
646
647
648
649
# File 'lib/cadenya/types.rb', line 638

def initialize(tool_count: nil, tool_set_count: nil, sub_agent_count: nil, created_by: nil, model: nil, score: nil, feedback_count: nil, assignments: nil, memory_layer_assignments: nil, memory_layer_count: nil)
  @tool_count = tool_count
  @tool_set_count = tool_set_count
  @sub_agent_count = sub_agent_count
  @created_by = created_by
  @model = model
  @score = score
  @feedback_count = feedback_count
  @assignments = assignments
  @memory_layer_assignments = memory_layer_assignments
  @memory_layer_count = memory_layer_count
end

Instance Attribute Details

#assignmentsObject (readonly)

Returns the value of attribute assignments.



636
637
638
# File 'lib/cadenya/types.rb', line 636

def assignments
  @assignments
end

#created_byObject (readonly)

Returns the value of attribute created_by.



636
637
638
# File 'lib/cadenya/types.rb', line 636

def created_by
  @created_by
end

#feedback_countObject (readonly)

Returns the value of attribute feedback_count.



636
637
638
# File 'lib/cadenya/types.rb', line 636

def feedback_count
  @feedback_count
end

#memory_layer_assignmentsObject (readonly)

Returns the value of attribute memory_layer_assignments.



636
637
638
# File 'lib/cadenya/types.rb', line 636

def memory_layer_assignments
  @memory_layer_assignments
end

#memory_layer_countObject (readonly)

Returns the value of attribute memory_layer_count.



636
637
638
# File 'lib/cadenya/types.rb', line 636

def memory_layer_count
  @memory_layer_count
end

#modelObject (readonly)

Returns the value of attribute model.



636
637
638
# File 'lib/cadenya/types.rb', line 636

def model
  @model
end

#scoreObject (readonly)

Returns the value of attribute score.



636
637
638
# File 'lib/cadenya/types.rb', line 636

def score
  @score
end

#sub_agent_countObject (readonly)

Returns the value of attribute sub_agent_count.



636
637
638
# File 'lib/cadenya/types.rb', line 636

def sub_agent_count
  @sub_agent_count
end

#tool_countObject (readonly)

Returns the value of attribute tool_count.



636
637
638
# File 'lib/cadenya/types.rb', line 636

def tool_count
  @tool_count
end

#tool_set_countObject (readonly)

Returns the value of attribute tool_set_count.



636
637
638
# File 'lib/cadenya/types.rb', line 636

def tool_set_count
  @tool_set_count
end

Class Method Details

.from_json(data) ⇒ Object



651
652
653
654
655
656
657
658
659
660
661
662
663
664
# File 'lib/cadenya/types.rb', line 651

def self.from_json(data)
  new(
    tool_count: data["toolCount"],
    tool_set_count: data["toolSetCount"],
    sub_agent_count: data["subAgentCount"],
    created_by: data["createdBy"].nil? ? nil : Types::Profile.from_json(data["createdBy"]),
    model: data["model"].nil? ? nil : Types::ResourceMetadata.from_json(data["model"]),
    score: data["score"],
    feedback_count: data["feedbackCount"],
    assignments: data["assignments"].nil? ? nil : (data["assignments"]).map { |item| Types.decode_VariationAssignment(item) },
    memory_layer_assignments: data["memoryLayerAssignments"].nil? ? nil : (data["memoryLayerAssignments"]).map { |item| Types::VariationMemoryLayerAssignment.from_json(item) },
    memory_layer_count: data["memoryLayerCount"],
  )
end

Instance Method Details

#to_hObject



666
667
668
669
670
671
672
673
674
675
676
677
678
679
# File 'lib/cadenya/types.rb', line 666

def to_h
  {
    tool_count: Util.plain(@tool_count),
    tool_set_count: Util.plain(@tool_set_count),
    sub_agent_count: Util.plain(@sub_agent_count),
    created_by: Util.plain(@created_by),
    model: Util.plain(@model),
    score: Util.plain(@score),
    feedback_count: Util.plain(@feedback_count),
    assignments: Util.plain(@assignments),
    memory_layer_assignments: Util.plain(@memory_layer_assignments),
    memory_layer_count: Util.plain(@memory_layer_count),
  }.reject { |_k, v| v.nil? }
end