Ollama4j
A Java library (wrapper/binding) for Ollama server.
Loading...
Searching...
No Matches
ConsoleOutputStreamHandler.java
Go to the documentation of this file.
1package io.github.ollama4j.impl;
2
3import io.github.ollama4j.models.generate.OllamaStreamHandler;
4
6 private final StringBuffer response = new StringBuffer();
7
8 @Override
9 public void accept(String message) {
10 String substr = message.substring(response.length());
11 response.append(substr);
12 System.out.print(substr);
13 }
14}