예제 #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());
        }
예제 #2
0
        public async Task <ActionResult> AddCacheVAlue(string key, [FromBody] string value)
        {
            await _redisCacheService.StringSetAsync(key, value);

            return(Ok());
        }