Module: LLM::Tool::Param::Utils Private

Extended by:
Utils
Included in:
Utils
Defined in:
lib/llm/tool/param.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Instance Method Summary collapse

Instance Method Details

#resolve(schema, type) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



85
86
87
# File 'lib/llm/tool/param.rb', line 85

def resolve(schema, type)
  LLM::Schema::Utils.resolve(schema, type)
end

#setup(leaf, description, options) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



89
90
91
92
93
94
95
# File 'lib/llm/tool/param.rb', line 89

def setup(leaf, description, options)
  options = {description:}.merge(options)
  options.each do |name, value|
    (value == true) ? leaf.public_send(name) : leaf.public_send(name, *value)
  end
  leaf
end

#fetch(properties, name) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



97
98
99
# File 'lib/llm/tool/param.rb', line 97

def fetch(properties, name)
  properties[name] || properties.fetch(name.to_s)
end