Class: Ollama::Tool::Function::Parameters

Inherits:
Object
  • Object
show all
Includes:
DTO
Defined in:
lib/ollama/tool/function/parameters.rb

Defined Under Namespace

Classes: Property

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from DTO

#as_array_of_hashes, #as_json, #to_json

Constructor Details

#initialize(type:, properties:, required:) ⇒ Parameters

Returns a new instance of Parameters.



6
7
8
9
# File 'lib/ollama/tool/function/parameters.rb', line 6

def initialize(type:, properties:, required:)
  @type, @properties, @required =
    type, Hash(properties).transform_values(&:to_hash), Array(required)
end

Instance Attribute Details

#propertiesObject (readonly)

Returns the value of attribute properties.



4
5
6
# File 'lib/ollama/tool/function/parameters.rb', line 4

def properties
  @properties
end

#requiredObject (readonly)

Returns the value of attribute required.



4
5
6
# File 'lib/ollama/tool/function/parameters.rb', line 4

def required
  @required
end

#typeObject (readonly)

Returns the value of attribute type.



4
5
6
# File 'lib/ollama/tool/function/parameters.rb', line 4

def type
  @type
end