MindsDB 25.7.4.0__py3-none-any.whl → 25.8.3.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 (65) hide show
  1. mindsdb/__about__.py +1 -1
  2. mindsdb/__main__.py +13 -1
  3. mindsdb/api/a2a/agent.py +6 -16
  4. mindsdb/api/a2a/common/types.py +3 -4
  5. mindsdb/api/a2a/task_manager.py +24 -35
  6. mindsdb/api/a2a/utils.py +63 -0
  7. mindsdb/api/executor/command_executor.py +9 -15
  8. mindsdb/api/executor/sql_query/steps/fetch_dataframe.py +21 -24
  9. mindsdb/api/executor/sql_query/steps/fetch_dataframe_partition.py +9 -3
  10. mindsdb/api/executor/sql_query/steps/subselect_step.py +11 -8
  11. mindsdb/api/executor/utilities/mysql_to_duckdb_functions.py +264 -0
  12. mindsdb/api/executor/utilities/sql.py +30 -0
  13. mindsdb/api/http/initialize.py +2 -1
  14. mindsdb/api/http/namespaces/agents.py +6 -7
  15. mindsdb/api/http/namespaces/views.py +56 -72
  16. mindsdb/integrations/handlers/db2_handler/db2_handler.py +19 -23
  17. mindsdb/integrations/handlers/gong_handler/__about__.py +2 -0
  18. mindsdb/integrations/handlers/gong_handler/__init__.py +30 -0
  19. mindsdb/integrations/handlers/gong_handler/connection_args.py +37 -0
  20. mindsdb/integrations/handlers/gong_handler/gong_handler.py +164 -0
  21. mindsdb/integrations/handlers/gong_handler/gong_tables.py +508 -0
  22. mindsdb/integrations/handlers/gong_handler/icon.svg +25 -0
  23. mindsdb/integrations/handlers/gong_handler/test_gong_handler.py +125 -0
  24. mindsdb/integrations/handlers/huggingface_handler/__init__.py +8 -12
  25. mindsdb/integrations/handlers/huggingface_handler/finetune.py +203 -223
  26. mindsdb/integrations/handlers/huggingface_handler/huggingface_handler.py +360 -383
  27. mindsdb/integrations/handlers/huggingface_handler/requirements.txt +7 -7
  28. mindsdb/integrations/handlers/huggingface_handler/requirements_cpu.txt +7 -7
  29. mindsdb/integrations/handlers/huggingface_handler/settings.py +25 -25
  30. mindsdb/integrations/handlers/langchain_handler/langchain_handler.py +1 -2
  31. mindsdb/integrations/handlers/openai_handler/constants.py +11 -30
  32. mindsdb/integrations/handlers/openai_handler/helpers.py +27 -34
  33. mindsdb/integrations/handlers/openai_handler/openai_handler.py +14 -12
  34. mindsdb/integrations/handlers/salesforce_handler/constants.py +9 -2
  35. mindsdb/integrations/libs/llm/config.py +0 -14
  36. mindsdb/integrations/libs/llm/utils.py +0 -15
  37. mindsdb/integrations/utilities/files/file_reader.py +5 -19
  38. mindsdb/integrations/utilities/rag/rerankers/base_reranker.py +1 -1
  39. mindsdb/interfaces/agents/agents_controller.py +83 -45
  40. mindsdb/interfaces/agents/constants.py +16 -3
  41. mindsdb/interfaces/agents/langchain_agent.py +84 -21
  42. mindsdb/interfaces/database/projects.py +111 -7
  43. mindsdb/interfaces/knowledge_base/controller.py +7 -1
  44. mindsdb/interfaces/knowledge_base/preprocessing/document_preprocessor.py +6 -10
  45. mindsdb/interfaces/knowledge_base/preprocessing/text_splitter.py +73 -0
  46. mindsdb/interfaces/query_context/context_controller.py +14 -15
  47. mindsdb/interfaces/skills/custom/text2sql/mindsdb_sql_toolkit.py +7 -1
  48. mindsdb/interfaces/skills/skill_tool.py +7 -1
  49. mindsdb/interfaces/skills/sql_agent.py +6 -2
  50. mindsdb/utilities/config.py +2 -0
  51. mindsdb/utilities/fs.py +60 -17
  52. {mindsdb-25.7.4.0.dist-info → mindsdb-25.8.3.0.dist-info}/METADATA +277 -262
  53. {mindsdb-25.7.4.0.dist-info → mindsdb-25.8.3.0.dist-info}/RECORD +57 -56
  54. mindsdb/integrations/handlers/anyscale_endpoints_handler/__about__.py +0 -9
  55. mindsdb/integrations/handlers/anyscale_endpoints_handler/__init__.py +0 -20
  56. mindsdb/integrations/handlers/anyscale_endpoints_handler/anyscale_endpoints_handler.py +0 -290
  57. mindsdb/integrations/handlers/anyscale_endpoints_handler/creation_args.py +0 -14
  58. mindsdb/integrations/handlers/anyscale_endpoints_handler/icon.svg +0 -4
  59. mindsdb/integrations/handlers/anyscale_endpoints_handler/requirements.txt +0 -2
  60. mindsdb/integrations/handlers/anyscale_endpoints_handler/settings.py +0 -51
  61. mindsdb/integrations/handlers/anyscale_endpoints_handler/tests/test_anyscale_endpoints_handler.py +0 -212
  62. /mindsdb/integrations/handlers/{anyscale_endpoints_handler/tests/__init__.py → gong_handler/requirements.txt} +0 -0
  63. {mindsdb-25.7.4.0.dist-info → mindsdb-25.8.3.0.dist-info}/WHEEL +0 -0
  64. {mindsdb-25.7.4.0.dist-info → mindsdb-25.8.3.0.dist-info}/licenses/LICENSE +0 -0
  65. {mindsdb-25.7.4.0.dist-info → mindsdb-25.8.3.0.dist-info}/top_level.txt +0 -0
@@ -1,14 +0,0 @@
1
- from collections import OrderedDict
2
-
3
- from mindsdb.integrations.libs.const import HANDLER_CONNECTION_ARG_TYPE as ARG_TYPE
4
-
5
-
6
- creation_args = OrderedDict(
7
- anyscale_endpoints_api_key={
8
- 'type': ARG_TYPE.STR,
9
- 'description': 'Key for anyscale endpoints.',
10
- 'required': False,
11
- 'label': 'Anyscale endpoints API key',
12
- 'secret': True
13
- }
14
- )
@@ -1,4 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40" fill="none">
2
- <path d="M13.3722 21.826H4.85157C2.13017 21.826 0 23.9511 0 26.6661V35.1627C0 37.8752 2.13017 40.0003 4.85157 40.0003H13.3722C16.0949 40.0003 18.2251 37.8752 18.2251 35.1627V26.6636C18.2251 23.9498 15.9756 21.826 13.3722 21.826ZM15.2664 35.0427C15.2664 36.1052 14.438 36.9302 13.3722 36.9302H4.85157C4.60193 36.9332 4.35421 36.8865 4.12301 36.7926C3.89181 36.6988 3.68182 36.5599 3.5054 36.3839C3.32898 36.208 3.18972 35.9987 3.09582 35.7684C3.00191 35.538 2.95527 35.2912 2.95864 35.0427V26.5474C2.95864 25.4849 3.78711 24.6598 4.85157 24.6598H13.3722C14.438 24.6598 15.2664 25.4849 15.2664 26.5474V35.0427Z" fill="#2055BE"/>
3
- <path d="M35.2664 14.9855H25.0888V4.83765C24.9696 2.12507 22.8406 0 20.118 0H4.85157C2.13017 0 0 2.12507 0 4.83765V13.0979C0 15.8117 2.13017 17.9356 4.85157 17.9356H22.0109V35.0448C22.0109 37.7587 24.1423 39.8825 26.8637 39.8825H35.1484C37.8698 39.8825 40 37.7587 40 35.0448V19.8231C40 17.228 37.8698 15.1042 35.2664 14.9855ZM4.85157 14.9855C4.60193 14.9885 4.35421 14.9417 4.12301 14.8479C3.89181 14.7541 3.68182 14.6151 3.5054 14.4392C3.32898 14.2633 3.18972 14.054 3.09582 13.8236C3.00191 13.5933 2.95527 13.3465 2.95864 13.0979V4.83765C2.95864 3.77512 3.78711 2.95009 4.85157 2.95009H20.118C21.1837 2.95009 22.0122 3.77512 22.0122 4.83765V14.9855H4.85157ZM37.1594 35.0448C37.1594 36.1074 36.3309 36.9324 35.2664 36.9324H26.9817C26.7321 36.9354 26.4844 36.8886 26.2532 36.7948C26.022 36.701 25.812 36.562 25.6356 36.3861C25.4592 36.2102 25.3199 36.0009 25.226 35.7705C25.1321 35.5402 25.0854 35.2934 25.0888 35.0448V17.9356H35.2664C36.3309 17.9356 37.1594 18.7606 37.1594 19.8231V35.0448Z" fill="#2055BE"/>
4
- </svg>
@@ -1,2 +0,0 @@
1
- pydantic-settings >= 2.1.0
2
- -r mindsdb/integrations/handlers/openai_handler/requirements.txt
@@ -1,51 +0,0 @@
1
- from typing import Text, List
2
- from pydantic_settings import BaseSettings
3
-
4
-
5
- class AnyscaleHandlerConfig(BaseSettings):
6
- """
7
- Configuration for the Anyscale handler.
8
-
9
- Attributes
10
- ----------
11
-
12
- ANYSCALE_API_BASE : Text
13
- Base URL for the Anyscale API.
14
-
15
- MIN_FT_VAL_LEN : int
16
- Minimum number of validation chats required for fine-tuning.
17
-
18
- MIN_FT_DATASET_LEN : int
19
- Minimum number of training and validation chats required for fine-tuning.
20
-
21
- DEFAULT_MODEL : Text
22
- Default model to use for models.
23
-
24
- DEFAULT_MODE : Text
25
- Default mode to use for models. Can be 'default', 'conversational', or 'conversational-full'.
26
-
27
- SUPPORTED_MODES : List
28
- List of supported modes. Can be 'default', 'conversational', or 'conversational-full'.
29
-
30
- RATE_LIMIT : int
31
- Number of requests per minute.
32
-
33
- MAX_BATCH_SIZE : int
34
- Maximum batch size for requests.
35
-
36
- DEFAULT_MAX_TOKENS : int
37
- Default maximum tokens for requests.
38
- """
39
-
40
- ANYSCALE_API_BASE: Text = 'https://api.endpoints.anyscale.com/v1'
41
- MIN_FT_VAL_LEN: int = 20
42
- MIN_FT_DATASET_LEN: int = MIN_FT_VAL_LEN * 2
43
- DEFAULT_MODEL: Text = 'meta-llama/Llama-2-7b-chat-hf'
44
- DEFAULT_MODE: Text = 'default'
45
- SUPPORTED_MODES: List = ['default', 'conversational', 'conversational-full']
46
- RATE_LIMIT: int = 25
47
- MAX_BATCH_SIZE: int = 20
48
- DEFAULT_MAX_TOKENS: int = 100
49
-
50
-
51
- anyscale_handler_config = AnyscaleHandlerConfig()
@@ -1,212 +0,0 @@
1
- import os
2
- import pytest
3
- import pandas as pd
4
- from unittest.mock import patch
5
-
6
- from tests.unit.ml_handlers.base_ml_test import BaseMLAPITest
7
-
8
-
9
- @pytest.mark.skipif(os.environ.get('MDB_TEST_ANYSCALE_ENDPOINTS_API_KEY') is None, reason='Missing API key!')
10
- class TestAnyscaleEndpoints(BaseMLAPITest):
11
- """
12
- Integration tests for Anyscale Endpoints AI engine.
13
- """
14
-
15
- def setup_method(self):
16
- """
17
- Setup test environment by creating a project and a Anyscale Endpoints engine.
18
- """
19
-
20
- super().setup_method()
21
- self.run_sql("CREATE DATABASE proj")
22
- self.run_sql(
23
- f"""
24
- CREATE ML_ENGINE anyscale_endpoints_engine
25
- FROM anyscale_endpoints
26
- USING
27
- anyscale_endpoints_api_key = '{self.get_api_key('MDB_TEST_ANYSCALE_ENDPOINTS_API_KEY')}';
28
- """
29
- )
30
-
31
- def test_create_model_raises_exception_with_invalid_model_parameter(self):
32
- """
33
- Test for invalid parameter during model creation.
34
- """
35
-
36
- self.run_sql(
37
- """
38
- CREATE MODEL proj.test_anyscale_invalid_parameter_model
39
- PREDICT answer
40
- USING
41
- engine='anyscale_endpoints_engine',
42
- model_name='this-model-does-not-exist',
43
- prompt_template='dummy_prompt_template';
44
- """
45
- )
46
- with pytest.raises(Exception):
47
- self.wait_predictor("proj", "test_anyscale_invalid_parameter_model")
48
-
49
- # TODO: Uncomment this once the handler is updated to handle unknown arguments.
50
- # def test_create_model_raises_exception_with_unknown_model_argument(self):
51
- # """
52
- # Test for unknown argument during model creation.
53
- # """
54
-
55
- # self.run_sql(
56
- # """
57
- # CREATE MODEL proj.test_anyscale_unknown_argument_model
58
- # PREDICT answer
59
- # USING
60
- # engine='anyscale_endpoints_engine',
61
- # prompt_template='dummy_prompt_template',
62
- # evidently_wrong_argument='wrong value';
63
- # """
64
- # )
65
- # with pytest.raises(Exception):
66
- # self.wait_predictor("proj", "test_anyscale_unknown_argument_model")
67
-
68
- def test_create_model_raises_exception_with_invalid_operation_mode(self):
69
- """
70
- Test for invalid operation mode during model creation.
71
- """
72
-
73
- self.run_sql(
74
- """
75
- CREATE MODEL proj.test_anyscale_invalid_operation_mode
76
- PREDICT answer
77
- USING
78
- engine='anyscale_endpoints_engine',
79
- prompt_template='dummy_prompt_template',
80
- mode='invalid_mode';
81
- """
82
- )
83
- with pytest.raises(Exception):
84
- self.wait_predictor("proj", "test_anyscale_invalid_operation_mode")
85
-
86
- def test_select_runs_no_errors_on_completion_sentiment_analysis_single(self):
87
- """
88
- Test for a valid response to a sentiment analysis task (completion).
89
- """
90
-
91
- self.run_sql(
92
- """
93
- CREATE MODEL proj.test_anyscale_single_sa
94
- PREDICT sentiment
95
- USING
96
- engine='anyscale_endpoints_engine',
97
- model_name = 'mistralai/Mistral-7B-Instruct-v0.1',
98
- prompt_template = 'Classify the sentiment of the following text as one of `positive`, `neutral` or `negative`: {{text}}';
99
- """
100
- )
101
- self.wait_predictor("proj", "test_anyscale_single_sa")
102
-
103
- result_df = self.run_sql(
104
- """
105
- SELECT sentiment
106
- FROM proj.test_anyscale_single_sa
107
- WHERE text = 'I love machine learning!';
108
- """
109
- )
110
-
111
- assert "positive" in result_df["sentiment"].iloc[0].lower()
112
-
113
- @patch("mindsdb.integrations.handlers.postgres_handler.Handler")
114
- def test_select_runs_no_errors_on_completion_sentiment_analysis_bulk(self, mock_postgres_handler):
115
- """
116
- Test for valid reponses to bulk questions in a sentiment analysis task (completion).
117
- """
118
-
119
- df = pd.DataFrame.from_dict({"text": [
120
- "I love machine learning!",
121
- "I hate slow internet connections!"
122
- ]})
123
- self.set_handler(mock_postgres_handler, name="pg", tables={"df": df})
124
-
125
- self.run_sql(
126
- """
127
- CREATE MODEL proj.test_anyscale_bulk_sa
128
- PREDICT sentiment
129
- USING
130
- engine='anyscale_endpoints_engine',
131
- model_name = 'mistralai/Mistral-7B-Instruct-v0.1',
132
- prompt_template = 'Classify the sentiment of the following text as one of `positive`, `neutral` or `negative`: {{text}}';
133
- """
134
- )
135
- self.wait_predictor("proj", "test_anyscale_bulk_sa")
136
-
137
- result_df = self.run_sql(
138
- """
139
- SELECT p.sentiment
140
- FROM pg.df as t
141
- JOIN proj.test_anyscale_bulk_sa as p;
142
- """
143
- )
144
-
145
- assert "positive" in result_df["sentiment"].iloc[0].lower()
146
- assert "negative" in result_df["sentiment"].iloc[1].lower()
147
-
148
- def test_select_runs_no_errors_on_chat_completion_question_answering_single(self):
149
- """
150
- Test for a valid response to a question answering task (chat completion).
151
- """
152
-
153
- self.run_sql(
154
- """
155
- CREATE MODEL proj.test_anyscale_single_qa
156
- PREDICT answer
157
- USING
158
- engine='anyscale_endpoints_engine',
159
- model_name = 'mistralai/Mistral-7B-Instruct-v0.1',
160
- question_column='question';
161
- """
162
- )
163
- self.wait_predictor("proj", "test_anyscale_single_qa")
164
-
165
- result_df = self.run_sql(
166
- """
167
- SELECT answer
168
- FROM proj.test_anyscale_single_qa
169
- WHERE question = 'What is the capital of Sweden?';
170
- """
171
- )
172
-
173
- assert "stockholm" in result_df["answer"].iloc[0].lower()
174
-
175
- @patch("mindsdb.integrations.handlers.postgres_handler.Handler")
176
- def test_select_runs_no_errors_on_chat_completion_question_answering_bulk(self, mock_postgres_handler):
177
- """
178
- Test for valid reponses to bulk questions in a question answering task (chat completion).
179
- """
180
-
181
- df = pd.DataFrame.from_dict({"question": [
182
- "What is the capital of Sweden?",
183
- "What is the second planet in the solar system?"
184
- ]})
185
- self.set_handler(mock_postgres_handler, name="pg", tables={"df": df})
186
-
187
- self.run_sql(
188
- """
189
- CREATE MODEL proj.test_anyscale_bulk_qa
190
- PREDICT answer
191
- USING
192
- engine='anyscale_endpoints_engine',
193
- model_name = 'mistralai/Mistral-7B-Instruct-v0.1',
194
- question_column='question';
195
- """
196
- )
197
- self.wait_predictor("proj", "test_anyscale_bulk_qa")
198
-
199
- result_df = self.run_sql(
200
- """
201
- SELECT p.answer
202
- FROM pg.df as t
203
- JOIN proj.test_anyscale_bulk_qa as p;
204
- """
205
- )
206
-
207
- assert "stockholm" in result_df["answer"].iloc[0].lower()
208
- assert "venus" in result_df["answer"].iloc[1].lower()
209
-
210
-
211
- if __name__ == '__main__':
212
- pytest.main([__file__])