class Ollama::Commands::Version

puts version # => “0.1.0” or similar version string
version = ollama.version
@example Retrieving the Ollama server version
to execute version requests.
from the base command structure and provides the necessary functionality
which retrieves information about the Ollama server’s version. It inherits
This class is used to interact with the Ollama API’s version endpoint,
A command class that represents the version API endpoint for Ollama.

def self.path

Returns:
  • (String) - the API endpoint path '/api/version' for version
def self.path
  '/api/version'
end

def initialize

the initial state of the instance.
It is typically called during the object creation process to establish
configuring it with a default setting that disables streaming behavior.
This method is responsible for initializing a new object instance and

The initialize method sets up a new instance with streaming disabled.
def initialize
  @stream = false
end

def perform(handler)

Returns:
  • (self) - returns the current instance after initiating the request

Parameters:
  • handler (Ollama::Handler) -- the handler object responsible for processing API responses
def perform(handler)
  @client.request(method: :get, path: self.class.path, stream:, handler:)
end