Point to a Github repo, and get an index that you can use for asking questions about the code.
Built with 🚀 Meerkat.
recording-guardrails.mov
recording-meerkat.mov
To get started,
git clone https://github.com/krandiash/talkdoc.git
conda create -n talkdoc python=3.9
pip install -r requirements.txtMake sure to setup your OpenAI key and/or Cohere key in your environment.
export OPENAI_API_KEY=<your_key>
export COHERE_API_KEY=<your_key>Plug in the name of any public Github repo!
python index-docs.py --repo <public_repo_url> --prompt-onlyFor example, we provide a demo for the meerkat (https://github.com/hazyresearch/meerkat) and numpy (https://github.com/numpy/numpy) repos.
python index-docs.py --repo https://github.com/hazyresearch/meerkat --prompt-only
# Type in a query like "How do I create an interactive visualization with a table and a scatterplot in Python with Meerkat?"
# Set n to a number like 5 to retrieve and put the top 5 most relevant results into the promptThis will generate a prompt that you can stick into ChatGPT or GPT-4.
If you want ChatGPT to answer your questions programatically, just remove the --prompt-only flag.
python index-docs.py --repo https://github.com/hazyresearch/meerkatNote that the numpy example is only supported right now with --model cohere/small (due to the size of the repo, I cheaped out).
You can change the indexing model by changing the --model flag. Pass in any model from OpenAI with openai/... e.g. openai/text-embedding-ada-002 or any model from Cohere with cohere/... e.g. cohere/small.
The same indexing workflow is available in the notebook. Just run the cells in index-docs.ipynb.
This might be more fun to use, since it shows off some of the cool features of Meerkat in visualizing and playing with the data!
For example, when a Table view pops up, try:
- double clicking on the numbers on the left side to open up a modal view.
- in the modal view, click on the column names on the left to go through the different columns.
The last cell shows off some of the cool interactive GUI stuff in Meerkat. For example, we're popping up a button there for you to be able to copy the prompt over to ChatGPT / GPT-4.