import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
import java.io.*;
import java.util.List;
+@Data
public class Configuration {
private static final String DEFAULT_CONFIG_FILE_PATH = "~/.config/alyverkko-cli.yaml".replaceFirst("^~", System.getProperty("user.home"));
private List<ConfigurationModel> models;
- public List<ConfigurationModel> getModels() {
- return models;
- }
-
public void setModels(List<ConfigurationModel> models) {
this.models = models;
}
return mapper.readValue(configFile, Configuration.class);
}
- public List<Prompt> getPrompts() {
- return prompts;
- }
-
- public void setPrompts(List<Prompt> prompts) {
- this.prompts = prompts;
- }
-
- public File getMailDirectory() {
- return mailDirectory;
- }
-
- public void setMailDirectory(File mailDirectory) {
- this.mailDirectory = mailDirectory;
- }
-
- public File getModelsDirectory() {
- return modelsDirectory;
- }
-
- public void setModelsDirectory(File modelsDirectory) {
- this.modelsDirectory = modelsDirectory;
- }
-
- public float getDefaultTemperature() {
- return defaultTemperature;
- }
-
- public void setDefaultTemperature(float defaultTemperature) {
- this.defaultTemperature = defaultTemperature;
- }
-
- public File getLlamaCppDirPath() {
- return llamaCppDirPath;
- }
-
- public void setLlamaCppDirPath(File llamaCppDirPath) {
- this.llamaCppDirPath = llamaCppDirPath;
- }
-
- public int getBatchThreadCount() {
- return batchThreadCount;
- }
-
- public void setBatchThreadCount(int batchThreadCount) {
- this.batchThreadCount = batchThreadCount;
- }
-
- public int getThreadCount() {
- return threadCount;
- }
-
- public void setThreadCount(int threadCount) {
- this.threadCount = threadCount;
- }
-
public String getPromptByAlias(String alias) {
//System.out.println("Prompts: " + prompts);
package eu.svjatoslav.alyverkko_cli.configuration;
import com.fasterxml.jackson.annotation.JsonProperty;
+import lombok.Data;
+@Data
public class ConfigurationModel {
private String alias;
@JsonProperty("end_of_text_marker")
private String endOfTextMarker;
- public String getAlias() {
- return alias;
- }
-
- public void setAlias(String alias) {
- this.alias = alias;
- }
-
- public String getFilesystemPath() {
- return filesystemPath;
- }
-
- public void setFilesystemPath(String filesystemPath) {
- this.filesystemPath = filesystemPath;
- }
-
- public int getContextSizeTokens() {
- return contextSizeTokens;
- }
-
- public void setContextSizeTokens(int contextSizeTokens) {
- this.contextSizeTokens = contextSizeTokens;
- }
-
- public String getEndOfTextMarker() {
- return endOfTextMarker;
- }
-
- public void setEndOfTextMarker(String endOfTextMarker) {
- this.endOfTextMarker = endOfTextMarker;
- }
-
}
package eu.svjatoslav.alyverkko_cli.configuration;
+import lombok.Data;
+
+@Data
public class Prompt {
private String alias;
private String prompt;
- public String getAlias() {
- return alias;
- }
-
- public void setAlias(String alias) {
- this.alias = alias;
- }
-
- public String getPrompt() {
- return prompt;
- }
-
- public void setPrompt(String prompt) {
- this.prompt = prompt;
- }
-
- @Override
- public String toString() {
- return "Prompt{" +
- "alias='" + alias + '\'' +
- ", prompt='" + prompt + '\'' +
- '}';
- }
}