internal static AnalyzeConversationResult DeserializeAnalyzeConversationResult(JsonElement element) { string query = default; Optional <string> detectedLanguage = default; BasePrediction prediction = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("query")) { query = property.Value.GetString(); continue; } if (property.NameEquals("detectedLanguage")) { detectedLanguage = property.Value.GetString(); continue; } if (property.NameEquals("prediction")) { prediction = BasePrediction.DeserializeBasePrediction(property.Value); continue; } } return(new AnalyzeConversationResult(query, detectedLanguage.Value, prediction)); }
internal AnalyzeConversationResult(string query, BasePrediction prediction) { if (query == null) { throw new ArgumentNullException(nameof(query)); } if (prediction == null) { throw new ArgumentNullException(nameof(prediction)); } Query = query; Prediction = prediction; }
public static AnalyzeConversationResult AnalyzeConversationResult(string query = null, string detectedLanguage = null, BasePrediction prediction = null) { return(new AnalyzeConversationResult(query, detectedLanguage, prediction)); }
internal AnalyzeConversationResult(string query, string detectedLanguage, BasePrediction prediction) { Query = query; DetectedLanguage = detectedLanguage; Prediction = prediction; }