ee.carlrobert.llm.client.you.completion.YouCompletionMode Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of llm-client Show documentation
Show all versions of llm-client Show documentation
Java http client wrapped around the OkHttp3 library
package ee.carlrobert.llm.client.you.completion;
import java.util.Arrays;
public enum YouCompletionMode {
DEFAULT("default", false),
AGENT("agent", false),
CUSTOM("custom", true),
RESEARCH("research", false);
private final String code;
private final boolean supportCustomModel;
YouCompletionMode(String code, boolean supportCustomModel) {
this.code = code;
this.supportCustomModel = supportCustomModel;
}
public String getCode() {
return code;
}
public String getDescription() {
return code.substring(0, 1).toUpperCase() + code.substring(1);
}
public boolean isSupportCustomModel() {
return supportCustomModel;
}
public String toString() {
return code;
}
public static YouCompletionMode findByCode(String code) {
return Arrays.stream(YouCompletionMode.values())
.filter(item -> item.getCode().equals(code))
.findFirst().orElseThrow();
}
}