Skip to content

Commit

Permalink
feat: add custom Evaluators in user settings
Browse files Browse the repository at this point in the history
  • Loading branch information
ivangabriele committed Jul 18, 2023
1 parent 3ea0051 commit c2672d6
Show file tree
Hide file tree
Showing 44 changed files with 651 additions and 622 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: [ivangabriele]
19 changes: 18 additions & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,25 @@ jobs:
# uses: actions/setup-node@v3
# with:
# cache: yarn
# node-version: 20
# node-version: 16
# - name: Install
# run: yarn
# - name: Test
# run: yarn test:unit

build:
name: Type
if: ${{ !startsWith(github.ref, 'refs/heads/ci-release-v') }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup
uses: actions/setup-node@v3
with:
cache: yarn
node-version: 16
- name: Install
run: yarn
- name: Build
run: yarn build
39 changes: 0 additions & 39 deletions .github/workflows/prerelease.yml

This file was deleted.

9 changes: 3 additions & 6 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,23 @@
.vscode/**
.vscode-test/**
.yarn/**
config/**
node_modules/**
scripts/**

.editorconfig
.eslintrc
.gitattributes
.gitignore
.yarnrc.yml
rollup.config.mjs
tsconfig.json
yarn.lock

assets/*
!assets/icons
assets/icons/*
!assets/icons/x512.png
assets/videos/**
dist/test/**
dist/**/*.js.map
src/**

!README.github.md

**/*.svg
**/*.vsix
61 changes: 0 additions & 61 deletions README.dist.md

This file was deleted.

40 changes: 23 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<p align="center">
<img alt="OpenAI Forge Logo" height="128" src="assets/icons/icon.svg" />
<img alt="OpenAI Forge Header" width="100%" src="assets/docs/readme-header.svg" />
<img alt="OpenAI Forge Logo" height="128" src="assets/icons/x512.png" />
<h1 align="center">OpenAI Forge</h1>
</p>

<p align="center">
Expand All @@ -21,39 +21,45 @@

## Screencast

https://github.com/ivangabriele/openai-forge-vsce/assets/5957876/fbb5ba36-a9b5-4251-868c-0fa6ef1676b5

## Requirements
<video src="https://github-production-user-asset-6210df.s3.amazonaws.com/5957876/253832578-fbb5ba36-a9b5-4251-868c-0fa6ef1676b5.mp4" width="100%"></video>

https://github.com/ivangabriele/openai-forge-vsce/assets/5957876/fbb5ba36-a9b5-4251-868c-0fa6ef1676b5

**YOU MUST INSTALL [OpenAI Forge Browser Extension](https://github.com/ivangabriele/openai-forge-browser#readme)
to make this extension work.**
## Getting Started

The communication with ChatGPT is done through the browser extension, via WebSocket.
Check the [WELCOME](docs/WELCOME.md) document to get started.

## How it works?

The OpenAI Forge VSCode extension runs a WebSocket server while the OpenAI Forge browser extension runs a WebSocket
client (only when you are have `https://chat.openai.com` open in your browser). That's how VSCode can communicate with
ChatGPT web application.
OpenAI Forge VSCode extension runs a WebSocket server while the OpenAI Forge browser extension runs a WebSocket client
when you have `https://chat.openai.com` open in your browser. That's how VSCode can communicate with ChatGPT web
application to automatically fill the prompt and submit it.

As for the errors, the OpenAI Forge VSCode extension runs an _evaluator_, that is a CLI command able to output errors
while attempting to build your code. This _evaluator_ command (and command arguments) is run in a child process, the
`stderr` output is extracted, embedded along your selected documents source code, and then sent to ChatGPT prompt.
As for the errors, OpenAI Forge VSCode extension runs an **Evaluator**_**, that is a CLI command able to output errors
while attempting to compile or lint your code. This _evaluator_ command is run in a child process, its `stderr` output
is extracted and embedded along your selected documents source code, before being sent to ChatGPT prompt, along with
your document source code.

## Features

Directly from Visual Studio Code, you can:

- [x] Send all the source code of one or multiple documents at once
- [x] Send evaluation errors to ask ChatGPT for fixes
- [x] Rust
- [x] Add a custom message to the generated prompt request (or don't)

### Bonus (for a better ChatGPT contextualization)
### ChatGPT Prompt Contextualization

- [x] Automatically include documents relative in prompt
- [x] Automatically "guess" and include some project information in the prompt header (can be disabled in settings)
OpenAI Forge add some contextual information to the automated prompt message in order to help improve ChatGPT accuracy:

- [x] Source code documents paths
- [x] Some workspace information "guessed" from you files path and extensions _(can be disabled in settings)_

## Current limitations

_In progress..._

## Known issues

_In progress..._
32 changes: 0 additions & 32 deletions assets/docs/readme-header.svg

This file was deleted.

4 changes: 2 additions & 2 deletions assets/videos/screencast.kdenlive
Git LFS file not shown
1 change: 1 addition & 0 deletions docs/FAQ.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_In progress..._
52 changes: 52 additions & 0 deletions docs/WELCOME.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Welcome to OpenAI Forge!

## Getting Started

### 1. Install OpenAI Forge Browser Extension

- [Brave](https://chrome.google.com/webstore/detail/openai-forge/nnppeeohaoogddcihgdpcolkmibbkked)
- [Chrome](https://chrome.google.com/webstore/detail/openai-forge/nnppeeohaoogddcihgdpcolkmibbkked)
- [Firefox](https://addons.mozilla.org/en-US/firefox/addon/openai-forge/)

### 2. Open a workspace (if not already done)

### 3. Configure the Evaluator

What the heck is an **Evaluator**?

It's a combination of files extension with a command able to generate error when compiling or linting those files.

OpenAI Forge use this command to detect errors in your code and send them to ChatGPT, along with the documents you selected, to automatically prompt for a fixed version of your code.

This command is called:
`OpenAI Forge: Evaluate errors and send them with the current document or stack` (<kbd>SHIFT + F, E</kbd>).

### 4. Open a [ChatGPT](https://chat.openai.com) chat in your browser

### 5. Add a few documents to your stack (or not)

Run the command `OpenAI Forge: Add/Remove current document to/from the stack` (<kbd>SHIFT + F, A</kbd>)
to select/unselect your currently edited document.

You can see them in the status bar:

![Stack](stack.png)
<br>

Or don't, if you just want to send your currently edited document alone.

### 6. Send them to ChatGPT

Run the command `OpenAI Forge: Send current document or stack` (<kbd>SHIFT + F, S</kbd>).

### 7. Useful Key Bindings

All OpenAI Forge default key bindings start with <kbd>SHIFT + F</kbd> (**F** for **F**orge):

- <kbd>SHIFT + F, A</kbd>: `OpenAI Forge: Add/Remove current document to/from the stack`
- <kbd>SHIFT + F, E</kbd>: `OpenAI Forge: Evaluate errors and send them with the current document or stack`
- <kbd>SHIFT + F, S</kbd>: `OpenAI Forge: Send current document or stack`

### 8. Star [my repo](https://github.com/ivangabriele/openai-forge-vsce) if you like it 🥰

### 9. May the Forge be with you 🔨!
Binary file added docs/stack.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit c2672d6

Please sign in to comment.