Ollama4j
A Java library (wrapper/binding) for Ollama server.
Loading...
Searching...
No Matches
OllamaEmbedRequestBuilder.java
Go to the documentation of this file.
1package io.github.ollama4j.models.embeddings;
2
3import io.github.ollama4j.utils.Options;
4
5import java.util.List;
6
11
12 private final OllamaEmbedRequestModel request;
13
14 private OllamaEmbedRequestBuilder(String model, List<String> input) {
15 this.request = new OllamaEmbedRequestModel(model,input);
16 }
17
18 public static OllamaEmbedRequestBuilder getInstance(String model, String... input){
19 return new OllamaEmbedRequestBuilder(model, List.of(input));
20 }
21
23 this.request.setOptions(options.getOptionsMap());
24 return this;
25 }
26
27 public OllamaEmbedRequestBuilder withKeepAlive(String keepAlive){
28 this.request.setKeepAlive(keepAlive);
29 return this;
30 }
31
33 this.request.setTruncate(false);
34 return this;
35 }
36
38 return this.request;
39 }
40}
static OllamaEmbedRequestBuilder getInstance(String model, String... input)