internal static QuestionAnsweringTargetIntentResult DeserializeQuestionAnsweringTargetIntentResult(JsonElement element)
        {
            Optional <KnowledgeBaseAnswers> result = default;
            TargetKind        targetKind           = default;
            Optional <string> apiVersion           = default;
            double            confidenceScore      = default;

            foreach (var property in element.EnumerateObject())
            {
                if (property.NameEquals("result"))
                {
                    if (property.Value.ValueKind == JsonValueKind.Null)
                    {
                        result = null;
                        continue;
                    }
                    result = KnowledgeBaseAnswers.DeserializeKnowledgeBaseAnswers(property.Value);
                    continue;
                }
                if (property.NameEquals("targetKind"))
                {
                    targetKind = new TargetKind(property.Value.GetString());
                    continue;
                }
                if (property.NameEquals("apiVersion"))
                {
                    apiVersion = property.Value.GetString();
                    continue;
                }
                if (property.NameEquals("confidenceScore"))
                {
                    confidenceScore = property.Value.GetDouble();
                    continue;
                }
            }
            return(new QuestionAnsweringTargetIntentResult(targetKind, apiVersion.Value, confidenceScore, result.Value));
        }
Exemplo n.º 2
0
 public static QuestionAnsweringTargetIntentResult QuestionAnsweringTargetIntentResult(TargetKind targetKind = default, string apiVersion = null, double confidenceScore = default, KnowledgeBaseAnswers result = null)
 {
     return(new QuestionAnsweringTargetIntentResult(targetKind, apiVersion, confidenceScore, result));
 }