One Logo Pool Ball
AppIntents · IOS API REFERENCE

PredictableIntent

protocol · iOS 16.0+ · SDK 27.1

protocol PredictableIntent : AppIntent

An interface that indicates the system can suggest the intent as a potential action to run. Add support for the `PredictableIntent` protocol to an app intent to improve the descriptions that the system displays for your app intent. When making proactive suggestions in interfaces like the Siri Suggestions widget, the system displays the descriptions you provide using this protocol. Create descriptions that explain your action clearly and concisely using only the parameters you find relevant. For example, you might build a description that incorporates only one of several of the app intent's parameters, if doing so leads to a more concise phrase. In your implementation of this protocol, provide one or more ``IntentPrediction`` types in the ``PredictableIntent/predictionConfiguration`` property. In each intent prediction, convey the purpose of your app intent using zero or more parameters. The following example shows an app intent offers a description using only the `name` parameter of the app intent. ``` struct CreateBook: AppIntent, PredictableIntent { @Parameter(title: "Book Name") var name: String? @Parameter(title: "Author", query: AuthorQuery.self) var author: AuthorEntity? static var predictionConfiguration: some IntentPredictionConfiguration { IntentPrediction(parameters: (\Self.$name)) { name in DisplayRepresentation( title: "Create a book named \(name)" ) } } @MainActor func perform() async throws -> IntentResult<BookEntity> { ... } } ```

Members (0)

This type has no directly callable members in this snapshot. See the framework’s skipped declarations for unsupported APIs.

Skipped declarations

No declarations were skipped in this snapshot.

All AppIntents types →