How to use AppIntents to parse user's speech and support direct parameter parsing?
when i use AppEntity like this:
@Parameter(title: LocalizedStringResource(stringLiteral: "SIRI_END"), requestValueDialog: "where you go")
var end: MapPoiAppEntity
in MapPoiAppEntity
Siri must first ask a question, and the user must answer before this method can be executed:
func entities(matching string: String) async throws -> [MapPoiAppEntity]
For example, if the user wakes up Siri and directly says, "I want to take a taxi to San Francisco," this method will not be executed, and the parameters will not be parsed.
I later discovered that I must first feed the data to this method in order to parse it.
func suggestedEntities() async throws -> [MapPoiAppEntity] {
print("identifier-> suggestedEntities")
let items = Self.saveItems
return items
}
This way, the destination can only be a limited list, and it cannot be used extensively. Why can't you just give me the destination directly in the "func entities(matching string: String)" method?
This is a knowledge point that I have not yet understood. If that's the case, please provide guidance. Or is it a design limitation from Apple that the dynamic parameter parsing can only have a limited list? Please tell me.