mirror of
https://github.com/amithkoujalgi/ollama4j.git
synced 2025-05-15 11:57:12 +02:00
Cleanup
This commit is contained in:
parent
3fc7e9423c
commit
ecb04d6d82
4
Makefile
4
Makefile
@ -11,9 +11,9 @@ doxygen:
|
|||||||
doxygen Doxyfile
|
doxygen Doxyfile
|
||||||
|
|
||||||
list-releases:
|
list-releases:
|
||||||
curl 'https://central.sonatype.com/api/internal/browse/component/versions?sortField=normalizedVersion&sortDirection=asc&page=0&size=12&filter=namespace%3Aio.github.amithkoujalgi%2Cname%3Aollama4j' \
|
curl 'https://central.sonatype.com/api/internal/browse/component/versions?sortField=normalizedVersion&sortDirection=desc&page=0&size=20&filter=namespace%3Aio.github.ollama4j%2Cname%3Aollama4j' \
|
||||||
--compressed \
|
--compressed \
|
||||||
--silent | jq '.components[].version'
|
--silent | jq -r '.components[].version'
|
||||||
|
|
||||||
build-docs:
|
build-docs:
|
||||||
npm i --prefix docs && npm run build --prefix docs
|
npm i --prefix docs && npm run build --prefix docs
|
||||||
|
@ -8,6 +8,7 @@ import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
|||||||
import io.github.ollama4j.utils.FileToBase64Serializer;
|
import io.github.ollama4j.utils.FileToBase64Serializer;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
@ -12,7 +12,7 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
public class OllamaChatMessageRole {
|
public class OllamaChatMessageRole {
|
||||||
private static final List<OllamaChatMessageRole> ROLES = new ArrayList<>();
|
private static final List<OllamaChatMessageRole> roles = new ArrayList<>();
|
||||||
|
|
||||||
public static final OllamaChatMessageRole SYSTEM = new OllamaChatMessageRole("system");
|
public static final OllamaChatMessageRole SYSTEM = new OllamaChatMessageRole("system");
|
||||||
public static final OllamaChatMessageRole USER = new OllamaChatMessageRole("user");
|
public static final OllamaChatMessageRole USER = new OllamaChatMessageRole("user");
|
||||||
@ -24,21 +24,21 @@ public class OllamaChatMessageRole {
|
|||||||
|
|
||||||
private OllamaChatMessageRole(String roleName) {
|
private OllamaChatMessageRole(String roleName) {
|
||||||
this.roleName = roleName;
|
this.roleName = roleName;
|
||||||
ROLES.add(this);
|
roles.add(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static OllamaChatMessageRole newCustomRole(String roleName) {
|
public static OllamaChatMessageRole newCustomRole(String roleName) {
|
||||||
OllamaChatMessageRole customRole = new OllamaChatMessageRole(roleName);
|
OllamaChatMessageRole customRole = new OllamaChatMessageRole(roleName);
|
||||||
ROLES.add(customRole);
|
roles.add(customRole);
|
||||||
return customRole;
|
return customRole;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<OllamaChatMessageRole> getRoles() {
|
public static List<OllamaChatMessageRole> getRoles() {
|
||||||
return new ArrayList<>(ROLES);
|
return new ArrayList<>(roles);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static OllamaChatMessageRole getRole(String roleName) throws RoleNotFoundException {
|
public static OllamaChatMessageRole getRole(String roleName) throws RoleNotFoundException {
|
||||||
for (OllamaChatMessageRole role : ROLES) {
|
for (OllamaChatMessageRole role : roles) {
|
||||||
if (role.roleName.equals(roleName)) {
|
if (role.roleName.equals(roleName)) {
|
||||||
return role;
|
return role;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user