Search code examples
botframework

Best way to pass the State information from Assistant to Skill


How to pass the dialogue context with the custom state information to the SKill. I was able to successfully do this by setting it as a property from the Assistant and saw that it's coming at the Skill. But, since assistant already handling the state can't we just use the same context in the skill level. Any input on the best practices and best way to accomplish this would be greatly appreciated. No documentation found for the same.

// code at the assistant level to pass the value to the skill
  protected override async Task<InterruptionAction> OnInterruptDialogAsync(DialogContext dc, CancellationToken cancellationToken)
        {                 

            dc.Context.Activity.Properties.Add("Location", "New York");

Solution

  • Unfortunately, there's not a great story on this at this point. You can read up on this thread to get some ideas and thoughts, but there is by far no real best practice. That being said, you should be able to get it to work somehow. Might have to get creative.

    The bot skill infrastructure is being revamped at the moment, and this scenario (passing state back and forth) is a priority and being addressed with having this work. Keep an eye out for those changes.