Ollama4j
A Java library (wrapper/binding) for Ollama server.
Loading...
Searching...
No Matches
OllamaResultStream.java
Go to the documentation of this file.
1
package
io.github.ollama4j.models.response;
2
3
import
java.util.Iterator;
4
import
java.util.LinkedList;
5
import
java.util.Queue;
6
7
public
class
OllamaResultStream
extends
LinkedList<String> implements Queue<String> {
8
@Override
9
public
String
poll
() {
10
StringBuilder tokens =
new
StringBuilder();
11
Iterator<String> iterator = this.listIterator();
12
while
(iterator.hasNext()) {
13
tokens.append(iterator.next());
14
iterator.remove();
15
}
16
return
tokens.toString();
17
}
18
}
io.github.ollama4j.models.response.OllamaResultStream
Definition
OllamaResultStream.java:7
io.github.ollama4j.models.response.OllamaResultStream.poll
String poll()
Definition
OllamaResultStream.java:9
src
main
java
io
github
ollama4j
models
response
OllamaResultStream.java
Generated by
1.12.0