Class ModelLibrary

java.lang.Object
eu.svjatoslav.alyverkko_cli.model.ModelLibrary

public class ModelLibrary extends Object
  • Constructor Details

    • ModelLibrary

      public ModelLibrary(File modelsBaseDirectory, List<ConfigurationModel> configModels)
      Represents a library of AI models.
      Parameters:
      modelsBaseDirectory - the directory containing the models
  • Method Details

    • addModel

      public void addModel(Model model)
      Adds a given model to the existing models list if it does not already exist.
      Parameters:
      model - the model to be added
      Throws:
      RuntimeException - if a model with the same alias already exists in the models list
    • getModels

      public List<Model> getModels()
      Returns a list of all the models.
      Returns:
      a list of Model objects representing the models
    • findModelByAlias

      public Optional<Model> findModelByAlias(String alias)
      Finds a model by its alias.
      Parameters:
      alias - the alias of the model to be found
      Returns:
      an Optional containing the model if it was found, or an empty Optional otherwise
    • getDefaultModel

      public Model getDefaultModel()
    • printModels

      public void printModels()
      Prints the details of each model in the list.