public static final class SmartReply.Session
- Object
- SmartReply.Session
ImplementsAutoCloseable
Reusable owner of a native Smart Reply backend.
Calling close() prevents new requests immediately and defers
native release until suggestions already in progress have completed.
Methods
public AsyncResource<String[]> suggest(SmartReplyMessage[] conversation) | Generates reply suggestions without recreating the native backend. |
public void close() | Closes the session. |
Inherited methods
Method details
suggest
public AsyncResource<String[]> suggest(SmartReplyMessage[] conversation)Generates reply suggestions without recreating the native backend.
Cancelling the returned resource suppresses late callbacks without
closing this reusable session.
Parameters
conversationSmartReplyMessage[]- chronological messages, oldest first;
nullis treated as an empty conversation
Returns
asynchronous suggestions, possibly empty
Throws
IllegalStateException- if this session is closed
close
public void close()Closes the session. This method is idempotent; native release is
deferred until pending suggestions finish.