MindsDB 25.8.3.0__py3-none-any.whl → 25.9.1.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of MindsDB might be problematic. Click here for more details.
- mindsdb/__about__.py +1 -1
- mindsdb/__main__.py +3 -45
- mindsdb/api/a2a/__init__.py +52 -0
- mindsdb/api/a2a/agent.py +11 -12
- mindsdb/api/a2a/common/server/server.py +17 -36
- mindsdb/api/a2a/common/server/task_manager.py +14 -28
- mindsdb/api/a2a/task_manager.py +20 -21
- mindsdb/api/a2a/utils.py +1 -1
- mindsdb/api/common/middleware.py +106 -0
- mindsdb/api/executor/utilities/mysql_to_duckdb_functions.py +466 -18
- mindsdb/api/executor/utilities/sql.py +9 -31
- mindsdb/api/http/initialize.py +34 -43
- mindsdb/api/http/namespaces/auth.py +6 -14
- mindsdb/api/http/namespaces/config.py +0 -2
- mindsdb/api/http/namespaces/default.py +74 -106
- mindsdb/api/http/namespaces/file.py +9 -3
- mindsdb/api/http/namespaces/handlers.py +77 -87
- mindsdb/api/http/start.py +29 -47
- mindsdb/api/litellm/start.py +11 -10
- mindsdb/api/mcp/__init__.py +165 -0
- mindsdb/api/mysql/mysql_proxy/mysql_proxy.py +33 -64
- mindsdb/api/postgres/postgres_proxy/postgres_proxy.py +86 -85
- mindsdb/integrations/handlers/autogluon_handler/requirements.txt +1 -1
- mindsdb/integrations/handlers/autosklearn_handler/requirements.txt +1 -1
- mindsdb/integrations/handlers/crate_handler/crate_handler.py +3 -7
- mindsdb/integrations/handlers/derby_handler/derby_handler.py +32 -34
- mindsdb/integrations/handlers/documentdb_handler/requirements.txt +1 -0
- mindsdb/integrations/handlers/dummy_data_handler/dummy_data_handler.py +12 -13
- mindsdb/integrations/handlers/flaml_handler/requirements.txt +1 -1
- mindsdb/integrations/handlers/google_books_handler/google_books_handler.py +45 -44
- mindsdb/integrations/handlers/google_calendar_handler/google_calendar_handler.py +101 -95
- mindsdb/integrations/handlers/google_content_shopping_handler/google_content_shopping_handler.py +129 -129
- mindsdb/integrations/handlers/google_fit_handler/google_fit_handler.py +59 -43
- mindsdb/integrations/handlers/google_search_handler/google_search_handler.py +38 -39
- mindsdb/integrations/handlers/informix_handler/informix_handler.py +5 -18
- mindsdb/integrations/handlers/lightfm_handler/requirements.txt +1 -1
- mindsdb/integrations/handlers/lightwood_handler/requirements.txt +4 -4
- mindsdb/integrations/handlers/maxdb_handler/maxdb_handler.py +22 -28
- mindsdb/integrations/handlers/monetdb_handler/monetdb_handler.py +3 -7
- mindsdb/integrations/handlers/mongodb_handler/mongodb_handler.py +53 -67
- mindsdb/integrations/handlers/mongodb_handler/requirements.txt +1 -0
- mindsdb/{api/mongo/utilities → integrations/handlers/mongodb_handler/utils}/mongodb_ast.py +43 -68
- mindsdb/{api/mongo/utilities → integrations/handlers/mongodb_handler/utils}/mongodb_parser.py +17 -25
- mindsdb/{api/mongo/utilities → integrations/handlers/mongodb_handler/utils}/mongodb_query.py +10 -16
- mindsdb/integrations/handlers/mongodb_handler/utils/mongodb_render.py +43 -69
- mindsdb/integrations/handlers/tpot_handler/requirements.txt +1 -1
- mindsdb/integrations/libs/base.py +1 -1
- mindsdb/integrations/libs/llm/config.py +15 -0
- mindsdb/integrations/libs/llm/utils.py +15 -0
- mindsdb/interfaces/agents/constants.py +1 -0
- mindsdb/interfaces/agents/langchain_agent.py +4 -0
- mindsdb/interfaces/agents/providers.py +20 -0
- mindsdb/interfaces/knowledge_base/controller.py +25 -7
- mindsdb/utilities/config.py +15 -158
- mindsdb/utilities/log.py +0 -25
- mindsdb/utilities/render/sqlalchemy_render.py +7 -1
- mindsdb/utilities/starters.py +0 -39
- {mindsdb-25.8.3.0.dist-info → mindsdb-25.9.1.1.dist-info}/METADATA +269 -267
- {mindsdb-25.8.3.0.dist-info → mindsdb-25.9.1.1.dist-info}/RECORD +62 -105
- mindsdb/api/a2a/__main__.py +0 -144
- mindsdb/api/a2a/run_a2a.py +0 -86
- mindsdb/api/common/check_auth.py +0 -42
- mindsdb/api/http/gunicorn_wrapper.py +0 -17
- mindsdb/api/mcp/start.py +0 -205
- mindsdb/api/mongo/__init__.py +0 -0
- mindsdb/api/mongo/classes/__init__.py +0 -5
- mindsdb/api/mongo/classes/query_sql.py +0 -19
- mindsdb/api/mongo/classes/responder.py +0 -45
- mindsdb/api/mongo/classes/responder_collection.py +0 -34
- mindsdb/api/mongo/classes/scram.py +0 -86
- mindsdb/api/mongo/classes/session.py +0 -23
- mindsdb/api/mongo/functions/__init__.py +0 -19
- mindsdb/api/mongo/responders/__init__.py +0 -73
- mindsdb/api/mongo/responders/add_shard.py +0 -13
- mindsdb/api/mongo/responders/aggregate.py +0 -90
- mindsdb/api/mongo/responders/buildinfo.py +0 -17
- mindsdb/api/mongo/responders/coll_stats.py +0 -63
- mindsdb/api/mongo/responders/company_id.py +0 -25
- mindsdb/api/mongo/responders/connection_status.py +0 -22
- mindsdb/api/mongo/responders/count.py +0 -21
- mindsdb/api/mongo/responders/db_stats.py +0 -32
- mindsdb/api/mongo/responders/delete.py +0 -105
- mindsdb/api/mongo/responders/describe.py +0 -23
- mindsdb/api/mongo/responders/end_sessions.py +0 -13
- mindsdb/api/mongo/responders/find.py +0 -175
- mindsdb/api/mongo/responders/get_cmd_line_opts.py +0 -18
- mindsdb/api/mongo/responders/get_free_monitoring_status.py +0 -14
- mindsdb/api/mongo/responders/get_parameter.py +0 -23
- mindsdb/api/mongo/responders/getlog.py +0 -14
- mindsdb/api/mongo/responders/host_info.py +0 -28
- mindsdb/api/mongo/responders/insert.py +0 -270
- mindsdb/api/mongo/responders/is_master.py +0 -20
- mindsdb/api/mongo/responders/is_master_lower.py +0 -13
- mindsdb/api/mongo/responders/list_collections.py +0 -55
- mindsdb/api/mongo/responders/list_databases.py +0 -37
- mindsdb/api/mongo/responders/list_indexes.py +0 -22
- mindsdb/api/mongo/responders/ping.py +0 -13
- mindsdb/api/mongo/responders/recv_chunk_start.py +0 -13
- mindsdb/api/mongo/responders/replsetgetstatus.py +0 -13
- mindsdb/api/mongo/responders/sasl_continue.py +0 -34
- mindsdb/api/mongo/responders/sasl_start.py +0 -33
- mindsdb/api/mongo/responders/update_range_deletions.py +0 -12
- mindsdb/api/mongo/responders/whatsmyuri.py +0 -18
- mindsdb/api/mongo/server.py +0 -388
- mindsdb/api/mongo/start.py +0 -15
- mindsdb/api/mongo/utilities/__init__.py +0 -0
- {mindsdb-25.8.3.0.dist-info → mindsdb-25.9.1.1.dist-info}/WHEEL +0 -0
- {mindsdb-25.8.3.0.dist-info → mindsdb-25.9.1.1.dist-info}/licenses/LICENSE +0 -0
- {mindsdb-25.8.3.0.dist-info → mindsdb-25.9.1.1.dist-info}/top_level.txt +0 -0
mindsdb/utilities/config.py
CHANGED
|
@@ -5,7 +5,6 @@ import argparse
|
|
|
5
5
|
import datetime
|
|
6
6
|
from pathlib import Path
|
|
7
7
|
from copy import deepcopy
|
|
8
|
-
import multiprocessing as mp
|
|
9
8
|
|
|
10
9
|
from appdirs import user_data_dir
|
|
11
10
|
|
|
@@ -160,7 +159,7 @@ class Config:
|
|
|
160
159
|
},
|
|
161
160
|
}
|
|
162
161
|
},
|
|
163
|
-
"gui": {"autoupdate": True},
|
|
162
|
+
"gui": {"open_on_start": True, "autoupdate": True},
|
|
164
163
|
"debug": False,
|
|
165
164
|
"environment": "local",
|
|
166
165
|
"integrations": {},
|
|
@@ -171,14 +170,6 @@ class Config:
|
|
|
171
170
|
"restart_on_failure": True,
|
|
172
171
|
"max_restart_count": 1,
|
|
173
172
|
"max_restart_interval_seconds": 60,
|
|
174
|
-
"server": {
|
|
175
|
-
"type": "waitress", # MINDSDB_HTTP_SERVER_TYPE MINDSDB_DEFAULT_SERVER
|
|
176
|
-
"config": {
|
|
177
|
-
"threads": 16,
|
|
178
|
-
"max_request_body_size": (1 << 30) * 10, # 10GB
|
|
179
|
-
"inbuf_overflow": (1 << 30) * 10,
|
|
180
|
-
},
|
|
181
|
-
},
|
|
182
173
|
},
|
|
183
174
|
"mysql": {
|
|
184
175
|
"host": api_host,
|
|
@@ -189,29 +180,11 @@ class Config:
|
|
|
189
180
|
"max_restart_count": 1,
|
|
190
181
|
"max_restart_interval_seconds": 60,
|
|
191
182
|
},
|
|
192
|
-
"mongodb": {"host": api_host, "port": "47336", "database": "mindsdb"},
|
|
193
183
|
"postgres": {"host": api_host, "port": "55432", "database": "mindsdb"},
|
|
194
|
-
"mcp": {
|
|
195
|
-
"host": api_host,
|
|
196
|
-
"port": "47337",
|
|
197
|
-
"enabled": True,
|
|
198
|
-
"restart_on_failure": True,
|
|
199
|
-
"max_restart_count": 1,
|
|
200
|
-
"max_restart_interval_seconds": 60,
|
|
201
|
-
},
|
|
202
184
|
"litellm": {
|
|
203
185
|
"host": "0.0.0.0", # API server binds to all interfaces by default
|
|
204
186
|
"port": "8000",
|
|
205
187
|
},
|
|
206
|
-
"a2a": {
|
|
207
|
-
"host": api_host,
|
|
208
|
-
"port": 47338,
|
|
209
|
-
"mindsdb_host": "localhost",
|
|
210
|
-
"mindsdb_port": 47334,
|
|
211
|
-
"agent_name": "my_agent",
|
|
212
|
-
"project_name": "mindsdb",
|
|
213
|
-
"enabled": False,
|
|
214
|
-
},
|
|
215
188
|
},
|
|
216
189
|
"cache": {"type": "local"},
|
|
217
190
|
"ml_task_queue": {"type": "local"},
|
|
@@ -250,11 +223,12 @@ class Config:
|
|
|
250
223
|
"""Collect config values from env vars to self._env_config"""
|
|
251
224
|
self._env_config = {
|
|
252
225
|
"logging": {"handlers": {"console": {}, "file": {}}},
|
|
253
|
-
"api": {"http": {
|
|
226
|
+
"api": {"http": {}},
|
|
254
227
|
"auth": {},
|
|
255
228
|
"paths": {},
|
|
256
229
|
"permanent_storage": {},
|
|
257
230
|
"ml_task_queue": {},
|
|
231
|
+
"gui": {},
|
|
258
232
|
}
|
|
259
233
|
|
|
260
234
|
# region storage root path
|
|
@@ -298,21 +272,6 @@ class Config:
|
|
|
298
272
|
self._env_config["auth"]["password"] = http_password
|
|
299
273
|
# endregion
|
|
300
274
|
|
|
301
|
-
# region permanent session lifetime
|
|
302
|
-
for env_name in (
|
|
303
|
-
"MINDSDB_HTTP_PERMANENT_SESSION_LIFETIME",
|
|
304
|
-
"FLASK_PERMANENT_SESSION_LIFETIME",
|
|
305
|
-
):
|
|
306
|
-
env_value = os.environ.get(env_name)
|
|
307
|
-
if isinstance(env_value, str):
|
|
308
|
-
try:
|
|
309
|
-
permanent_session_lifetime = int(env_value)
|
|
310
|
-
except Exception:
|
|
311
|
-
raise ValueError(f"Warning: Can't cast env var {env_name} value to int: {env_value}")
|
|
312
|
-
self._env_config["auth"]["http_permanent_session_lifetime"] = permanent_session_lifetime
|
|
313
|
-
break
|
|
314
|
-
# endregion
|
|
315
|
-
|
|
316
275
|
# region logging
|
|
317
276
|
if os.environ.get("MINDSDB_LOG_LEVEL", "") != "":
|
|
318
277
|
self._env_config["logging"]["handlers"]["console"]["level"] = os.environ["MINDSDB_LOG_LEVEL"]
|
|
@@ -325,35 +284,6 @@ class Config:
|
|
|
325
284
|
self._env_config["logging"]["handlers"]["file"]["enabled"] = True
|
|
326
285
|
# endregion
|
|
327
286
|
|
|
328
|
-
# region server type
|
|
329
|
-
server_type = os.environ.get("MINDSDB_HTTP_SERVER_TYPE", "").lower()
|
|
330
|
-
if server_type == "":
|
|
331
|
-
server_type = os.environ.get("MINDSDB_DEFAULT_SERVER", "").lower()
|
|
332
|
-
if server_type != "":
|
|
333
|
-
if server_type == "waitress":
|
|
334
|
-
self._env_config["api"]["http"]["server"]["type"] = "waitress"
|
|
335
|
-
self._default_config["api"]["http"]["server"]["config"] = {}
|
|
336
|
-
self._env_config["api"]["http"]["server"]["config"] = {
|
|
337
|
-
"threads": 16,
|
|
338
|
-
"max_request_body_size": (1 << 30) * 10, # 10GB
|
|
339
|
-
"inbuf_overflow": (1 << 30) * 10,
|
|
340
|
-
}
|
|
341
|
-
elif server_type == "flask":
|
|
342
|
-
self._env_config["api"]["http"]["server"]["type"] = "flask"
|
|
343
|
-
self._default_config["api"]["http"]["server"]["config"] = {}
|
|
344
|
-
self._env_config["api"]["http"]["server"]["config"] = {}
|
|
345
|
-
elif server_type == "gunicorn":
|
|
346
|
-
self._env_config["api"]["http"]["server"]["type"] = "gunicorn"
|
|
347
|
-
self._default_config["api"]["http"]["server"]["config"] = {}
|
|
348
|
-
self._env_config["api"]["http"]["server"]["config"] = {
|
|
349
|
-
"workers": min(mp.cpu_count(), 4),
|
|
350
|
-
"timeout": 600,
|
|
351
|
-
"reuse_port": True,
|
|
352
|
-
"preload_app": True,
|
|
353
|
-
"threads": 4,
|
|
354
|
-
}
|
|
355
|
-
# endregion
|
|
356
|
-
|
|
357
287
|
if os.environ.get("MINDSDB_DB_CON", "") != "":
|
|
358
288
|
self._env_config["storage_db"] = os.environ["MINDSDB_DB_CON"]
|
|
359
289
|
|
|
@@ -373,31 +303,9 @@ class Config:
|
|
|
373
303
|
if os.environ.get("MINDSDB_DATA_CATALOG_ENABLED", "").lower() in ("1", "true"):
|
|
374
304
|
self._env_config["data_catalog"] = {"enabled": True}
|
|
375
305
|
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
a2a_config["host"] = os.environ.get("MINDSDB_A2A_HOST")
|
|
380
|
-
if os.environ.get("MINDSDB_A2A_PORT"):
|
|
381
|
-
a2a_config["port"] = int(os.environ.get("MINDSDB_A2A_PORT"))
|
|
382
|
-
if os.environ.get("MINDSDB_HOST"):
|
|
383
|
-
a2a_config["mindsdb_host"] = os.environ.get("MINDSDB_HOST")
|
|
384
|
-
if os.environ.get("MINDSDB_PORT"):
|
|
385
|
-
a2a_config["mindsdb_port"] = int(os.environ.get("MINDSDB_PORT"))
|
|
386
|
-
if os.environ.get("MINDSDB_AGENT_NAME"):
|
|
387
|
-
a2a_config["agent_name"] = os.environ.get("MINDSDB_AGENT_NAME")
|
|
388
|
-
if os.environ.get("MINDSDB_PROJECT_NAME"):
|
|
389
|
-
a2a_config["project_name"] = os.environ.get("MINDSDB_PROJECT_NAME")
|
|
390
|
-
if os.environ.get("MINDSDB_A2A_ENABLED") is not None:
|
|
391
|
-
a2a_config["enabled"] = os.environ.get("MINDSDB_A2A_ENABLED").lower() in (
|
|
392
|
-
"true",
|
|
393
|
-
"1",
|
|
394
|
-
"yes",
|
|
395
|
-
"y",
|
|
396
|
-
)
|
|
397
|
-
|
|
398
|
-
if a2a_config:
|
|
399
|
-
self._env_config["api"]["a2a"] = a2a_config
|
|
400
|
-
# endregion
|
|
306
|
+
if os.environ.get("MINDSDB_NO_STUDIO", "").lower() in ("1", "true"):
|
|
307
|
+
self._env_config["gui"]["open_on_start"] = False
|
|
308
|
+
self._env_config["gui"]["autoupdate"] = False
|
|
401
309
|
|
|
402
310
|
def fetch_auto_config(self) -> bool:
|
|
403
311
|
"""Load dict readed from config.auto.json to `auto_config`.
|
|
@@ -430,10 +338,11 @@ class Config:
|
|
|
430
338
|
"""
|
|
431
339
|
if self._user_config is None:
|
|
432
340
|
cmd_args_config = self.cmd_args.config
|
|
433
|
-
if isinstance(
|
|
434
|
-
self.config_path = cmd_args_config
|
|
435
|
-
elif isinstance(os.environ.get("MINDSDB_CONFIG_PATH"), str):
|
|
341
|
+
if isinstance(os.environ.get("MINDSDB_CONFIG_PATH"), str):
|
|
436
342
|
self.config_path = os.environ["MINDSDB_CONFIG_PATH"]
|
|
343
|
+
elif isinstance(cmd_args_config, str):
|
|
344
|
+
self.config_path = cmd_args_config
|
|
345
|
+
|
|
437
346
|
if self.config_path == "absent":
|
|
438
347
|
self.config_path = None
|
|
439
348
|
if isinstance(self.config_path, str):
|
|
@@ -459,40 +368,13 @@ class Config:
|
|
|
459
368
|
"""Merge multiple configs to one."""
|
|
460
369
|
new_config = deepcopy(self._default_config)
|
|
461
370
|
_merge_configs(new_config, self._user_config)
|
|
462
|
-
_merge_configs(new_config, self._auto_config or {})
|
|
463
|
-
_merge_configs(new_config, self._env_config or {})
|
|
464
|
-
|
|
465
|
-
# Apply command-line arguments for A2A
|
|
466
|
-
a2a_config = {}
|
|
467
|
-
|
|
468
|
-
# Check for A2A command-line arguments
|
|
469
|
-
if hasattr(self.cmd_args, "a2a_host") and self.cmd_args.a2a_host is not None:
|
|
470
|
-
a2a_config["host"] = self.cmd_args.a2a_host
|
|
471
|
-
|
|
472
|
-
if hasattr(self.cmd_args, "a2a_port") and self.cmd_args.a2a_port is not None:
|
|
473
|
-
a2a_config["port"] = self.cmd_args.a2a_port
|
|
474
371
|
|
|
475
|
-
if
|
|
476
|
-
|
|
372
|
+
if getattr(self.cmd_args, "no_studio", None) is True:
|
|
373
|
+
new_config["gui"]["open_on_start"] = False
|
|
374
|
+
new_config["gui"]["autoupdate"] = False
|
|
477
375
|
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
if hasattr(self.cmd_args, "agent_name") and self.cmd_args.agent_name is not None:
|
|
482
|
-
a2a_config["agent_name"] = self.cmd_args.agent_name
|
|
483
|
-
|
|
484
|
-
if hasattr(self.cmd_args, "project_name") and self.cmd_args.project_name is not None:
|
|
485
|
-
a2a_config["project_name"] = self.cmd_args.project_name
|
|
486
|
-
|
|
487
|
-
# Merge command-line args config with highest priority
|
|
488
|
-
if a2a_config:
|
|
489
|
-
_merge_configs(new_config, {"api": {"a2a": a2a_config}})
|
|
490
|
-
|
|
491
|
-
# Ensure A2A port is never 0, which would prevent the A2A API from starting
|
|
492
|
-
a2a_config = new_config["api"].get("a2a")
|
|
493
|
-
if a2a_config is not None and isinstance(a2a_config, dict):
|
|
494
|
-
if "port" in a2a_config and (a2a_config["port"] == 0 or a2a_config["port"] is None):
|
|
495
|
-
a2a_config["port"] = 47338 # Use the default port value
|
|
376
|
+
_merge_configs(new_config, self._auto_config or {})
|
|
377
|
+
_merge_configs(new_config, self._env_config or {})
|
|
496
378
|
|
|
497
379
|
# region create dirs
|
|
498
380
|
for key, value in new_config["paths"].items():
|
|
@@ -550,12 +432,6 @@ class Config:
|
|
|
550
432
|
if "log" in self._config:
|
|
551
433
|
logger.warning("The 'log' config option is no longer supported. Use 'logging' instead.")
|
|
552
434
|
|
|
553
|
-
if os.environ.get("MINDSDB_DEFAULT_SERVER", "") != "":
|
|
554
|
-
logger.warning(
|
|
555
|
-
"Env variable 'MINDSDB_DEFAULT_SERVER' is going to be deprecated soon. "
|
|
556
|
-
"Use 'MINDSDB_HTTP_SERVER_TYPE' instead."
|
|
557
|
-
)
|
|
558
|
-
|
|
559
435
|
file_upload_domains = self._config.get("file_upload_domains")
|
|
560
436
|
if isinstance(file_upload_domains, list) and len(file_upload_domains) > 0:
|
|
561
437
|
allowed_origins = self._config["url_file_upload"]["allowed_origins"]
|
|
@@ -566,14 +442,6 @@ class Config:
|
|
|
566
442
|
'use config["url_file_upload"]["allowed_origins"] instead.'
|
|
567
443
|
)
|
|
568
444
|
|
|
569
|
-
for env_name in ("MINDSDB_HTTP_SERVER_TYPE", "MINDSDB_DEFAULT_SERVER"):
|
|
570
|
-
env_value = os.environ.get(env_name, "")
|
|
571
|
-
if env_value.lower() not in ("waitress", "flask", "gunicorn", ""):
|
|
572
|
-
logger.warning(
|
|
573
|
-
f"The value '{env_value}' of the environment variable {env_name} is not valid. "
|
|
574
|
-
"It must be one of the following: 'waitress', 'flask', or 'gunicorn'."
|
|
575
|
-
)
|
|
576
|
-
|
|
577
445
|
@property
|
|
578
446
|
def cmd_args(self):
|
|
579
447
|
if self._cmd_args is None:
|
|
@@ -624,17 +492,6 @@ class Config:
|
|
|
624
492
|
help="Project containing the agent (default: mindsdb)",
|
|
625
493
|
)
|
|
626
494
|
|
|
627
|
-
# A2A specific arguments
|
|
628
|
-
parser.add_argument("--a2a-host", type=str, default=None, help="A2A server host")
|
|
629
|
-
parser.add_argument("--a2a-port", type=int, default=None, help="A2A server port")
|
|
630
|
-
parser.add_argument("--mindsdb-host", type=str, default=None, help="MindsDB server host")
|
|
631
|
-
parser.add_argument("--mindsdb-port", type=int, default=None, help="MindsDB server port")
|
|
632
|
-
parser.add_argument(
|
|
633
|
-
"--agent-name",
|
|
634
|
-
type=str,
|
|
635
|
-
default=None,
|
|
636
|
-
help="MindsDB agent name to connect to",
|
|
637
|
-
)
|
|
638
495
|
parser.add_argument("--project-name", type=str, default=None, help="MindsDB project name")
|
|
639
496
|
parser.add_argument("--update-gui", action="store_true", default=False, help="Update GUI and exit")
|
|
640
497
|
|
mindsdb/utilities/log.py
CHANGED
|
@@ -99,31 +99,6 @@ def get_handlers_config(process_name: str) -> dict:
|
|
|
99
99
|
return handlers_config
|
|
100
100
|
|
|
101
101
|
|
|
102
|
-
def get_uvicorn_logging_config(process_name: str) -> dict:
|
|
103
|
-
"""Generate a logging configuration dictionary for Uvicorn using MindsDB's logging settings.
|
|
104
|
-
|
|
105
|
-
Args:
|
|
106
|
-
process_name (str): The name of the process to include in log file names and handlers.
|
|
107
|
-
|
|
108
|
-
Returns:
|
|
109
|
-
dict: A dictionary suitable for use with logging.config.dictConfig, configured for Uvicorn logging.
|
|
110
|
-
"""
|
|
111
|
-
handlers_config = get_handlers_config(process_name)
|
|
112
|
-
mindsdb_log_level = get_mindsdb_log_level()
|
|
113
|
-
return {
|
|
114
|
-
"version": 1,
|
|
115
|
-
"formatters": FORMATTERS,
|
|
116
|
-
"handlers": handlers_config,
|
|
117
|
-
"loggers": {
|
|
118
|
-
"uvicorn": {
|
|
119
|
-
"handlers": list(handlers_config.keys()),
|
|
120
|
-
"level": mindsdb_log_level,
|
|
121
|
-
"propagate": False,
|
|
122
|
-
}
|
|
123
|
-
},
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
|
|
127
102
|
def configure_logging(process_name: str = None):
|
|
128
103
|
handlers_config = get_handlers_config(process_name)
|
|
129
104
|
mindsdb_log_level = get_mindsdb_log_level()
|
|
@@ -47,7 +47,7 @@ def _compile_interval(element, compiler, **kw):
|
|
|
47
47
|
if items[1].upper().endswith("S"):
|
|
48
48
|
items[1] = items[1][:-1]
|
|
49
49
|
|
|
50
|
-
if compiler.dialect.driver in ["snowflake"]:
|
|
50
|
+
if compiler.dialect.driver in ["snowflake"] or compiler.dialect.name in ["postgresql"]:
|
|
51
51
|
# quote all
|
|
52
52
|
args = " ".join(map(str, items))
|
|
53
53
|
args = f"'{args}'"
|
|
@@ -282,6 +282,12 @@ class SqlalchemyRender:
|
|
|
282
282
|
func = functions[t.op.lower()]
|
|
283
283
|
col = func(arg0, arg1)
|
|
284
284
|
else:
|
|
285
|
+
# for unknown operators wrap arguments into parens
|
|
286
|
+
if isinstance(t.args[0], ast.BinaryOperation):
|
|
287
|
+
arg0 = arg0.self_group()
|
|
288
|
+
if isinstance(t.args[1], ast.BinaryOperation):
|
|
289
|
+
arg1 = arg1.self_group()
|
|
290
|
+
|
|
285
291
|
col = arg0.op(t.op)(arg1)
|
|
286
292
|
|
|
287
293
|
if t.alias:
|
mindsdb/utilities/starters.py
CHANGED
|
@@ -18,16 +18,6 @@ def start_mysql(*args, **kwargs):
|
|
|
18
18
|
start(*args, **kwargs)
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
def start_mongo(*args, **kwargs):
|
|
22
|
-
from mindsdb.utilities.log import initialize_logging
|
|
23
|
-
|
|
24
|
-
initialize_logging("mongo")
|
|
25
|
-
|
|
26
|
-
from mindsdb.api.mongo.start import start
|
|
27
|
-
|
|
28
|
-
start(*args, **kwargs)
|
|
29
|
-
|
|
30
|
-
|
|
31
21
|
def start_postgres(*args, **kwargs):
|
|
32
22
|
from mindsdb.utilities.log import initialize_logging
|
|
33
23
|
|
|
@@ -68,17 +58,6 @@ def start_scheduler(*args, **kwargs):
|
|
|
68
58
|
start(*args, **kwargs)
|
|
69
59
|
|
|
70
60
|
|
|
71
|
-
def start_mcp(*args, **kwargs):
|
|
72
|
-
"""Start the MCP server"""
|
|
73
|
-
from mindsdb.utilities.log import initialize_logging
|
|
74
|
-
|
|
75
|
-
initialize_logging("mcp")
|
|
76
|
-
|
|
77
|
-
from mindsdb.api.mcp.start import start
|
|
78
|
-
|
|
79
|
-
start(*args, **kwargs)
|
|
80
|
-
|
|
81
|
-
|
|
82
61
|
def start_litellm(*args, **kwargs):
|
|
83
62
|
"""Start the LiteLLM server"""
|
|
84
63
|
from mindsdb.utilities.log import initialize_logging
|
|
@@ -88,21 +67,3 @@ def start_litellm(*args, **kwargs):
|
|
|
88
67
|
from mindsdb.api.litellm.start import start
|
|
89
68
|
|
|
90
69
|
start(*args, **kwargs)
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
def start_a2a(*args, **kwargs):
|
|
94
|
-
"""Start the A2A server as a subprocess of the main MindsDB process"""
|
|
95
|
-
from mindsdb.utilities.log import initialize_logging
|
|
96
|
-
|
|
97
|
-
initialize_logging("a2a")
|
|
98
|
-
|
|
99
|
-
from mindsdb.api.a2a.run_a2a import main
|
|
100
|
-
|
|
101
|
-
# Extract configuration from the global config
|
|
102
|
-
from mindsdb.utilities.config import Config
|
|
103
|
-
|
|
104
|
-
config = Config()
|
|
105
|
-
a2a_config = config.get("api", {}).get("a2a", {})
|
|
106
|
-
|
|
107
|
-
# Pass configuration to the A2A main function
|
|
108
|
-
main(a2a_config, *args, **kwargs)
|