Allow cancelling ongoing async generation in LlmInference #5327
Labels
platform:android
Issues with Android as Platform
stat:awaiting googler
Waiting for Google Engineer's Response
task:LLM inference
Issues related to MediaPipe LLM Inference Gen AI setup
type:feature
Enhancement in the New Functionality or Request for a New Solution
MediaPipe Solution (you are using)
LlmInference for Android
Programming language
Android Java
Are you willing to contribute it
Yes
Describe the feature and the current behaviour/state
There should be a way to cancel the task created by generateResponseAsync(). Proposed API: add a cancel() method in the LlmInference class that cancels all ongoing requests, or provide a version of generateResponseAsync() that returns a Future
Will this change the current API? How?
No response
Who will benefit with this feature?
No response
Please specify the use cases for this feature
Applications that allow the user to cancel a query, either explicitly, or implicitly by submitting a new query before the last one has finished processing, would need this feature to avoid having to process a request that it no longer cares about.
Any Other info
No response
The text was updated successfully, but these errors were encountered: