Ollama4j
A Java library (wrapper/binding) for Ollama server.
|
Public Member Functions | |
OllamaChatEndpointCaller (String host, BasicAuth basicAuth, long requestTimeoutSeconds, boolean verbose) | |
OllamaResult | call (OllamaRequestBody body, OllamaStreamHandler streamHandler) throws OllamaBaseException, IOException, InterruptedException |
Public Member Functions inherited from io.github.ollama4j.models.request.OllamaEndpointCaller | |
OllamaEndpointCaller (String host, BasicAuth basicAuth, long requestTimeoutSeconds, boolean verbose) | |
OllamaResult | callSync (OllamaRequestBody body) throws OllamaBaseException, IOException, InterruptedException |
Protected Member Functions | |
String | getEndpointSuffix () |
boolean | parseResponseAndAddToBuffer (String line, StringBuilder responseBuffer) |
Protected Member Functions inherited from io.github.ollama4j.models.request.OllamaEndpointCaller |
Specialization class for requests
Definition at line 21 of file OllamaChatEndpointCaller.java.
io.github.ollama4j.models.request.OllamaChatEndpointCaller.OllamaChatEndpointCaller | ( | String | host, |
BasicAuth | basicAuth, | ||
long | requestTimeoutSeconds, | ||
boolean | verbose ) |
Definition at line 27 of file OllamaChatEndpointCaller.java.
OllamaResult io.github.ollama4j.models.request.OllamaChatEndpointCaller.call | ( | OllamaRequestBody | body, |
OllamaStreamHandler | streamHandler ) throws OllamaBaseException, IOException, InterruptedException |
Definition at line 67 of file OllamaChatEndpointCaller.java.
|
protected |
Reimplemented from io.github.ollama4j.models.request.OllamaEndpointCaller.
Definition at line 32 of file OllamaChatEndpointCaller.java.
|
protected |
Parses streamed Response line from ollama chat. Using com.fasterxml.jackson.databind.ObjectMapper#readValue(String, TypeReference)
should throw IllegalArgumentException
in case of null line or com.fasterxml.jackson.core.JsonParseException
in case the JSON Object cannot be parsed to a OllamaChatResponseModel
. Thus, the ResponseModel should never be null.
line | streamed line of ollama stream response |
responseBuffer | Stringbuffer to add latest response message part to |
Reimplemented from io.github.ollama4j.models.request.OllamaEndpointCaller.
Definition at line 48 of file OllamaChatEndpointCaller.java.