AppIntent(_:schema:)
Makes an app intent that conforms to a schema available to Siri as a tool.
Declaration
@attached(memberAttribute) @attached(extension, conformances: ToolIntent, AppIntent, AssistantSchemaIntent, ShowInAppSearchResultsIntent, OpenIntent, DeleteIntent, AudioPlaybackIntent, AudioRecordingIntent, LiveActivityIntent, URLRepresentableIntent, names: named(__appSchemaIntent)) macro AppIntent<T>(_ traits: AppIntentTraits, schema: T) where T : AppSchemaIntentParameters
- traits:
The intent’s roles, such as
.toolor[.tool]. - schema:
The schema the intent conforms to.
Overview
Use this macro in place of @AppIntent(schema:). It adds everything @AppIntent(schema:) adds, plus a ToolIntent conformance:
@AppIntent(.tool, schema: .journal.createEntry)
struct CreateEntryIntent {
var title: String?
var message: AttributedString
// ...
}Only schemas available exclusively in Shortcuts are supported. Schemas in primary domains, such as .messages.sendMessage, are already handled by Siri, and using one here is an error.