Class: Cadenya::Types::CallableTool_Agent

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(type: nil, agent: nil) ⇒ CallableTool_Agent

Returns a new instance of CallableTool_Agent.



8987
8988
8989
8990
# File 'lib/cadenya/types.rb', line 8987

def initialize(type: nil, agent: nil)
  @type = type
  @agent = agent
end

Instance Attribute Details

#agentObject (readonly)

Returns the value of attribute agent.



8985
8986
8987
# File 'lib/cadenya/types.rb', line 8985

def agent
  @agent
end

#typeObject (readonly)

Returns the value of attribute type.



8985
8986
8987
# File 'lib/cadenya/types.rb', line 8985

def type
  @type
end

Class Method Details

.from_json(data) ⇒ Object



8992
8993
8994
8995
8996
8997
# File 'lib/cadenya/types.rb', line 8992

def self.from_json(data)
  new(
    type: data["type"],
    agent: data["agent"].nil? ? nil : Types::ResourceMetadata.from_json(data["agent"]),
  )
end

Instance Method Details

#to_hObject



8999
9000
9001
9002
9003
9004
# File 'lib/cadenya/types.rb', line 8999

def to_h
  {
    type: Util.plain(@type),
    agent: Util.plain(@agent),
  }.reject { |_k, v| v.nil? }
end