Search code examples
c#chatbotazure-cognitive-servicesazure-language-understanding

LUIS refresh dispatch programmatically


I have an application that uses QNA APIs to add FAQs to a specific KB that is connected to a dispatch app.

When the user create FAQ from my applications it is not added to the dispatch app unless I manually run the command dispatch refresh

Is there a way to refresh the dispatch programmatically?


Solution

  • There isn't a straightforward way, no. As far as the Dispatch documentation is concerned, Dispatch is just a CLI tool and nothing more. You could use something like the Process class in System.Diagnostics to invoke that CLI tool programmatically, though it would depend on your local CLI configuration to be correct.

    Additionally, Dispatch is deprecated and soon to be fully replaced with the Orchestrator, which has a C# (and JavaScript) programming interface. As an alternative to invoking Dispatch through the Process class, you could update your application to make use of Orchestrator and interact with the Orchestrator programmatically instead.