class Ollama::Commands::Pull
@return [ self ] returns the receiver after defining the command method
as default, otherwise ‘default_handler`.
@note Create Command `name`, if `stream` was true, set `stream_handler`
@param stream_handler [ Class, nil ] the handler class to use for streaming responses, if applicable
@param default_handler [ Class ] the default handler class to use when no explicit handler is provided
@param name [ Symbol ] the name of the command to define
command supports streaming and the presence of an explicit handler.
process responses. It determines which handler to use based on whether the
command method can be invoked with parameters and an optional handler to
Defines a new command method that corresponds to an Ollama API endpoint. The
The command method creates a command method for the Ollama client
def self.path
-
(String)- the API endpoint path '/api/pull' for pull requests
def self.path '/api/pull' end
def initialize(model:, insecure: nil, stream: true)
-
stream(TrueClass, FalseClass) -- whether to enable streaming for -
insecure(TrueClass, FalseClass, nil) -- whether to allow insecure -
model(String) -- the name of the model to be pushed
def initialize(model:, insecure: nil, stream: true) @model, @insecure, @stream = model, insecure, stream end
def perform(handler)
-
(self)- returns the current instance after initiating the request
Parameters:
-
handler(Ollama::Handler) -- the handler object responsible for processing API
def perform(handler) @client.request(method: :post, path: self.class.path, body: to_json, stream:, handler:) end