App Intents people: I have an intent that I’d like to take one of two things:

• Tuple of (enum, int)
OR
• An object that was created by a different of my intents

Is there any way to do this cleanly? It sure seems like this should do it, but it doesn’t:

@caseyliss I ran into a similar issue a year or so ago and couldn't find any way other than to make two different AppIntents whenever I need two different input types 😅

Would love if someone knows a better way!

@caseyliss might not do exactly what you want, but I do something like the following, otherwise it becomes impossible to build the conditional descriptions:

struct MyContainerEntity: AppEntity {
let id: MyContainerEnum
}

enum MyContainerEnum {
case media(MediaSearchResult)
case type(MediaTypeAppEnum)
}

struct GetMediaInfoIntent: AppIntent {
@Parameter(...)
var item: MyContainerEntity
}

@caseyliss I had to create an enum in my case to choose which type. This would be the non-optional parameter. It's associated value would be an optional input.

Here, user can choose "List Type” which impacts the supported variable in the header.

Hope my implementation helps you.

@JoshHrach Took me some fumbling about to get what you were driving at, but this seems to have gotten me over the hump. THANK YOU!
@caseyliss Glad I could help! 😁 If you find a better solution, please share. My Intents game isn't where it needs to be quite yet.