RepoQuery is an early-beta project, that uses recursive OpenAI function calling paired with semantic search using All-MiniLM-L6-V2 to index and answer user queries about public GitHub repositories.
To generate and store embeddings for a GitHub repository.
The parameters are passed as a JSON object in the request body:
owner
(string, required): The owner of the repository.name
(string, required): The name of the repository.branch
(string, required): The name of the branch.
The request is processed by the server and responses are sent as Server-sent events(SSE). The event stream will contain the following events with optional data. https://github.com/open-sauced/repo-query/blob/f2f415a4fa9c02d4530624fd7bac2105eea1a77c/src/routes/events.rs#L14-L20
curl --location 'localhost:3000/embed' \
--header 'Content-Type: application/json' \
--data '{
"owner": "open-sauced",
"name": "ai",
"branch": "beta"
}'
To perform a query on the API with a specific question related to a repository.
The parameters are passed as a JSON object in the request body:
query
(string, required): The question or query you want to ask.repository
(object, required): Information about the repository for which you want to get the answer.owner
(string, required): The owner of the repository.name
(string, required): The name of the repository.branch
(string, required): The name of the branch.
The request is processed by the server and responses are sent as Server-sent events(SSE). The event stream will contain the following events with optional data. https://github.com/open-sauced/repo-query/blob/f2f415a4fa9c02d4530624fd7bac2105eea1a77c/src/routes/events.rs#L22-L29
curl --location 'localhost:3000/query' \
--header 'Content-Type: application/json' \
--data '{
"query": "How is the PR description being generated using AI?",
"repository": {
"owner": "open-sauced",
"name": "ai",
"branch": "beta"
}
}'
To check if a repository has been indexed.
owner
(string, required): The owner of the repository.name
(string, required): The name of the repository.branch
(string, required): The name of the branch.
This endpoint returns an OK
status code if the repository has been indexed by the service.
curl --location 'localhost:3000/embed?owner=open-sauced&name=ai&branch=beta'
To run the project locally, there are a few prerequisites:
- The Rust toolchain
- The Onnx Runtime. Will be downloaded and installed automatically when building the project.
- Docker to run the QdrantDB instance.
Once, the above requirements are satisfied, you can run the project like so:
The project requires the following environment variables to be set.
OPENAI_API_KEY
. To authenticate requests to OpenAI.
Start Docker and run the following commands to spin-up a Docker container with a QdrantDB image.
docker pull qdrant/qdrant
docker run -p 6333:6333 -p 6334:6334 qdrant/qdrant
The database dashboard will be accessible at localhost:6333/dashboard, the project communicates with the DB on port 6334
.
Run the following command to install the dependencies and run the project on port 3000
.
cargo run --release
This command will build and run the project with optimizations enabled(Highly recommended).
We encourage you to contribute to OpenSauced! Please check out the Contributing guide for guidelines about how to proceed.
We have a commit utility called @open-sauced/conventional-commit that helps you write your commits in a way that is easy to understand and process by others.
Got Questions? Join the conversation in our Discord.
Find Open Sauced videos and release overviews on our YouTube Channel.
MIT © Open Sauced