Skip to content

Commit

Permalink
Explanation section Update
Browse files Browse the repository at this point in the history
  • Loading branch information
kashifalikhan36 committed Dec 2, 2024
1 parent 5c3ae00 commit 89f6997
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions LeakCode/public/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,23 @@ setTimeout(async () => {
});

const response = await session.prompt(element.textContent);
console.log("1 ok");
console.log(response);

// const session_2 = await ai.languageModel.create({
// systemPrompt:
// "Pretend to be a LeetCode master. I will provide you with a code , and your task is to give me shortest and easiest explanation in very short and simple way and in simple and short steps of it with new lines. Do not modify or rewrite the code. Just explain how the code works and what it does.",
// });
const session_2 = await ai.languageModel.create({
systemPrompt:
"Pretend to be a LeetCode master. I will provide you with a code , and your task is to give me shortest and easiest explanation in very short and simple way and in simple and short steps of it with new lines. Do not modify or rewrite the code. Just explain how the code works and what it does.",
});

// const response_2 = await session_2.prompt(element.textContent);
// console.log("2 ok");
const response_2 = await session_2.prompt(element.textContent);
console.log(response_2);

const session_3 = await ai.languageModel.create({
systemPrompt:
"You have to Pretend like a Youtube Video Searecher. I will give you the code and You will write a query to serach in 4-8 words only for youtube to get right video of it . Example:- 'two sum question leetcode' ",
});

const response_3 = await session_3.prompt(element.textContent);
console.log("3 ok");
let explain = "This Section is in Under Development";
console.log(response_3);

function openCodeViewerPage(code, explain, query) {
// Encode the code to be URL-safe
Expand All @@ -59,7 +58,7 @@ setTimeout(async () => {
}

// Call the function to open the new page with the code
openCodeViewerPage(response, explain, response_3);
openCodeViewerPage(response, response_2, response_3);
} catch (error) {
console.error("Error interacting with the language model:", error);
}
Expand Down

0 comments on commit 89f6997

Please sign in to comment.