Ollama4j
A Java library (wrapper/binding) for Ollama server.
|
Public Member Functions | |
OllamaChatEndpointCaller (String host, BasicAuth basicAuth, long requestTimeoutSeconds, boolean verbose) | |
OllamaChatResult | call (OllamaChatRequest body, OllamaTokenHandler tokenHandler) throws OllamaBaseException, IOException, InterruptedException |
OllamaChatResult | callSync (OllamaChatRequest body) throws OllamaBaseException, IOException, InterruptedException |
Public Member Functions inherited from io.github.ollama4j.models.request.OllamaEndpointCaller | |
OllamaEndpointCaller (String host, BasicAuth basicAuth, long requestTimeoutSeconds, boolean verbose) | |
Protected Member Functions | |
String | getEndpointSuffix () |
boolean | parseResponseAndAddToBuffer (String line, StringBuilder responseBuffer) |
Protected Member Functions inherited from io.github.ollama4j.models.request.OllamaEndpointCaller | |
HttpRequest.Builder | getRequestBuilderDefault (URI uri) |
String | getBasicAuthHeaderValue () |
boolean | isBasicAuthCredentialsSet () |
Specialization class for requests
Definition at line 27 of file OllamaChatEndpointCaller.java.
io.github.ollama4j.models.request.OllamaChatEndpointCaller.OllamaChatEndpointCaller | ( | String | host, |
BasicAuth | basicAuth, | ||
long | requestTimeoutSeconds, | ||
boolean | verbose ) |
Definition at line 33 of file OllamaChatEndpointCaller.java.
OllamaChatResult io.github.ollama4j.models.request.OllamaChatEndpointCaller.call | ( | OllamaChatRequest | body, |
OllamaTokenHandler | tokenHandler ) throws OllamaBaseException, IOException, InterruptedException |
Definition at line 73 of file OllamaChatEndpointCaller.java.
OllamaChatResult io.github.ollama4j.models.request.OllamaChatEndpointCaller.callSync | ( | OllamaChatRequest | body | ) | throws OllamaBaseException, IOException, InterruptedException |
Definition at line 79 of file OllamaChatEndpointCaller.java.
|
protected |
Reimplemented from io.github.ollama4j.models.request.OllamaEndpointCaller.
Definition at line 38 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 54 of file OllamaChatEndpointCaller.java.