Skip to content

Commit

Permalink
Update README files, adding some images
Browse files Browse the repository at this point in the history
  • Loading branch information
opcode81 committed Jul 10, 2023
1 parent 406c7e3 commit d3ea19d
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 89 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/temp
57 changes: 19 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,53 +2,34 @@

This repository contains two projects:

* The **AutoDev Python project** providing the core functionality (`./autodev`)
* A Java project implementing the **AutoDev IntellIJ IDEA plugin** which provides access to the coding assistance functions within an IDE (`./idea-plugin`).
* The **AutoDev Python project** providing the core functionality (`./autodev`), including
* auto-completion models (that can suggest completions based on the current editing context)
* fine-tuning of completion models to teach them new languages (or to teach them about your libraries, your code style, etc.)
* quantitative & qualitative evaluation
* optimization of models for inference (including quantization)

## AutoDev Python Project
* code-based assistance functions, where an instruction-following model is given a task based on an existing code snippet (e.g. reviewing code, adding comments or input checks, explaining code, etc.)
* an inference service, which access to the above functions
* question answering on document databases (including source code documents)
* A Java project implementing the **AutoDev IntellIJ IDEA plugin** which provides access to the coding assistance functions within JetBrains IDEs such as IntelliJ IDEA, PyCharm and others (`./idea-plugin`).

### Environment
Please refer to the projects' individual README files for further information.

Use conda to set up your virtual environment:
## AutoDev in Action

conda env create -f environment.yml
### Fine-Tuned Auto-Completion

### Packages
Generating completions for the Ruby programming language based on a fine-tuned version of bigcode/santacoder, which originally knew only Python, Java and JavaScript:

The `autodev` package provides the following Python modules:
* `llm` provides **abstractions for large language models** (LLMs).
* The high-level abstraction, which provides streaming-based queries, is given by the `StreamingLLM` class.
* Instances of `StreamingLLM` can be created via specializations of the `LLMFactory` class.
* `LLMType` constitutes a convenient enumeration of the model types considered in concrete factory implementations.
* `code_functions` contains **code assistant functions** that take code as input and return text/code as output, supporting editor-based
actions where the user selects text in the editor and then uses the context menu to invoke an assistant function.
* `service` implements a **Flask-based service** that provides access to the aforementioned code functions via an HTTP service.
* `stream_formatting` is concerned with the on-the-fly HTML formatting of streamed responses
* `document_qa` provides simple **question answering** functionality (based on a static set of documents)
* further modules (`splitting`, `indexing`, `embedding`) that could prove useful when extending the question answering use case to use fewer non-standard components that are directly provided by the `langchain` library
* `logging` facilitates logging configuration (as a drop-in replacement for Python's `logging` module)
![Example: auto-completion](images/auto-completion-ruby.gif "Auto-completion in IntelliJ IDEA")

### Runnable Scripts
### Assistance Functions Built on Instruction-Following Models

The root folder contains runnable scripts:
* `run_qa_fireface_manual.py` and `run_qa_sensai.py` implement question answering use cases based on the manual of an audio interface and the [sensAI](http://github.com/jambit/sensAI) library source code respectively.
* `run_service.py` starts the HTTP service for remote access to coding assistance functions.
Adding input checks to a function:

Notebooks:
* `apply_code_functions.ipynb` can be used to apply code functions to the code snippets in `data/code_snippets` using different LLMs.
![Example: adding input checks](images/add-input-checks.gif "Adding input checks in IntelliJ IDEA")

## AutoDev IntellIJ IDEA Plugin
Identifying potential problems in a piece of code:

Open the folder `idea-plugin/autodev-plugin` as a project in IntellIJ.

IntelliJ should detect the gradle project and display the run configuration `Run Plugin`.
Running this configuration will start an IntellIJ instance with the plugin enabled.
By default, it will query the service at `localhost:5000`.

### Components

* The file `plugin.xml` defines the plugin components that are activated
* The package `de.appliedai.autodev.actions` contains editor actions (available in the editor context menu)
* Class `de.appliedai.autodev.ServiceClient` contains the service client implementation, in which the service URL is configured.
* Class `de.appliedai.autodev.AutoDevToolWindowManager` manages the creation of tool window components/tabs that are displayed in reaction to user queries.
![Example: identifying potential problems](images/potential-problems.gif "Identifying potential problems of a piece of code in IntelliJ IDEA")

8 changes: 0 additions & 8 deletions idea-plugin/README-java-deps.md

This file was deleted.

64 changes: 21 additions & 43 deletions idea-plugin/README.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,32 @@
# AutoDev: LLM-Based Coding Assistance Functions
# AutoDev IntellIJ IDEA Plugin

This repository contains two projects:
A plugin for IntelliJ IDEA and other JetBrains IDEs.

* The **AutoDev Python project** providing the core functionality (`./autodev`)
* A Java project implementing the **AutoDev IntellIJ IDEA plugin** which provides access to the coding assistance functions within an IDE (`./idea-plugin`).
## Development Environment

## AutoDev Python Project

### Environment

Use conda to set up your virtual environment:

conda env create -f environment.yml

### Packages

The `autodev` package provides the following Python modules:
* `llm` provides **abstractions for large language models** (LLMs).
* The high-level abstraction, which provides streaming-based queries, is given by the `StreamingLLM` class.
* Instances of `StreamingLLM` can be created via specializations of the `LLMFactory` class.
* `LLMType` constitutes a convenient enumeration of the model types considered in concrete factory implementations.
* `code_functions` contains **code assistant functions** that take code as input and return text/code as output, supporting editor-based
actions where the user selects text in the editor and then uses the context menu to invoke an assistant function.
* `service` implements a **Flask-based service** that provides access to the aforementioned code functions via an HTTP service.
* `stream_formatting` is concerned with the on-the-fly HTML formatting of streamed responses
* `document_qa` provides simple **question answering** functionality (based on a static set of documents)
* further modules (`splitting`, `indexing`, `embedding`) that could prove useful when extending the question answering use case to use fewer non-standard components that are directly provided by the `langchain` library
* `logging` facilitates logging configuration (as a drop-in replacement for Python's `logging` module)

### Runnable Scripts

The root folder contains runnable scripts:
* `run_qa_fireface_manual.py` and `run_qa_sensai.py` implement question answering use cases based on the manual of an audio interface and the [sensAI](http://github.com/jambit/sensAI) library source code respectively.
* `run_service.py` starts the HTTP service for remote access to coding assistance functions.
When opening this folder as a project in IntellIJ IDEA;
a gradle project should be detected and the run configuration `Run Plugin`
should be available.
Running this configuration will start an IntellIJ instance with the plugin enabled.

Notebooks:
* `apply_code_functions.ipynb` can be used to apply code functions to the code snippets in `data/code_snippets` using different LLMs.
### Building Dependencies

## AutoDev IntellIJ IDEA Plugin
The project depends on components from TabNine.
To build these dependencies and make them available on your local machine,
checkout branch `v1.0.9-autodev` from
[here](https://github.com/opcode81/tabnine-intellij/tree/v1.0.9-autodev).
Then, in folders `Common` and `Tabnine`, run

Open the folder `idea-plugin/autodev-plugin` as a project in IntellIJ.
../gradlew -x test build publishToMavenLocal

IntelliJ should detect the gradle project and display the run configuration `Run Plugin`.
Running this configuration will start an IntellIJ instance with the plugin enabled.
By default, it will query the service at `localhost:5000`.
NOTE: Use a newer version of JDK 11 (e.g. 11.0.9), otherwise it may not work
(it didn't work for me with either JDK 17 or JDK 11.0.0).

### Components
## Components

* The file `plugin.xml` defines the plugin components that are activated
* The package `de.appliedai.autodev.actions` contains editor actions (available in the editor context menu)
* Class `de.appliedai.autodev.ServiceClient` contains the service client implementation, in which the service URL is configured.
* The file `plugin.xml` defines the plugin components that are activated.
*
* The package `de.appliedai.autodev.actions` contains editor actions (available in the editor context menu).
* Class `de.appliedai.autodev.ServiceClient` contains the service client implementation.
* Class `de.appliedai.autodev.AutoDevToolWindowManager` manages the creation of tool window components/tabs that are displayed in reaction to user queries.

Binary file added images/add-input-checks.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/auto-completion-ruby.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/potential-problems.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d3ea19d

Please sign in to comment.