Ollama4j
A Java library (wrapper/binding) for Ollama server.
Loading...
Searching...
No Matches
io.github.ollama4j.models.request.OllamaEndpointCaller Class Referenceabstract
Inheritance diagram for io.github.ollama4j.models.request.OllamaEndpointCaller:
io.github.ollama4j.models.request.OllamaChatEndpointCaller io.github.ollama4j.models.request.OllamaGenerateEndpointCaller

Public Member Functions

 OllamaEndpointCaller (String host, BasicAuth basicAuth, long requestTimeoutSeconds, boolean verbose)
 
OllamaResult callSync (OllamaRequestBody body) throws OllamaBaseException, IOException, InterruptedException
 

Protected Member Functions

abstract String getEndpointSuffix ()
 
abstract boolean parseResponseAndAddToBuffer (String line, StringBuilder responseBuffer)
 

Detailed Description

Abstract helperclass to call the ollama api server.

Definition at line 27 of file OllamaEndpointCaller.java.

Constructor & Destructor Documentation

◆ OllamaEndpointCaller()

io.github.ollama4j.models.request.OllamaEndpointCaller.OllamaEndpointCaller ( String host,
BasicAuth basicAuth,
long requestTimeoutSeconds,
boolean verbose )

Definition at line 36 of file OllamaEndpointCaller.java.

Member Function Documentation

◆ callSync()

OllamaResult io.github.ollama4j.models.request.OllamaEndpointCaller.callSync ( OllamaRequestBody body) throws OllamaBaseException, IOException, InterruptedException

Calls the api server on the given host and endpoint suffix asynchronously, aka waiting for the response.

Parameters
bodyPOST body payload
Returns
result answer given by the assistant
Exceptions
OllamaBaseExceptionany response code than 200 has been returned
IOExceptionin case the responseStream can not be read
InterruptedExceptionin case the server is not reachable or network issues happen

Definition at line 57 of file OllamaEndpointCaller.java.

◆ getEndpointSuffix()

abstract String io.github.ollama4j.models.request.OllamaEndpointCaller.getEndpointSuffix ( )
abstractprotected

◆ parseResponseAndAddToBuffer()

abstract boolean io.github.ollama4j.models.request.OllamaEndpointCaller.parseResponseAndAddToBuffer ( String line,
StringBuilder responseBuffer )
abstractprotected

The documentation for this class was generated from the following file: