minor fixes

This commit is contained in:
Christopher 2023-06-26 18:28:32 -04:00
parent 7af3e2b332
commit 5350ea703c
5 changed files with 8 additions and 4 deletions

View File

@ -1,5 +1,7 @@
# gpt-contextfiles # gpt-contextfiles
![gpt-contextfiles viewport](extension.png)
> if you'll like to contribute or provide any feedback check out the [link](https://github.com/Iheuzio/gpt-contextfiles/issues) > if you'll like to contribute or provide any feedback check out the [link](https://github.com/Iheuzio/gpt-contextfiles/issues)
This extension uses the openai api, there are many models avaliable: This extension uses the openai api, there are many models avaliable:
@ -28,13 +30,15 @@ Submit -> Submits the query to the api
Refresh -> refreshes the window so that all new files will be available for that session. Refresh -> refreshes the window so that all new files will be available for that session.
Click -> Click the orange code and then paste it in your editor for fast coding
- Right click to add files to the context window - Right click to add files to the context window
- Click on the extension addon to open the context window, refresh to update the files to check. - Click on the extension addon to open the context window, refresh to update the files to check.
- Select the files uses checkboxes - Select the files uses checkboxes
- Wait for response to be returned - Wait for response to be returned
Other features:
![Copy button demonstration](copy-image.png)
- Click copy to to copy the snippet of code into your file for fast coding
# How it works # How it works
We can select two files we want to pass through, however we can uncheck one of them for later debugging and enter our question: We can select two files we want to pass through, however we can uncheck one of them for later debugging and enter our question:

View File

@ -98,7 +98,7 @@ async function handleQuestionSubmission(panel, question, selectedUris) {
// Call OpenAI API with the question and file contents // Call OpenAI API with the question and file contents
try { try {
const chatCompletion = await openai.createChatCompletion({ const chatCompletion = await openai.createChatCompletion({
model: "gpt-3.5-turbo", model: "gpt-3.5-turbo-16k",
messages: [ messages: [
{ role: "system", content: "Answer the coding questions, only provide the code and documentation, explaining the solution after providing the code." }, { role: "system", content: "Answer the coding questions, only provide the code and documentation, explaining the solution after providing the code." },
{ role: "user", content: question + "\n" + fileContents}, { role: "user", content: question + "\n" + fileContents},
@ -193,7 +193,7 @@ function getWebviewContent(apiResponse = '', question = '') {
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
width: 50%; width: 90%;
height: 100%; height: 100%;
margin: 0 auto; margin: 0 auto;
background-color: #1e1e1e; background-color: #1e1e1e;

BIN
images/copy-image.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 MiB

After

Width:  |  Height:  |  Size: 13 MiB

BIN
images/extension.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB