SpeechAnalyzer > AnalysisContext lack of documentation

I'm using the new SpeechAnalyzer framework to detect certain commands and want to improve accuracy by giving context. Seems like AnalysisContext is the solution for this, but couldn't find any usage example. So I want to make sure that I'm doing it right or not.

       let context = AnalysisContext()
       context.contextualStrings = [
           AnalysisContext.ContextualStringsTag("commands"): [
               "set speed level",
               "set jump level",
               "increase speed",
               "decrease speed",
                ...
           ],
           AnalysisContext.ContextualStringsTag("vocabulary"): [
               "speed", "jump", ...
           ]
       ]

        try await analyzer.setContext(context)

With this implementation, it still gives outputs like "Set some speed level", "It's speed level", etc.

Also, is it possible to make it expect number after those commands, in order to eliminate results like "set some speed level to" (instead of two).

SpeechAnalyzer > AnalysisContext lack of documentation
 
 
Q