Skip to content

Commit

Permalink
corrected code for chatting with multiple dataframes in 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gdcsinaptik committed Jan 17, 2025
1 parent ec86585 commit 1424d3a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 64 deletions.
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ df.chat(
You can also pass in multiple dataframes to PandaAI and ask questions relating them.

```python
from pandasai import Agent
import pandasai as pai

employees_data = {
'EmployeeID': [1, 2, 3, 4, 5],
Expand All @@ -137,8 +137,7 @@ salaries_df = pai.DataFrame(salaries_data)
# You can get your free API key signing up at https://app.pandabi.ai (you can also configure it in your .env file)
pai.api_key.set("your-pai-api-key")

agent = Agent([employees_df, salaries_df])
agent.chat("Who gets paid the most?")
pai.chat("Who gets paid the most?", employees_df, salaries_df)
```

```
Expand All @@ -149,17 +148,19 @@ You can find more examples in the [examples](examples) directory.

## 📜 License

PandaAI is available under the MIT expat license, except for the `pandasai/ee` directory (which has it's [license here](https://github.com/Sinaptik-AI/pandas-ai/blob/master/pandasai/ee/LICENSE) if applicable.
PandaAI is available under the MIT expat license, except for the `pandasai/ee` directory of this repository, which has its [license here](https://github.com/Sinaptik-AI/pandas-ai/blob/master/pandasai/ee/LICENSE).

If you are interested in managed PandaAI Cloud or self-hosted Enterprise Offering, [contact us](https://forms.gle/JEUqkwuTqFZjhP7h8).
If you are interested in managed PandaAI Cloud or self-hosted Enterprise Offering, [contact us](https://getpanda.ai/pricing).

## Resources

> **Beta Notice**
> Release v3 is currently in beta. The following documentation and examples reflect he features and functionality in progress and may change before the final release.
- [Docs](https://pandas-ai.readthedocs.io/en/latest/) for comprehensive documentation
- [Examples](examples) for example notebooks
- [Discord](https://discord.gg/KYKj9F2FRH) for discussion with the community and PandaAI team

> **Beta Notice**
> Release v3 is currently in beta. This documentation reflects the features and functionality in progress and may change before the final release.

## 🤝 Contributing

Expand All @@ -168,4 +169,4 @@ For more information, please check out the [contributing guidelines](CONTRIBUTIN

### Thank you!

[![Contributors](https://contrib.rocks/image?repo=sinaptik-ai/pandas-ai)](https://github.com/sinaptik-ai/pandas-ai/graphs/contributors)
[![Contributors](https://contrib.rocks/image?repo=sinaptik-ai/pandas-ai)](https://github.com/sinaptik-ai/pandas-ai/graphs/contributors)
43 changes: 0 additions & 43 deletions docs/v3/conversational-agent.mdx

This file was deleted.

10 changes: 0 additions & 10 deletions docs/v3/privacy-and-security.mdx

This file was deleted.

5 changes: 2 additions & 3 deletions docs/v3/smart-dataframes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ Example migration:
```python
# Old code
from pandasai import SmartDataframe
smart_df = SmartDataframe(df, config={"enable_cache": False})
smart_df = SmartDataframe(df)

# New code
import pandasai as pai
pai.config.set({"enable_cache": False})

df = pai.DataFrame(df)
```

Expand Down Expand Up @@ -60,7 +60,6 @@ SmartDataframe accepted configuration options through its constructor:
```python
smart_df = SmartDataframe(df, config={
"llm": llm, # LLM instance
"enable_cache": True, # Enable/disable cache
"save_logs": True, # Save conversation logs
"verbose": False # Print detailed logs
})
Expand Down

0 comments on commit 1424d3a

Please sign in to comment.