mirror of
https://github.com/amithkoujalgi/ollama4j.git
synced 2025-11-03 10:00:41 +01:00
Fixes to listModels API
This commit is contained in:
@@ -3,62 +3,72 @@ package io.github.amithkoujalgi.ollama4j.core.models;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class Model {
|
||||
private String name;
|
||||
@JsonProperty("modified_at")
|
||||
private String modifiedAt;
|
||||
private String digest;
|
||||
private long size;
|
||||
|
||||
/**
|
||||
* Returns the model's tag. This includes model name and its version separated by a colon character `:`
|
||||
* @return model tag
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
private String name;
|
||||
@JsonProperty("modified_at")
|
||||
private String modifiedAt;
|
||||
private String digest;
|
||||
private long size;
|
||||
@JsonProperty("details")
|
||||
private ModelMeta modelMeta;
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
/**
|
||||
* Returns the model's tag. This includes model name and its version separated by a colon
|
||||
* character `:`
|
||||
*
|
||||
* @return model tag
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the model name without its version
|
||||
* @return model name
|
||||
*/
|
||||
public String getModelName() {
|
||||
return name.split(":")[0];
|
||||
}
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the model version without its name
|
||||
* @return model version
|
||||
*/
|
||||
public String getModelVersion() {
|
||||
return name.split(":")[1];
|
||||
}
|
||||
/**
|
||||
* Returns the model name without its version
|
||||
*
|
||||
* @return model name
|
||||
*/
|
||||
public String getModelName() {
|
||||
return name.split(":")[0];
|
||||
}
|
||||
|
||||
public String getModifiedAt() {
|
||||
return modifiedAt;
|
||||
}
|
||||
/**
|
||||
* Returns the model version without its name
|
||||
*
|
||||
* @return model version
|
||||
*/
|
||||
public String getModelVersion() {
|
||||
return name.split(":")[1];
|
||||
}
|
||||
|
||||
public void setModifiedAt(String modifiedAt) {
|
||||
this.modifiedAt = modifiedAt;
|
||||
}
|
||||
public String getModifiedAt() {
|
||||
return modifiedAt;
|
||||
}
|
||||
|
||||
public String getDigest() {
|
||||
return digest;
|
||||
}
|
||||
public void setModifiedAt(String modifiedAt) {
|
||||
this.modifiedAt = modifiedAt;
|
||||
}
|
||||
|
||||
public void setDigest(String digest) {
|
||||
this.digest = digest;
|
||||
}
|
||||
public String getDigest() {
|
||||
return digest;
|
||||
}
|
||||
|
||||
public long getSize() {
|
||||
return size;
|
||||
}
|
||||
public void setDigest(String digest) {
|
||||
this.digest = digest;
|
||||
}
|
||||
|
||||
public void setSize(long size) {
|
||||
this.size = size;
|
||||
}
|
||||
public long getSize() {
|
||||
return size;
|
||||
}
|
||||
|
||||
public void setSize(long size) {
|
||||
this.size = size;
|
||||
}
|
||||
|
||||
public ModelMeta getModelMeta() {
|
||||
return modelMeta;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
package io.github.amithkoujalgi.ollama4j.core.models;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class ModelMeta {
|
||||
|
||||
@JsonProperty("format")
|
||||
private String format;
|
||||
|
||||
@JsonProperty("family")
|
||||
private String family;
|
||||
|
||||
@JsonProperty("families")
|
||||
private String[] families;
|
||||
|
||||
@JsonProperty("parameter_size")
|
||||
private String parameterSize;
|
||||
|
||||
@JsonProperty("quantization_level")
|
||||
private String quantizationLevel;
|
||||
|
||||
public String getFormat() {
|
||||
return format;
|
||||
}
|
||||
|
||||
public void setFormat(String format) {
|
||||
this.format = format;
|
||||
}
|
||||
|
||||
public String getFamily() {
|
||||
return family;
|
||||
}
|
||||
|
||||
public void setFamily(String family) {
|
||||
this.family = family;
|
||||
}
|
||||
|
||||
public String[] getFamilies() {
|
||||
return families;
|
||||
}
|
||||
|
||||
public void setFamilies(String[] families) {
|
||||
this.families = families;
|
||||
}
|
||||
|
||||
public String getParameterSize() {
|
||||
return parameterSize;
|
||||
}
|
||||
|
||||
public void setParameterSize(String parameterSize) {
|
||||
this.parameterSize = parameterSize;
|
||||
}
|
||||
|
||||
public String getQuantizationLevel() {
|
||||
return quantizationLevel;
|
||||
}
|
||||
|
||||
public void setQuantizationLevel(String quantizationLevel) {
|
||||
this.quantizationLevel = quantizationLevel;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user