Class: Cadenya::Types::ToolSpec
- Inherits:
-
Object
- Object
- Cadenya::Types::ToolSpec
- Defined in:
- lib/cadenya/types.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#llm_tool_name ⇒ Object
readonly
Returns the value of attribute llm_tool_name.
-
#parameters ⇒ Object
readonly
Returns the value of attribute parameters.
-
#requires_approval ⇒ Object
readonly
Returns the value of attribute requires_approval.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(description: nil, requires_approval: nil, parameters: nil, config: nil, llm_tool_name: nil) ⇒ ToolSpec
constructor
A new instance of ToolSpec.
- #to_h ⇒ Object
Constructor Details
#initialize(description: nil, requires_approval: nil, parameters: nil, config: nil, llm_tool_name: nil) ⇒ ToolSpec
Returns a new instance of ToolSpec.
6398 6399 6400 6401 6402 6403 6404 |
# File 'lib/cadenya/types.rb', line 6398 def initialize(description: nil, requires_approval: nil, parameters: nil, config: nil, llm_tool_name: nil) @description = description @requires_approval = requires_approval @parameters = parameters @config = config @llm_tool_name = llm_tool_name end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
6396 6397 6398 |
# File 'lib/cadenya/types.rb', line 6396 def config @config end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
6396 6397 6398 |
# File 'lib/cadenya/types.rb', line 6396 def description @description end |
#llm_tool_name ⇒ Object (readonly)
Returns the value of attribute llm_tool_name.
6396 6397 6398 |
# File 'lib/cadenya/types.rb', line 6396 def llm_tool_name @llm_tool_name end |
#parameters ⇒ Object (readonly)
Returns the value of attribute parameters.
6396 6397 6398 |
# File 'lib/cadenya/types.rb', line 6396 def parameters @parameters end |
#requires_approval ⇒ Object (readonly)
Returns the value of attribute requires_approval.
6396 6397 6398 |
# File 'lib/cadenya/types.rb', line 6396 def requires_approval @requires_approval end |
Class Method Details
.from_json(data) ⇒ Object
6406 6407 6408 6409 6410 6411 6412 6413 6414 |
# File 'lib/cadenya/types.rb', line 6406 def self.from_json(data) new( description: data["description"], requires_approval: data["requiresApproval"], parameters: data["parameters"], config: data["config"].nil? ? nil : Types.decode_ToolSpec_Config(data["config"]), llm_tool_name: data["llmToolName"], ) end |
Instance Method Details
#to_h ⇒ Object
6416 6417 6418 6419 6420 6421 6422 6423 6424 |
# File 'lib/cadenya/types.rb', line 6416 def to_h { description: Util.plain(@description), requires_approval: Util.plain(@requires_approval), parameters: Util.plain(@parameters), config: Util.plain(@config), llm_tool_name: Util.plain(@llm_tool_name), }.reject { |_k, v| v.nil? } end |