forked from Mirror/ollama4j
		
	Merge pull request #2 from AgentSchmecker/model_update
Updates Model.java to be up to date with current OllamaAPI
This commit is contained in:
		
							
								
								
									
										7
									
								
								pom.xml
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								pom.xml
									
									
									
									
									
								
							@@ -149,7 +149,12 @@
 | 
				
			|||||||
        <dependency>
 | 
					        <dependency>
 | 
				
			||||||
            <groupId>com.fasterxml.jackson.core</groupId>
 | 
					            <groupId>com.fasterxml.jackson.core</groupId>
 | 
				
			||||||
            <artifactId>jackson-databind</artifactId>
 | 
					            <artifactId>jackson-databind</artifactId>
 | 
				
			||||||
            <version>2.15.3</version>
 | 
					            <version>2.17.1</version>
 | 
				
			||||||
 | 
					        </dependency>
 | 
				
			||||||
 | 
					        <dependency>
 | 
				
			||||||
 | 
					            <groupId>com.fasterxml.jackson.datatype</groupId>
 | 
				
			||||||
 | 
					            <artifactId>jackson-datatype-jsr310</artifactId>
 | 
				
			||||||
 | 
					            <version>2.17.1</version>
 | 
				
			||||||
        </dependency>
 | 
					        </dependency>
 | 
				
			||||||
        <dependency>
 | 
					        <dependency>
 | 
				
			||||||
            <groupId>ch.qos.logback</groupId>
 | 
					            <groupId>ch.qos.logback</groupId>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,7 @@
 | 
				
			|||||||
package io.github.amithkoujalgi.ollama4j.core.models;
 | 
					package io.github.amithkoujalgi.ollama4j.core.models;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import java.time.LocalDateTime;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import com.fasterxml.jackson.annotation.JsonProperty;
 | 
					import com.fasterxml.jackson.annotation.JsonProperty;
 | 
				
			||||||
import com.fasterxml.jackson.core.JsonProcessingException;
 | 
					import com.fasterxml.jackson.core.JsonProcessingException;
 | 
				
			||||||
import io.github.amithkoujalgi.ollama4j.core.utils.Utils;
 | 
					import io.github.amithkoujalgi.ollama4j.core.utils.Utils;
 | 
				
			||||||
@@ -11,7 +13,9 @@ public class Model {
 | 
				
			|||||||
  private String name;
 | 
					  private String name;
 | 
				
			||||||
  private String model;
 | 
					  private String model;
 | 
				
			||||||
  @JsonProperty("modified_at")
 | 
					  @JsonProperty("modified_at")
 | 
				
			||||||
  private String modifiedAt;
 | 
					  private LocalDateTime modifiedAt;
 | 
				
			||||||
 | 
					  @JsonProperty("expires_at")
 | 
				
			||||||
 | 
					  private LocalDateTime expiresAt;
 | 
				
			||||||
  private String digest;
 | 
					  private String digest;
 | 
				
			||||||
  private long size;
 | 
					  private long size;
 | 
				
			||||||
  @JsonProperty("details")
 | 
					  @JsonProperty("details")
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,10 +8,18 @@ import java.net.URISyntaxException;
 | 
				
			|||||||
import java.net.URL;
 | 
					import java.net.URL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import com.fasterxml.jackson.databind.ObjectMapper;
 | 
					import com.fasterxml.jackson.databind.ObjectMapper;
 | 
				
			||||||
 | 
					import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class Utils {
 | 
					public class Utils {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  private static ObjectMapper objectMapper;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  public static ObjectMapper getObjectMapper() {
 | 
					  public static ObjectMapper getObjectMapper() {
 | 
				
			||||||
    return new ObjectMapper();
 | 
					    if(objectMapper == null) {
 | 
				
			||||||
 | 
					      objectMapper = new ObjectMapper();
 | 
				
			||||||
 | 
					      objectMapper.registerModule(new JavaTimeModule());
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    return objectMapper;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  public static byte[] loadImageBytesFromUrl(String imageUrl)
 | 
					  public static byte[] loadImageBytesFromUrl(String imageUrl)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user