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

Public Member Functions

 OllamaGenerateEndpointCaller (String host, Auth basicAuth, long requestTimeoutSeconds, boolean verbose)
 
OllamaResult call (OllamaRequestBody body, OllamaStreamHandler thinkingStreamHandler, OllamaStreamHandler responseStreamHandler) throws OllamaBaseException, IOException, InterruptedException
 
OllamaResult callSync (OllamaRequestBody body) throws OllamaBaseException, IOException, InterruptedException
 
- Public Member Functions inherited from io.github.ollama4j.models.request.OllamaEndpointCaller
 OllamaEndpointCaller (String host, Auth auth, long requestTimeoutSeconds, boolean verbose)
 

Protected Member Functions

String getEndpointSuffix ()
 
boolean parseResponseAndAddToBuffer (String line, StringBuilder responseBuffer, StringBuilder thinkingBuffer)
 
- Protected Member Functions inherited from io.github.ollama4j.models.request.OllamaEndpointCaller
HttpRequest.Builder getRequestBuilderDefault (URI uri)
 
boolean isAuthCredentialsSet ()
 

Detailed Description

Definition at line 26 of file OllamaGenerateEndpointCaller.java.

Constructor & Destructor Documentation

◆ OllamaGenerateEndpointCaller()

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

Definition at line 32 of file OllamaGenerateEndpointCaller.java.

Member Function Documentation

◆ call()

OllamaResult io.github.ollama4j.models.request.OllamaGenerateEndpointCaller.call ( OllamaRequestBody body,
OllamaStreamHandler thinkingStreamHandler,
OllamaStreamHandler responseStreamHandler ) throws OllamaBaseException, IOException, InterruptedException

Definition at line 61 of file OllamaGenerateEndpointCaller.java.

◆ callSync()

OllamaResult io.github.ollama4j.models.request.OllamaGenerateEndpointCaller.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 76 of file OllamaGenerateEndpointCaller.java.

◆ getEndpointSuffix()

String io.github.ollama4j.models.request.OllamaGenerateEndpointCaller.getEndpointSuffix ( )
protected

◆ parseResponseAndAddToBuffer()

boolean io.github.ollama4j.models.request.OllamaGenerateEndpointCaller.parseResponseAndAddToBuffer ( String line,
StringBuilder responseBuffer,
StringBuilder thinkingBuffer )
protected

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