Ollama4j
A Java library (wrapper/binding) for Ollama server.
Loading...
Searching...
No Matches
OllamaEmbedRequestModel.java
Go to the documentation of this file.
1package io.github.ollama4j.models.embeddings;
2
3import com.fasterxml.jackson.annotation.JsonProperty;
4import com.fasterxml.jackson.core.JsonProcessingException;
5import lombok.Data;
6import lombok.NoArgsConstructor;
7import lombok.NonNull;
8import lombok.RequiredArgsConstructor;
9
10import java.util.List;
11import java.util.Map;
12
13import static io.github.ollama4j.utils.Utils.getObjectMapper;
14
15@Data
16@RequiredArgsConstructor
17@NoArgsConstructor
19 @NonNull
20 private String model;
21
22 @NonNull
23 private List<String> input;
24
25 private Map<String, Object> options;
26
27 @JsonProperty(value = "keep_alive")
28 private String keepAlive;
29
30 @JsonProperty(value = "truncate")
31 private Boolean truncate = true;
32
33 @Override
34 public String toString() {
35 try {
36 return getObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(this);
37 } catch (JsonProcessingException e) {
38 throw new RuntimeException(e);
39 }
40 }
41}