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

ee.carlrobert.llm.client.ollama.completion.request.OllamaEmbeddingRequest Maven / Gradle / Ivy

There is a newer version: 0.8.28
Show newest version
package ee.carlrobert.llm.client.ollama.completion.request;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;

/*
 * See ollama/api
 */
@JsonInclude(Include.NON_NULL)
public class OllamaEmbeddingRequest {

  private final String model;
  private final String prompt;
  private final OllamaParameters options;

  public OllamaEmbeddingRequest(Builder builder) {
    this.prompt = builder.prompt;
    this.model = builder.model;
    this.options = builder.options;
  }

  public String getModel() {
    return model;
  }

  public String getPrompt() {
    return prompt;
  }

  public OllamaParameters getOptions() {
    return options;
  }

  public static class Builder {

    private final String model;
    private final String prompt;
    private OllamaParameters options = null;

    public Builder(String model, String prompt) {
      this.model = model;
      this.prompt = prompt;
    }

    public OllamaEmbeddingRequest.Builder setOptions(OllamaParameters options) {
      this.options = options;
      return OllamaEmbeddingRequest.Builder.this;
    }

    public OllamaEmbeddingRequest build() {
      return new OllamaEmbeddingRequest(this);
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy