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

Update llms.mdx #1410

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 21 additions & 3 deletions docs/llms.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ The generated code is then executed to produce the result.

[![Choose the LLM](https://cdn.loom.com/sessions/thumbnails/5496c9c07ee04f69bfef1bc2359cd591-00001.jpg)](https://www.loom.com/share/5496c9c07ee04f69bfef1bc2359cd591 "Choose the LLM")

You can either choose a LLM by instantiating one and passing it to the `SmartDataFrame` or `SmartDatalake` constructor,
or you can specify one in the `pandasai.json` file.
You can either choose a LLM by either instantiating it and passing it to the `SmartDataFrame` or `SmartDatalake` constructor,
or by specifying it in the `pandasai.json` configuration file.

If the model expects one or more parameters, you can pass them to the constructor or specify them in the `pandasai.json`
file, in the `llm_options` param, as it follows:
file, in the `llm_options` parameters, Here’s an example of how to structure your `pandasai.json` file:

```json
{
Expand All @@ -21,6 +21,24 @@ file, in the `llm_options` param, as it follows:
}
}
```
> **Note:**
> `pandasai.json` can be configure for any LLM.

## Working with pandasai.json file

In this example, `data.csv` is your data file, and pandasai.json is the configuration file. Make sure the configuration file is named `pandasai.json` and is in the same folder as your code.

```python
from pandasai import SmartDataframe
from pandasai.config import load_config_from_json

# Load configuration from pandasai.json
config = load_config_from_json()

df = SmartDataframe("data.csv", config=config)
response = df.chat("give me revenue of Top 5 companies for year 2021")
print(response)
```

## BambooLLM

Expand Down
Loading