Ollama4j
A Java library (wrapper/binding) for Ollama server.
Loading...
Searching...
No Matches
OllamaEmbedRequest.java
Go to the documentation of this file.
1
/*
2
* Ollama4j - Java library for interacting with Ollama server.
3
* Copyright (c) 2025 Amith Koujalgi and contributors.
4
*
5
* Licensed under the MIT License (the "License");
6
* you may not use this file except in compliance with the License.
7
*
8
*/
9
package
io.github.ollama4j.models.embed;
10
11
import
static
io.github.ollama4j.utils.Utils.getObjectMapper;
12
13
import
com.fasterxml.jackson.annotation.JsonProperty;
14
import
com.fasterxml.jackson.core.JsonProcessingException;
15
import
java.util.List;
16
import
java.util.Map;
17
import
lombok.*;
18
19
@SuppressWarnings(
"NullableProblems"
)
20
@Data
21
@RequiredArgsConstructor
22
@NoArgsConstructor
23
public
class
OllamaEmbedRequest
{
24
@NonNull
private
String model;
25
26
@NonNull
private
List<String> input;
27
28
private
Map<String, Object> options;
29
30
@JsonProperty(value =
"keep_alive"
)
31
private
String keepAlive;
32
33
@JsonProperty(value =
"truncate"
)
34
private
Boolean truncate =
true
;
35
36
@Override
37
public
String
toString
() {
38
try
{
39
return
getObjectMapper().writerWithDefaultPrettyPrinter().writeValueAsString(
this
);
40
}
catch
(JsonProcessingException e) {
41
throw
new
RuntimeException(e);
42
}
43
}
44
}
io.github.ollama4j.models.embed.OllamaEmbedRequest
Definition
OllamaEmbedRequest.java:23
io.github.ollama4j.models.embed.OllamaEmbedRequest.toString
String toString()
Definition
OllamaEmbedRequest.java:37
src
main
java
io
github
ollama4j
models
embed
OllamaEmbedRequest.java
Generated by
1.12.0