mirror of
				https://github.com/amithkoujalgi/ollama4j.git
				synced 2025-11-04 10:30:41 +01:00 
			
		
		
		
	Updated models with @JsonProperty to have Java-naming conventions for attributes
				
					
				
			This commit is contained in:
		@@ -1,7 +1,12 @@
 | 
			
		||||
package io.github.amithkoujalgi.ollama4j.core.models;
 | 
			
		||||
 | 
			
		||||
import com.fasterxml.jackson.annotation.JsonProperty;
 | 
			
		||||
 | 
			
		||||
public class Model {
 | 
			
		||||
    private String name, modified_at, digest;
 | 
			
		||||
    private String name;
 | 
			
		||||
    @JsonProperty("modified_at")
 | 
			
		||||
    private String modifiedAt;
 | 
			
		||||
    private String digest;
 | 
			
		||||
    private Long size;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
@@ -32,12 +37,12 @@ public class Model {
 | 
			
		||||
        this.name = name;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public String getModified_at() {
 | 
			
		||||
        return modified_at;
 | 
			
		||||
    public String getModifiedAt() {
 | 
			
		||||
        return modifiedAt;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setModified_at(String modified_at) {
 | 
			
		||||
        this.modified_at = modified_at;
 | 
			
		||||
    public void setModifiedAt(String modifiedAt) {
 | 
			
		||||
        this.modifiedAt = modifiedAt;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public String getDigest() {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,10 +1,14 @@
 | 
			
		||||
package io.github.amithkoujalgi.ollama4j.core.models;
 | 
			
		||||
 | 
			
		||||
import com.fasterxml.jackson.annotation.JsonProperty;
 | 
			
		||||
import com.fasterxml.jackson.core.JsonProcessingException;
 | 
			
		||||
import com.fasterxml.jackson.databind.ObjectMapper;
 | 
			
		||||
 | 
			
		||||
public class ModelDetail {
 | 
			
		||||
    private String license, modelfile, parameters, template;
 | 
			
		||||
    private String license;
 | 
			
		||||
    @JsonProperty("modelfile")
 | 
			
		||||
    private String modelFile;
 | 
			
		||||
    private String parameters, template;
 | 
			
		||||
 | 
			
		||||
    public String getLicense() {
 | 
			
		||||
        return license;
 | 
			
		||||
@@ -14,12 +18,12 @@ public class ModelDetail {
 | 
			
		||||
        this.license = license;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public String getModelfile() {
 | 
			
		||||
        return modelfile;
 | 
			
		||||
    public String getModelFile() {
 | 
			
		||||
        return modelFile;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setModelfile(String modelfile) {
 | 
			
		||||
        this.modelfile = modelfile;
 | 
			
		||||
    public void setModelFile(String modelFile) {
 | 
			
		||||
        this.modelFile = modelFile;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public String getParameters() {
 | 
			
		||||
 
 | 
			
		||||
@@ -1,61 +1,118 @@
 | 
			
		||||
package io.github.amithkoujalgi.ollama4j.core.models;
 | 
			
		||||
 | 
			
		||||
import com.fasterxml.jackson.annotation.JsonProperty;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
public class OllamaResponseModel {
 | 
			
		||||
    private String model;
 | 
			
		||||
    private String created_at;
 | 
			
		||||
    @JsonProperty("created_at")
 | 
			
		||||
    private String createdAt;
 | 
			
		||||
    private String response;
 | 
			
		||||
    private Boolean done;
 | 
			
		||||
    private List<Integer> context;
 | 
			
		||||
    private Long total_duration;
 | 
			
		||||
    private Long load_duration;
 | 
			
		||||
    private Long prompt_eval_duration;
 | 
			
		||||
    private Long eval_duration;
 | 
			
		||||
    private Integer prompt_eval_count;
 | 
			
		||||
    @JsonProperty("total_duration")
 | 
			
		||||
    private Long totalDuration;
 | 
			
		||||
 | 
			
		||||
    @JsonProperty("load_duration")
 | 
			
		||||
    private Long loadDuration;
 | 
			
		||||
    @JsonProperty("prompt_eval_duration")
 | 
			
		||||
    private Long promptEvalDuration;
 | 
			
		||||
    @JsonProperty("eval_duration")
 | 
			
		||||
 | 
			
		||||
    private Long evalDuration;
 | 
			
		||||
    @JsonProperty("prompt_eval_count")
 | 
			
		||||
 | 
			
		||||
    private Integer promptEvalCount;
 | 
			
		||||
    @JsonProperty("evalCount")
 | 
			
		||||
 | 
			
		||||
    private Integer eval_count;
 | 
			
		||||
 | 
			
		||||
    public String getModel() {
 | 
			
		||||
        return model;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public String getCreated_at() {
 | 
			
		||||
        return created_at;
 | 
			
		||||
    public void setModel(String model) {
 | 
			
		||||
        this.model = model;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public String getCreatedAt() {
 | 
			
		||||
        return createdAt;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setCreatedAt(String createdAt) {
 | 
			
		||||
        this.createdAt = createdAt;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public String getResponse() {
 | 
			
		||||
        return response;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setResponse(String response) {
 | 
			
		||||
        this.response = response;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Boolean getDone() {
 | 
			
		||||
        return done;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setDone(Boolean done) {
 | 
			
		||||
        this.done = done;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public List<Integer> getContext() {
 | 
			
		||||
        return context;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Long getTotal_duration() {
 | 
			
		||||
        return total_duration;
 | 
			
		||||
    public void setContext(List<Integer> context) {
 | 
			
		||||
        this.context = context;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Long getLoad_duration() {
 | 
			
		||||
        return load_duration;
 | 
			
		||||
    public Long getTotalDuration() {
 | 
			
		||||
        return totalDuration;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Long getPrompt_eval_duration() {
 | 
			
		||||
        return prompt_eval_duration;
 | 
			
		||||
    public void setTotalDuration(Long totalDuration) {
 | 
			
		||||
        this.totalDuration = totalDuration;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Long getEval_duration() {
 | 
			
		||||
        return eval_duration;
 | 
			
		||||
    public Long getLoadDuration() {
 | 
			
		||||
        return loadDuration;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Integer getPrompt_eval_count() {
 | 
			
		||||
        return prompt_eval_count;
 | 
			
		||||
    public void setLoadDuration(Long loadDuration) {
 | 
			
		||||
        this.loadDuration = loadDuration;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Long getPromptEvalDuration() {
 | 
			
		||||
        return promptEvalDuration;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setPromptEvalDuration(Long promptEvalDuration) {
 | 
			
		||||
        this.promptEvalDuration = promptEvalDuration;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Long getEvalDuration() {
 | 
			
		||||
        return evalDuration;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setEvalDuration(Long evalDuration) {
 | 
			
		||||
        this.evalDuration = evalDuration;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Integer getPromptEvalCount() {
 | 
			
		||||
        return promptEvalCount;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setPromptEvalCount(Integer promptEvalCount) {
 | 
			
		||||
        this.promptEvalCount = promptEvalCount;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public Integer getEval_count() {
 | 
			
		||||
        return eval_count;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void setEval_count(Integer eval_count) {
 | 
			
		||||
        this.eval_count = eval_count;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user