Enum IntentSource
- All Implemented Interfaces:
Comparable<IntentSource>
Where an intent invocation came from.
Handlers should rarely branch on this -- an intent that behaves differently depending on who asked is a bug waiting to happen -- but it is useful for analytics, for tailoring the spoken line, and for deciding how much detail a snippet should carry.
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAn in-app call toIntents.invoke(String, Map), including the simulator's Intents window.A language model calling the intent as a tool, through the projectionIntents.asTools()exposes.A shortcut the user placed or the system suggested: the Shortcuts app, an iOS App Shortcut, or an Android launcher shortcut.The user tapped an item this app published throughIntents.index(List).The platform did not say, or the source is one this version does not model.A voice assistant (Siri on iOS).A button on a home-screen widget or live activity bound to this intent. -
Method Summary
Modifier and TypeMethodDescriptionstatic IntentSourceReturns the enum constant of this type with the specified name.static IntentSource[]values()Returns an array containing the constants of this enum type, in the order they are declared.Methods inherited from class Enum
clone, compareTo, equals, getDeclaringClass, getEnumValues, hashCode, name, ordinal, setEnumValues, toString, valueOf
-
Enum Constant Details
-
VOICE
A voice assistant (Siri on iOS). Only ever seen whereIntents.isVoiceInvocationSupported()is true. -
SPOTLIGHT
The user tapped an item this app published throughIntents.index(List). -
SHORTCUT
A shortcut the user placed or the system suggested: the Shortcuts app, an iOS App Shortcut, or an Android launcher shortcut. -
WIDGET
A button on a home-screen widget or live activity bound to this intent. -
IN_APP
An in-app call toIntents.invoke(String, Map), including the simulator's Intents window. -
MODEL
A language model calling the intent as a tool, through the projectionIntents.asTools()exposes. -
UNKNOWN
The platform did not say, or the source is one this version does not model. Treat exactly asIN_APP.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-