Skip to content

Commit a0adcec

Browse files
committed
update error message
1 parent 34de1fc commit a0adcec

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/popup/popup.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ function initActionButton(buttonId: string, action: string, chatGPTProvider: Cha
7777
if (codeText) {
7878
processCode(chatGPTProvider, codeText, action);
7979
} else {
80-
const errorMessage = "Unable to retrieve code. Please open a Leetcode problem's description page and refresh the page.";
80+
const errorMessage = "Cannot read from page. Please open a Leetcode problem and refresh the page.";
8181
setInfoMessage(errorMessage, 5000);
8282
}
8383
};
@@ -121,11 +121,10 @@ function processCode(
121121
if (action === 'analyze') {
122122
prompt = `
123123
As an experienced software engineer, please analyze the code complexity of the Leetcode
124-
problem titled ${problemTitle} and the accompanying code below. Return only the time
125-
and space complexity of the function in big O notation. The space complexity should not
126-
include the output (return value) of the function. Your analysis should be direct and concise.
127-
You can provide a one sentence explanation of the time and space complexity. The problem
128-
description and code are provided below\n. ${codeText}`;
124+
problem titled ${problemTitle} and the accompanying code below. The output (return value) of
125+
the function should not be factored into the time and space complexity of the function.
126+
Return the time and space complexity of the function in big O notation. Your analysis should be direct and concise
127+
with no more than two sentences. The problem description and code are provided below\n. ${codeText}`;
129128
if (infoMessage) infoMessage.textContent = 'Analyzing code complexity ...';
130129
if (analyzeCodeResponse) analyzeCodeResponse.classList.remove('hidden');
131130
if (fixCodeContainer) fixCodeContainer.classList.add('hidden');
@@ -140,6 +139,7 @@ function processCode(
140139
2. If code is provided and contains errors: Identify the issues, correct them, and optimize the code if possible.
141140
3. If the provided code is already correct and optimized: Simply return it as-is.
142141
IMPORTANT: Your response should only include the function definition and code solution in plain text format (no backticks, code blocks, or additional formatting).
142+
Do not explain your solution or provide any additional information other than the code.
143143
Here's the problem description and code:\n
144144
${codeText}
145145
`

0 commit comments

Comments
 (0)