Class: Foobara::Ai::OllamaApi::ListLocalModels

Inherits:
BaseCommand show all
Includes:
CachedCommand
Defined in:
foobara-ollama-api-1.0.4/src/foobara/ai/ollama_api/list_local_models.rb

Constant Summary

Constants included from TruncatedInspect

TruncatedInspect::MAX_LENGTH

Instance Method Summary collapse

Methods inherited from BaseCommand

#api_token, #build_request_headers

Methods inherited from Command

install!

Methods included from CommandPatternImplementation

install_state_machine_callback_methods

Methods included from TruncatedInspect

#inspect, truncating

Methods included from Concern

foobara_class_methods_module_for, foobara_concern?, included

Instance Method Details

#build_result ⇒ Object



17
18
19
20
21
# File 'src/foobara/ai/ollama_api/list_local_models.rb', line 17

def build_result
  response_body["models"].map do |model_data|
    Types::LocalModel.new(model_data, ignore_unexpected_attributes: true)
  end
end