mirror of
https://github.com/amithkoujalgi/ollama4j.git
synced 2025-10-27 06:30:42 +01:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 33ebd088c4 | |||
| caf632ec8b | |||
| 62f3c3efa5 | |||
| 613e152e7d |
21
pom.xml
21
pom.xml
@@ -4,7 +4,7 @@
|
||||
|
||||
<groupId>io.github.amithkoujalgi</groupId>
|
||||
<artifactId>ollama4j</artifactId>
|
||||
<version>1.0.73</version>
|
||||
<version>1.0.72-1</version>
|
||||
|
||||
<name>Ollama4j</name>
|
||||
<description>Java library for interacting with Ollama API.</description>
|
||||
@@ -39,7 +39,7 @@
|
||||
<connection>scm:git:git@github.com:amithkoujalgi/ollama4j.git</connection>
|
||||
<developerConnection>scm:git:https://github.com/amithkoujalgi/ollama4j.git</developerConnection>
|
||||
<url>https://github.com/amithkoujalgi/ollama4j</url>
|
||||
<tag>v1.0.73</tag>
|
||||
<tag>v1.0.16</tag>
|
||||
</scm>
|
||||
|
||||
<build>
|
||||
@@ -139,6 +139,13 @@
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>gitea</id>
|
||||
<url>https://gitea.seeseepuff.be/api/packages/seeseemelk/maven</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
@@ -189,12 +196,12 @@
|
||||
|
||||
<distributionManagement>
|
||||
<snapshotRepository>
|
||||
<id>ossrh</id>
|
||||
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
|
||||
<id>gitea</id>
|
||||
<url>https://gitea.seeseepuff.be/api/packages/seeseemelk/maven</url>
|
||||
</snapshotRepository>
|
||||
<repository>
|
||||
<id>ossrh</id>
|
||||
<url>https://s01.oss.sonatype.org/service/local/staging/deploy/maven2</url>
|
||||
<id>gitea</id>
|
||||
<url>https://gitea.seeseepuff.be/api/packages/seeseemelk/maven</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
|
||||
@@ -308,4 +315,4 @@
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
</project>
|
||||
</project>
|
||||
|
||||
@@ -16,16 +16,10 @@ public class OllamaChatResult extends OllamaResult{
|
||||
List<OllamaChatMessage> chatHistory) {
|
||||
super(response, responseTime, httpStatusCode);
|
||||
this.chatHistory = chatHistory;
|
||||
appendAnswerToChatHistory(response);
|
||||
}
|
||||
|
||||
public List<OllamaChatMessage> getChatHistory() {
|
||||
return chatHistory;
|
||||
}
|
||||
|
||||
private void appendAnswerToChatHistory(String answer){
|
||||
OllamaChatMessage assistantMessage = new OllamaChatMessage(OllamaChatMessageRole.ASSISTANT, answer);
|
||||
this.chatHistory.add(assistantMessage);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -11,8 +11,6 @@ public class OllamaChatStreamObserver {
|
||||
|
||||
private List<OllamaChatResponseModel> responseParts = new ArrayList<>();
|
||||
|
||||
private String message = "";
|
||||
|
||||
public OllamaChatStreamObserver(OllamaStreamHandler streamHandler) {
|
||||
this.streamHandler = streamHandler;
|
||||
}
|
||||
@@ -23,8 +21,7 @@ public class OllamaChatStreamObserver {
|
||||
}
|
||||
|
||||
protected void handleCurrentResponsePart(OllamaChatResponseModel currentResponsePart){
|
||||
message = message + currentResponsePart.getMessage().getContent();
|
||||
streamHandler.accept(message);
|
||||
streamHandler.accept(currentResponsePart.getMessage().getContent());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -79,5 +79,4 @@ public class OllamaModelType {
|
||||
public static final String NOTUS = "notus";
|
||||
public static final String DUCKDB_NSQL = "duckdb-nsql";
|
||||
public static final String ALL_MINILM = "all-minilm";
|
||||
public static final String CODESTRAL = "codestral";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user