class Ollama::Tool::Function::Parameters
)
required: %w[location]
properties: { location: property },
type: ‘object’,
parameters = Ollama::Tool::Function::Parameters.new(
)
description: ‘The location to get weather for’
type: ‘string’,
property = Ollama::Tool::Function::Parameters::Property.new(
@example Creating a parameters specification for a tool function
properties of each parameter, and which parameters are required.
that a function tool accepts. It includes the type of parameter object, the
This class encapsulates the structure required for defining the parameters
Ollama API interactions.
A class that represents the parameters specification for a tool function in
def initialize(type:, properties:, required:)
-
required(Array) -- the names of required parameters -
properties(Hash) -- the properties of each parameter -
type(String) -- the type of parameter object
def initialize(type:, properties:, required:) @type, @properties, @required = type, Hash(properties).transform_values(&:to_hash), Array(required) end