Large-language model based "agent" that can can execute small tasks by using a Python REPL and pre-implemented methods. The "agent loop" is based on ReAct.
The agent can look up methods using a method_search()
method that uses semantic search on the indexed Python methods. Methods are indexed using OpenAI embedding of their signatures and descriptions.
More details in the blogpost at https://peterroelants.github.io/posts/react-repl-agent/
There are 2 notebooks to run the agent:
- Run on single task notebooks/react_repl_agent.ipynb
- Uses Papermill to run a batch of tasks notebooks/run_batch.ipynb
A conda/mamba environment is provided at env/.
Certain libraries (such as the openai library) need a secret key to use them. These should be added to the secrets/ directory.
If you want to contribute, please do so via pull requests.
To run all code formatting and linters before pushing a commit run:
./tools/run_all.sh