-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
272 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.12" | ||
|
||
- name: Install Poetry | ||
run: curl -sSL https://install.python-poetry.org | python3 - | ||
|
||
- name: Configure Poetry | ||
run: | | ||
poetry config virtualenvs.create false | ||
- name: Install Dependencies | ||
run: poetry install --no-interaction --no-ansi | ||
|
||
- name: Run Tests | ||
run: pytest | ||
|
||
- name: Lint with flake8 | ||
run: flake8 | ||
|
||
- name: Format with black | ||
run: black --check . | ||
|
||
- name: Sort imports with isort | ||
run: isort --check-only . |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,60 @@ | ||
# Git Vector | ||
# Git-Vector | ||
|
||
## Overview | ||
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) | ||
|
||
Git Vector is a Python tool that enhances the capabilities of OpenAI models by providing them with context from Git repositories. This allows for more informed and relevant interactions with the models, leveraging the rich history and content of your codebase. | ||
**Git-Vector** is a command-line tool that allows developers to interact with their Git repositories using OpenAI models. It provides a conversational interface to help you understand and navigate your codebase by leveraging the full context of your repository. | ||
|
||
## Features | ||
|
||
- **Contextual Prompting**: Integrate Git repository context into prompts for OpenAI models. | ||
- **Embeddings Cache**: Efficiently cache embeddings to speed up repeated queries. | ||
- **Tracked File Retrieval**: Automatically retrieve tracked files from a Git repository. | ||
- **Text File Detection**: Identify text files to ensure only relevant content is processed. | ||
## Table of Contents | ||
|
||
## Installation | ||
- [Git-Vector](#git-vector) | ||
- [Table of Contents](#table-of-contents) | ||
- [Features](#features) | ||
- [Installation](#installation) | ||
- [Usage](#usage) | ||
- [Configuration](#configuration) | ||
- [License](#license) | ||
- [Author](#author) | ||
- [Acknowledgments](#acknowledgments) | ||
|
||
To install Git Vector, you'll need to have Python 3.12 or higher. You can install the project using Poetry: | ||
## Features | ||
|
||
```bash | ||
poetry install | ||
``` | ||
- **Conversational Interface**: Interactively ask questions about your codebase and receive detailed explanations. | ||
- **Full Repository Context**: The tool indexes your entire Git repository to provide context-aware responses. | ||
- **Caching Mechanism**: Embeddings are cached to improve performance on subsequent runs. | ||
- **Customizable Models**: Supports different OpenAI models for both embeddings and chat completions. | ||
- **Configurable Parameters**: Adjust maximum tokens for prompts and responses to suit your needs. | ||
|
||
Alternatively, you can clone the repository and install the dependencies manually: | ||
## Installation | ||
|
||
```bash | ||
git clone [email protected]:blomqma/git-vector.git | ||
cd git-vector | ||
pip install -r requirements.txt | ||
pip install git-vector | ||
``` | ||
|
||
## Usage | ||
|
||
1. **Set Up Environment Variables**: Create a `.env` file in the root directory of your project and add your OpenAI API key: | ||
1. **Set Up Environment Variables**: | ||
|
||
Export your OpenAI API key as an environment variable (or use a `.env` file): | ||
|
||
``` | ||
OPENAI_API_KEY=your_api_key_here | ||
export OPENAI_API_KEY=your_api_key_here | ||
``` | ||
|
||
2. **Run the Application**: Use the command line interface to interact with the tool. For example: | ||
2. **Run the Application**: | ||
|
||
```bash | ||
python main.py | ||
``` | ||
git-vector --repo-dir /path/to/your/git/repository | ||
``` | ||
|
||
You can specify the directory of your Git repository as an argument. | ||
|
||
## Development | ||
|
||
To contribute to the development of Git Vector, you can set up your development environment using the following commands: | ||
|
||
```bash | ||
# Install development dependencies | ||
poetry install --with dev | ||
|
||
# Format code | ||
poetry run black . | ||
This will start the intera`tive CLI for the user to chat with the codebase. | ||
|
||
# Check code style | ||
poetry run flake8 . | ||
## Configuration | ||
|
||
# Run tests | ||
poetry run pytest | ||
``` | ||
- `--repo-dir`: (Required) The path to the Git repository. | ||
- `--embedding-model`: The OpenAI model to use for embeddings (default: `text-embedding-3-small`). | ||
- `--chat-model`: The OpenAI model to use for chat completions (default: `gpt-4o-mini`). | ||
- `--max-prompt-tokens`: Maximum number of tokens for the prompt (default: `2000`). | ||
- `--max-response-tokens`: Maximum number of tokens for the response (default: `500`). | ||
|
||
## License | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
__version__ = "0.1.0" | ||
|
||
from .git_vector import main | ||
|
||
__all__ = ["main"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.