Exemplo n.º 1
0
        public async Task <IList <IntentClassifier> > GetAllIntents(bool fromCache = false)
        {
            IList <IntentClassifier> intents = null;

            if (fromCache)
            {
                intents = await _redisCache.StringGetAsync <IList <IntentClassifier> >("aichat-intents");
            }

            if (intents == null)
            {
                intents = await _luisAuthoringClient.Model.ListIntentsAsync(_luisSettings.AppId, _luisSettings.LuisVersion);

                if (intents != null)
                {
                    await _redisCache.StringSetAsync("aichat-intents", intents);
                }
            }
            return(intents?.ToList());
        }
Exemplo n.º 2
0
 public async Task <ActionResult <string> > GetCacheValue(string key)
 {
     return(Ok(await _redisCacheService.StringGetAsync <string>(key)));
 }