Ollama4j
A Java library (wrapper/binding) for Ollama server.
Loading...
Searching...
No Matches
PromptBuilder.java
Go to the documentation of this file.
1
package
io.github.ollama4j.utils;
2
19
public
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
56
public
PromptBuilder
addSeparator
() {
57
prompt.append(
"\n--------------------------------------------------\n"
);
58
return
this
;
59
}
60
66
public
String
build
() {
67
return
prompt.toString();
68
}
69
}
io.github.ollama4j.utils.PromptBuilder
Definition
PromptBuilder.java:19
io.github.ollama4j.utils.PromptBuilder.addSeparator
PromptBuilder addSeparator()
Definition
PromptBuilder.java:56
io.github.ollama4j.utils.PromptBuilder.PromptBuilder
PromptBuilder()
Definition
PromptBuilder.java:24
io.github.ollama4j.utils.PromptBuilder.build
String build()
Definition
PromptBuilder.java:66
io.github.ollama4j.utils.PromptBuilder.addLine
PromptBuilder addLine(String text)
Definition
PromptBuilder.java:45
io.github.ollama4j.utils.PromptBuilder.add
PromptBuilder add(String text)
Definition
PromptBuilder.java:34
src
main
java
io
github
ollama4j
utils
PromptBuilder.java
Generated by
1.12.0