gpt-code-assistant


Namegpt-code-assistant JSON
Version 0.0.1 PyPI version JSON
download
home_pagehttps://github.com/narenmanoharan/gpt-code-assistant
Summarygpt-code-assistant is an intelligent coding assistant leveraging language models to search, retrieve, explore and comprehend your codebase.
upload_time2023-08-01 22:27:10
maintainer
docs_urlNone
authornarenmanoharan
requires_python>=3.8.17,<4.0.0
licenseApache-2.0
keywords gpt code search gpt4 llm
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center">
  <img
    height="240"
    width="240"
    alt="logo"
    src="https://raw.githubusercontent.com/narenmanoharan/gpt-code-assistant/main/public/logo.png"
  />
  <h1>gpt-code-assistant</h1>
  <p>
    <b>gpt-code-assistant</b> is an AI-based open-source tool for exploring, querying, and understanding any codebase using Language Models (LLMs) and vector embeddings (a technique to convert objects, like text, into vectors).
  </p>
</div>

## Table of Contents

- [Features](#features)
- [Getting Started](#getting-started)
  - [Installation](#installation)
  - [Usage](#usage)
- [Configuration](#configuration)
- [Problem](#problem)
- [Roadmap](#roadmap)
- [Contributing](#contributing)

## Features

- **LLM-based Search & Retrieval**: Uses Language Models for efficient code search, retrieval, and comprehension.
- **File-system Integration**: Designed to work with any codebase and operates directly with any local code on your machine, allowing seamless integration with your existing workflow.
- **Language Agnostic**: Supports multiple programming languages.
- **Privacy-centric Design**: Code snippets are only transmitted when a question is asked and the Language Model requests the relevant code, ensuring privacy. **(Note: Code snippets are shared with OpenAI)**

Future plans include supporting local models and the ability to generate code.

## Getting Started

### Installation

```bash
pip install gpt-code-assistant
```

### Usage

#### Create a project

First, create a project to index all the files. This step involves creating embeddings for each file and storing them in a local database.

```bash
gpt-code-assistant create-project <project-name> <path-to-codebase>

gpt-code-assistant create-project gpt-code-assistant .
```

#### Ask a question about your codebase

To query about the purpose of your codebase, you can use the `query` command:

```bash
gpt-code-assistant query <project-name> "What does this codebase do?"
```

<img src="public/demo.gif" width="750"  alt="gpt-code-assistant demo"/>

If you want to generate a test for a specific file, for example analytics.py, you can mention the file name to improve accuracy:

```bash
gpt-code-assistant query gpt-code-assistant "Can you generate a test for analytics.py?"
```

For a general usage question about a certain module, like analytics, you can use keywords to search across the codebase:

```bash
gpt-code-assistant query gpt-code-assistant "How do I use the analytics module?"
```

**Remember, mentioning the file name or specific keywords improves the accuracy of the search.**

#### List all projects

To get a list of all the projects:

```bash
gpt-code-assistant list-projects
```

#### Refresh a project

If you want to reindex a project and update the embeddings to the latest content:

```bash
gpt-code-assistant refresh-project <project-name>
```

#### Delete a project

If you wish to delete a project and all its data (including embeddings):

```bash
gpt-code-assistant delete-project <project-name>
```

#### Select a model to use

You can select which model to use for your queries:

```bash
gpt-code-assistant select-model
```

Defaults to `gpt-3.5-turbo-16k`. The selected model is stored in `$HOME/.gpt-code-assistant/config.toml`.

### Configuration

The tool will prompt you to configure the `OPENAI_API_KEY`, if you haven't already.

## Problem

You want to leverage the power of GPT-4 to search your codebase, but you don't want to manually copy and paste code snippets into a prompt nor send your code to another third-party service (other than OpenAI). This tool solves these problems by letting GPT-4 determine the most relevant code snippets within your codebase. It also allows you to perform your queries in your terminal, removing the need for a separate UI.

Examples of the types of questions you might want to ask:

- 🐛 Help debugging errors and finding the relevant code and files
- 📝 Document large files or functionalities formatted as markdown
- 🛠️ Generate new code based on existing files and conventions
- 📨 Ask general questions about any part of the codebase

## Roadmap

- [x] Use vector embeddings to improve search and retrieval
- [ ] Add support for additional models (Claude, Bedrock, etc)
- [ ] Add support for local models (Llama2, Starcoder, etc)
- [ ] Add support for generating code and saving it to a file
- [ ] Support for searching across multiple codebases
- [ ] Allow the model to create new functions that it can then execute
- [ ] Use [guidance](https://github.com/microsoft/guidance) to improve prompts

## Contributing

We love contributions from the community! ❤️ If you'd like to contribute, feel free to fork the repository and submit a pull request.

Please read our [Code of Conduct](CODE_OF_CONDUCT.md) and [Contributing Guide](CONTRIBUTING.md) for more detailed steps and information.

## Code of Conduct

We are committed to fostering a welcoming community. To ensure that everyone feels safe and welcome, we have a [Code of Conduct](CODE_OF_CONDUCT.md) that all contributors, maintainers, and users of this project are expected to adhere to.

## Support

If you're having trouble using `gpt-code-assistant`, feel free to [open an issue](https://github.com/narenmanoharan/gpt-code-assistant/issues) on our GitHub. You can also reach out to us directly at [narenkmanoharan@gmail.com](mailto:narenkmanoharan@gmail.com). We're always happy to help!

## Feedback

Your feedback is very important to us! If you have ideas for how we can improve `gpt-code-assistant`, we'd love to hear from you. Please [open an issue](https://github.com/narenmanoharan/gpt-code-assistant/issues) or reach out to us directly at [narenkmanoharan@gmail](mailto:narenkmanoharan@gmail) with your feedback or thoughts.

## License

This project is licensed under the terms of the [Apache 2.0](LICENSE).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/narenmanoharan/gpt-code-assistant",
    "name": "gpt-code-assistant",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8.17,<4.0.0",
    "maintainer_email": "",
    "keywords": "gpt,code,search,gpt4,llm",
    "author": "narenmanoharan",
    "author_email": "narenkmanoharan@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/08/80/f1c8340e57f735160cb0468fe51aa98f2f0262ed893d8ca99c8ce08eefb1/gpt_code_assistant-0.0.1.tar.gz",
    "platform": null,
    "description": "<div align=\"center\">\n  <img\n    height=\"240\"\n    width=\"240\"\n    alt=\"logo\"\n    src=\"https://raw.githubusercontent.com/narenmanoharan/gpt-code-assistant/main/public/logo.png\"\n  />\n  <h1>gpt-code-assistant</h1>\n  <p>\n    <b>gpt-code-assistant</b> is an AI-based open-source tool for exploring, querying, and understanding any codebase using Language Models (LLMs) and vector embeddings (a technique to convert objects, like text, into vectors).\n  </p>\n</div>\n\n## Table of Contents\n\n- [Features](#features)\n- [Getting Started](#getting-started)\n  - [Installation](#installation)\n  - [Usage](#usage)\n- [Configuration](#configuration)\n- [Problem](#problem)\n- [Roadmap](#roadmap)\n- [Contributing](#contributing)\n\n## Features\n\n- **LLM-based Search & Retrieval**: Uses Language Models for efficient code search, retrieval, and comprehension.\n- **File-system Integration**: Designed to work with any codebase and operates directly with any local code on your machine, allowing seamless integration with your existing workflow.\n- **Language Agnostic**: Supports multiple programming languages.\n- **Privacy-centric Design**: Code snippets are only transmitted when a question is asked and the Language Model requests the relevant code, ensuring privacy. **(Note: Code snippets are shared with OpenAI)**\n\nFuture plans include supporting local models and the ability to generate code.\n\n## Getting Started\n\n### Installation\n\n```bash\npip install gpt-code-assistant\n```\n\n### Usage\n\n#### Create a project\n\nFirst, create a project to index all the files. This step involves creating embeddings for each file and storing them in a local database.\n\n```bash\ngpt-code-assistant create-project <project-name> <path-to-codebase>\n\ngpt-code-assistant create-project gpt-code-assistant .\n```\n\n#### Ask a question about your codebase\n\nTo query about the purpose of your codebase, you can use the `query` command:\n\n```bash\ngpt-code-assistant query <project-name> \"What does this codebase do?\"\n```\n\n<img src=\"public/demo.gif\" width=\"750\"  alt=\"gpt-code-assistant demo\"/>\n\nIf you want to generate a test for a specific file, for example analytics.py, you can mention the file name to improve accuracy:\n\n```bash\ngpt-code-assistant query gpt-code-assistant \"Can you generate a test for analytics.py?\"\n```\n\nFor a general usage question about a certain module, like analytics, you can use keywords to search across the codebase:\n\n```bash\ngpt-code-assistant query gpt-code-assistant \"How do I use the analytics module?\"\n```\n\n**Remember, mentioning the file name or specific keywords improves the accuracy of the search.**\n\n#### List all projects\n\nTo get a list of all the projects:\n\n```bash\ngpt-code-assistant list-projects\n```\n\n#### Refresh a project\n\nIf you want to reindex a project and update the embeddings to the latest content:\n\n```bash\ngpt-code-assistant refresh-project <project-name>\n```\n\n#### Delete a project\n\nIf you wish to delete a project and all its data (including embeddings):\n\n```bash\ngpt-code-assistant delete-project <project-name>\n```\n\n#### Select a model to use\n\nYou can select which model to use for your queries:\n\n```bash\ngpt-code-assistant select-model\n```\n\nDefaults to `gpt-3.5-turbo-16k`. The selected model is stored in `$HOME/.gpt-code-assistant/config.toml`.\n\n### Configuration\n\nThe tool will prompt you to configure the `OPENAI_API_KEY`, if you haven't already.\n\n## Problem\n\nYou want to leverage the power of GPT-4 to search your codebase, but you don't want to manually copy and paste code snippets into a prompt nor send your code to another third-party service (other than OpenAI). This tool solves these problems by letting GPT-4 determine the most relevant code snippets within your codebase. It also allows you to perform your queries in your terminal, removing the need for a separate UI.\n\nExamples of the types of questions you might want to ask:\n\n- \ud83d\udc1b Help debugging errors and finding the relevant code and files\n- \ud83d\udcdd Document large files or functionalities formatted as markdown\n- \ud83d\udee0\ufe0f Generate new code based on existing files and conventions\n- \ud83d\udce8 Ask general questions about any part of the codebase\n\n## Roadmap\n\n- [x] Use vector embeddings to improve search and retrieval\n- [ ] Add support for additional models (Claude, Bedrock, etc)\n- [ ] Add support for local models (Llama2, Starcoder, etc)\n- [ ] Add support for generating code and saving it to a file\n- [ ] Support for searching across multiple codebases\n- [ ] Allow the model to create new functions that it can then execute\n- [ ] Use [guidance](https://github.com/microsoft/guidance) to improve prompts\n\n## Contributing\n\nWe love contributions from the community! \u2764\ufe0f If you'd like to contribute, feel free to fork the repository and submit a pull request.\n\nPlease read our [Code of Conduct](CODE_OF_CONDUCT.md) and [Contributing Guide](CONTRIBUTING.md) for more detailed steps and information.\n\n## Code of Conduct\n\nWe are committed to fostering a welcoming community. To ensure that everyone feels safe and welcome, we have a [Code of Conduct](CODE_OF_CONDUCT.md) that all contributors, maintainers, and users of this project are expected to adhere to.\n\n## Support\n\nIf you're having trouble using `gpt-code-assistant`, feel free to [open an issue](https://github.com/narenmanoharan/gpt-code-assistant/issues) on our GitHub. You can also reach out to us directly at [narenkmanoharan@gmail.com](mailto:narenkmanoharan@gmail.com). We're always happy to help!\n\n## Feedback\n\nYour feedback is very important to us! If you have ideas for how we can improve `gpt-code-assistant`, we'd love to hear from you. Please [open an issue](https://github.com/narenmanoharan/gpt-code-assistant/issues) or reach out to us directly at [narenkmanoharan@gmail](mailto:narenkmanoharan@gmail) with your feedback or thoughts.\n\n## License\n\nThis project is licensed under the terms of the [Apache 2.0](LICENSE).\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "gpt-code-assistant is an intelligent coding assistant leveraging language models to search, retrieve, explore and comprehend your codebase.",
    "version": "0.0.1",
    "project_urls": {
        "Homepage": "https://github.com/narenmanoharan/gpt-code-assistant",
        "Repository": "https://github.com/narenmanoharan/gpt-code-assistant",
        "discussions": "https://github.com/narenmanoharan/gpt-code-assistant/discussions",
        "issues": "https://github.com/narenmanoharan/gpt-code-assistant/issues",
        "wiki": "https://github.com/narenmanoharan/gpt-code-assistant/wiki"
    },
    "split_keywords": [
        "gpt",
        "code",
        "search",
        "gpt4",
        "llm"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7d418c6f39d12b5d77f0d08681b8a7a01bc69a3ed1fa38afdab4aab76b1c8b97",
                "md5": "ff94f4f2d94ece889b9d055da066ad6b",
                "sha256": "0d6f07a76d41834341edca553c33839780273ffd21c9b0f8ac9006cc0780fcaa"
            },
            "downloads": -1,
            "filename": "gpt_code_assistant-0.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ff94f4f2d94ece889b9d055da066ad6b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8.17,<4.0.0",
            "size": 22233,
            "upload_time": "2023-08-01T22:27:08",
            "upload_time_iso_8601": "2023-08-01T22:27:08.620868Z",
            "url": "https://files.pythonhosted.org/packages/7d/41/8c6f39d12b5d77f0d08681b8a7a01bc69a3ed1fa38afdab4aab76b1c8b97/gpt_code_assistant-0.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0880f1c8340e57f735160cb0468fe51aa98f2f0262ed893d8ca99c8ce08eefb1",
                "md5": "07f69b659fbf732359702f37c15dc7a3",
                "sha256": "133d5522a1ff16ce5b81c16bd4f575d039e2a0abdd8778d46b7bdfab51beb279"
            },
            "downloads": -1,
            "filename": "gpt_code_assistant-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "07f69b659fbf732359702f37c15dc7a3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8.17,<4.0.0",
            "size": 19303,
            "upload_time": "2023-08-01T22:27:10",
            "upload_time_iso_8601": "2023-08-01T22:27:10.215547Z",
            "url": "https://files.pythonhosted.org/packages/08/80/f1c8340e57f735160cb0468fe51aa98f2f0262ed893d8ca99c8ce08eefb1/gpt_code_assistant-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-01 22:27:10",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "narenmanoharan",
    "github_project": "gpt-code-assistant",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "gpt-code-assistant"
}
        
Elapsed time: 0.09572s