Class GenerationHandle
java.lang.Object
smile.llm.engine.GenerationHandle
Handle for an in-flight or queued
GenerationRequest.-
Method Summary
Modifier and TypeMethodDescriptionvoidabort()Requests cancellation.future()Returns the completion future for this generation.booleanReturns whether this handle was aborted.static GenerationHandleof(long requestId, CompletableFuture<ChatCompletion> future) Creates a handle for a future owned outsideInferenceEngine(e.g.longReturns the engine-assigned request id.
-
Method Details
-
of
Creates a handle for a future owned outsideInferenceEngine(e.g. serve fallback when no engine is present).- Parameters:
requestId- engine-assigned request id.future- completion future for the generation.- Returns:
- new handle wrapping
future.
-
requestId
public long requestId()Returns the engine-assigned request id.- Returns:
- request id.
-
future
Returns the completion future for this generation.- Returns:
- completion of the generation (exceptionally if aborted or failed).
-
abort
public void abort()Requests cancellation. Queued jobs are dropped (Instant Eviction from the wait queue). Running jobs stop cooperatively between decode steps when the model seesisAborted()(at most one forward after abort). -
isAborted
-