返回 Skill 列表
extension
分类: AI Agent 能力无需 API Key

"siri-intents"

Siri和应用程序意图:应用程序意图框架、应用程序快捷方式、语音命令、进程内意图、快捷方式应用程序集成。在添加Siri语音命令、创建应用程序快捷方式或与快捷方式应用程序集成时使用。触发词:AppIntent, AppShortcutsProvider, Siri, 语音命令, 快捷方式。

person作者: jakexiaohubgithub

Siri Intents

SIRI VOICE COMMANDS (App Intents): FRAMEWORK: import AppIntents (iOS 16+, replaces legacy SiriKit Intents)

BASIC INTENT: struct OpenNoteIntent: AppIntent { static var title: LocalizedStringResource = "Open Note" static var description = IntentDescription("Opens a specific note in the app")

@Parameter(title: "Note Name")
var noteName: String

func perform() async throws -> some IntentResult & ProvidesDialog {
    // Navigate to note or perform action
    return .result(dialog: "Opening \(noteName)")
}

}

APP SHORTCUTS (makes intent discoverable via Siri without user setup): struct MyAppShortcuts: AppShortcutsProvider { static var appShortcuts: [AppShortcut] { AppShortcut( intent: OpenNoteIntent(), phrases: ["Open (.$noteName) in (.applicationName)", "Show note (.$noteName)"], shortTitle: "Open Note", systemImageName: "note.text" ) } }

ENTITLEMENT: Add com.apple.developer.siri entitlement (CONFIG_CHANGES entitlements key). NO SEPARATE TARGET: App Intents run in-process — no extension target needed. DONATION: AppShortcutsProvider automatically donates shortcuts to Siri.