diff --git a/extension.js b/extension.js index 7302d59..42ba463 100644 --- a/extension.js +++ b/extension.js @@ -98,7 +98,7 @@ async function handleQuestionSubmission(panel, question, selectedUris) { // Call OpenAI API with the question and file contents try { const chatCompletion = await openai.createChatCompletion({ - model: "gpt-3.5-turbo-16k", + model: "gpt-3.5-turbo", messages: [ { 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}, @@ -418,17 +418,41 @@ function getWebviewContent(apiResponse = '', question = '') { } #code-block { - padding: 0; - background: none; + padding: 10px 0 10px 10px; + padding- + border-radius: 5px; + background-color: black; border: none; font: inherit; color: inherit; cursor: pointer; outline: inherit; - margin: 0; width: 100%; text-align: left; + display: inline-block; + position: relative; } + + #copy-button { + padding: 5px; + border-radius: 5px; + background-color: #007acc; + border: none; + font: inherit; + color: #fff; + cursor: pointer; + outline: inherit; + margin: 5px; + position: absolute; + top: 0; + right: 0; + } + + #copy-button:hover { + background-color: #fff; + color: #000; + } + @@ -455,7 +479,7 @@ function getWebviewContent(apiResponse = '', question = '') { apiResponse ? `
-
${apiResponse.replace(/```([^```]+)```/g, '')}+
${apiResponse.replace(/```([^```]+)```/g, '')}$1