Siri not calling AppIntents

I am very new to App Intents and I am trying to add them to my On Device LLM ChatBot app so my users can get answers to any questions anywhere in iOS.

I have the following code and it is working wonderfully in the Shortcuts app.

import AppIntents

struct AskAi: AppIntent {
    static var openAppWhenRun: Bool = false
    static let title: LocalizedStringResource = "Ask Ai About"
    static let description = "Gets an answer from Ai for your question."
    
    @Parameter(title: "Question")
    var question: String
    
    static var parameterSummary: some ParameterSummary {
        Summary("Ask Ai About \(\.$question)")
    }
    
    @MainActor
    func perform() async throws -> some IntentResult & ReturnsValue<String> {
        let bot: Bot = Bot()
        await bot.respond(to: self.question)
        
        return .result(
            value: bot.output
        )
    }
}

class AppShortcuts: AppShortcutsProvider {
    static var appShortcuts: [AppShortcut] {
        AppShortcut(
            intent: AskAi(),
            phrases: [
                "Ask \(.applicationName) \(\.$question)",
                "Get \(.applicationName) answer for \(\.$question)",
                "Open \(\.$question) using \(.applicationName) ",
                "Using \(.applicationName) get help with \(\.$question)"
            ],
            shortTitle: "Ask Ai",
            systemImageName: "sparkles"
        )
    }
}

I can create a shortcut for this AppIntent and that allows me say speak the response.

I can call my shortcut via iOS 18 Beta 1 by the Shortcut name I set in the Shortcuts app and that allows it to work.

It does not work at all by just Asking Siri any of the phrases I have defined.

The info.plist has an app name alias defined just to be sure.

I even added the Siri capability in Xcode-beta.

I also tried using the ProvidesDialog return type too.

Whatever I do the AppIntent is invisible to Siri.

Siri tries to search the web, looking for my app name in the contacts or have an error Apple Cash which has nothing to do with what I was talking about.

Is there anything else I am missing for setting up iOS AppIntents to work with Siri?

Answered by HelloBlaine in 791343022

I found out what it was...

the Phrases just needed to be set without using my String Parameter "question"

This phrase fixed my issue: "Ask \(.applicationName)",

Confirmed that this also is not working with iOS 17 Siri either. so something likely isn't setup properly I'm just not sure what.

Accepted Answer

I found out what it was...

the Phrases just needed to be set without using my String Parameter "question"

This phrase fixed my issue: "Ask \(.applicationName)",

Siri not calling AppIntents
 
 
Q