mirror of
https://github.com/tcsenpai/spacellama.git
synced 2025-06-13 06:27:18 +00:00
customizable system prompt
This commit is contained in:
parent
0c7ed8afff
commit
f90b62070d
@ -6,50 +6,58 @@ browser.browserAction.onClicked.addListener(() => {
|
|||||||
|
|
||||||
browser.runtime.onMessage.addListener((request, sender, sendResponse) => {
|
browser.runtime.onMessage.addListener((request, sender, sendResponse) => {
|
||||||
if (request.action === "summarize") {
|
if (request.action === "summarize") {
|
||||||
summarizeContent(request.content)
|
summarizeContent(request.content, request.systemPrompt)
|
||||||
.then(summary => {
|
.then((summary) => {
|
||||||
sendResponse({ summary });
|
sendResponse({ summary });
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch((error) => {
|
||||||
console.error('Error in summarizeContent:', error);
|
console.error("Error in summarizeContent:", error);
|
||||||
sendResponse({ error: error.toString(), details: error.details });
|
sendResponse({ error: error.toString(), details: error.details });
|
||||||
});
|
});
|
||||||
return true; // Indicates that we will send a response asynchronously
|
return true; // Indicates that we will send a response asynchronously
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
async function summarizeContent(content) {
|
async function summarizeContent(content, systemPrompt) {
|
||||||
const settings = await browser.storage.local.get(['ollamaEndpoint', 'ollamaModel']);
|
const settings = await browser.storage.local.get([
|
||||||
const endpoint = `${settings.ollamaEndpoint || 'http://localhost:11434'}/api/generate`;
|
"ollamaEndpoint",
|
||||||
const model = settings.ollamaModel || 'llama2';
|
"ollamaModel",
|
||||||
|
]);
|
||||||
|
const endpoint = `${
|
||||||
|
settings.ollamaEndpoint || "http://localhost:11434"
|
||||||
|
}/api/generate`;
|
||||||
|
const model = settings.ollamaModel || "llama3.1:8b";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
console.log(`Using system prompt: ${systemPrompt}`);
|
||||||
const response = await fetch(endpoint, {
|
const response = await fetch(endpoint, {
|
||||||
method: 'POST',
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
"Content-Type": "application/json",
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
prompt: `Summarize the following text:\n\n${content}`,
|
prompt: `${systemPrompt}\n\nFollow the above instructions and summarize the following text:\n\n${content}`,
|
||||||
model: model,
|
model: model,
|
||||||
stream: false
|
stream: false,
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
const errorText = await response.text();
|
const errorText = await response.text();
|
||||||
throw new Error(`HTTP error! status: ${response.status}, message: ${errorText}`);
|
throw new Error(
|
||||||
|
`HTTP error! status: ${response.status}, message: ${errorText}`
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
return data.response;
|
return data.response;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error details:', error);
|
console.error("Error details:", error);
|
||||||
error.details = {
|
error.details = {
|
||||||
endpoint: endpoint,
|
endpoint: endpoint,
|
||||||
model: model,
|
model: model,
|
||||||
message: error.message
|
message: error.message,
|
||||||
};
|
};
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,90 +1,104 @@
|
|||||||
body {
|
body {
|
||||||
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
background-color: #f5f5f5;
|
background-color: #f5f5f5;
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
max-width: 600px;
|
max-width: 600px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
padding: 40px 20px;
|
padding: 40px 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
margin-bottom: 30px;
|
margin-bottom: 30px;
|
||||||
color: #2c3e50;
|
color: #2c3e50;
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-group {
|
.form-group {
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
label {
|
label {
|
||||||
display: block;
|
display: block;
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: #34495e;
|
color: #34495e;
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-group {
|
.input-group {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
input[type="text"] {
|
input[type="text"] {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
border: 1px solid #bdc3c7;
|
border: 1px solid #bdc3c7;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
transition: border-color 0.3s ease;
|
transition: border-color 0.3s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
input[type="text"]:focus {
|
input[type="text"]:focus {
|
||||||
outline: none;
|
outline: none;
|
||||||
border-color: #3498db;
|
border-color: #3498db;
|
||||||
}
|
}
|
||||||
|
|
||||||
.status-indicator {
|
.status-indicator {
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn {
|
.btn {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding: 10px 20px;
|
padding: 10px 20px;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
border: none;
|
border: none;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: background-color 0.3s ease;
|
transition: background-color 0.3s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-primary {
|
.btn-primary {
|
||||||
background-color: #3498db;
|
background-color: #3498db;
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.btn-primary:hover {
|
.btn-primary:hover {
|
||||||
background-color: #2980b9;
|
background-color: #2980b9;
|
||||||
}
|
}
|
||||||
|
|
||||||
.status-message {
|
.status-message {
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
.status-message.success {
|
.status-message.success {
|
||||||
background-color: #2ecc71;
|
background-color: #2ecc71;
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
.status-message.error {
|
.status-message.error {
|
||||||
background-color: #e74c3c;
|
background-color: #e74c3c;
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
textarea {
|
||||||
|
width: 100%;
|
||||||
|
padding: 10px;
|
||||||
|
font-size: 16px;
|
||||||
|
border: 1px solid #bdc3c7;
|
||||||
|
border-radius: 5px;
|
||||||
|
transition: border-color 0.3s ease;
|
||||||
|
resize: vertical;
|
||||||
|
}
|
||||||
|
textarea:focus {
|
||||||
|
outline: none;
|
||||||
|
border-color: #3498db;
|
||||||
|
}
|
||||||
|
@ -1,30 +1,38 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>OLLAMA Summarizer Settings</title>
|
<title>OLLAMA Summarizer Settings</title>
|
||||||
<link rel="stylesheet" type="text/css" href="options.css">
|
<link rel="stylesheet" type="text/css" href="options.css" />
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<h1>OLLAMA Summarizer Settings</h1>
|
<h1>OLLAMA Summarizer Settings</h1>
|
||||||
<form id="settings-form">
|
<form id="settings-form">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="endpoint">OLLAMA Endpoint:</label>
|
<label for="endpoint">OLLAMA Endpoint:</label>
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input type="text" id="endpoint" placeholder="http://localhost:11434">
|
<input
|
||||||
<span id="endpoint-status" class="status-indicator"></span>
|
type="text"
|
||||||
|
id="endpoint"
|
||||||
|
placeholder="http://localhost:11434"
|
||||||
|
/>
|
||||||
|
<span id="endpoint-status" class="status-indicator"></span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="form-group">
|
||||||
<div class="form-group">
|
<label for="model">OLLAMA Model:</label>
|
||||||
<label for="model">OLLAMA Model:</label>
|
<input type="text" id="model" placeholder="llama2" />
|
||||||
<input type="text" id="model" placeholder="llama2">
|
</div>
|
||||||
</div>
|
<button type="submit" class="btn btn-primary">Save Settings</button>
|
||||||
<button type="submit" class="btn btn-primary">Save Settings</button>
|
<div class="form-group">
|
||||||
</form>
|
<label for="system-prompt">System Prompt:</label>
|
||||||
<div id="status" class="status-message"></div>
|
<textarea id="system-prompt" rows="3" class="form-control"></textarea>
|
||||||
</div>
|
</div>
|
||||||
<script src="options.js"></script>
|
</form>
|
||||||
</body>
|
<div id="status" class="status-message"></div>
|
||||||
</html>
|
</div>
|
||||||
|
<script src="options.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
@ -3,58 +3,67 @@ async function validateEndpoint(endpoint) {
|
|||||||
const response = await fetch(`${endpoint}/api/tags`);
|
const response = await fetch(`${endpoint}/api/tags`);
|
||||||
return response.ok;
|
return response.ok;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error validating endpoint:', error);
|
console.error("Error validating endpoint:", error);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateEndpointStatus(isValid) {
|
function updateEndpointStatus(isValid) {
|
||||||
const statusElement = document.getElementById('endpoint-status');
|
const statusElement = document.getElementById("endpoint-status");
|
||||||
statusElement.textContent = isValid ? '✅' : '❌';
|
statusElement.textContent = isValid ? "✅" : "❌";
|
||||||
statusElement.title = isValid ? 'Endpoint is valid' : 'Endpoint is invalid';
|
statusElement.title = isValid ? "Endpoint is valid" : "Endpoint is invalid";
|
||||||
}
|
}
|
||||||
|
|
||||||
async function saveOptions(e) {
|
async function saveOptions(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
const endpoint = document.getElementById('endpoint').value;
|
const endpoint = document.getElementById("endpoint").value;
|
||||||
const model = document.getElementById('model').value;
|
const model = document.getElementById("model").value;
|
||||||
const status = document.getElementById('status');
|
const systemPrompt = document.getElementById("system-prompt").value;
|
||||||
|
const status = document.getElementById("status");
|
||||||
// Ensure the endpoint doesn't end with /api/generate
|
// Ensure the endpoint doesn't end with /api/generate
|
||||||
const cleanEndpoint = endpoint.replace(/\/api\/generate\/?$/, '');
|
const cleanEndpoint = endpoint.replace(/\/api\/generate\/?$/, "");
|
||||||
|
status.textContent = "Validating endpoint...";
|
||||||
status.textContent = 'Validating endpoint...';
|
|
||||||
const isValid = await validateEndpoint(cleanEndpoint);
|
const isValid = await validateEndpoint(cleanEndpoint);
|
||||||
updateEndpointStatus(isValid);
|
updateEndpointStatus(isValid);
|
||||||
|
|
||||||
if (isValid) {
|
if (isValid) {
|
||||||
browser.storage.local.set({
|
browser.storage.local
|
||||||
ollamaEndpoint: cleanEndpoint,
|
.set({
|
||||||
ollamaModel: model
|
ollamaEndpoint: cleanEndpoint,
|
||||||
}).then(() => {
|
ollamaModel: model,
|
||||||
status.textContent = 'Options saved and endpoint validated.';
|
systemPrompt: systemPrompt,
|
||||||
setTimeout(() => {
|
})
|
||||||
status.textContent = '';
|
.then(() => {
|
||||||
}, 2000);
|
status.textContent = "Options saved and endpoint validated.";
|
||||||
});
|
setTimeout(() => {
|
||||||
|
status.textContent = "";
|
||||||
|
}, 2000);
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
status.textContent = 'Invalid endpoint. Please check the URL and try again.';
|
status.textContent =
|
||||||
|
"Invalid endpoint. Please check the URL and try again.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function restoreOptions() {
|
async function restoreOptions() {
|
||||||
const result = await browser.storage.local.get(['ollamaEndpoint', 'ollamaModel']);
|
const result = await browser.storage.local.get([
|
||||||
const endpoint = result.ollamaEndpoint || 'http://localhost:11434';
|
"ollamaEndpoint",
|
||||||
document.getElementById('endpoint').value = endpoint;
|
"ollamaModel",
|
||||||
document.getElementById('model').value = result.ollamaModel || 'llama2';
|
"systemPrompt",
|
||||||
|
]);
|
||||||
|
const endpoint = result.ollamaEndpoint || "http://localhost:11434";
|
||||||
|
const defaultSystemPrompt = "You are a helpful AI assistant. Summarize the given text concisely.";
|
||||||
|
document.getElementById("endpoint").value = endpoint;
|
||||||
|
document.getElementById("model").value = result.ollamaModel || "llama2";
|
||||||
|
document.getElementById("system-prompt").value = result.systemPrompt || defaultSystemPrompt;
|
||||||
const isValid = await validateEndpoint(endpoint);
|
const isValid = await validateEndpoint(endpoint);
|
||||||
updateEndpointStatus(isValid);
|
updateEndpointStatus(isValid);
|
||||||
}
|
}
|
||||||
|
|
||||||
document.addEventListener('DOMContentLoaded', restoreOptions);
|
document.addEventListener("DOMContentLoaded", restoreOptions);
|
||||||
document.getElementById('settings-form').addEventListener('submit', saveOptions);
|
document
|
||||||
document.getElementById('endpoint').addEventListener('blur', async (e) => {
|
.getElementById("settings-form")
|
||||||
|
.addEventListener("submit", saveOptions);
|
||||||
|
document.getElementById("endpoint").addEventListener("blur", async (e) => {
|
||||||
const isValid = await validateEndpoint(e.target.value);
|
const isValid = await validateEndpoint(e.target.value);
|
||||||
updateEndpointStatus(isValid);
|
updateEndpointStatus(isValid);
|
||||||
});
|
});
|
||||||
|
@ -87,4 +87,39 @@ h1 {
|
|||||||
|
|
||||||
#open-options {
|
#open-options {
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.form-group {
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
label {
|
||||||
|
display: block;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
textarea {
|
||||||
|
width: 100%;
|
||||||
|
padding: 10px;
|
||||||
|
border: 1px solid #ccc;
|
||||||
|
border-radius: 4px;
|
||||||
|
resize: vertical;
|
||||||
|
}
|
||||||
|
|
||||||
|
#save-prompt {
|
||||||
|
margin-top: 10px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#summary, #system-prompt {
|
||||||
|
user-select: text;
|
||||||
|
-webkit-user-select: text;
|
||||||
|
-moz-user-select: text;
|
||||||
|
-ms-user-select: text;
|
||||||
|
}
|
||||||
|
|
||||||
|
#summary {
|
||||||
|
white-space: pre-wrap;
|
||||||
|
word-wrap: break-word;
|
||||||
|
}
|
||||||
|
@ -11,8 +11,13 @@
|
|||||||
<h1>OLLAMA Summarizer</h1>
|
<h1>OLLAMA Summarizer</h1>
|
||||||
<button id="summarize" class="btn btn-primary">Summarize</button>
|
<button id="summarize" class="btn btn-primary">Summarize</button>
|
||||||
<div id="summary" class="summary-container"></div>
|
<div id="summary" class="summary-container"></div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="system-prompt">System Prompt:</label>
|
||||||
|
<textarea id="system-prompt" rows="3" class="form-control"></textarea>
|
||||||
|
</div>
|
||||||
|
<button id="save-prompt" class="btn btn-secondary">Save Prompt</button>
|
||||||
<button id="open-options" class="btn btn-secondary">Open Settings</button>
|
<button id="open-options" class="btn btn-secondary">Open Settings</button>
|
||||||
</div>
|
</div>
|
||||||
<script src="sidebar.js"></script>
|
<script src="sidebar.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -1,28 +1,37 @@
|
|||||||
document.addEventListener('DOMContentLoaded', () => {
|
document.addEventListener("DOMContentLoaded", () => {
|
||||||
const summarizeButton = document.getElementById('summarize');
|
const summarizeButton = document.getElementById("summarize");
|
||||||
const summaryDiv = document.getElementById('summary');
|
const summaryDiv = document.getElementById("summary");
|
||||||
const openOptionsButton = document.getElementById('open-options');
|
const openOptionsButton = document.getElementById("open-options");
|
||||||
|
|
||||||
summarizeButton.addEventListener('click', () => {
|
summarizeButton.addEventListener("click", () => {
|
||||||
summaryDiv.innerHTML = '<p>Summarizing...</p>';
|
summaryDiv.innerHTML = "<p>Summarizing...</p>";
|
||||||
summarizeButton.disabled = true;
|
summarizeButton.disabled = true;
|
||||||
|
|
||||||
browser.tabs.query({ active: true, currentWindow: true }, (tabs) => {
|
browser.tabs.query({ active: true, currentWindow: true }, (tabs) => {
|
||||||
browser.tabs.sendMessage(tabs[0].id, { action: "getContent" }, (response) => {
|
browser.tabs.sendMessage(
|
||||||
|
tabs[0].id,
|
||||||
|
{ action: "getContent" },
|
||||||
|
(response) => {
|
||||||
if (browser.runtime.lastError) {
|
if (browser.runtime.lastError) {
|
||||||
handleError('Error getting page content: ' + browser.runtime.lastError.message);
|
handleError(
|
||||||
|
"Error getting page content: " + browser.runtime.lastError.message
|
||||||
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (response && response.content) {
|
if (response && response.content) {
|
||||||
|
const systemPrompt = systemPromptTextarea.value;
|
||||||
browser.runtime.sendMessage(
|
browser.runtime.sendMessage(
|
||||||
{ action: "summarize", content: response.content },
|
{ action: "summarize", content: response.content, systemPrompt: systemPrompt },
|
||||||
(response) => {
|
(response) => {
|
||||||
if (browser.runtime.lastError) {
|
if (browser.runtime.lastError) {
|
||||||
handleError('Error during summarization: ' + browser.runtime.lastError.message);
|
handleError(
|
||||||
|
"Error during summarization: " +
|
||||||
|
browser.runtime.lastError.message
|
||||||
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (response && response.summary) {
|
if (response && response.summary) {
|
||||||
// Render the Markdown content
|
// Render the Markdown content
|
||||||
summaryDiv.innerHTML = marked.parse(response.summary);
|
summaryDiv.innerHTML = marked.parse(response.summary);
|
||||||
@ -35,22 +44,39 @@ document.addEventListener('DOMContentLoaded', () => {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
handleError('Error: Could not retrieve page content.');
|
handleError("Error: Could not retrieve page content.");
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
});
|
);
|
||||||
});
|
});
|
||||||
|
});
|
||||||
openOptionsButton.addEventListener('click', () => {
|
|
||||||
browser.runtime.openOptionsPage();
|
openOptionsButton.addEventListener("click", () => {
|
||||||
});
|
browser.runtime.openOptionsPage();
|
||||||
|
});
|
||||||
function handleError(errorMessage, details = null) {
|
|
||||||
console.error("Error:", errorMessage, details);
|
function handleError(errorMessage, details = null) {
|
||||||
summaryDiv.innerHTML = `<p>Error: ${errorMessage}</p>`;
|
console.error("Error:", errorMessage, details);
|
||||||
if (details) {
|
summaryDiv.innerHTML = `<p>Error: ${errorMessage}</p>`;
|
||||||
summaryDiv.innerHTML += `<pre>${JSON.stringify(details, null, 2)}</pre>`;
|
if (details) {
|
||||||
}
|
summaryDiv.innerHTML += `<pre>${JSON.stringify(details, null, 2)}</pre>`;
|
||||||
summarizeButton.disabled = false;
|
|
||||||
}
|
}
|
||||||
});
|
summarizeButton.disabled = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const systemPromptTextarea = document.getElementById("system-prompt");
|
||||||
|
const savePromptButton = document.getElementById("save-prompt");
|
||||||
|
|
||||||
|
// Load saved system prompt
|
||||||
|
browser.storage.local.get("systemPrompt").then((result) => {
|
||||||
|
const defaultSystemPrompt = "You are a helpful AI assistant. Summarize the given text concisely.";
|
||||||
|
systemPromptTextarea.value = result.systemPrompt || defaultSystemPrompt;
|
||||||
|
});
|
||||||
|
|
||||||
|
savePromptButton.addEventListener("click", () => {
|
||||||
|
const systemPrompt = systemPromptTextarea.value;
|
||||||
|
browser.storage.local.set({ systemPrompt }).then(() => {
|
||||||
|
alert("System prompt saved successfully!");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user