Skip to content

Commit 5846f07

Browse files
committed
add missing config
1 parent 0eab7e1 commit 5846f07

File tree

1 file changed

+34
-10
lines changed

1 file changed

+34
-10
lines changed

docs/v3/migration-guide.mdx

Lines changed: 34 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ description: "Step-by-step guide to migrate from PandasAI v2 to v3"
44
---
55

66
<Note title="Migration Notice">
7-
PandasAI 3.0 introduces significant architectural changes. This guide covers breaking changes and migration steps. See [Backwards Compatibility](/v3/migration-backwards-compatibility) for v2 classes that still work.
7+
PandasAI 3.0 introduces significant architectural changes. This guide covers
8+
breaking changes and migration steps. See [Backwards
9+
Compatibility](/v3/migration-backwards-compatibility) for v2 classes that
10+
still work.
811
</Note>
912

1013
## Breaking Changes
@@ -13,9 +16,10 @@ description: "Step-by-step guide to migrate from PandasAI v2 to v3"
1316

1417
Configuration is now global using `pai.config.set()` instead of per-dataframe. Several options have been removed:
1518

16-
**Removed:** `save_charts`, `enable_cache`, `security`, `custom_whitelisted_dependencies`, `save_charts_path`
19+
**Removed:** `save_charts`, `enable_cache`, `security`, `custom_whitelisted_dependencies`, `save_charts_path`, `custom_head`
1720

1821
**v2:**
22+
1923
```python
2024
from pandasai import SmartDataframe
2125

@@ -29,6 +33,7 @@ df = SmartDataframe(data, config=config)
2933
```
3034

3135
**v3:**
36+
3237
```python
3338
import pandasai as pai
3439

@@ -42,6 +47,7 @@ df = pai.DataFrame(data)
4247
```
4348

4449
**Key Changes:**
50+
4551
- Global configuration applies to all dataframes
4652
- Charts returned as `ChartResponse` objects for manual handling
4753
- Security handled through sandbox environment
@@ -54,6 +60,7 @@ df = pai.DataFrame(data)
5460
LLMs are now extension-based. Install `pandasai-litellm` separately for unified access to 100+ models.
5561

5662
**v2:**
63+
5764
```python
5865
from pandasai.llm import OpenAI
5966
from pandasai import SmartDataframe
@@ -63,6 +70,7 @@ df = SmartDataframe(data, config={"llm": llm})
6370
```
6471

6572
**v3:**
73+
6674
```bash
6775
pip install pandasai-litellm
6876
```
@@ -77,6 +85,7 @@ df = pai.DataFrame(data)
7785
```
7886

7987
**Key Changes:**
88+
8089
- LLMs are now extension-based, not built-in
8190
- Install `pandasai-litellm` for unified LLM interface
8291
- LiteLLM supports 100+ models (GPT-4, Claude, Gemini, etc.)
@@ -90,6 +99,7 @@ df = pai.DataFrame(data)
9099
Connectors are now separate extensions. Install only what you need. Cloud connectors require [enterprise license](/v3/enterprise-features).
91100

92101
**v2:**
102+
93103
```python
94104
from pandasai.connectors import PostgreSQLConnector
95105
from pandasai import SmartDataframe
@@ -103,6 +113,7 @@ df = SmartDataframe(connector)
103113
```
104114

105115
**v3:**
116+
106117
```bash
107118
pip install pandasai-sql[postgres]
108119
```
@@ -127,6 +138,7 @@ df = pai.create(
127138
```
128139

129140
**Key Changes:**
141+
130142
- Install specific extensions: `pandasai-sql[postgres]`, `pandasai-sql[mysql]`
131143
- Use `pai.create()` with semantic layer
132144
- Environment variables supported: `${DB_USER}`
@@ -136,12 +148,14 @@ df = pai.create(
136148
### Skills
137149

138150
<Note title="Enterprise Feature">
139-
Skills require a valid enterprise license for production use. See [Enterprise Features](/v3/enterprise-features) for more details.
151+
Skills require a valid enterprise license for production use. See [Enterprise
152+
Features](/v3/enterprise-features) for more details.
140153
</Note>
141154

142155
Skills use `@pai.skill` decorator and are automatically registered globally.
143156

144157
**v2:**
158+
145159
```python
146160
from pandasai.skills import skill
147161
from pandasai import Agent
@@ -158,6 +172,7 @@ agent.add_skills(calculate_bonus)
158172
```
159173

160174
**v3:**
175+
161176
```python
162177
import pandasai as pai
163178
from pandasai import Agent
@@ -174,6 +189,7 @@ agent = Agent([df])
174189
```
175190

176191
**Key Changes:**
192+
177193
- Use `@pai.skill` instead of `@skill`
178194
- Automatic global registration
179195
- No need for `agent.add_skills()`
@@ -184,12 +200,14 @@ agent = Agent([df])
184200
### Training
185201

186202
<Note title="Enterprise Feature">
187-
Training with vector stores requires a valid enterprise license for production use. See [Enterprise Features](/v3/enterprise-features) for more details.
203+
Training with vector stores requires a valid enterprise license for production
204+
use. See [Enterprise Features](/v3/enterprise-features) for more details.
188205
</Note>
189206

190207
Training is now available through local vector stores (ChromaDB, Qdrant, Pinecone, LanceDB) for few-shot learning. The `train()` method is still available but requires a vector store.
191208

192209
**v2:**
210+
193211
```python
194212
from pandasai import Agent
195213

@@ -198,6 +216,7 @@ agent.train(queries=["query"], codes=["code"])
198216
```
199217

200218
**v3:**
219+
201220
```python
202221
from pandasai import Agent
203222
from pandasai.ee.vectorstores import ChromaDB
@@ -211,6 +230,7 @@ agent.train(queries=["query"], codes=["code"])
211230
```
212231

213232
**Key Changes:**
233+
214234
- Training requires a vector store (ChromaDB, Qdrant, Pinecone, LanceDB)
215235
- Vector stores enable few-shot learning
216236
- Better scalability and performance
@@ -265,9 +285,10 @@ pai.config.set({
265285
### Step 4: Migrate DataFrames (optional)
266286

267287
Check the [Backwards Compatibility](/v3/migration-backwards-compatibility) section for details on the difference between SmartDataframe, SmartDatalakes, and the new Semantic DataFrames (pai dataframes).
268-
In this way you can decide if migrating or not.
288+
In this way you can decide if migrating or not.
269289

270290
**Option A: Keep SmartDataframe (backward compatible)**
291+
271292
```python
272293
from pandasai import SmartDataframe
273294

@@ -276,6 +297,7 @@ response = df.chat("Your question")
276297
```
277298

278299
**Option B: Use pai.DataFrame (recommended)**
300+
279301
```python
280302
import pandasai as pai
281303

@@ -297,6 +319,7 @@ response = df.chat("Your question")
297319
```
298320

299321
**Multiple DataFrames:**
322+
300323
```python
301324
# v2 style (still works)
302325
from pandasai import SmartDatalake
@@ -338,7 +361,8 @@ df = pai.create(
338361
### Step 6: Update Skills (if applicable)
339362

340363
<Note title="Enterprise Feature">
341-
Skills require a valid enterprise license for production use. See [Enterprise Features](/v3/enterprise-features) for more details.
364+
Skills require a valid enterprise license for production use. See [Enterprise
365+
Features](/v3/enterprise-features) for more details.
342366
</Note>
343367

344368
```python
@@ -362,7 +386,7 @@ def calculate_metric(value: float) -> float:
362386
### Step 7: Remove Deprecated Configuration
363387

364388
```python
365-
# Remove: save_charts, enable_cache, security,
389+
# Remove: save_charts, enable_cache, security,
366390
# custom_whitelisted_dependencies, save_charts_path
367391

368392
# v3 (keep only these)
@@ -415,7 +439,7 @@ print(response)
415439
---
416440

417441
<Note>
418-
**Next Steps:**
419-
- Review [Backwards Compatibility](/v3/migration-backwards-compatibility) for v2 classes
420-
- Check [Migration Troubleshooting](/v3/migration-troubleshooting) for common issues
442+
**Next Steps:** - Review [Backwards
443+
Compatibility](/v3/migration-backwards-compatibility) for v2 classes - Check
444+
[Migration Troubleshooting](/v3/migration-troubleshooting) for common issues
421445
</Note>

0 commit comments

Comments
 (0)