-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(sql): use only added tables of connector #869
Conversation
WalkthroughThe recent updates involve enhancing security and functionality in the handling of SQL queries within a data management library. A method for verifying the relevance of tables in SQL queries was added, alongside a new exception to handle malicious queries. There's also a refinement in the initialization of table names, ensuring they default to a connector's fallback name. Test cases have been expanded to cover these new features and changes. Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 4
Configuration used: CodeRabbit UI
Files selected for processing (3)
- pandasai/helpers/code_manager.py (4 hunks)
- pandasai/smart_dataframe/init.py (1 hunks)
- tests/test_codemanager.py (4 hunks)
Additional comments: 8
tests/test_codemanager.py (4)
2-2: The import of the
ast
module is correctly added to support the new test cases that involve parsing Python code to check for SQL query validity.12-12: The replacement of
NoCodeFoundError
withMaliciousQueryError
in the import statement aligns with the new exception handling strategy for malicious SQL queries.587-603: The test
test_check_is_query_using_relevant_table_multiple_tables
correctly checks that no exception is raised when a query involving multiple valid tables is passed. This test ensures that the method can handle complex queries with joins.622-639: The test
test_check_is_query_using_relevant_table_multiple_tables_one_unknown
correctly raises aMaliciousQueryError
when a query with at least one unknown table is passed. This test ensures that the method correctly identifies unauthorized table access even when other tables in the query are valid.pandasai/smart_dataframe/__init__.py (1)
- 286-286: The logic for setting the table name in the
__init__
method has been modified to always set the table name to the connector's fallback name if a connector is present. This change ensures consistency in how the table name is set and is in line with the PR objectives.pandasai/helpers/code_manager.py (3)
11-11: The import of
extract_table_names
is consistent with the PR objectives to enhance SQL query security.18-18: The addition of
MaliciousQueryError
to the exceptions list is appropriate for handling unauthorized table access in SQL queries.388-390: The check for allowed tables in SQL queries within the
_clean_code
method is a good security practice. Ensure that this logic is thoroughly tested with various SQL query inputs.Verification successful
The search results confirm that there are tests in
tests/test_codemanager.py
designed to verify the functionality of the_check_is_query_using_relevant_table
method. The tests cover various scenarios, including invalid queries, valid queries, multiple tables, unknown tables, and multiple tables with at least one unknown. This indicates that the logic for checking allowed tables in SQL queries within the_clean_code
method has been tested thoroughly.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for tests that verify the allowed tables check in SQL queries. rg --type python 'test_check_is_query_using_relevant_table'Length of output: 90
Script:
#!/bin/bash # Search for tests that verify the allowed tables check in SQL queries without specifying file type. rg 'test_check_is_query_using_relevant_table'Length of output: 509
tests/test_codemanager.py
Outdated
def test_check_is_query_using_relevant_table_invalid_query( | ||
self, code_manager: CodeManager | ||
): | ||
mock_node = ast.parse("sql_query = 'SELECT * FROM your_table'").body[0] | ||
|
||
with pytest.raises(MaliciousQueryError) as excinfo: | ||
code_manager._check_is_query_using_relevant_table(mock_node) | ||
|
||
assert str(excinfo.value) == ( | ||
"Query uses tables you don't provided, add new datatable or update query" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test test_check_is_query_using_relevant_table_invalid_query
correctly raises a MaliciousQueryError
when an invalid query is passed. However, the error message "Query uses tables you don't provided, add new datatable or update query" contains grammatical errors.
- "Query uses tables you don't provided, add new datatable or update query"
+ "Query uses tables you haven't provided. Add a new datatable or update the query."
Committable suggestion
❗ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
def test_check_is_query_using_relevant_table_invalid_query( | |
self, code_manager: CodeManager | |
): | |
mock_node = ast.parse("sql_query = 'SELECT * FROM your_table'").body[0] | |
with pytest.raises(MaliciousQueryError) as excinfo: | |
code_manager._check_is_query_using_relevant_table(mock_node) | |
assert str(excinfo.value) == ( | |
"Query uses tables you don't provided, add new datatable or update query" | |
) | |
def test_check_is_query_using_relevant_table_invalid_query( | |
self, code_manager: CodeManager | |
): | |
mock_node = ast.parse("sql_query = 'SELECT * FROM your_table'").body[0] | |
with pytest.raises(MaliciousQueryError) as excinfo: | |
code_manager._check_is_query_using_relevant_table(mock_node) | |
assert str(excinfo.value) == ( | |
"Query uses tables you haven't provided. Add a new datatable or update the query." | |
) |
tests/test_codemanager.py
Outdated
def test_check_is_query_using_relevant_table_valid_query( | ||
self, code_manager: CodeManager | ||
): | ||
mock_node = ast.parse("sql_query = 'SELECT * FROM allowed_table'").body[0] | ||
|
||
class MockObject: | ||
table_name = "allowed_table" | ||
|
||
code_manager._dfs = [MockObject()] | ||
|
||
code_manager._check_is_query_using_relevant_table(mock_node) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test test_check_is_query_using_relevant_table_valid_query
seems to correctly handle a valid query by not raising an exception. However, it lacks an assertion to confirm that the method under test behaves as expected when a valid query is passed.
tests/test_codemanager.py
Outdated
def test_check_is_query_using_relevant_table_unknown_table( | ||
self, code_manager: CodeManager | ||
): | ||
mock_node = ast.parse("sql_query = 'SELECT * FROM unknown_table'").body[0] | ||
|
||
class MockObject: | ||
table_name = "allowed_table" | ||
|
||
code_manager._dfs = [MockObject()] | ||
|
||
with pytest.raises(MaliciousQueryError) as excinfo: | ||
code_manager._check_is_query_using_relevant_table(mock_node) | ||
|
||
assert str(excinfo.value) == ( | ||
"Query uses tables you don't provided, add new datatable or update query" | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test test_check_is_query_using_relevant_table_unknown_table
properly raises a MaliciousQueryError
when a query with an unknown table is passed. The error message should be corrected for grammatical accuracy as mentioned earlier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- pandasai/helpers/sql.py (1 hunks)
Additional comments: 1
pandasai/helpers/sql.py (1)
- 4-12: The
extract_table_names
function uses a regex pattern to extract table names from SQL queries. The pattern looks for words followingFROM
orJOIN
clauses, which is a common way to reference tables in SQL. The function then flattens the list of matches and filters out any empty strings to return a list of table names. This implementation seems correct and efficient for its intended purpose.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- pandasai/helpers/code_manager.py (4 hunks)
Files skipped from review as they are similar to previous changes (1)
- pandasai/helpers/code_manager.py
@ArslanSaleem could you fix the tests? I've just updated a error message based on CodeRabbit suggestion! |
pandasai/helpers/code_manager.py
Outdated
def _check_is_query_using_relevant_table(self, node: ast.Assign): | ||
for target in node.targets: | ||
if ( | ||
isinstance(target, ast.Name) | ||
and target.id in "sql_query" | ||
and isinstance(node.value, ast.Constant) | ||
and isinstance(node.value.value, str) | ||
): | ||
sql_query = node.value.value | ||
table_names = extract_table_names(sql_query) | ||
allowed_table_names = [df.table_name for df in self._dfs] | ||
if any( | ||
table_name not in allowed_table_names for table_name in table_names | ||
): | ||
raise MaliciousQueryError( | ||
"Query uses unauthorized tables: {unauthorized_tables}. Please add them as new datatables or update the query." | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May I suggest making this utility return a bool and raising MaliciousQueryError
when you call it (if it returns False)? In this scenario, I'd rename it to _is_query_using_relevant_table
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mspronesti good catch, I agree!
Also, since the logic for the "direct sql" is becoming more complex, we should probably move it all outside of the code manager! But we can probably create a separate PR for this! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (2)
- pandasai/helpers/code_manager.py (4 hunks)
- tests/test_codemanager.py (4 hunks)
Files skipped from review as they are similar to previous changes (2)
- pandasai/helpers/code_manager.py
- tests/test_codemanager.py
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #869 +/- ##
==========================================
+ Coverage 85.15% 85.21% +0.05%
==========================================
Files 89 90 +1
Lines 3866 3881 +15
==========================================
+ Hits 3292 3307 +15
Misses 574 574 ☔ View full report in Codecov by Sentry. |
@gventuri Yes, absolutely and more scenarios will come |
* fix(output_type): handle errors for wrong output type (#866) * fix(output_type): handle errors for output type * fix: leftovers * fix: test case to mock format-response * fix: upgrade duckdb * Release v1.5.15 * fix(sql): use only added tables of connector (#869) * fix(sql): use only added tables of connector * leftover file * chore: rephrase the error message Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix(sql): fix test cases and improve output error message --------- Co-authored-by: Gabriele Venturi <lele.venturi@gmail.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat/integration_testing test cases created (#873) * feat/integration_testing test cases created based Loan Payments data * feat/integration_testing four more datasets added * fix/moved csv datasets to integration folder * fix/changed pytest command to run only in tests folder * fix/changed pytest command to run only in tests folder --------- Co-authored-by: Milind Lalwani <milindlalwani@Milinds-MacBook-Air.local> * feat(helpers): add gpt-3.5-turbo-1106 fine-tuned (#876) * fix: rephrase query (#872) * Fixed Agent rephrase_query Error * Fixed Agent rephrase_query Error * add encoding --------- Co-authored-by: Pranab Pathak <pranabpathak@Pranabs-MacBook-Air.local> * Release v1.5.16 --------- Co-authored-by: Gabriele Venturi <lele.venturi@gmail.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: milind-sinaptik <149694044+milind-sinaptik@users.noreply.github.com> Co-authored-by: Milind Lalwani <milindlalwani@Milinds-MacBook-Air.local> Co-authored-by: Massimiliano Pronesti <massimiliano.pronesti@gmail.com> Co-authored-by: Pranab1011 <47911727+Pranab1011@users.noreply.github.com> Co-authored-by: Pranab Pathak <pranabpathak@Pranabs-MacBook-Air.local>
* fix(output_type): handle errors for wrong output type (#866) * fix(output_type): handle errors for output type * fix: leftovers * fix: test case to mock format-response * fix: upgrade duckdb * Release v1.5.15 * fix(sql): use only added tables of connector (#869) * fix(sql): use only added tables of connector * leftover file * chore: rephrase the error message Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix(sql): fix test cases and improve output error message --------- Co-authored-by: Gabriele Venturi <lele.venturi@gmail.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat/integration_testing test cases created (#873) * feat/integration_testing test cases created based Loan Payments data * feat/integration_testing four more datasets added * fix/moved csv datasets to integration folder * fix/changed pytest command to run only in tests folder * fix/changed pytest command to run only in tests folder --------- Co-authored-by: Milind Lalwani <milindlalwani@Milinds-MacBook-Air.local> * feat(helpers): add gpt-3.5-turbo-1106 fine-tuned (#876) * fix: rephrase query (#872) * Fixed Agent rephrase_query Error * Fixed Agent rephrase_query Error * add encoding --------- Co-authored-by: Pranab Pathak <pranabpathak@Pranabs-MacBook-Air.local> * Release v1.5.16 * fix(code manager): parsing of called functions (#883) * feat(helpers): add gpt-3.5-turbo-1106 fine-tuned * fix(code manager): parsing of called functions * fmt * fix: open charts return on format plot (#881) Co-authored-by: Long Le <longlh@tech.est-rouge.com> * feat(project): add Makefile, re-lint project, restructure tests (#884) * feat(project): add Makefile, re-lint project, restructure tests * unused imports * Release v1.5.17 * docs:pdate examples.md (#887) Minor fix of exmaples.md * refactor: TypeVar for IResponseParser (#889) (#890) * refactor: TypeVar for IResponseParser (#889) * (refactor): introduce TypeVar for IResponseParser implementation in output_logic_unit.py * (fix): add missing call of super().__init__() in ProcessOutput class * refactor: TypeVar for IResponseParser (#889) * (style): linter fail at output_logic_unit.py * [fix] logging chart saving only if code contains chart (#897) Co-authored-by: Lorenzobattistela <lorenzobattistela@gmail.com> * fix(airtable): use personal access token instead of api key Api key has been deprecated: https://airtable.com/developers/web/api/authentication * feat: add df summarization shortcut (#901) * fix: badge for "Open in Colab" (#903) * feat: add support Google Gemini API in LLMs (#902) * Updating shortcuts to include df summarization * Updating support for google gemini models * Make google-generativeai package optional * fix: upgrade google-ai --------- Co-authored-by: Gabriele Venturi <lele.venturi@gmail.com> * Release v1.5.18 * docs: update Google Colab Badge (#914) The existing badge's signature was somehow seems to be expired so just add Google Colab's officially provided svg badge. * docs: Rectify code examples by adding missing statements (#915) Anyone who is quite new to python won't be able to simplify code errors when directly copied code demo from official website. Updated code example is taken from the root README.md and tested. * feat: add support for modin (#907) * feat: add support for modin * fix(ci): dev deps * update docs * add some tests * upate contributing guidelines * fix helpers * fix docs example * update pandasai/smart_dataframe/__init__.py * Release v1.5.19 * feat: update OpenAI pricing * chore: add Flask openai example (#941) * 'Refactored by Sourcery' * chore: add Flask html example * chore: add Flask openai example * sourcery refactor integration tests * fix: Flask package install set to optional --------- Co-authored-by: Sourcery AI <> * chore: restore smart dataframe and smartdatalake functionalities * fix ruff formatting * fix: yahoo connector * fix: file import sorting * fix: import sorting * fix: module import * ignore integration_tests * fix: ruff * ruff fix * remove integration folder * fix: ci workflow * fix: modin * fix: ruff imports --------- Co-authored-by: Gabriele Venturi <lele.venturi@gmail.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: milind-sinaptik <149694044+milind-sinaptik@users.noreply.github.com> Co-authored-by: Milind Lalwani <milindlalwani@Milinds-MacBook-Air.local> Co-authored-by: Massimiliano Pronesti <massimiliano.pronesti@gmail.com> Co-authored-by: Pranab1011 <47911727+Pranab1011@users.noreply.github.com> Co-authored-by: Pranab Pathak <pranabpathak@Pranabs-MacBook-Air.local> Co-authored-by: Lh Long <lhlong09t4@gmail.com> Co-authored-by: Long Le <longlh@tech.est-rouge.com> Co-authored-by: PVA <37487002+PavelAgurov@users.noreply.github.com> Co-authored-by: Ihor <31508183+nautics889@users.noreply.github.com> Co-authored-by: Lorenzo Battistela <70359945+Lorenzobattistela@users.noreply.github.com> Co-authored-by: Lorenzobattistela <lorenzobattistela@gmail.com> Co-authored-by: Sparsh Jain <31439850+dudesparsh@users.noreply.github.com> Co-authored-by: Devashish Datt Mamgain <devashish@kommunicate.io> Co-authored-by: Hemant Sachdeva <hemant.evolver@gmail.com> Co-authored-by: aloha-fim <15258433+aloha-fim@users.noreply.github.com>
… 1 message (#947) * fix(output_type): handle errors for wrong output type (#866) * fix(output_type): handle errors for output type * fix: leftovers * fix: test case to mock format-response * fix: upgrade duckdb * Release v1.5.15 * fix(sql): use only added tables of connector (#869) * fix(sql): use only added tables of connector * leftover file * chore: rephrase the error message Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix(sql): fix test cases and improve output error message --------- Co-authored-by: Gabriele Venturi <lele.venturi@gmail.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat/integration_testing test cases created (#873) * feat/integration_testing test cases created based Loan Payments data * feat/integration_testing four more datasets added * fix/moved csv datasets to integration folder * fix/changed pytest command to run only in tests folder * fix/changed pytest command to run only in tests folder --------- Co-authored-by: Milind Lalwani <milindlalwani@Milinds-MacBook-Air.local> * feat(helpers): add gpt-3.5-turbo-1106 fine-tuned (#876) * fix: rephrase query (#872) * Fixed Agent rephrase_query Error * Fixed Agent rephrase_query Error * add encoding --------- Co-authored-by: Pranab Pathak <pranabpathak@Pranabs-MacBook-Air.local> * Release v1.5.16 * fix(code manager): parsing of called functions (#883) * feat(helpers): add gpt-3.5-turbo-1106 fine-tuned * fix(code manager): parsing of called functions * fmt * fix: open charts return on format plot (#881) Co-authored-by: Long Le <longlh@tech.est-rouge.com> * feat(project): add Makefile, re-lint project, restructure tests (#884) * feat(project): add Makefile, re-lint project, restructure tests * unused imports * Release v1.5.17 * docs:pdate examples.md (#887) Minor fix of exmaples.md * refactor: TypeVar for IResponseParser (#889) (#890) * refactor: TypeVar for IResponseParser (#889) * (refactor): introduce TypeVar for IResponseParser implementation in output_logic_unit.py * (fix): add missing call of super().__init__() in ProcessOutput class * refactor: TypeVar for IResponseParser (#889) * (style): linter fail at output_logic_unit.py * [fix] logging chart saving only if code contains chart (#897) Co-authored-by: Lorenzobattistela <lorenzobattistela@gmail.com> * fix(airtable): use personal access token instead of api key Api key has been deprecated: https://airtable.com/developers/web/api/authentication * feat: add df summarization shortcut (#901) * fix: badge for "Open in Colab" (#903) * feat: add support Google Gemini API in LLMs (#902) * Updating shortcuts to include df summarization * Updating support for google gemini models * Make google-generativeai package optional * fix: upgrade google-ai --------- Co-authored-by: Gabriele Venturi <lele.venturi@gmail.com> * Release v1.5.18 * docs: update Google Colab Badge (#914) The existing badge's signature was somehow seems to be expired so just add Google Colab's officially provided svg badge. * docs: Rectify code examples by adding missing statements (#915) Anyone who is quite new to python won't be able to simplify code errors when directly copied code demo from official website. Updated code example is taken from the root README.md and tested. * feat: add support for modin (#907) * feat: add support for modin * fix(ci): dev deps * update docs * add some tests * upate contributing guidelines * fix helpers * fix docs example * update pandasai/smart_dataframe/__init__.py * Release v1.5.19 * feat: update OpenAI pricing * chore: add Flask openai example (#941) * 'Refactored by Sourcery' * chore: add Flask html example * chore: add Flask openai example * sourcery refactor integration tests * fix: Flask package install set to optional --------- Co-authored-by: Sourcery AI <> * chore: restore smart dataframe and smartdatalake functionalities * fix ruff formatting * fix: yahoo connector * fix: file import sorting * fix: import sorting * fix: module import * ignore integration_tests * fix: ruff * ruff fix * remove integration folder * fix: ci workflow * fix: modin * fix: ruff imports * fix(plot): always pass one lib for plotting in updated prompt * fix: query tracker track code execution * fix: add skills in query tracker and rag to return one sample by default --------- Co-authored-by: Gabriele Venturi <lele.venturi@gmail.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: milind-sinaptik <149694044+milind-sinaptik@users.noreply.github.com> Co-authored-by: Milind Lalwani <milindlalwani@Milinds-MacBook-Air.local> Co-authored-by: Massimiliano Pronesti <massimiliano.pronesti@gmail.com> Co-authored-by: Pranab1011 <47911727+Pranab1011@users.noreply.github.com> Co-authored-by: Pranab Pathak <pranabpathak@Pranabs-MacBook-Air.local> Co-authored-by: Lh Long <lhlong09t4@gmail.com> Co-authored-by: Long Le <longlh@tech.est-rouge.com> Co-authored-by: PVA <37487002+PavelAgurov@users.noreply.github.com> Co-authored-by: Ihor <31508183+nautics889@users.noreply.github.com> Co-authored-by: Lorenzo Battistela <70359945+Lorenzobattistela@users.noreply.github.com> Co-authored-by: Lorenzobattistela <lorenzobattistela@gmail.com> Co-authored-by: Sparsh Jain <31439850+dudesparsh@users.noreply.github.com> Co-authored-by: Devashish Datt Mamgain <devashish@kommunicate.io> Co-authored-by: Hemant Sachdeva <hemant.evolver@gmail.com> Co-authored-by: aloha-fim <15258433+aloha-fim@users.noreply.github.com>
* fix(output_type): handle errors for wrong output type (#866) * fix(output_type): handle errors for output type * fix: leftovers * fix: test case to mock format-response * fix: upgrade duckdb * Release v1.5.15 * fix(sql): use only added tables of connector (#869) * fix(sql): use only added tables of connector * leftover file * chore: rephrase the error message Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix(sql): fix test cases and improve output error message --------- Co-authored-by: Gabriele Venturi <lele.venturi@gmail.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat/integration_testing test cases created (#873) * feat/integration_testing test cases created based Loan Payments data * feat/integration_testing four more datasets added * fix/moved csv datasets to integration folder * fix/changed pytest command to run only in tests folder * fix/changed pytest command to run only in tests folder --------- Co-authored-by: Milind Lalwani <milindlalwani@Milinds-MacBook-Air.local> * feat(helpers): add gpt-3.5-turbo-1106 fine-tuned (#876) * fix: rephrase query (#872) * Fixed Agent rephrase_query Error * Fixed Agent rephrase_query Error * add encoding --------- Co-authored-by: Pranab Pathak <pranabpathak@Pranabs-MacBook-Air.local> * Release v1.5.16 * fix(code manager): parsing of called functions (#883) * feat(helpers): add gpt-3.5-turbo-1106 fine-tuned * fix(code manager): parsing of called functions * fmt * fix: open charts return on format plot (#881) Co-authored-by: Long Le <longlh@tech.est-rouge.com> * feat(project): add Makefile, re-lint project, restructure tests (#884) * feat(project): add Makefile, re-lint project, restructure tests * unused imports * Release v1.5.17 * docs:pdate examples.md (#887) Minor fix of exmaples.md * refactor: TypeVar for IResponseParser (#889) (#890) * refactor: TypeVar for IResponseParser (#889) * (refactor): introduce TypeVar for IResponseParser implementation in output_logic_unit.py * (fix): add missing call of super().__init__() in ProcessOutput class * refactor: TypeVar for IResponseParser (#889) * (style): linter fail at output_logic_unit.py * [fix] logging chart saving only if code contains chart (#897) Co-authored-by: Lorenzobattistela <lorenzobattistela@gmail.com> * fix(airtable): use personal access token instead of api key Api key has been deprecated: https://airtable.com/developers/web/api/authentication * feat: add df summarization shortcut (#901) * fix: badge for "Open in Colab" (#903) * feat: add support Google Gemini API in LLMs (#902) * Updating shortcuts to include df summarization * Updating support for google gemini models * Make google-generativeai package optional * fix: upgrade google-ai --------- Co-authored-by: Gabriele Venturi <lele.venturi@gmail.com> * Release v1.5.18 * docs: update Google Colab Badge (#914) The existing badge's signature was somehow seems to be expired so just add Google Colab's officially provided svg badge. * docs: Rectify code examples by adding missing statements (#915) Anyone who is quite new to python won't be able to simplify code errors when directly copied code demo from official website. Updated code example is taken from the root README.md and tested. * feat: add support for modin (#907) * feat: add support for modin * fix(ci): dev deps * update docs * add some tests * upate contributing guidelines * fix helpers * fix docs example * update pandasai/smart_dataframe/__init__.py * Release v1.5.19 * feat: update OpenAI pricing * chore: add Flask openai example (#941) * 'Refactored by Sourcery' * chore: add Flask html example * chore: add Flask openai example * sourcery refactor integration tests * fix: Flask package install set to optional --------- Co-authored-by: Sourcery AI <> * chore: restore smart dataframe and smartdatalake functionalities * fix ruff formatting * fix: yahoo connector * fix: file import sorting * fix: import sorting * fix: module import * ignore integration_tests * fix: ruff * ruff fix * remove integration folder * fix: ci workflow * fix: modin * fix: ruff imports * fix(plot): always pass one lib for plotting in updated prompt * fix: query tracker track code execution * fix: add skills in query tracker and rag to return one sample by default * fix: function call check and query tracker tracking --------- Co-authored-by: Gabriele Venturi <lele.venturi@gmail.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: milind-sinaptik <149694044+milind-sinaptik@users.noreply.github.com> Co-authored-by: Milind Lalwani <milindlalwani@Milinds-MacBook-Air.local> Co-authored-by: Massimiliano Pronesti <massimiliano.pronesti@gmail.com> Co-authored-by: Pranab1011 <47911727+Pranab1011@users.noreply.github.com> Co-authored-by: Pranab Pathak <pranabpathak@Pranabs-MacBook-Air.local> Co-authored-by: Lh Long <lhlong09t4@gmail.com> Co-authored-by: Long Le <longlh@tech.est-rouge.com> Co-authored-by: PVA <37487002+PavelAgurov@users.noreply.github.com> Co-authored-by: Ihor <31508183+nautics889@users.noreply.github.com> Co-authored-by: Lorenzo Battistela <70359945+Lorenzobattistela@users.noreply.github.com> Co-authored-by: Lorenzobattistela <lorenzobattistela@gmail.com> Co-authored-by: Sparsh Jain <31439850+dudesparsh@users.noreply.github.com> Co-authored-by: Devashish Datt Mamgain <devashish@kommunicate.io> Co-authored-by: Hemant Sachdeva <hemant.evolver@gmail.com> Co-authored-by: aloha-fim <15258433+aloha-fim@users.noreply.github.com>
* refactor: clean code in smart_dataframe and smart_datalake (#814) * refactor: extract import from file method * refactor: extract df head methods * refactor: move connector config in the relative connector file * refactor: csv and pandas files are now treated as a connector * chore: remove verbose getters and setters * refactor: remove load and save feature * refactor: create dataframe proxy * chore: simplify agent * chore: simplify datalake * refactor: simplify smart datalake * refactor: centralize context in lakes * refactor: move lake callbacks to dedicate class * fix: load connector before generating cache hex * fix: only allow direct sql to SQLConnectors * fix: check sql connector was not working * fix(connector): update connector validation at the start * fix(direct_sql): fix some leftovers * fix: merged change revert built-in shadowing --------- Co-authored-by: ArslanSaleem <khan.arslan38@gmail.com> * refactor(query_tracker): clean code and create error handling pipeling (#875) * refactor(smart_datalake): clean chat method of smart datalake * refactor(smartlake_pipeline): minor cleanups and comments * refactor(query_tracker): refactor query tracker input and output * refactor(query_tracker): adding error pipeline * refactor(query_tracker): some rename and delete extras * refactor(query_tracker): remove comments * Merge Main Changes to v1.6 (#878) * fix(output_type): handle errors for wrong output type (#866) * fix(output_type): handle errors for output type * fix: leftovers * fix: test case to mock format-response * fix: upgrade duckdb * Release v1.5.15 * fix(sql): use only added tables of connector (#869) * fix(sql): use only added tables of connector * leftover file * chore: rephrase the error message Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix(sql): fix test cases and improve output error message --------- Co-authored-by: Gabriele Venturi <lele.venturi@gmail.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat/integration_testing test cases created (#873) * feat/integration_testing test cases created based Loan Payments data * feat/integration_testing four more datasets added * fix/moved csv datasets to integration folder * fix/changed pytest command to run only in tests folder * fix/changed pytest command to run only in tests folder --------- Co-authored-by: Milind Lalwani <milindlalwani@Milinds-MacBook-Air.local> * feat(helpers): add gpt-3.5-turbo-1106 fine-tuned (#876) * fix: rephrase query (#872) * Fixed Agent rephrase_query Error * Fixed Agent rephrase_query Error * add encoding --------- Co-authored-by: Pranab Pathak <pranabpathak@Pranabs-MacBook-Air.local> * Release v1.5.16 --------- Co-authored-by: Gabriele Venturi <lele.venturi@gmail.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: milind-sinaptik <149694044+milind-sinaptik@users.noreply.github.com> Co-authored-by: Milind Lalwani <milindlalwani@Milinds-MacBook-Air.local> Co-authored-by: Massimiliano Pronesti <massimiliano.pronesti@gmail.com> Co-authored-by: Pranab1011 <47911727+Pranab1011@users.noreply.github.com> Co-authored-by: Pranab Pathak <pranabpathak@Pranabs-MacBook-Air.local> * refactor: remove inheritance of pandas methods in the SmartDataframe * refactor: remove shortcuts * refactor: smart df cannot chat anymore * refactor: remove unused validate method from sdf * refactor: add name and description to connectors * refactor: remove custom prompts * refactor: remove synthetic pipelines * refactor: remove custom instructions * refactor: remove starcoder and falcon * refactor: move df head to connectors * refactor: remove sdf * refactor: remove leftovers logic units * refactor: rename SmartDataLake to AgentCore * refactor: rename DataLake pipeline to Chat * refactor: remove agent core, moving the logic to agent * refactor: refactor the prompt templates using Jinja2 * feat(Agent): train agent docs or question/answers (#895) * feat(VectorStore): adding chromadb vector store for RAG * test(agent_train): adding more test cases and error handling * refact(agent_train): add logging to chroma db * feat(RAG): use trained data from vector db in prompt (#896) * feat(VectorStore): adding chromadb vector store for RAG * test(agent_train): adding more test cases and error handling * refact(agent_train): add logging to chroma db * feat(RAG): use trained vector in prompt * Merge v1.6 into to v2.0 (#900) * refactor(Prompt): adding more context for dataframe and multiple types of serialization (#880) * refactor(prompt): update dataframe serialization in prompt * tests(prompt): fix and adding new tests * fix(prompt): adding type to dataframe serialize function * refactor(prompt): add field descriptions in yml prompt * fix(prompt): direct_sql still using old dataframe table * refactor(direct_sql): add instruction and note for using relevant table only * refactor(query_tracker): clean output of query tracker format (#888) * feat(GoogleBigQuery): adding google big query connector (#886) * feat(VectorStore): adding chromadb vector store for RAG * test(agent_train): adding more test cases and error handling * refact(agent_train): add logging to chroma db * feat(RAG): use trained vector in prompt * Merge v1.6 to v2.0 * feat: execute_sql_query_usage creating error prompt if execute_sql_que… (#898) * feat/execute_sql_query_usage creating error prompt if execute_sql_query is not used when direct_sql is set to true * fix/comment added before raising exception --------- Co-authored-by: Milind Lalwani <milindlalwani@Milinds-Air.digi.box> * fix(prompt_path): path issue if pandasai used outside of pandas env (#909) * feat(agent): adding optional pipeline call (#916) s * feat(system prompt): use system in llm prompts (#925) * fix(code_manager): minor fixes in code manager * feat(system_prompt): adding system prompts to be added in llm call * fix(code_manager): minor fixes in code manager (#923) Co-authored-by: Gabriele Venturi <lele.venturi@gmail.com> * feat/update method in vector db added * feat/get by id method added * feat(multiturn-conv): update prompts and use api's for multiturn (#928) * fix(code_manager): minor fixes in code manager * feat(system_prompt): adding system prompts to be added in llm call * feat(multi-turn-conv): adding support for multi turn conversation * feat(multi-turn): add missing files * feat(BambooVectorStore): adding bamboo vector to store and retrieve t… (#935) * feat(BambooVectorStore): adding bamboo vector to store and retrieve training docs on cloud * rename test class name * feat(BambooLLM): add bamboo llm wrapper (#940) * feat(BambooVectorStore): adding bamboo vector to store and retrieve training docs on cloud * rename test class name * feat(bamboo_llm): adding bamboo llm interface * fix: clean up few commented and leftover changes * chore: restore smart dataframe and smartdatalake functionalities * fix ruff formatting * fix: yahoo connector * fix: file import sorting * fix: import sorting * fix: module import * ignore integration_tests * fix: ruff * ruff fix * remove integration folder * fix: ci workflow * fix: modin * fix: ruff imports * fix(plot): always pass one lib for plotting in updated prompt * Merge to release 2.0 (#945) * fix(output_type): handle errors for wrong output type (#866) * fix(output_type): handle errors for output type * fix: leftovers * fix: test case to mock format-response * fix: upgrade duckdb * Release v1.5.15 * fix(sql): use only added tables of connector (#869) * fix(sql): use only added tables of connector * leftover file * chore: rephrase the error message Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix(sql): fix test cases and improve output error message --------- Co-authored-by: Gabriele Venturi <lele.venturi@gmail.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat/integration_testing test cases created (#873) * feat/integration_testing test cases created based Loan Payments data * feat/integration_testing four more datasets added * fix/moved csv datasets to integration folder * fix/changed pytest command to run only in tests folder * fix/changed pytest command to run only in tests folder --------- Co-authored-by: Milind Lalwani <milindlalwani@Milinds-MacBook-Air.local> * feat(helpers): add gpt-3.5-turbo-1106 fine-tuned (#876) * fix: rephrase query (#872) * Fixed Agent rephrase_query Error * Fixed Agent rephrase_query Error * add encoding --------- Co-authored-by: Pranab Pathak <pranabpathak@Pranabs-MacBook-Air.local> * Release v1.5.16 * fix(code manager): parsing of called functions (#883) * feat(helpers): add gpt-3.5-turbo-1106 fine-tuned * fix(code manager): parsing of called functions * fmt * fix: open charts return on format plot (#881) Co-authored-by: Long Le <longlh@tech.est-rouge.com> * feat(project): add Makefile, re-lint project, restructure tests (#884) * feat(project): add Makefile, re-lint project, restructure tests * unused imports * Release v1.5.17 * docs:pdate examples.md (#887) Minor fix of exmaples.md * refactor: TypeVar for IResponseParser (#889) (#890) * refactor: TypeVar for IResponseParser (#889) * (refactor): introduce TypeVar for IResponseParser implementation in output_logic_unit.py * (fix): add missing call of super().__init__() in ProcessOutput class * refactor: TypeVar for IResponseParser (#889) * (style): linter fail at output_logic_unit.py * [fix] logging chart saving only if code contains chart (#897) Co-authored-by: Lorenzobattistela <lorenzobattistela@gmail.com> * fix(airtable): use personal access token instead of api key Api key has been deprecated: https://airtable.com/developers/web/api/authentication * feat: add df summarization shortcut (#901) * fix: badge for "Open in Colab" (#903) * feat: add support Google Gemini API in LLMs (#902) * Updating shortcuts to include df summarization * Updating support for google gemini models * Make google-generativeai package optional * fix: upgrade google-ai --------- Co-authored-by: Gabriele Venturi <lele.venturi@gmail.com> * Release v1.5.18 * docs: update Google Colab Badge (#914) The existing badge's signature was somehow seems to be expired so just add Google Colab's officially provided svg badge. * docs: Rectify code examples by adding missing statements (#915) Anyone who is quite new to python won't be able to simplify code errors when directly copied code demo from official website. Updated code example is taken from the root README.md and tested. * feat: add support for modin (#907) * feat: add support for modin * fix(ci): dev deps * update docs * add some tests * upate contributing guidelines * fix helpers * fix docs example * update pandasai/smart_dataframe/__init__.py * Release v1.5.19 * feat: update OpenAI pricing * chore: add Flask openai example (#941) * 'Refactored by Sourcery' * chore: add Flask html example * chore: add Flask openai example * sourcery refactor integration tests * fix: Flask package install set to optional --------- Co-authored-by: Sourcery AI <> * chore: restore smart dataframe and smartdatalake functionalities * fix ruff formatting * fix: yahoo connector * fix: file import sorting * fix: import sorting * fix: module import * ignore integration_tests * fix: ruff * ruff fix * remove integration folder * fix: ci workflow * fix: modin * fix: ruff imports --------- Co-authored-by: Gabriele Venturi <lele.venturi@gmail.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: milind-sinaptik <149694044+milind-sinaptik@users.noreply.github.com> Co-authored-by: Milind Lalwani <milindlalwani@Milinds-MacBook-Air.local> Co-authored-by: Massimiliano Pronesti <massimiliano.pronesti@gmail.com> Co-authored-by: Pranab1011 <47911727+Pranab1011@users.noreply.github.com> Co-authored-by: Pranab Pathak <pranabpathak@Pranabs-MacBook-Air.local> Co-authored-by: Lh Long <lhlong09t4@gmail.com> Co-authored-by: Long Le <longlh@tech.est-rouge.com> Co-authored-by: PVA <37487002+PavelAgurov@users.noreply.github.com> Co-authored-by: Ihor <31508183+nautics889@users.noreply.github.com> Co-authored-by: Lorenzo Battistela <70359945+Lorenzobattistela@users.noreply.github.com> Co-authored-by: Lorenzobattistela <lorenzobattistela@gmail.com> Co-authored-by: Sparsh Jain <31439850+dudesparsh@users.noreply.github.com> Co-authored-by: Devashish Datt Mamgain <devashish@kommunicate.io> Co-authored-by: Hemant Sachdeva <hemant.evolver@gmail.com> Co-authored-by: aloha-fim <15258433+aloha-fim@users.noreply.github.com> * fix: query tracker track code execution * fix: add skills in query tracker and rag to return one sample by default * fix(skills): add skills to query tracker and by default rag to return 1 message (#947) * fix(output_type): handle errors for wrong output type (#866) * fix(output_type): handle errors for output type * fix: leftovers * fix: test case to mock format-response * fix: upgrade duckdb * Release v1.5.15 * fix(sql): use only added tables of connector (#869) * fix(sql): use only added tables of connector * leftover file * chore: rephrase the error message Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix(sql): fix test cases and improve output error message --------- Co-authored-by: Gabriele Venturi <lele.venturi@gmail.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat/integration_testing test cases created (#873) * feat/integration_testing test cases created based Loan Payments data * feat/integration_testing four more datasets added * fix/moved csv datasets to integration folder * fix/changed pytest command to run only in tests folder * fix/changed pytest command to run only in tests folder --------- Co-authored-by: Milind Lalwani <milindlalwani@Milinds-MacBook-Air.local> * feat(helpers): add gpt-3.5-turbo-1106 fine-tuned (#876) * fix: rephrase query (#872) * Fixed Agent rephrase_query Error * Fixed Agent rephrase_query Error * add encoding --------- Co-authored-by: Pranab Pathak <pranabpathak@Pranabs-MacBook-Air.local> * Release v1.5.16 * fix(code manager): parsing of called functions (#883) * feat(helpers): add gpt-3.5-turbo-1106 fine-tuned * fix(code manager): parsing of called functions * fmt * fix: open charts return on format plot (#881) Co-authored-by: Long Le <longlh@tech.est-rouge.com> * feat(project): add Makefile, re-lint project, restructure tests (#884) * feat(project): add Makefile, re-lint project, restructure tests * unused imports * Release v1.5.17 * docs:pdate examples.md (#887) Minor fix of exmaples.md * refactor: TypeVar for IResponseParser (#889) (#890) * refactor: TypeVar for IResponseParser (#889) * (refactor): introduce TypeVar for IResponseParser implementation in output_logic_unit.py * (fix): add missing call of super().__init__() in ProcessOutput class * refactor: TypeVar for IResponseParser (#889) * (style): linter fail at output_logic_unit.py * [fix] logging chart saving only if code contains chart (#897) Co-authored-by: Lorenzobattistela <lorenzobattistela@gmail.com> * fix(airtable): use personal access token instead of api key Api key has been deprecated: https://airtable.com/developers/web/api/authentication * feat: add df summarization shortcut (#901) * fix: badge for "Open in Colab" (#903) * feat: add support Google Gemini API in LLMs (#902) * Updating shortcuts to include df summarization * Updating support for google gemini models * Make google-generativeai package optional * fix: upgrade google-ai --------- Co-authored-by: Gabriele Venturi <lele.venturi@gmail.com> * Release v1.5.18 * docs: update Google Colab Badge (#914) The existing badge's signature was somehow seems to be expired so just add Google Colab's officially provided svg badge. * docs: Rectify code examples by adding missing statements (#915) Anyone who is quite new to python won't be able to simplify code errors when directly copied code demo from official website. Updated code example is taken from the root README.md and tested. * feat: add support for modin (#907) * feat: add support for modin * fix(ci): dev deps * update docs * add some tests * upate contributing guidelines * fix helpers * fix docs example * update pandasai/smart_dataframe/__init__.py * Release v1.5.19 * feat: update OpenAI pricing * chore: add Flask openai example (#941) * 'Refactored by Sourcery' * chore: add Flask html example * chore: add Flask openai example * sourcery refactor integration tests * fix: Flask package install set to optional --------- Co-authored-by: Sourcery AI <> * chore: restore smart dataframe and smartdatalake functionalities * fix ruff formatting * fix: yahoo connector * fix: file import sorting * fix: import sorting * fix: module import * ignore integration_tests * fix: ruff * ruff fix * remove integration folder * fix: ci workflow * fix: modin * fix: ruff imports * fix(plot): always pass one lib for plotting in updated prompt * fix: query tracker track code execution * fix: add skills in query tracker and rag to return one sample by default --------- Co-authored-by: Gabriele Venturi <lele.venturi@gmail.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: milind-sinaptik <149694044+milind-sinaptik@users.noreply.github.com> Co-authored-by: Milind Lalwani <milindlalwani@Milinds-MacBook-Air.local> Co-authored-by: Massimiliano Pronesti <massimiliano.pronesti@gmail.com> Co-authored-by: Pranab1011 <47911727+Pranab1011@users.noreply.github.com> Co-authored-by: Pranab Pathak <pranabpathak@Pranabs-MacBook-Air.local> Co-authored-by: Lh Long <lhlong09t4@gmail.com> Co-authored-by: Long Le <longlh@tech.est-rouge.com> Co-authored-by: PVA <37487002+PavelAgurov@users.noreply.github.com> Co-authored-by: Ihor <31508183+nautics889@users.noreply.github.com> Co-authored-by: Lorenzo Battistela <70359945+Lorenzobattistela@users.noreply.github.com> Co-authored-by: Lorenzobattistela <lorenzobattistela@gmail.com> Co-authored-by: Sparsh Jain <31439850+dudesparsh@users.noreply.github.com> Co-authored-by: Devashish Datt Mamgain <devashish@kommunicate.io> Co-authored-by: Hemant Sachdeva <hemant.evolver@gmail.com> Co-authored-by: aloha-fim <15258433+aloha-fim@users.noreply.github.com> * fix: function call check and query tracker tracking * fixes/in release2.0 (#951) * fix(output_type): handle errors for wrong output type (#866) * fix(output_type): handle errors for output type * fix: leftovers * fix: test case to mock format-response * fix: upgrade duckdb * Release v1.5.15 * fix(sql): use only added tables of connector (#869) * fix(sql): use only added tables of connector * leftover file * chore: rephrase the error message Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix(sql): fix test cases and improve output error message --------- Co-authored-by: Gabriele Venturi <lele.venturi@gmail.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat/integration_testing test cases created (#873) * feat/integration_testing test cases created based Loan Payments data * feat/integration_testing four more datasets added * fix/moved csv datasets to integration folder * fix/changed pytest command to run only in tests folder * fix/changed pytest command to run only in tests folder --------- Co-authored-by: Milind Lalwani <milindlalwani@Milinds-MacBook-Air.local> * feat(helpers): add gpt-3.5-turbo-1106 fine-tuned (#876) * fix: rephrase query (#872) * Fixed Agent rephrase_query Error * Fixed Agent rephrase_query Error * add encoding --------- Co-authored-by: Pranab Pathak <pranabpathak@Pranabs-MacBook-Air.local> * Release v1.5.16 * fix(code manager): parsing of called functions (#883) * feat(helpers): add gpt-3.5-turbo-1106 fine-tuned * fix(code manager): parsing of called functions * fmt * fix: open charts return on format plot (#881) Co-authored-by: Long Le <longlh@tech.est-rouge.com> * feat(project): add Makefile, re-lint project, restructure tests (#884) * feat(project): add Makefile, re-lint project, restructure tests * unused imports * Release v1.5.17 * docs:pdate examples.md (#887) Minor fix of exmaples.md * refactor: TypeVar for IResponseParser (#889) (#890) * refactor: TypeVar for IResponseParser (#889) * (refactor): introduce TypeVar for IResponseParser implementation in output_logic_unit.py * (fix): add missing call of super().__init__() in ProcessOutput class * refactor: TypeVar for IResponseParser (#889) * (style): linter fail at output_logic_unit.py * [fix] logging chart saving only if code contains chart (#897) Co-authored-by: Lorenzobattistela <lorenzobattistela@gmail.com> * fix(airtable): use personal access token instead of api key Api key has been deprecated: https://airtable.com/developers/web/api/authentication * feat: add df summarization shortcut (#901) * fix: badge for "Open in Colab" (#903) * feat: add support Google Gemini API in LLMs (#902) * Updating shortcuts to include df summarization * Updating support for google gemini models * Make google-generativeai package optional * fix: upgrade google-ai --------- Co-authored-by: Gabriele Venturi <lele.venturi@gmail.com> * Release v1.5.18 * docs: update Google Colab Badge (#914) The existing badge's signature was somehow seems to be expired so just add Google Colab's officially provided svg badge. * docs: Rectify code examples by adding missing statements (#915) Anyone who is quite new to python won't be able to simplify code errors when directly copied code demo from official website. Updated code example is taken from the root README.md and tested. * feat: add support for modin (#907) * feat: add support for modin * fix(ci): dev deps * update docs * add some tests * upate contributing guidelines * fix helpers * fix docs example * update pandasai/smart_dataframe/__init__.py * Release v1.5.19 * feat: update OpenAI pricing * chore: add Flask openai example (#941) * 'Refactored by Sourcery' * chore: add Flask html example * chore: add Flask openai example * sourcery refactor integration tests * fix: Flask package install set to optional --------- Co-authored-by: Sourcery AI <> * chore: restore smart dataframe and smartdatalake functionalities * fix ruff formatting * fix: yahoo connector * fix: file import sorting * fix: import sorting * fix: module import * ignore integration_tests * fix: ruff * ruff fix * remove integration folder * fix: ci workflow * fix: modin * fix: ruff imports * fix(plot): always pass one lib for plotting in updated prompt * fix: query tracker track code execution * fix: add skills in query tracker and rag to return one sample by default * fix: function call check and query tracker tracking --------- Co-authored-by: Gabriele Venturi <lele.venturi@gmail.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: milind-sinaptik <149694044+milind-sinaptik@users.noreply.github.com> Co-authored-by: Milind Lalwani <milindlalwani@Milinds-MacBook-Air.local> Co-authored-by: Massimiliano Pronesti <massimiliano.pronesti@gmail.com> Co-authored-by: Pranab1011 <47911727+Pranab1011@users.noreply.github.com> Co-authored-by: Pranab Pathak <pranabpathak@Pranabs-MacBook-Air.local> Co-authored-by: Lh Long <lhlong09t4@gmail.com> Co-authored-by: Long Le <longlh@tech.est-rouge.com> Co-authored-by: PVA <37487002+PavelAgurov@users.noreply.github.com> Co-authored-by: Ihor <31508183+nautics889@users.noreply.github.com> Co-authored-by: Lorenzo Battistela <70359945+Lorenzobattistela@users.noreply.github.com> Co-authored-by: Lorenzobattistela <lorenzobattistela@gmail.com> Co-authored-by: Sparsh Jain <31439850+dudesparsh@users.noreply.github.com> Co-authored-by: Devashish Datt Mamgain <devashish@kommunicate.io> Co-authored-by: Hemant Sachdeva <hemant.evolver@gmail.com> Co-authored-by: aloha-fim <15258433+aloha-fim@users.noreply.github.com> * update comparison operator (#953) * docs: improve readme and license * lint: fix lint in examples * docs: add deploy methods in the documentation * refactor: rename to ChromaDB * feat: make BambooVector the default vectorstore * lint: fix lint in examples * docs: add docs for training, agent description * docs: add video for training LLM --------- Co-authored-by: ArslanSaleem <khan.arslan38@gmail.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: milind-sinaptik <149694044+milind-sinaptik@users.noreply.github.com> Co-authored-by: Milind Lalwani <milindlalwani@Milinds-MacBook-Air.local> Co-authored-by: Massimiliano Pronesti <massimiliano.pronesti@gmail.com> Co-authored-by: Pranab1011 <47911727+Pranab1011@users.noreply.github.com> Co-authored-by: Pranab Pathak <pranabpathak@Pranabs-MacBook-Air.local> Co-authored-by: Milind Lalwani <milindlalwani@Milinds-Air.digi.box> Co-authored-by: Lh Long <lhlong09t4@gmail.com> Co-authored-by: Long Le <longlh@tech.est-rouge.com> Co-authored-by: PVA <37487002+PavelAgurov@users.noreply.github.com> Co-authored-by: Ihor <31508183+nautics889@users.noreply.github.com> Co-authored-by: Lorenzo Battistela <70359945+Lorenzobattistela@users.noreply.github.com> Co-authored-by: Lorenzobattistela <lorenzobattistela@gmail.com> Co-authored-by: Sparsh Jain <31439850+dudesparsh@users.noreply.github.com> Co-authored-by: Devashish Datt Mamgain <devashish@kommunicate.io> Co-authored-by: Hemant Sachdeva <hemant.evolver@gmail.com> Co-authored-by: aloha-fim <15258433+aloha-fim@users.noreply.github.com>
* Release v2.0 * refactor: clean code in smart_dataframe and smart_datalake (#814) * refactor: extract import from file method * refactor: extract df head methods * refactor: move connector config in the relative connector file * refactor: csv and pandas files are now treated as a connector * chore: remove verbose getters and setters * refactor: remove load and save feature * refactor: create dataframe proxy * chore: simplify agent * chore: simplify datalake * refactor: simplify smart datalake * refactor: centralize context in lakes * refactor: move lake callbacks to dedicate class * fix: load connector before generating cache hex * fix: only allow direct sql to SQLConnectors * fix: check sql connector was not working * fix(connector): update connector validation at the start * fix(direct_sql): fix some leftovers * fix: merged change revert built-in shadowing --------- Co-authored-by: ArslanSaleem <khan.arslan38@gmail.com> * refactor(query_tracker): clean code and create error handling pipeling (#875) * refactor(smart_datalake): clean chat method of smart datalake * refactor(smartlake_pipeline): minor cleanups and comments * refactor(query_tracker): refactor query tracker input and output * refactor(query_tracker): adding error pipeline * refactor(query_tracker): some rename and delete extras * refactor(query_tracker): remove comments * Merge Main Changes to v1.6 (#878) * fix(output_type): handle errors for wrong output type (#866) * fix(output_type): handle errors for output type * fix: leftovers * fix: test case to mock format-response * fix: upgrade duckdb * Release v1.5.15 * fix(sql): use only added tables of connector (#869) * fix(sql): use only added tables of connector * leftover file * chore: rephrase the error message Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix(sql): fix test cases and improve output error message --------- Co-authored-by: Gabriele Venturi <lele.venturi@gmail.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat/integration_testing test cases created (#873) * feat/integration_testing test cases created based Loan Payments data * feat/integration_testing four more datasets added * fix/moved csv datasets to integration folder * fix/changed pytest command to run only in tests folder * fix/changed pytest command to run only in tests folder --------- Co-authored-by: Milind Lalwani <milindlalwani@Milinds-MacBook-Air.local> * feat(helpers): add gpt-3.5-turbo-1106 fine-tuned (#876) * fix: rephrase query (#872) * Fixed Agent rephrase_query Error * Fixed Agent rephrase_query Error * add encoding --------- Co-authored-by: Pranab Pathak <pranabpathak@Pranabs-MacBook-Air.local> * Release v1.5.16 --------- Co-authored-by: Gabriele Venturi <lele.venturi@gmail.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: milind-sinaptik <149694044+milind-sinaptik@users.noreply.github.com> Co-authored-by: Milind Lalwani <milindlalwani@Milinds-MacBook-Air.local> Co-authored-by: Massimiliano Pronesti <massimiliano.pronesti@gmail.com> Co-authored-by: Pranab1011 <47911727+Pranab1011@users.noreply.github.com> Co-authored-by: Pranab Pathak <pranabpathak@Pranabs-MacBook-Air.local> * refactor: remove inheritance of pandas methods in the SmartDataframe * refactor: remove shortcuts * refactor: smart df cannot chat anymore * refactor: remove unused validate method from sdf * refactor: add name and description to connectors * refactor: remove custom prompts * refactor: remove synthetic pipelines * refactor: remove custom instructions * refactor: remove starcoder and falcon * refactor: move df head to connectors * refactor: remove sdf * refactor: remove leftovers logic units * refactor: rename SmartDataLake to AgentCore * refactor: rename DataLake pipeline to Chat * refactor: remove agent core, moving the logic to agent * refactor: refactor the prompt templates using Jinja2 * feat(Agent): train agent docs or question/answers (#895) * feat(VectorStore): adding chromadb vector store for RAG * test(agent_train): adding more test cases and error handling * refact(agent_train): add logging to chroma db * feat(RAG): use trained data from vector db in prompt (#896) * feat(VectorStore): adding chromadb vector store for RAG * test(agent_train): adding more test cases and error handling * refact(agent_train): add logging to chroma db * feat(RAG): use trained vector in prompt * Merge v1.6 into to v2.0 (#900) * refactor(Prompt): adding more context for dataframe and multiple types of serialization (#880) * refactor(prompt): update dataframe serialization in prompt * tests(prompt): fix and adding new tests * fix(prompt): adding type to dataframe serialize function * refactor(prompt): add field descriptions in yml prompt * fix(prompt): direct_sql still using old dataframe table * refactor(direct_sql): add instruction and note for using relevant table only * refactor(query_tracker): clean output of query tracker format (#888) * feat(GoogleBigQuery): adding google big query connector (#886) * feat(VectorStore): adding chromadb vector store for RAG * test(agent_train): adding more test cases and error handling * refact(agent_train): add logging to chroma db * feat(RAG): use trained vector in prompt * Merge v1.6 to v2.0 * feat: execute_sql_query_usage creating error prompt if execute_sql_que… (#898) * feat/execute_sql_query_usage creating error prompt if execute_sql_query is not used when direct_sql is set to true * fix/comment added before raising exception --------- Co-authored-by: Milind Lalwani <milindlalwani@Milinds-Air.digi.box> * fix(prompt_path): path issue if pandasai used outside of pandas env (#909) * feat(agent): adding optional pipeline call (#916) s * feat(system prompt): use system in llm prompts (#925) * fix(code_manager): minor fixes in code manager * feat(system_prompt): adding system prompts to be added in llm call * fix(code_manager): minor fixes in code manager (#923) Co-authored-by: Gabriele Venturi <lele.venturi@gmail.com> * feat/update method in vector db added * feat/get by id method added * feat(multiturn-conv): update prompts and use api's for multiturn (#928) * fix(code_manager): minor fixes in code manager * feat(system_prompt): adding system prompts to be added in llm call * feat(multi-turn-conv): adding support for multi turn conversation * feat(multi-turn): add missing files * feat(BambooVectorStore): adding bamboo vector to store and retrieve t… (#935) * feat(BambooVectorStore): adding bamboo vector to store and retrieve training docs on cloud * rename test class name * feat(BambooLLM): add bamboo llm wrapper (#940) * feat(BambooVectorStore): adding bamboo vector to store and retrieve training docs on cloud * rename test class name * feat(bamboo_llm): adding bamboo llm interface * fix: clean up few commented and leftover changes * chore: restore smart dataframe and smartdatalake functionalities * fix ruff formatting * fix: yahoo connector * fix: file import sorting * fix: import sorting * fix: module import * ignore integration_tests * fix: ruff * ruff fix * remove integration folder * fix: ci workflow * fix: modin * fix: ruff imports * fix(plot): always pass one lib for plotting in updated prompt * Merge to release 2.0 (#945) * fix(output_type): handle errors for wrong output type (#866) * fix(output_type): handle errors for output type * fix: leftovers * fix: test case to mock format-response * fix: upgrade duckdb * Release v1.5.15 * fix(sql): use only added tables of connector (#869) * fix(sql): use only added tables of connector * leftover file * chore: rephrase the error message Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix(sql): fix test cases and improve output error message --------- Co-authored-by: Gabriele Venturi <lele.venturi@gmail.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat/integration_testing test cases created (#873) * feat/integration_testing test cases created based Loan Payments data * feat/integration_testing four more datasets added * fix/moved csv datasets to integration folder * fix/changed pytest command to run only in tests folder * fix/changed pytest command to run only in tests folder --------- Co-authored-by: Milind Lalwani <milindlalwani@Milinds-MacBook-Air.local> * feat(helpers): add gpt-3.5-turbo-1106 fine-tuned (#876) * fix: rephrase query (#872) * Fixed Agent rephrase_query Error * Fixed Agent rephrase_query Error * add encoding --------- Co-authored-by: Pranab Pathak <pranabpathak@Pranabs-MacBook-Air.local> * Release v1.5.16 * fix(code manager): parsing of called functions (#883) * feat(helpers): add gpt-3.5-turbo-1106 fine-tuned * fix(code manager): parsing of called functions * fmt * fix: open charts return on format plot (#881) Co-authored-by: Long Le <longlh@tech.est-rouge.com> * feat(project): add Makefile, re-lint project, restructure tests (#884) * feat(project): add Makefile, re-lint project, restructure tests * unused imports * Release v1.5.17 * docs:pdate examples.md (#887) Minor fix of exmaples.md * refactor: TypeVar for IResponseParser (#889) (#890) * refactor: TypeVar for IResponseParser (#889) * (refactor): introduce TypeVar for IResponseParser implementation in output_logic_unit.py * (fix): add missing call of super().__init__() in ProcessOutput class * refactor: TypeVar for IResponseParser (#889) * (style): linter fail at output_logic_unit.py * [fix] logging chart saving only if code contains chart (#897) Co-authored-by: Lorenzobattistela <lorenzobattistela@gmail.com> * fix(airtable): use personal access token instead of api key Api key has been deprecated: https://airtable.com/developers/web/api/authentication * feat: add df summarization shortcut (#901) * fix: badge for "Open in Colab" (#903) * feat: add support Google Gemini API in LLMs (#902) * Updating shortcuts to include df summarization * Updating support for google gemini models * Make google-generativeai package optional * fix: upgrade google-ai --------- Co-authored-by: Gabriele Venturi <lele.venturi@gmail.com> * Release v1.5.18 * docs: update Google Colab Badge (#914) The existing badge's signature was somehow seems to be expired so just add Google Colab's officially provided svg badge. * docs: Rectify code examples by adding missing statements (#915) Anyone who is quite new to python won't be able to simplify code errors when directly copied code demo from official website. Updated code example is taken from the root README.md and tested. * feat: add support for modin (#907) * feat: add support for modin * fix(ci): dev deps * update docs * add some tests * upate contributing guidelines * fix helpers * fix docs example * update pandasai/smart_dataframe/__init__.py * Release v1.5.19 * feat: update OpenAI pricing * chore: add Flask openai example (#941) * 'Refactored by Sourcery' * chore: add Flask html example * chore: add Flask openai example * sourcery refactor integration tests * fix: Flask package install set to optional --------- Co-authored-by: Sourcery AI <> * chore: restore smart dataframe and smartdatalake functionalities * fix ruff formatting * fix: yahoo connector * fix: file import sorting * fix: import sorting * fix: module import * ignore integration_tests * fix: ruff * ruff fix * remove integration folder * fix: ci workflow * fix: modin * fix: ruff imports --------- Co-authored-by: Gabriele Venturi <lele.venturi@gmail.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: milind-sinaptik <149694044+milind-sinaptik@users.noreply.github.com> Co-authored-by: Milind Lalwani <milindlalwani@Milinds-MacBook-Air.local> Co-authored-by: Massimiliano Pronesti <massimiliano.pronesti@gmail.com> Co-authored-by: Pranab1011 <47911727+Pranab1011@users.noreply.github.com> Co-authored-by: Pranab Pathak <pranabpathak@Pranabs-MacBook-Air.local> Co-authored-by: Lh Long <lhlong09t4@gmail.com> Co-authored-by: Long Le <longlh@tech.est-rouge.com> Co-authored-by: PVA <37487002+PavelAgurov@users.noreply.github.com> Co-authored-by: Ihor <31508183+nautics889@users.noreply.github.com> Co-authored-by: Lorenzo Battistela <70359945+Lorenzobattistela@users.noreply.github.com> Co-authored-by: Lorenzobattistela <lorenzobattistela@gmail.com> Co-authored-by: Sparsh Jain <31439850+dudesparsh@users.noreply.github.com> Co-authored-by: Devashish Datt Mamgain <devashish@kommunicate.io> Co-authored-by: Hemant Sachdeva <hemant.evolver@gmail.com> Co-authored-by: aloha-fim <15258433+aloha-fim@users.noreply.github.com> * fix: query tracker track code execution * fix: add skills in query tracker and rag to return one sample by default * fix(skills): add skills to query tracker and by default rag to return 1 message (#947) * fix(output_type): handle errors for wrong output type (#866) * fix(output_type): handle errors for output type * fix: leftovers * fix: test case to mock format-response * fix: upgrade duckdb * Release v1.5.15 * fix(sql): use only added tables of connector (#869) * fix(sql): use only added tables of connector * leftover file * chore: rephrase the error message Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix(sql): fix test cases and improve output error message --------- Co-authored-by: Gabriele Venturi <lele.venturi@gmail.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat/integration_testing test cases created (#873) * feat/integration_testing test cases created based Loan Payments data * feat/integration_testing four more datasets added * fix/moved csv datasets to integration folder * fix/changed pytest command to run only in tests folder * fix/changed pytest command to run only in tests folder --------- Co-authored-by: Milind Lalwani <milindlalwani@Milinds-MacBook-Air.local> * feat(helpers): add gpt-3.5-turbo-1106 fine-tuned (#876) * fix: rephrase query (#872) * Fixed Agent rephrase_query Error * Fixed Agent rephrase_query Error * add encoding --------- Co-authored-by: Pranab Pathak <pranabpathak@Pranabs-MacBook-Air.local> * Release v1.5.16 * fix(code manager): parsing of called functions (#883) * feat(helpers): add gpt-3.5-turbo-1106 fine-tuned * fix(code manager): parsing of called functions * fmt * fix: open charts return on format plot (#881) Co-authored-by: Long Le <longlh@tech.est-rouge.com> * feat(project): add Makefile, re-lint project, restructure tests (#884) * feat(project): add Makefile, re-lint project, restructure tests * unused imports * Release v1.5.17 * docs:pdate examples.md (#887) Minor fix of exmaples.md * refactor: TypeVar for IResponseParser (#889) (#890) * refactor: TypeVar for IResponseParser (#889) * (refactor): introduce TypeVar for IResponseParser implementation in output_logic_unit.py * (fix): add missing call of super().__init__() in ProcessOutput class * refactor: TypeVar for IResponseParser (#889) * (style): linter fail at output_logic_unit.py * [fix] logging chart saving only if code contains chart (#897) Co-authored-by: Lorenzobattistela <lorenzobattistela@gmail.com> * fix(airtable): use personal access token instead of api key Api key has been deprecated: https://airtable.com/developers/web/api/authentication * feat: add df summarization shortcut (#901) * fix: badge for "Open in Colab" (#903) * feat: add support Google Gemini API in LLMs (#902) * Updating shortcuts to include df summarization * Updating support for google gemini models * Make google-generativeai package optional * fix: upgrade google-ai --------- Co-authored-by: Gabriele Venturi <lele.venturi@gmail.com> * Release v1.5.18 * docs: update Google Colab Badge (#914) The existing badge's signature was somehow seems to be expired so just add Google Colab's officially provided svg badge. * docs: Rectify code examples by adding missing statements (#915) Anyone who is quite new to python won't be able to simplify code errors when directly copied code demo from official website. Updated code example is taken from the root README.md and tested. * feat: add support for modin (#907) * feat: add support for modin * fix(ci): dev deps * update docs * add some tests * upate contributing guidelines * fix helpers * fix docs example * update pandasai/smart_dataframe/__init__.py * Release v1.5.19 * feat: update OpenAI pricing * chore: add Flask openai example (#941) * 'Refactored by Sourcery' * chore: add Flask html example * chore: add Flask openai example * sourcery refactor integration tests * fix: Flask package install set to optional --------- Co-authored-by: Sourcery AI <> * chore: restore smart dataframe and smartdatalake functionalities * fix ruff formatting * fix: yahoo connector * fix: file import sorting * fix: import sorting * fix: module import * ignore integration_tests * fix: ruff * ruff fix * remove integration folder * fix: ci workflow * fix: modin * fix: ruff imports * fix(plot): always pass one lib for plotting in updated prompt * fix: query tracker track code execution * fix: add skills in query tracker and rag to return one sample by default --------- Co-authored-by: Gabriele Venturi <lele.venturi@gmail.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: milind-sinaptik <149694044+milind-sinaptik@users.noreply.github.com> Co-authored-by: Milind Lalwani <milindlalwani@Milinds-MacBook-Air.local> Co-authored-by: Massimiliano Pronesti <massimiliano.pronesti@gmail.com> Co-authored-by: Pranab1011 <47911727+Pranab1011@users.noreply.github.com> Co-authored-by: Pranab Pathak <pranabpathak@Pranabs-MacBook-Air.local> Co-authored-by: Lh Long <lhlong09t4@gmail.com> Co-authored-by: Long Le <longlh@tech.est-rouge.com> Co-authored-by: PVA <37487002+PavelAgurov@users.noreply.github.com> Co-authored-by: Ihor <31508183+nautics889@users.noreply.github.com> Co-authored-by: Lorenzo Battistela <70359945+Lorenzobattistela@users.noreply.github.com> Co-authored-by: Lorenzobattistela <lorenzobattistela@gmail.com> Co-authored-by: Sparsh Jain <31439850+dudesparsh@users.noreply.github.com> Co-authored-by: Devashish Datt Mamgain <devashish@kommunicate.io> Co-authored-by: Hemant Sachdeva <hemant.evolver@gmail.com> Co-authored-by: aloha-fim <15258433+aloha-fim@users.noreply.github.com> * fix: function call check and query tracker tracking * fixes/in release2.0 (#951) * fix(output_type): handle errors for wrong output type (#866) * fix(output_type): handle errors for output type * fix: leftovers * fix: test case to mock format-response * fix: upgrade duckdb * Release v1.5.15 * fix(sql): use only added tables of connector (#869) * fix(sql): use only added tables of connector * leftover file * chore: rephrase the error message Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix(sql): fix test cases and improve output error message --------- Co-authored-by: Gabriele Venturi <lele.venturi@gmail.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat/integration_testing test cases created (#873) * feat/integration_testing test cases created based Loan Payments data * feat/integration_testing four more datasets added * fix/moved csv datasets to integration folder * fix/changed pytest command to run only in tests folder * fix/changed pytest command to run only in tests folder --------- Co-authored-by: Milind Lalwani <milindlalwani@Milinds-MacBook-Air.local> * feat(helpers): add gpt-3.5-turbo-1106 fine-tuned (#876) * fix: rephrase query (#872) * Fixed Agent rephrase_query Error * Fixed Agent rephrase_query Error * add encoding --------- Co-authored-by: Pranab Pathak <pranabpathak@Pranabs-MacBook-Air.local> * Release v1.5.16 * fix(code manager): parsing of called functions (#883) * feat(helpers): add gpt-3.5-turbo-1106 fine-tuned * fix(code manager): parsing of called functions * fmt * fix: open charts return on format plot (#881) Co-authored-by: Long Le <longlh@tech.est-rouge.com> * feat(project): add Makefile, re-lint project, restructure tests (#884) * feat(project): add Makefile, re-lint project, restructure tests * unused imports * Release v1.5.17 * docs:pdate examples.md (#887) Minor fix of exmaples.md * refactor: TypeVar for IResponseParser (#889) (#890) * refactor: TypeVar for IResponseParser (#889) * (refactor): introduce TypeVar for IResponseParser implementation in output_logic_unit.py * (fix): add missing call of super().__init__() in ProcessOutput class * refactor: TypeVar for IResponseParser (#889) * (style): linter fail at output_logic_unit.py * [fix] logging chart saving only if code contains chart (#897) Co-authored-by: Lorenzobattistela <lorenzobattistela@gmail.com> * fix(airtable): use personal access token instead of api key Api key has been deprecated: https://airtable.com/developers/web/api/authentication * feat: add df summarization shortcut (#901) * fix: badge for "Open in Colab" (#903) * feat: add support Google Gemini API in LLMs (#902) * Updating shortcuts to include df summarization * Updating support for google gemini models * Make google-generativeai package optional * fix: upgrade google-ai --------- Co-authored-by: Gabriele Venturi <lele.venturi@gmail.com> * Release v1.5.18 * docs: update Google Colab Badge (#914) The existing badge's signature was somehow seems to be expired so just add Google Colab's officially provided svg badge. * docs: Rectify code examples by adding missing statements (#915) Anyone who is quite new to python won't be able to simplify code errors when directly copied code demo from official website. Updated code example is taken from the root README.md and tested. * feat: add support for modin (#907) * feat: add support for modin * fix(ci): dev deps * update docs * add some tests * upate contributing guidelines * fix helpers * fix docs example * update pandasai/smart_dataframe/__init__.py * Release v1.5.19 * feat: update OpenAI pricing * chore: add Flask openai example (#941) * 'Refactored by Sourcery' * chore: add Flask html example * chore: add Flask openai example * sourcery refactor integration tests * fix: Flask package install set to optional --------- Co-authored-by: Sourcery AI <> * chore: restore smart dataframe and smartdatalake functionalities * fix ruff formatting * fix: yahoo connector * fix: file import sorting * fix: import sorting * fix: module import * ignore integration_tests * fix: ruff * ruff fix * remove integration folder * fix: ci workflow * fix: modin * fix: ruff imports * fix(plot): always pass one lib for plotting in updated prompt * fix: query tracker track code execution * fix: add skills in query tracker and rag to return one sample by default * fix: function call check and query tracker tracking --------- Co-authored-by: Gabriele Venturi <lele.venturi@gmail.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: milind-sinaptik <149694044+milind-sinaptik@users.noreply.github.com> Co-authored-by: Milind Lalwani <milindlalwani@Milinds-MacBook-Air.local> Co-authored-by: Massimiliano Pronesti <massimiliano.pronesti@gmail.com> Co-authored-by: Pranab1011 <47911727+Pranab1011@users.noreply.github.com> Co-authored-by: Pranab Pathak <pranabpathak@Pranabs-MacBook-Air.local> Co-authored-by: Lh Long <lhlong09t4@gmail.com> Co-authored-by: Long Le <longlh@tech.est-rouge.com> Co-authored-by: PVA <37487002+PavelAgurov@users.noreply.github.com> Co-authored-by: Ihor <31508183+nautics889@users.noreply.github.com> Co-authored-by: Lorenzo Battistela <70359945+Lorenzobattistela@users.noreply.github.com> Co-authored-by: Lorenzobattistela <lorenzobattistela@gmail.com> Co-authored-by: Sparsh Jain <31439850+dudesparsh@users.noreply.github.com> Co-authored-by: Devashish Datt Mamgain <devashish@kommunicate.io> Co-authored-by: Hemant Sachdeva <hemant.evolver@gmail.com> Co-authored-by: aloha-fim <15258433+aloha-fim@users.noreply.github.com> * update comparison operator (#953) * docs: improve readme and license * lint: fix lint in examples * docs: add deploy methods in the documentation * refactor: rename to ChromaDB * feat: make BambooVector the default vectorstore * lint: fix lint in examples * docs: add docs for training, agent description * docs: add video for training LLM --------- Co-authored-by: ArslanSaleem <khan.arslan38@gmail.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: milind-sinaptik <149694044+milind-sinaptik@users.noreply.github.com> Co-authored-by: Milind Lalwani <milindlalwani@Milinds-MacBook-Air.local> Co-authored-by: Massimiliano Pronesti <massimiliano.pronesti@gmail.com> Co-authored-by: Pranab1011 <47911727+Pranab1011@users.noreply.github.com> Co-authored-by: Pranab Pathak <pranabpathak@Pranabs-MacBook-Air.local> Co-authored-by: Milind Lalwani <milindlalwani@Milinds-Air.digi.box> Co-authored-by: Lh Long <lhlong09t4@gmail.com> Co-authored-by: Long Le <longlh@tech.est-rouge.com> Co-authored-by: PVA <37487002+PavelAgurov@users.noreply.github.com> Co-authored-by: Ihor <31508183+nautics889@users.noreply.github.com> Co-authored-by: Lorenzo Battistela <70359945+Lorenzobattistela@users.noreply.github.com> Co-authored-by: Lorenzobattistela <lorenzobattistela@gmail.com> Co-authored-by: Sparsh Jain <31439850+dudesparsh@users.noreply.github.com> Co-authored-by: Devashish Datt Mamgain <devashish@kommunicate.io> Co-authored-by: Hemant Sachdeva <hemant.evolver@gmail.com> Co-authored-by: aloha-fim <15258433+aloha-fim@users.noreply.github.com> * feat: fix poetry.lock * fix: update domain name (#970) * docs: improve docs about training * fix(agent): langchain LLM instantiation (#977) * fix(agent): langchain LLM instantiation * replace object with mock * feat: add support for Gemini API * Release v2.0.2 * fix(llm): Google Gemini signature and memory usage (#980) * Release v2.0.3 * Release v2.0.3 * build: fix issue * build: fix ci for windows (#1005) * fix: add number result to memory as string (#997) Co-authored-by: Gabriele Venturi <lele.venturi@gmail.com> * fix: remove logger refs from SmartDataframe (#985) * Remove logger from smart_dataframe constructor * Remove logger from SmartDatalake args definition --------- Co-authored-by: Gabriele Venturi <lele.venturi@gmail.com> * chore(code_manager): filter code for redeclaration of pd.DataFrame from head (#1003) * feat(CockroachDBConnector): add support for cockroachdb * fix: cockroach db connector * fix: import polars (#1009) * Update polars dependency Move polars dependency into init to make it optional * fix: polars import * fix: fix linter --------- Co-authored-by: PVA <37487002+PavelAgurov@users.noreply.github.com> * Release v2.0.4 * Release v2.0.5 --------- Co-authored-by: ArslanSaleem <khan.arslan38@gmail.com> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: milind-sinaptik <149694044+milind-sinaptik@users.noreply.github.com> Co-authored-by: Milind Lalwani <milindlalwani@Milinds-MacBook-Air.local> Co-authored-by: Massimiliano Pronesti <massimiliano.pronesti@gmail.com> Co-authored-by: Pranab1011 <47911727+Pranab1011@users.noreply.github.com> Co-authored-by: Pranab Pathak <pranabpathak@Pranabs-MacBook-Air.local> Co-authored-by: Milind Lalwani <milindlalwani@Milinds-Air.digi.box> Co-authored-by: Lh Long <lhlong09t4@gmail.com> Co-authored-by: Long Le <longlh@tech.est-rouge.com> Co-authored-by: PVA <37487002+PavelAgurov@users.noreply.github.com> Co-authored-by: Ihor <31508183+nautics889@users.noreply.github.com> Co-authored-by: Lorenzo Battistela <70359945+Lorenzobattistela@users.noreply.github.com> Co-authored-by: Lorenzobattistela <lorenzobattistela@gmail.com> Co-authored-by: Sparsh Jain <31439850+dudesparsh@users.noreply.github.com> Co-authored-by: Devashish Datt Mamgain <devashish@kommunicate.io> Co-authored-by: Hemant Sachdeva <hemant.evolver@gmail.com> Co-authored-by: aloha-fim <15258433+aloha-fim@users.noreply.github.com> Co-authored-by: Cheng Wai <17866260+chengwaikoo@users.noreply.github.com>
Summary by CodeRabbit
New Features
Bug Fixes
Tests