forked from Mirror/ollama4j
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e1b9d42771 | ||
|
|
1a086c37c0 | ||
|
|
3ed3187ba9 | ||
|
|
b7cd81a7f5 | ||
|
|
e750c2d7f9 | ||
|
|
62f16131f3 | ||
|
|
2cbaf12d7c | ||
|
|
e2d555d404 | ||
|
|
c296b34174 | ||
|
|
e8f99f28ec | ||
|
|
250b1abc79 |
10
README.md
10
README.md
@@ -110,6 +110,16 @@ make it
|
|||||||
Releases (newer artifact versions) are done automatically on pushing the code to the `main` branch through GitHub
|
Releases (newer artifact versions) are done automatically on pushing the code to the `main` branch through GitHub
|
||||||
Actions CI workflow.
|
Actions CI workflow.
|
||||||
|
|
||||||
|
#### Who's using Ollama4j?
|
||||||
|
|
||||||
|
- `Datafaker`: a library to generate fake data
|
||||||
|
- https://github.com/datafaker-net/datafaker-experimental/tree/main/ollama-api
|
||||||
|
- `Vaadin Web UI`: UI-Tester for Interactions with Ollama via ollama4j
|
||||||
|
- https://github.com/TEAMPB/ollama4j-vaadin-ui
|
||||||
|
- `ollama-translator`: Minecraft 1.20.6 spigot plugin allows to easily break language barriers by using ollama on the
|
||||||
|
server to translate all messages into a specfic target language.
|
||||||
|
- https://github.com/liebki/ollama-translator
|
||||||
|
|
||||||
#### Traction
|
#### Traction
|
||||||
|
|
||||||
[](https://star-history.com/#amithkoujalgi/ollama4j&Date)
|
[](https://star-history.com/#amithkoujalgi/ollama4j&Date)
|
||||||
|
|||||||
11
pom.xml
11
pom.xml
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
<groupId>io.github.amithkoujalgi</groupId>
|
<groupId>io.github.amithkoujalgi</groupId>
|
||||||
<artifactId>ollama4j</artifactId>
|
<artifactId>ollama4j</artifactId>
|
||||||
<version>1.0.67</version>
|
<version>1.0.70</version>
|
||||||
|
|
||||||
<name>Ollama4j</name>
|
<name>Ollama4j</name>
|
||||||
<description>Java library for interacting with Ollama API.</description>
|
<description>Java library for interacting with Ollama API.</description>
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
<connection>scm:git:git@github.com:amithkoujalgi/ollama4j.git</connection>
|
<connection>scm:git:git@github.com:amithkoujalgi/ollama4j.git</connection>
|
||||||
<developerConnection>scm:git:https://github.com/amithkoujalgi/ollama4j.git</developerConnection>
|
<developerConnection>scm:git:https://github.com/amithkoujalgi/ollama4j.git</developerConnection>
|
||||||
<url>https://github.com/amithkoujalgi/ollama4j</url>
|
<url>https://github.com/amithkoujalgi/ollama4j</url>
|
||||||
<tag>v1.0.67</tag>
|
<tag>v1.0.70</tag>
|
||||||
</scm>
|
</scm>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
@@ -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