Class OllamaAsyncResultCallback
- java.lang.Object
-
- java.lang.Thread
-
- io.github.amithkoujalgi.ollama4j.core.models.OllamaAsyncResultCallback
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
-
Field Summary
-
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description OllamaAsyncResultCallback(HttpRequest.Builder requestBuilder, OllamaRequestModel ollamaRequestModel, long requestTimeoutSeconds)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetResponse()Returns the final completion/response when the execution completes.Queue<String>getStream()booleanisComplete()Returns the status of the thread.voidrun()voidsetRequestTimeoutSeconds(long requestTimeoutSeconds)-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
-
-
-
Constructor Detail
-
OllamaAsyncResultCallback
public OllamaAsyncResultCallback(HttpRequest.Builder requestBuilder, OllamaRequestModel ollamaRequestModel, long requestTimeoutSeconds)
-
-
Method Detail
-
isComplete
public boolean isComplete()
Returns the status of the thread. This does not indicate that the request was successful or a failure, rather it is just a status flag to indicate if the thread is active or ended.- Returns:
- boolean - status
-
getResponse
public String getResponse()
Returns the final completion/response when the execution completes. Does not return intermediate results.- Returns:
- String completion/response text
-
setRequestTimeoutSeconds
public void setRequestTimeoutSeconds(long requestTimeoutSeconds)
-
-