Skip to content

Instantly share code, notes, and snippets.

@DavidZirinsky
DavidZirinsky / ask_questions_on_codebase.py
Last active September 8, 2023 21:52
How to ask questions about a git repo using chatgbt's api
# call this script with the command: python3 ask_questions_on_codebase.py
from langchain.document_loaders import GitLoader
from langchain.indexes import VectorstoreIndexCreator
import os
# if this fails, just use the bash command export OPENAI_API_KEY=YOUR_KEY_HERE
os.environ['OPENAI_API_KEY'] = 'YOUR_KEY_HERE'
os.environ['OPENAI_MODEL'] = 'text-embedding-ada-002' # specify your model here