Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1873189

Browse files
committed
improved prompt for solution code, more letter spacing for analyze code response
1 parent 9c5f1b5 commit 1873189

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

‎src/popup/popup.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ a {
205205

206206
#analyze-code-response {
207207
white-space: pre-wrap;
208+
letter-spacing: 1px;
208209
}
209210

210211
#fix-code-container {

‎src/popup/popup.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,15 @@ function processCode(
163163
}
164164
else if (action === 'fix') {
165165
prompt = `
166-
As an experienced software engineer, analyze and provide a clear and concise solution for the
167-
Leetcode problem: ${problemTitle}. Prioritize a clean and efficient solution.
168-
Format your response in the following way:
169-
- Keep the explanation minimal and straightforward
170-
- Show code only without excessive comments
171-
- Ensure the solution is correct for all edge cases
172-
173-
Here's the problem details: ${codeText}`;
166+
As a coding professional, I need your expertise with a specific LeetCode problem named ${problemTitle}.
167+
Please follow the instructions:
168+
1. If no code is provided: Generate an efficient and accurate solution for the problem.
169+
2. If code is provided and contains errors: Identify the issues, correct them, and optimize the code if possible.
170+
3. If the provided code is already correct and optimized: Simply return it as-is.
171+
IMPORTANT: Your response should only include the function definition and code solution in plain text format (no backticks, code blocks, or additional formatting).
172+
Do not explain your solution or provide any additional information other than the code.
173+
Here's the problem description, restraints, examples, and code:\n
174+
${codeText}`
174175
if (infoMessage) infoMessage.textContent = 'Getting solution code ...';
175176

176177
if (fixCodeContainer) fixCodeContainer.classList.remove('hidden');

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /