class Ollama::Commands::Tags
tags.models # => array of model information hashes
tags = ollama.tags
@example Retrieving a list of local models
tag listing requests.
base command structure and provides the necessary functionality to execute
retrieves information about locally available models. It inherits from the
This class is used to interact with the Ollama API’s tags endpoint, which
A command class that represents the tags API endpoint for Ollama.
def self.path
-
(String)- the API endpoint path '/api/tags' for tag listing requests
def self.path '/api/tags' end
def initialize(**parameters)
-
parameters(Hash) -- a hash containing initialization parameters
def initialize(**parameters) parameters.empty? or raise ArgumentError, "Invalid parameters: #{parameters.keys * ' '}" @stream = false end
def perform(handler)
-
(self)- returns the current instance after initiating the request
Parameters:
-
handler(Ollama::Handlers) -- the handler object responsible for processing API responses
def perform(handler) @client.request(method: :get, path: self.class.path, stream:, handler:) end