PAI: A CLI tool
main
A base implementation
pai.__main__
Driver code for the CLI tool Pai is the command line tool designed to provide a convenient way to interact with PandasAI through a command line interface (CLI).
pai [OPTIONS]
Options:
- -d, --dataset: The file path to the dataset.
- -t, --token: Your HuggingFace or OpenAI API token, if no token provided pai will pull
from the
.envfile. - -m, --model: Choice of LLM, either
openai,open-assistant, orstarcoder. - -p, --prompt: Prompt that PandasAI will run.
To view a full list of available options and their descriptions, run the following command:
pai --help
Example
pai -d "~/pandasai/example/data/Loan payments data.csv" -m "openai"
-p "How many loans are from men and have been paid off?"
Should result in the same output as the
from_csv.pyexample.
main(dataset, token, model, prompt)
Main logic for the command line interface tool.
Source code in pai/__main__.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | |