Class: DatagroutConduit::DiscoveredTool
- Inherits:
-
Struct
- Object
- Struct
- DatagroutConduit::DiscoveredTool
- Defined in:
- lib/datagrout_conduit/types.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#input_schema ⇒ Object
Returns the value of attribute input_schema.
-
#integration ⇒ Object
Returns the value of attribute integration.
-
#name ⇒ Object
Returns the value of attribute name.
-
#score ⇒ Object
Returns the value of attribute score.
-
#server ⇒ Object
Returns the value of attribute server.
Class Method Summary collapse
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description
149 150 151 |
# File 'lib/datagrout_conduit/types.rb', line 149 def description @description end |
#input_schema ⇒ Object
Returns the value of attribute input_schema
149 150 151 |
# File 'lib/datagrout_conduit/types.rb', line 149 def input_schema @input_schema end |
#integration ⇒ Object
Returns the value of attribute integration
149 150 151 |
# File 'lib/datagrout_conduit/types.rb', line 149 def integration @integration end |
#name ⇒ Object
Returns the value of attribute name
149 150 151 |
# File 'lib/datagrout_conduit/types.rb', line 149 def name @name end |
#score ⇒ Object
Returns the value of attribute score
149 150 151 |
# File 'lib/datagrout_conduit/types.rb', line 149 def score @score end |
#server ⇒ Object
Returns the value of attribute server
149 150 151 |
# File 'lib/datagrout_conduit/types.rb', line 149 def server @server end |
Class Method Details
.from_hash(hash) ⇒ Object
150 151 152 153 154 155 156 157 158 159 160 161 |
# File 'lib/datagrout_conduit/types.rb', line 150 def self.from_hash(hash) hash = hash.transform_keys(&:to_s) # DG returns "tool_name" (not "name") and "input_contract" (not "input_schema") new( name: hash["tool_name"] || hash["name"], description: hash["description"], input_schema: hash["input_contract"] || hash["input_schema"] || hash["inputSchema"], score: hash["score"]&.to_f, integration: hash["integration"], server: hash["server"] ) end |