Giter VIP home page Giter VIP logo

talkdoc's Introduction

๐ŸŽ™๏ธ talkdoc

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.txt

Make 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>

๐Ÿ“‡ Indexing

Plug in the name of any public Github repo!

python index-docs.py --repo <public_repo_url> --prompt-only

For 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 prompt

This 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/meerkat

Note that the numpy example is only supported right now with --model cohere/small (due to the size of the repo, I cheaped out).

โš™๏ธ Changing indexing model

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.

๐Ÿ“ Indexing in the Notebook

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:

  1. double clicking on the numbers on the left side to open up a modal view.
  2. 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.

talkdoc's People

Contributors

krandiash avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.