File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
app/src/main/kotlin/com/google/ai/sample/feature/multimodal Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -620,6 +620,17 @@ performReasoning(
620620 // Parse commands from the text
621621 val commands = CommandParser .parseCommands(text)
622622
623+ // Check if takeScreenshot() is not in the response
624+ if (! commands.any { it is Command .TakeScreenshot }) {
625+ // Show a toast message
626+ val context = MainActivity .getInstance()?.applicationContext
627+ if (context != null ) {
628+ withContext(Dispatchers .Main ) {
629+ Toast .makeText(context, " The AI stopped Screen Operator" , Toast .LENGTH_SHORT ).show()
630+ }
631+ }
632+ }
633+
623634 if (commands.isNotEmpty()) {
624635 if (commandProcessingJob?.isActive != true || stopExecutionFlag.get()) return @launch
625636 Log .d(TAG , " Found ${commands.size} commands in response" )
You can’t perform that action at this time.
0 commit comments