OpensIntent. How to make AppIntents work like in ChatGPT app?

I have implemented a code that answers my question with Siri, but I want to have a continuous conversation like in ChatGPT app. Can't understand documentation properly to do that.

import AppIntents

@available(iOS 16.0, *)
struct MyAppShortcuts: AppShortcutsProvider {
  static var appShortcuts: [AppShortcut] {
    AppShortcut(
      intent: AskQuestionIntent(),
      phrases: [
        "Ask \(.applicationName)",
        "Ask \(.applicationName) a question"
      ]
    )
  }
}


@available(iOS 16, *)
struct AskQuestionIntent: AppIntent {
    
    static var title: LocalizedStringResource = "Ask question"
    static var description = IntentDescription("Ask questions directly")
    
    @Parameter(title: "Question", requestValueDialog: "What would you like to ask?")
    var question: String
    
    @MainActor
    func perform() async throws -> some OpensIntent {
        return .result(opensIntent: self, dialog: IntentDialog(stringLiteral: "some result"))
    }
}

Here is How it looks like in ChatGPT:

And here is my app:

`

Post not yet marked as solved Up vote post of hotcoder Down vote post of hotcoder
669 views

Replies

Did you find a way? I am trying to achieve a behavior just like you described but reading apple's documentation did not help me to solve the issue :(