Ejemplo n.º 1
0
        private Dictionary <string, Microsoft.Bot.Builder.AI.QnA.QnAMaker> BuildDictionary()
        {
            Dictionary <string, Microsoft.Bot.Builder.AI.QnA.QnAMaker> result = new Dictionary <string, Microsoft.Bot.Builder.AI.QnA.QnAMaker>();

            var qnaEndpoint = new Microsoft.Bot.Builder.AI.QnA.QnAMakerEndpoint()
            {
                KnowledgeBaseId = config.KbId,
                EndpointKey     = config.EndpointKey,
                Host            = config.Hostname,
            };

            var qnaOptions = new Microsoft.Bot.Builder.AI.QnA.QnAMakerOptions
            {
                ScoreThreshold = 0.3F
            };

            Microsoft.Bot.Builder.AI.QnA.QnAMaker qnaMaker = null;

            if (botTelemetryClient != null)
            {
                qnaMaker = new Microsoft.Bot.Builder.AI.QnA.QnAMaker(qnaEndpoint, qnaOptions, httpClient, botTelemetryClient, true);
            }
            else
            {
                qnaMaker = new Microsoft.Bot.Builder.AI.QnA.QnAMaker(qnaEndpoint, qnaOptions, httpClient);
            }

            result.Add(config.Name, qnaMaker);

            return(result);
        }
Ejemplo n.º 2
0
        private Dictionary <string, Microsoft.Bot.Builder.AI.QnA.QnAMaker> BuildDictionary()
        {
            Dictionary <string, Microsoft.Bot.Builder.AI.QnA.QnAMaker> result = new Dictionary <string, Microsoft.Bot.Builder.AI.QnA.QnAMaker>();

            var qnaEndpoint = new Microsoft.Bot.Builder.AI.QnA.QnAMakerEndpoint()
            {
                KnowledgeBaseId = config.KbId,
                EndpointKey     = config.EndpointKey,
                Host            = config.Hostname,
            };

            var qnaOptions = new Microsoft.Bot.Builder.AI.QnA.QnAMakerOptions
            {
                ScoreThreshold = 0.3F
            };

            var qnaMaker = new Microsoft.Bot.Builder.AI.QnA.QnAMaker(qnaEndpoint, qnaOptions);

            result.Add(config.Name, qnaMaker);

            return(result);
        }