Ollama4j
A Java library (wrapper/binding) for Ollama server.
Loading...
Searching...
No Matches
PromptBuilder.java
Go to the documentation of this file.
1package io.github.ollama4j.utils;
2
19public class PromptBuilder {
20
21 private final StringBuilder prompt;
22
24 public PromptBuilder() {
25 this.prompt = new StringBuilder();
26 }
27
34 public PromptBuilder add(String text) {
35 prompt.append(text);
36 return this;
37 }
38
45 public PromptBuilder addLine(String text) {
46 prompt.append(text).append("\n");
47 return this;
48 }
49
57 prompt.append("\n--------------------------------------------------\n");
58 return this;
59 }
60
66 public String build() {
67 return prompt.toString();
68 }
69}
PromptBuilder addLine(String text)