![]() |
Ollama4j
A Java library (wrapper/binding) for Ollama server.
|
Public Member Functions | |
| OllamaGenerateEndpointCaller (String host, Auth basicAuth, long requestTimeoutSeconds) | |
| OllamaResult | call (OllamaRequestBody body, OllamaGenerateTokenHandler thinkingStreamHandler, OllamaGenerateTokenHandler responseStreamHandler) throws OllamaException, IOException, InterruptedException |
| OllamaResult | callSync (OllamaRequestBody body) throws OllamaException, IOException, InterruptedException |
Static Public Attributes | |
| static final String | endpoint = "/api/generate" |
Protected Member Functions | |
| boolean | parseResponseAndAddToBuffer (String line, StringBuilder responseBuffer, StringBuilder thinkingBuffer) |
Protected Member Functions inherited from io.github.ollama4j.models.request.OllamaEndpointCaller | |
| OllamaEndpointCaller (String host, Auth auth, long requestTimeoutSeconds) | |
| HttpRequest.Builder | getRequestBuilderDefault (URI uri) |
| boolean | isAuthCredentialsSet () |
Definition at line 33 of file OllamaGenerateEndpointCaller.java.
| io.github.ollama4j.models.request.OllamaGenerateEndpointCaller.OllamaGenerateEndpointCaller | ( | String | host, |
| Auth | basicAuth, | ||
| long | requestTimeoutSeconds ) |
Definition at line 40 of file OllamaGenerateEndpointCaller.java.
| OllamaResult io.github.ollama4j.models.request.OllamaGenerateEndpointCaller.call | ( | OllamaRequestBody | body, |
| OllamaGenerateTokenHandler | thinkingStreamHandler, | ||
| OllamaGenerateTokenHandler | responseStreamHandler ) throws OllamaException, IOException, InterruptedException |
Definition at line 66 of file OllamaGenerateEndpointCaller.java.
| OllamaResult io.github.ollama4j.models.request.OllamaGenerateEndpointCaller.callSync | ( | OllamaRequestBody | body | ) | throws OllamaException, IOException, InterruptedException |
Calls the api server on the given host and endpoint suffix asynchronously, aka waiting for the response.
| body | POST body payload |
| OllamaException | any response code than 200 has been returned |
| IOException | in case the responseStream can not be read |
| InterruptedException | in case the server is not reachable or network issues happen |
Definition at line 87 of file OllamaGenerateEndpointCaller.java.
|
protected |
Reimplemented from io.github.ollama4j.models.request.OllamaEndpointCaller.
Definition at line 45 of file OllamaGenerateEndpointCaller.java.
|
static |
Definition at line 36 of file OllamaGenerateEndpointCaller.java.