public static ToneAnalysis ToneAnalyzer(AppSettings appSettings, ToneAnalyzerRequest requestBody)
        {
            string  methodName = "ToneAnalyzer";
            dynamic result     = new ExpandoObject();

            try
            {
                ToneAnalyzer     settings      = appSettings.WatsonServices.ToneAnalyzer;
                IamAuthenticator authenticator = new IamAuthenticator(apikey: $"{requestBody.Apikey}");
                IBM.Watson.ToneAnalyzer.v3.ToneAnalyzerService toneAnalyzer = new IBM.Watson.ToneAnalyzer.v3.ToneAnalyzerService($"{settings.Version}", authenticator);
                toneAnalyzer.SetServiceUrl($"{requestBody.Endpoint}");
                ToneInput toneInput = new ToneInput()
                {
                    Text = requestBody.Text
                };
                result = toneAnalyzer.Tone(
                    toneInput: new MemoryStream(Encoding.UTF8.GetBytes(requestBody.Text)),
                    sentences: requestBody.Sentences,
                    contentLanguage: requestBody.ContentLanguage != null ? requestBody.ContentLanguage : "en",
                    acceptLanguage: requestBody.AcceptLanguage
                    ).Result;
                return(result);
            }
            catch (Exception e)
            {
                Log.Write(appSettings, LogEnum.ERROR.ToString(), label, className, methodName, $"ERROR: {JsonConvert.SerializeObject(requestBody)}");
                Log.Write(appSettings, LogEnum.ERROR.ToString(), label, className, methodName, $"ERROR: {e.Source + Environment.NewLine + e.Message + Environment.NewLine + e.StackTrace}");
                throw e;
            }
        }
        public static UtteranceAnalyses ToneAnalyzerCustomer(AppSettings appSettings, ToneAnalyzerRequest requestBody)
        {
            string  methodName = "ToneAnalyzer";
            dynamic result     = new ExpandoObject();

            try
            {
                ToneAnalyzer     settings      = appSettings.WatsonServices.ToneAnalyzer;
                IamAuthenticator authenticator = new IamAuthenticator(apikey: $"{requestBody.Apikey}");
                IBM.Watson.ToneAnalyzer.v3.ToneAnalyzerService toneAnalyzer = new IBM.Watson.ToneAnalyzer.v3.ToneAnalyzerService($"{settings.Version}", authenticator);
                toneAnalyzer.SetServiceUrl($"{requestBody.Endpoint}");

                List <Utterance> utterances = new List <Utterance>();
                requestBody.Utterances.ForEach(u =>
                {
                    utterances.Add(new Utterance()
                    {
                        User = u["user"].ToString(),
                        Text = u["text"].ToString()
                    });
                });
                result = toneAnalyzer.ToneChat(
                    utterances: utterances,
                    contentLanguage: requestBody.ContentLanguage != null ? requestBody.ContentLanguage : "en",
                    acceptLanguage: requestBody.AcceptLanguage
                    ).Result;
                return(result);
            }
            catch (Exception e)
            {
                Log.Write(appSettings, LogEnum.ERROR.ToString(), label, className, methodName, $"ERROR: {JsonConvert.SerializeObject(requestBody)}");
                Log.Write(appSettings, LogEnum.ERROR.ToString(), label, className, methodName, $"ERROR: {e.Source + Environment.NewLine + e.Message + Environment.NewLine + e.StackTrace}");
                throw e;
            }
        }