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> AddCacheVAlue(string key, [FromBody] string value) { await _redisCacheService.StringSetAsync(key, value); return(Ok()); }