Compare commits

..

No commits in common. "main" and "0.2.2" have entirely different histories.
main ... 0.2.2

5 changed files with 6 additions and 21 deletions

View File

@ -4,15 +4,6 @@ Version History
## [Unreleased] ## [Unreleased]
## [Release 0.2.3]
## What's Changed
* fix(display-html): html is now properly displayed by @Iheuzio in https://github.com/Iheuzio/gpt-contextfiles/pull/38
* Release 0.2.3 by @Iheuzio in https://github.com/Iheuzio/gpt-contextfiles/pull/39
**Full Changelog**: https://github.com/Iheuzio/gpt-contextfiles/compare/0.2.2...0.2.3
## [Release 0.2.2] ## [Release 0.2.2]
## What's Changed ## What's Changed

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "gpt-contextfiles", "name": "gpt-contextfiles",
"version": "0.2.3", "version": "0.2.1",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "gpt-contextfiles", "name": "gpt-contextfiles",
"version": "0.2.3", "version": "0.2.1",
"dependencies": { "dependencies": {
"openai": "^3.3.0" "openai": "^3.3.0"
}, },

View File

@ -2,7 +2,7 @@
"name": "gpt-contextfiles", "name": "gpt-contextfiles",
"displayName": "GPT-ContextFiles", "displayName": "GPT-ContextFiles",
"description": "Choose the files to pass into GPT to provide a question with multiple files", "description": "Choose the files to pass into GPT to provide a question with multiple files",
"version": "0.2.3", "version": "0.2.2",
"engines": { "engines": {
"vscode": "^1.79.0" "vscode": "^1.79.0"
}, },

View File

@ -39,7 +39,7 @@ async function handleQuestionSubmission(panel, question, selectedUris) {
const chatCompletion = await openai.createChatCompletion({ const chatCompletion = await openai.createChatCompletion({
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. Put codeblocks inside ``` code ``` with file names above each snippet." }, { 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},
], ],
}); });

View File

@ -304,19 +304,13 @@ function getWebviewContent(apiResponse = '', question = '') {
</div> </div>
<div class="content" id="api-response"> <div class="content" id="api-response">
<div id="question-rep"> <div id="question-rep">
<p>${ <p>${question ? '> ' + question : null}</p>
question = question.replace(/</g, '&lt;').replace(/>/g, '&gt;'),
question ? '> ' + question : null
}</p>
</div> </div>
${ ${
apiResponse ? ` apiResponse ? `
<div id="rendered"> <div id="rendered">
<p id="responses"> <p id="responses">
<pre id="response">${ <pre id="response">${apiResponse.replace(/```([^```]+)```/g, '<div id="code-block"><code>$1</code><button onclick="copyCode(event)" id="copy-button">copy</button></div>')}</pre>
apiResponse = apiResponse.replace(/</g, '&lt;').replace(/>/g, '&gt;'),
apiResponse.replace(/```([^```]+)```/g, '<div id="code-block"><code>$1</code><button onclick="copyCode(event)" id="copy-button">copy</button></div>')
}</pre>
</p> </p>
</div> </div>
` : null ` : null