Skip to content
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(code manager): parsing of called functions #883

Merged
merged 3 commits into from
Jan 20, 2024

Conversation

mspronesti
Copy link
Contributor

@mspronesti mspronesti commented Jan 20, 2024

Hi @gventuri,
this PR fixes the detection of called functions (skills) when parsing the generated code.
Example of failing case:

import pandas as pd
from pandasai import Agent

from pandasai.llm import OpenAI
import os
from pandasai.skills import skill

employees_data = {
    "EmployeeID": [1, 2, 3, 4, 5],
    "Name": ["John", "Emma", "Liam", "Olivia", "William"],
    "Department": ["HR", "Sales", "IT", "Marketing", "Finance"],
}

employees_df = pd.DataFrame(employees_data)
employees_df.attrs['name'] = 'foo_df'


# Add function docstring to give more context to model
@skill()
def get_dataframe_name(df: pd.DataFrame) -> str:
    """
    Returns the name of the given dataframe.
    Args:
        df (pd.Dataframe)
    """
    if df is not None and "name" in df.attrs:
        return df.attrs['name']
    else:
        return ""


os.environ["OPENAI_API_KEY"] = "sk-..."

llm = OpenAI(temperature=0)

agent = Agent([employees_df], config={"llm": llm, "enable_cache": False, "verbose": True}, memory_size=10)

agent.add_skills(get_dataframe_name)

# Chat with the agent
response = agent.chat("What is the name of the provided dataframe?")
print(response)

Generated code:

df = dfs[0]
name = get_dataframe_name(df)
result = {'type': 'string', 'value': name}

Which fails (without this fix) with the following error:

2024-01-20 15:44:53 [ERROR] Failed with error: Traceback (most recent call last):
  File "/home/mspronesti/Desktop/pandas-ai/pandasai/pipelines/smart_datalake_chat/code_execution.py", line 52, in execute
    result = pipeline_context.query_exec_tracker.execute_func(
  File "/home/mspronesti/Desktop/pandas-ai/pandasai/helpers/query_exec_tracker.py", line 128, in execute_func
    result = function(*args, **kwargs)
  File "/home/mspronesti/Desktop/pandas-ai/pandasai/helpers/code_manager.py", line 212, in execute_code
    exec(code_to_run, environment)
  File "<string>", line 2, in <module>
NameError: name 'get_dataframe_name' is not defined

Summary by CodeRabbit

  • Refactor
    • Improved code indentation for better readability and maintainability.
    • Streamlined the identification of unsafe methods to enhance security checks.
    • Optimized the function call detection within the code execution context.
    • Refined the logic for identifying unauthorized table use in SQL queries.
    • Enhanced the detection of dataframe overwrites to prevent unintended data loss.
    • Updated the import checks to align with whitelisted libraries and custom dependencies.
    • Improved utility functions for dataframe identification and comparison extraction.

Copy link
Contributor

coderabbitai bot commented Jan 20, 2024

Warning

Rate Limit Exceeded

@mspronesti has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 21 minutes and 58 seconds before requesting another review.

How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.
Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.
Please see our FAQ for further information.

Commits Files that changed from the base of the PR and between 81a7173 and 49a9fd9.

Walkthrough

The changes primarily involve formatting adjustments, such as aligning indentation within class definitions and method arguments. Additionally, there's a simplification in the list comprehension within a security-related method. A few logical structures have been condensed for clarity, and there are minor changes to variable assignments and function calls to enhance readability and maintainability.

Changes

File Path Change Summary
.../helpers/code_manager.py Adjusted indentation in class definitions and methods.
.../helpers/code_manager.py Simplified list comprehension in security checks.
.../helpers/code_manager.py Streamlined logical conditions and assignment structures.

🐰✨
In code's vast garden, indents align,
A rabbit hops through, making it fine.
Security tightens, with lists so sleek,
Bugs scatter away, with every tweak. 🌟🐾

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?

Share

Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit-tests for this file.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit tests for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • The JSON schema for the configuration file is available here.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Type: Bug fix

PR Summary: The pull request addresses an issue with the detection of called functions within the code execution context. It modifies the logic for identifying function calls in the abstract syntax tree, ensuring that the skills manager correctly recognizes and adds used skills. Additionally, the PR includes updates to the openai_info module, adding new fine-tuned model identifiers and their associated costs.

Decision: Comment

📝 Type: 'Bug fix' - not supported yet.
  • Sourcery currently only approves 'Typo fix' PRs.
✅ Issue addressed: this change correctly addresses the issue or implements the desired feature.
No details provided.
✅ Small diff: the diff is small enough to approve with confidence.
No details provided.

General suggestions:

  • Ensure that the refactoring of the function call detection logic does not introduce any regressions by thoroughly testing all possible cases where a function call might occur.
  • Review the changes to ensure that they adhere to the project's coding standards, particularly with respect to indentation and formatting.
  • Verify that the addition of new model identifiers in the openai_info module is accompanied by the necessary updates elsewhere in the codebase to handle these new models.

Thanks for using Sourcery. We offer it for free for open source projects and would be very grateful if you could help us grow. If you like it, would you consider sharing Sourcery on your favourite social media? ✨

Share Sourcery

Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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

Commits Files that changed from the base of the PR and between 3f4b1e5 and 81a7173.
Files selected for processing (2)
  • pandasai/helpers/code_manager.py (9 hunks)
  • pandasai/helpers/openai_info.py (1 hunks)
Additional comments: 13
pandasai/helpers/openai_info.py (2)
  • 47-47: The addition of the new model "gpt-3.5-turbo-1106-finetuned" with its associated cost is consistent with the existing pattern of model cost definitions.
  • 50-50: The addition of the new model "gpt-3.5-turbo-1106-finetuned-completion" with its associated cost is consistent with the existing pattern of model cost definitions.
pandasai/helpers/code_manager.py (11)
  • 32-34: The indentation of the constructor parameters has been increased. This is a style change and does not affect the functionality of the code.
  • 75-78: The indentation of the constructor parameters has been increased. This is a style change and does not affect the functionality of the code.
  • 296-311: The streamlining of the list of methods checked by the _is_unsafe function is a formatting change that improves readability without altering functionality.
  • 316-322: The refactoring of the find_function_calls method improves the detection of function calls by considering both ast.Name and ast.Attribute types. This change is crucial for recognizing functions decorated with @skill() and making them available during code execution.
  • 328-330: The indentation change in the check_direct_sql_func_def_exists method is a style change and does not affect the functionality of the code.
  • 336-339: The indentation change in the _get_sql_irrelevant_tables method is a style change and does not affect the functionality of the code.
  • 375-377: The indentation change in the _clean_code method is a style change and does not affect the functionality of the code.
  • 388-390: The indentation change in the _clean_code method is a style change and does not affect the functionality of the code.
  • 415-417: The indentation change in the _is_df_overwrite method is a style change and does not affect the functionality of the code.
  • 438-439: The indentation change in the _check_imports method is a style change and does not affect the functionality of the code.
  • 611-614: The indentation change in the _extract_comparisons method is a style change and does not affect the functionality of the code.

@codecov-commenter
Copy link

codecov-commenter commented Jan 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (470b70a) 85.21% compared to head (49a9fd9) 85.22%.
Report is 3 commits behind head on main.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #883      +/-   ##
==========================================
+ Coverage   85.21%   85.22%   +0.01%     
==========================================
  Files          90       90              
  Lines        3881     3885       +4     
==========================================
+ Hits         3307     3311       +4     
  Misses        574      574              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gventuri
Copy link
Collaborator

Thanks a lot for the great fix @mspronesti!!

@gventuri gventuri merged commit 431e077 into Sinaptik-AI:main Jan 20, 2024
9 checks passed
gventuri added a commit that referenced this pull request Feb 20, 2024
* 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>
gventuri added a commit that referenced this pull request Feb 20, 2024
… 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>
gventuri added a commit that referenced this pull request Feb 21, 2024
* 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>
gventuri added a commit that referenced this pull request Feb 29, 2024
* 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>
gventuri added a commit that referenced this pull request Mar 8, 2024
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants