repositorypackage
0.0.0-20230317214503-84b9110901f7
Repository: https://github.com/justyntemme/addcontext.git
Documentation: pkg.go.dev
# README
addContext
GitHub Repository: Adding Context to Questions for GPT-3 API via GitHub Repositories
What is this?
This is a Go program that adds context to questions for the GPT-3 API via GitHub repositories.
How does it work?
- The program first clones the specified GitHub repository into a temporary directory.
- It then reads all the Go files in that directory and combines them into a single string.
- Next, it prompts the user to enter a question about the code.
- The program then sends the question along with the code to the GPT-3 API using the go-gpt3 package.
- The API will then generate a response to the question along with additional context extracted from the provided code.
- The program outputs the generated response.
How do I use it?
To use this program, you will need to have a GPT-3 API key from OpenAI. Once you have your key, follow these steps:
- Clone this repository to your local machine.
- Inside the cloned directory, run
go mod tidy
to download the required dependencies. - Run
go build main.go
to build the program. - Run the program with the following flags:
-u
or--url
: The GitHub repository URL to clone.-q
or--question
: The question to ask about the code.-k
or--key
: Your OpenAI API key. Example usage:
$ ./addContext -u https://github.com/exampleUser/exampleRepo -q "What is the purpose of this function?" -k YOUR_OPENAI_API_KEY
Dependencies
- go-git: Package for handling Git repositories in Go.
- go-gpt3: Go client for the OpenAI GPT-3 API.
- cobra: Command-line interface library for Go.
Generated by gpt3.5Tubo with addContext