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