All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ee.carlrobert.llm.client.you.completion.YouCompletionMode Maven / Gradle / Ivy

There is a newer version: 0.8.28
Show newest version
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();
  }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy