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()); }
public async Task <ActionResult <string> > GetCacheValue(string key) { return(Ok(await _redisCacheService.StringGetAsync <string>(key))); }