private static void ListEntities(WitRequest r, WitConfiguration configuration, Action onUpdateComplete) { EditorForegroundRunner.Run(() => { var entitiesRequest = configuration.ListEntitiesRequest(); entitiesRequest.onResponse = (er) => ListTraits(er, configuration, onUpdateComplete); OnUpdateData(r, (response) => UpdateIntentList(configuration, response), entitiesRequest.Request); }); }
// Refresh entities data private static void RefreshEntitiesData(WitConfiguration configuration, Action <string> onRefreshComplete) { PerformConfigRequest(configuration, configuration.ListEntitiesRequest(), ApplyEntityList, (error) => { if (!string.IsNullOrEmpty(error)) { RefreshDataComplete(configuration, error, onRefreshComplete); } else { RefreshTraitsData(configuration, onRefreshComplete); } }); }