Python REPL with LLM integration
Project description
pai: It's like having code interpreter in your Python REPL
A Python REPL with a built in AI agents and code generation. REPL history is used for LLM context. Supports OpenAI and llama.cpp
You and the AI have access to the same data, so you can guide the AI and move seamlessly between the two.
Installation
pip install pai-repl
Command line usage
When you invoke pai
, it will start an interactive Python REPL with a built in AI agent.
$ pai
INP [0]>
Use with OpenAI. The default model is gpt-4
$ export OPENAI_API_KEY=<your key>
$ pai
Specify OpenAI model
$ pai --openai gpt-3.5-turbo
Use with llama.cpp compatible models
$ pai --llama <path to model>
Prompt pai from the command line
$ pai "find the largest file in the current directory"
AI Agent
Prompt the AI agent to complete a task by typing pai: <prompt>
. The AI agent will continuously generate and run code until it completes the task or fails. All generated code must be approved by the user.
The task: "pai: there is a csv in the current directory. find it and give me a full analysis"
Generate code
Generate code in the REPL by type gen: <prompt>
. The generated code will be displayed and you can accept, edit or cancel it.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pai_repl-0.1.12-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b06254efe563c6e09d49b704d01c76791dbc57369f93e30ddb701663cb073b40 |
|
MD5 | ab215ac22527301ba20f184a0c033003 |
|
BLAKE2b-256 | 9b7e95c5a9c6eca64813f3390c9950644c5fe1732df581d4a2aaada2e8780c43 |