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

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

Detailed Description

Specialization class for requests

Definition at line 21 of file OllamaChatEndpointCaller.java.

Constructor & Destructor Documentation

◆ OllamaChatEndpointCaller()

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

Definition at line 27 of file OllamaChatEndpointCaller.java.

Member Function Documentation

◆ call()

OllamaResult io.github.ollama4j.models.request.OllamaChatEndpointCaller.call ( OllamaRequestBody body,
OllamaStreamHandler streamHandler ) throws OllamaBaseException, IOException, InterruptedException

Definition at line 67 of file OllamaChatEndpointCaller.java.

◆ getEndpointSuffix()

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

◆ parseResponseAndAddToBuffer()

boolean io.github.ollama4j.models.request.OllamaChatEndpointCaller.parseResponseAndAddToBuffer ( String line,
StringBuilder responseBuffer )
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.

Parameters
linestreamed line of ollama stream response
responseBufferStringbuffer to add latest response message part to
Returns
TRUE, if ollama-Response has 'done' state

Reimplemented from io.github.ollama4j.models.request.OllamaEndpointCaller.

Definition at line 48 of file OllamaChatEndpointCaller.java.


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