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

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

Overview

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.

API:

  • private

Instance Method Summary collapse

Instance Method Details

#resolve(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.

API:

  • private



51
52
53
54
55
56
57
58
59
60
61
# File 'lib/llm/shell/internal/llm.rb/lib/llm/tool/param.rb', line 51

def resolve(type)
  if type == String
    :string
  elsif type == Integer
    :integer
  elsif type == Float
    :number
  else
    type
  end
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.

API:

  • private



63
64
65
66
67
68
69
70
71
72
# File 'lib/llm/shell/internal/llm.rb/lib/llm/tool/param.rb', line 63

def setup(leaf, description, options)
  required = options.fetch(:required, false)
  default = options.fetch(:default, nil)
  enum = options.fetch(:enum, nil)
  leaf.required if required
  leaf.description(description) if description
  leaf.default(default) if default
  leaf.enum(enum) if enum
  leaf
end