Ollama4j
A Java library (wrapper/binding) for Ollama server.
Loading...
Searching...
No Matches
OllamaEmbedRequestBuilder.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*/
9package io.github.ollama4j.models.embed;
10
11import io.github.ollama4j.utils.Options;
12import java.util.List;
13
18
19 private final OllamaEmbedRequest request;
20
21 private OllamaEmbedRequestBuilder(String model, List<String> input) {
22 this.request = new OllamaEmbedRequest(model, input);
23 }
24
25 public static OllamaEmbedRequestBuilder getInstance(String model, String... input) {
26 return new OllamaEmbedRequestBuilder(model, List.of(input));
27 }
28
30 this.request.setOptions(options.getOptionsMap());
31 return this;
32 }
33
34 public OllamaEmbedRequestBuilder withKeepAlive(String keepAlive) {
35 this.request.setKeepAlive(keepAlive);
36 return this;
37 }
38
40 this.request.setTruncate(false);
41 return this;
42 }
43
45 return this.request;
46 }
47}
static OllamaEmbedRequestBuilder getInstance(String model, String... input)