def initialize_interfaces(app): app.default_store = DataStore() app.naitve_interface = NativeInterface() app.custom_models = CustomModels() app.dbw = DatabaseWrapper() config = Config() app.config_obj = config
if api_name not in config['api']: print( f"Trying run '{api_name}' API, but is no config for this api.") print(f"Please, fill config['api']['{api_name}']") sys.exit(0) start_functions = { 'http': start_http, 'mysql': start_mysql, 'mongodb': start_mongo } archive_obsolete_predictors(config, '2.11.0') mdb = MindsdbNative(config) cst = CustomModels(config) # @TODO Maybe just use `get_model_data` directly here ? Seems like a useless abstraction model_data_arr = [{ 'name': x['name'], 'predict': x['predict'], 'data_analysis': mdb.get_model_data(x['name'])['data_analysis_v2'] } for x in mdb.get_models()] model_data_arr.extend(cst.get_models()) dbw = DatabaseWrapper(config) dbw.register_predictors(model_data_arr)
def __init__(self, config): self.config = config self.mindsdb_native = NativeInterface(config) self.custom_models = CustomModels(config)
def __init__(self, config): self.config = Config() self.mindsdb_native = NativeInterface() self.custom_models = CustomModels() self.ai_table = AITable_store() self.default_store = DataStore()
def initialize_interfaces(config, app): app.default_store = DataStore(config) app.mindsdb_native = MindsdbNative(config) app.custom_models = CustomModels(config) app.config_obj = config
def initialize_interfaces(config, app): app.default_store = DataStore(config) app.mindsdb_native = NativeInterface(config) app.custom_models = CustomModels(config) app.dbw = DatabaseWrapper(config) app.config_obj = config
'port': config['api'][api]['port'], 'process': None, 'started': False } for api in api_arr } if not ray_based: apis['rcp'] = {'process': rpc_proc, 'started': True} start_functions = { 'http': start_http, 'mysql': start_mysql, 'mongodb': start_mongo } mdb = NativeInterface() cst = CustomModels() model_data_arr = get_all_models_meta_data(mdb, cst) dbw = DatabaseWrapper() for db_alias in config['integrations']: dbw.setup_integration(db_alias) dbw.register_predictors(model_data_arr) for broken_name in [name for name, connected in dbw.check_connections().items() if connected is False]: log.error(f'Error failed to integrate with database aliased: {broken_name}') for api_name, api_data in apis.items(): if api_data['started']: continue print(f'{api_name} API: starting...')