Contents

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 : AppSchemaIntent

Parameters

  • traits:

    The intent’s roles, such as .tool or [.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.

See Also

Tool support