Understanding the AI and natural language processing capabilities of PandasAI
Release v3 is currently in beta. This documentation reflects the features and functionality in progress and may change before the final release.
The Natural Language Layer uses generative AI to transform natural language queries into production-ready code generated by LLMs.
When you use the .chat
method on a dataframe, PandasAI passes to the LLM the question, the table headers, and 5-10 rows of the Dataframe.
It then instructs the LLM to generate the most relevant code, whether Python or SQL. The code is then executed locally.
There are different output formats supported by PandasAI, which can be found here.
PandasAI allows you to configure the NL Layer with the config.set()
method.
Example:
bool
True
pandasai.log
file in the root of your project.bool
False
int
3