Ollama4j
A Java library (wrapper/binding) for Ollama server.
Loading...
Searching...
No Matches
OllamaGenerateRequestBuilder.java
Go to the documentation of this file.
1package io.github.ollama4j.models.generate;
2
3import io.github.ollama4j.utils.Options;
4
10
11 private OllamaGenerateRequestBuilder(String model, String prompt){
12 request = new OllamaGenerateRequest(model, prompt);
13 }
14
15 private OllamaGenerateRequest request;
16
17 public static OllamaGenerateRequestBuilder getInstance(String model){
18 return new OllamaGenerateRequestBuilder(model,"");
19 }
20
22 return request;
23 }
24
26 request.setPrompt(prompt);
27 return this;
28 }
29
31 this.request.setReturnFormatJson(true);
32 return this;
33 }
34
36 this.request.setOptions(options.getOptionsMap());
37 return this;
38 }
39
41 this.request.setTemplate(template);
42 return this;
43 }
44
46 this.request.setStream(true);
47 return this;
48 }
49
51 this.request.setKeepAlive(keepAlive);
52 return this;
53 }
54
55}