MindsDB 25.6.4.0__py3-none-any.whl → 25.7.2.0__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.

Files changed (61) hide show
  1. mindsdb/__about__.py +1 -1
  2. mindsdb/__main__.py +53 -94
  3. mindsdb/api/a2a/agent.py +30 -206
  4. mindsdb/api/a2a/common/server/server.py +26 -27
  5. mindsdb/api/a2a/task_manager.py +93 -227
  6. mindsdb/api/a2a/utils.py +21 -0
  7. mindsdb/api/executor/command_executor.py +8 -6
  8. mindsdb/api/executor/datahub/datanodes/information_schema_datanode.py +1 -1
  9. mindsdb/api/executor/datahub/datanodes/integration_datanode.py +9 -11
  10. mindsdb/api/executor/datahub/datanodes/system_tables.py +1 -1
  11. mindsdb/api/executor/planner/query_prepare.py +68 -87
  12. mindsdb/api/executor/sql_query/steps/fetch_dataframe.py +6 -1
  13. mindsdb/api/executor/sql_query/steps/union_step.py +11 -9
  14. mindsdb/api/executor/utilities/sql.py +97 -21
  15. mindsdb/api/http/namespaces/agents.py +126 -201
  16. mindsdb/api/http/namespaces/config.py +12 -1
  17. mindsdb/api/http/namespaces/file.py +49 -24
  18. mindsdb/api/mcp/start.py +45 -31
  19. mindsdb/integrations/handlers/chromadb_handler/chromadb_handler.py +45 -52
  20. mindsdb/integrations/handlers/huggingface_handler/__init__.py +17 -12
  21. mindsdb/integrations/handlers/huggingface_handler/finetune.py +223 -223
  22. mindsdb/integrations/handlers/huggingface_handler/huggingface_handler.py +383 -383
  23. mindsdb/integrations/handlers/huggingface_handler/requirements.txt +7 -6
  24. mindsdb/integrations/handlers/huggingface_handler/requirements_cpu.txt +7 -6
  25. mindsdb/integrations/handlers/huggingface_handler/settings.py +25 -25
  26. mindsdb/integrations/handlers/litellm_handler/litellm_handler.py +22 -15
  27. mindsdb/integrations/handlers/pgvector_handler/pgvector_handler.py +244 -141
  28. mindsdb/integrations/handlers/postgres_handler/postgres_handler.py +1 -1
  29. mindsdb/integrations/handlers/salesforce_handler/salesforce_handler.py +3 -2
  30. mindsdb/integrations/handlers/salesforce_handler/salesforce_tables.py +1 -1
  31. mindsdb/integrations/handlers/statsforecast_handler/requirements.txt +1 -0
  32. mindsdb/integrations/handlers/statsforecast_handler/requirements_extra.txt +1 -0
  33. mindsdb/integrations/libs/keyword_search_base.py +41 -0
  34. mindsdb/integrations/libs/vectordatabase_handler.py +114 -84
  35. mindsdb/integrations/utilities/rag/rerankers/base_reranker.py +36 -42
  36. mindsdb/integrations/utilities/sql_utils.py +11 -0
  37. mindsdb/interfaces/agents/agents_controller.py +29 -9
  38. mindsdb/interfaces/agents/langchain_agent.py +7 -5
  39. mindsdb/interfaces/agents/mcp_client_agent.py +4 -4
  40. mindsdb/interfaces/agents/mindsdb_database_agent.py +10 -43
  41. mindsdb/interfaces/data_catalog/data_catalog_reader.py +3 -1
  42. mindsdb/interfaces/database/projects.py +1 -3
  43. mindsdb/interfaces/functions/controller.py +54 -64
  44. mindsdb/interfaces/functions/to_markdown.py +47 -14
  45. mindsdb/interfaces/knowledge_base/controller.py +228 -110
  46. mindsdb/interfaces/knowledge_base/evaluate.py +18 -6
  47. mindsdb/interfaces/knowledge_base/executor.py +346 -0
  48. mindsdb/interfaces/knowledge_base/llm_client.py +5 -6
  49. mindsdb/interfaces/knowledge_base/preprocessing/document_preprocessor.py +20 -45
  50. mindsdb/interfaces/knowledge_base/preprocessing/models.py +36 -69
  51. mindsdb/interfaces/skills/custom/text2sql/mindsdb_kb_tools.py +2 -0
  52. mindsdb/interfaces/skills/sql_agent.py +181 -130
  53. mindsdb/interfaces/storage/db.py +9 -7
  54. mindsdb/utilities/config.py +58 -40
  55. mindsdb/utilities/exception.py +58 -7
  56. mindsdb/utilities/security.py +54 -11
  57. {mindsdb-25.6.4.0.dist-info → mindsdb-25.7.2.0.dist-info}/METADATA +245 -259
  58. {mindsdb-25.6.4.0.dist-info → mindsdb-25.7.2.0.dist-info}/RECORD +61 -58
  59. {mindsdb-25.6.4.0.dist-info → mindsdb-25.7.2.0.dist-info}/WHEEL +0 -0
  60. {mindsdb-25.6.4.0.dist-info → mindsdb-25.7.2.0.dist-info}/licenses/LICENSE +0 -0
  61. {mindsdb-25.6.4.0.dist-info → mindsdb-25.7.2.0.dist-info}/top_level.txt +0 -0
@@ -1,6 +1,7 @@
1
- # NOTE: Any changes made here need to be made to requirements_cpu.txt as well
2
- datasets==2.16.1
3
- evaluate==0.4.3
4
- nltk==3.9.1
5
- huggingface-hub==0.29.3
6
- torch==2.6.0
1
+ # # NOTE: Any changes made here need to be made to requirements_cpu.txt as well
2
+ # datasets==2.16.1
3
+ # evaluate==0.4.3
4
+ # nltk==3.9.1
5
+ # huggingface-hub==0.29.3
6
+ # torch==2.7.1
7
+ # transformers >= 4.42.4
@@ -1,6 +1,7 @@
1
- # Needs to be installed with `pip install --extra-index-url https://download.pytorch.org/whl/ .[huggingface_cpu]`
2
- datasets==2.16.1
3
- evaluate==0.4.3
4
- nltk==3.9.1
5
- huggingface-hub==0.29.3
6
- torch==2.6.0+cpu
1
+ # # Needs to be installed with `pip install --extra-index-url https://download.pytorch.org/whl/ .[huggingface_cpu]`
2
+ # datasets==2.16.1
3
+ # evaluate==0.4.3
4
+ # nltk==3.9.1
5
+ # huggingface-hub==0.29.3
6
+ # torch==2.7.1+cpu
7
+ # transformers >= 4.42.4
@@ -1,27 +1,27 @@
1
- from mindsdb.integrations.handlers.huggingface_handler.finetune import (
2
- _finetune_cls,
3
- _finetune_fill_mask,
4
- _finetune_question_answering,
5
- _finetune_summarization,
6
- _finetune_text_generation,
7
- _finetune_translate,
8
- )
1
+ # from mindsdb.integrations.handlers.huggingface_handler.finetune import (
2
+ # _finetune_cls,
3
+ # _finetune_fill_mask,
4
+ # _finetune_question_answering,
5
+ # _finetune_summarization,
6
+ # _finetune_text_generation,
7
+ # _finetune_translate,
8
+ # )
9
9
 
10
- # todo once we have moved predict tasks functions into a separate function
11
- # PREDICT_MAP = {
12
- # 'text-classification': self.predict_text_classification,
13
- # 'zero-shot-classification': self.predict_zero_shot,
14
- # 'translation': self.predict_translation,
15
- # 'summarization': self.predict_summarization,
16
- # 'fill-mask': self.predict_fill_mask
17
- # }
10
+ # # todo once we have moved predict tasks functions into a separate function
11
+ # # PREDICT_MAP = {
12
+ # # 'text-classification': self.predict_text_classification,
13
+ # # 'zero-shot-classification': self.predict_zero_shot,
14
+ # # 'translation': self.predict_translation,
15
+ # # 'summarization': self.predict_summarization,
16
+ # # 'fill-mask': self.predict_fill_mask
17
+ # # }
18
18
 
19
- FINETUNE_MAP = {
20
- "text-classification": _finetune_cls,
21
- "zero-shot-classification": _finetune_cls,
22
- "translation": _finetune_translate,
23
- "summarization": _finetune_summarization,
24
- "fill-mask": _finetune_fill_mask,
25
- "text-generation": _finetune_text_generation,
26
- "question-answering": _finetune_question_answering,
27
- }
19
+ # FINETUNE_MAP = {
20
+ # "text-classification": _finetune_cls,
21
+ # "zero-shot-classification": _finetune_cls,
22
+ # "translation": _finetune_translate,
23
+ # "summarization": _finetune_summarization,
24
+ # "fill-mask": _finetune_fill_mask,
25
+ # "text-generation": _finetune_text_generation,
26
+ # "question-answering": _finetune_question_answering,
27
+ # }
@@ -30,27 +30,34 @@ class LiteLLMHandler(BaseMLEngine):
30
30
  if "using" not in args:
31
31
  raise Exception("Litellm engine requires a USING clause. See settings.py for more info on supported args.")
32
32
 
33
- @staticmethod
34
- def embeddings(model: str, messages: List[str], args: dict) -> List[list]:
35
- response = embedding(model=model, input=messages, **args)
36
- return [rec["embedding"] for rec in response.data]
37
-
38
- @staticmethod
39
- async def acompletion(model: str, messages: List[dict], args: dict):
40
- if model.startswith("snowflake/") and "snowflake_account_id" in args:
33
+ @classmethod
34
+ def prepare_arguments(cls, provider, model_name, args):
35
+ if provider == "snowflake" and "snowflake_account_id" in args:
41
36
  args["api_base"] = (
42
37
  f"https://{args['snowflake_account_id']}.snowflakecomputing.com/api/v2/cortex/inference:complete"
43
38
  )
39
+ if provider == "google":
40
+ provider = "gemini"
41
+ if "base_url" in args:
42
+ args["api_base"] = args.pop("base_url")
44
43
 
45
- return await acompletion(model=model, messages=messages, stream=False, **args)
44
+ model_name = f"{provider}/{model_name}"
45
+ return model_name, args
46
46
 
47
- @staticmethod
48
- def completion(model: str, messages: List[dict], args: dict):
49
- if model.startswith("snowflake/") and "snowflake_account_id" in args:
50
- args["api_base"] = (
51
- f"https://{args['snowflake_account_id']}.snowflakecomputing.com/api/v2/cortex/inference:complete"
52
- )
47
+ @classmethod
48
+ def embeddings(cls, provider: str, model: str, messages: List[str], args: dict) -> List[list]:
49
+ model, args = cls.prepare_arguments(provider, model, args)
50
+ response = embedding(model=model, input=messages, **args)
51
+ return [rec["embedding"] for rec in response.data]
52
+
53
+ @classmethod
54
+ async def acompletion(cls, provider: str, model: str, messages: List[dict], args: dict):
55
+ model, args = cls.prepare_arguments(provider, model, args)
56
+ return await acompletion(model=model, messages=messages, stream=False, **args)
53
57
 
58
+ @classmethod
59
+ def completion(cls, provider: str, model: str, messages: List[dict], args: dict):
60
+ model, args = cls.prepare_arguments(provider, model, args)
54
61
  return completion(model=model, messages=messages, stream=False, **args)
55
62
 
56
63
  def create(