mirror of
https://github.com/Iheuzio/gpt-contextfiles.git
synced 2025-07-18 14:00:48 +00:00
Merge pull request #20 from Iheuzio/fix/update-readme
fix(assistant): Assistant would not answer reponse
This commit is contained in:
commit
fd56052233
20
README.md
20
README.md
@ -28,10 +28,19 @@ 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.
|
||||||
|
|
||||||
User must ctrl+shift+p and click on the `Open GPT Context Panel` option and then add files (before or after), then input the question.
|
- 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.
|
||||||
|
- Select the files uses checkboxes
|
||||||
|
- After submit is pressed, wait until the question disappears, this means the query is processed by openai and was fully sent
|
||||||
|
- Click `API Response` to view your query
|
||||||
|
|
||||||
# Examples
|
# Examples
|
||||||
|
|
||||||
|
Demo of how to use the extension:
|
||||||
|

|
||||||
|
|
||||||
|
# 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:
|
||||||
|
|
||||||
```
|
```
|
||||||
@ -40,14 +49,11 @@ c:\dev\test\gpt-contextfiles-test\program.js:
|
|||||||
\```
|
\```
|
||||||
window.alert("Hello World!")
|
window.alert("Hello World!")
|
||||||
\```
|
\```
|
||||||
|
```
|
||||||
|
|
||||||
|
Functions based on the principle of files passed into it
|
||||||
|
```
|
||||||
Selected Files:
|
Selected Files:
|
||||||
[x] c:\dev\test\gpt-contextfiles-test\program.js
|
[x] c:\dev\test\gpt-contextfiles-test\program.js
|
||||||
[ ] c:\dev\test\gpt-contextfiles-test\program2.js
|
[ ] c:\dev\test\gpt-contextfiles-test\program2.js
|
||||||
```
|
```
|
||||||
|
|
||||||
Expected Ouput:
|
|
||||||
|
|
||||||
`
|
|
||||||
The window.alert() method is a built-in JavaScript function that displays an alert box with a specified message and an OK button. In this case, the message is "Hello World!".
|
|
||||||
`
|
|
||||||
|
@ -101,8 +101,7 @@ async function handleQuestionSubmission(panel, question, selectedUris) {
|
|||||||
model: "gpt-3.5-turbo-16k",
|
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 },
|
{ role: "user", content: question + "\n" + fileContents},
|
||||||
{ role: "assistant", content: fileContents }
|
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -445,7 +444,7 @@ function getWebviewContent(apiResponse = '', question = '') {
|
|||||||
${
|
${
|
||||||
apiResponse ? `
|
apiResponse ? `
|
||||||
<div id="rendered">
|
<div id="rendered">
|
||||||
<p>${apiResponse}</p>
|
<p id="responses">${apiResponse}</p>
|
||||||
</div>
|
</div>
|
||||||
` : null
|
` : null
|
||||||
}
|
}
|
||||||
@ -481,6 +480,10 @@ function getWebviewContent(apiResponse = '', question = '') {
|
|||||||
|
|
||||||
function toggleApiResponse() {
|
function toggleApiResponse() {
|
||||||
const apiResponse = document.getElementById('api-response');
|
const apiResponse = document.getElementById('api-response');
|
||||||
|
var response = document.getElementById('responses');
|
||||||
|
if(response === null || response === 'null') {
|
||||||
|
return;
|
||||||
|
}
|
||||||
apiResponse.classList.toggle('active');
|
apiResponse.classList.toggle('active');
|
||||||
const content = apiResponse;
|
const content = apiResponse;
|
||||||
const collapsible = apiResponse.previousElementSibling;
|
const collapsible = apiResponse.previousElementSibling;
|
||||||
|
BIN
images/demo-program.gif
Normal file
BIN
images/demo-program.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 MiB |
Loading…
Reference in New Issue
Block a user