5 Commits
1.4.1 ... main

Author SHA1 Message Date
rigoni
e1618679eb add mildstone 2024-11-21 12:43:01 +01:00
Achiya Elyasaf
42960a01a2 Update service-worker.js 2024-10-20 20:52:09 +03:00
Achiya Elyasaf
3a09eb1432 Update popup.js 2024-10-20 20:51:49 +03:00
Achiya Elyasaf
261a34484c Update service-worker.js 2024-10-20 20:49:51 +03:00
Achiya Elyasaf
32b11efa1a Update popup.js 2024-10-20 20:49:11 +03:00
5 changed files with 25 additions and 22 deletions

View File

@@ -21,6 +21,8 @@ It requires inserting an API key from [OpenAI](https://platform.openai.com/accou
You also need to choose which tools you wish to enable. See the [Issues](#issues) section if you have problems activating the tools. You also need to choose which tools you wish to enable. See the [Issues](#issues) section if you have problems activating the tools.
Change shortcuts: `chrome://extensions/shortcuts`
## Usage ## Usage
These are the tools that are currently available: These are the tools that are currently available:

View File

@@ -6,7 +6,7 @@
"content_scripts": [ "content_scripts": [
{ {
"js": ["scripts/jquery.js", "scripts/content.js"], "js": ["scripts/jquery.js", "scripts/content.js"],
"matches": ["https://*.overleaf.com/project/*"] "matches": ["https://*.overleaf.com/project/*", "https://*.mildstone.org/project/*"]
} }
], ],
"description": "LLM-based tools for Overleaf", "description": "LLM-based tools for Overleaf",
@@ -18,21 +18,21 @@
"commands": { "commands": {
"Complete": { "Complete": {
"suggested_key": { "suggested_key": {
"default": "Alt+C" "default": "Ctrl + Shift + C"
}, },
"description": "Complete selected text" "description": "Completa il testo selezionato"
}, },
"Improve": { "Improve": {
"suggested_key": { "suggested_key": {
"default": "Alt+I" "default": "Ctrl + Shift + I"
}, },
"description": "Improve selected text" "description": "Migliora il testo selezionato"
}, },
"Ask": { "Ask": {
"suggested_key": { "suggested_key": {
"default": "Alt+A" "default": "Ctrl + Shift + A"
}, },
"description": "Use the selected text to ask GPT. It adds to the beginning of the selected text: 'In Latex, '" "description": "Chiedi a Chat-GPT attraverso il testo selezionato"
} }
}, },
"background": { "background": {

View File

@@ -7,18 +7,18 @@
<link rel="stylesheet" href="/popup/jsoneditor.min.css"/> <link rel="stylesheet" href="/popup/jsoneditor.min.css"/>
</head> </head>
<body> <body>
<h1 class="extension-title">LeafLLM: an AI-powered Overleaf</h1> <h1 class="extension-title">LeafLLM</h1>
<div id="controls" class="form-container"> <div id="controls" class="form-container">
<div class="control"> <div class="control">
<div class="input" id="shortcut-Improve"><span>ALT</span><span>I</span></div> <div class="input" id="shortcut-Improve"><span>Alt</span><span>I</span></div>
<div class="effect">Improve selected text.</div> <div class="effect">Improve selected text.</div>
</div> </div>
<div class="control"> <div class="control">
<div class="input" id="shortcut-Complete"><span>ALT</span><span>C</span></div> <div class="input" id="shortcut-Complete"><span>Alt</span><span>C</span></div>
<div class="effect">Complete selected text.</div> <div class="effect">Complete selected text.</div>
</div> </div>
<div class="control"> <div class="control">
<div class="input" id="shortcut-Ask"><span>ALT</span><span>A</span></div> <div class="input" id="shortcut-Ask"><span>Alt</span><span>A</span></div>
<div class="effect">Ask GPT.</div> <div class="effect">Ask GPT.</div>
</div> </div>
</div> </div>

View File

@@ -11,19 +11,19 @@ const defaultConfigurations = {
max_tokens: 512, max_tokens: 512,
messages: [{ messages: [{
role: 'system', role: 'system',
content: 'You are an assistant in a Latex editor that continues the given text. No need to rewrite the given text' content: 'You are an assistant in a Latex editor, usually used for writing academic papers. Continues the given text. No need to rewrite the given text.'
}] }]
}, },
Improve: { Improve: {
messages: [{ messages: [{
role: 'system', role: 'system',
content: 'You are an assistant in a Latex editor that improves the given text' content: 'You are an assistant in a Latex editor, usually used for writing academic papers. Style and improves the given text.'
}] }]
}, },
Ask: { Ask: {
messages: [{ messages: [{
role: 'system', role: 'system',
content: 'You are an assistant in a Latex editor. Answer questions without introduction/explanations' content: 'You are an assistant in a Latex editor, usually used for writing academic papers. Address the given questions/request without introduction/explanations.'
}] }]
} }
} }

View File

@@ -5,34 +5,34 @@ const defaultConfigurations = {
base: { base: {
n: 1, n: 1,
temperature: 0.5, temperature: 0.5,
model: 'gpt-3.5-turbo' model: 'gpt-4-turbo'
}, },
Complete: { Complete: {
max_tokens: 512, max_tokens: 512,
messages: [{ messages: [{
role: 'system', role: 'system',
content: 'You are an assistant in a Latex editor that continues the given text. No need to rewrite the given text' content: 'You are an assistant in a Latex editor, usually used for writing academic papers. Continues the given text. No need to rewrite the given text.'
}] }]
}, },
Improve: { Improve: {
messages: [{ messages: [{
role: 'system', role: 'system',
content: 'You are an assistant in a Latex editor that improves the given text' content: 'You are an assistant in a Latex editor, usually used for writing academic papers. Style and improves the given text.'
}] }]
}, },
Ask: { Ask: {
messages: [{ messages: [{
role: 'system', role: 'system',
content: 'You are an assistant in a Latex editor. Answer questions without introduction/explanations' content: 'You are an assistant in a Latex editor, usually used for writing academic papers. Address the given questions/request without introduction/explanations.'
}] }]
} }
} }
} }
const settings = [ const settings = [
{ key: 'Complete', shortcut: 'Alt+C', status: 'enabled', type: 'Command' }, { key: 'Complete', shortcut: 'Ctrl + Shift + C', status: 'enabled', type: 'Command' },
{ key: 'Improve', shortcut: 'Alt+I', status: 'enabled', type: 'Command' }, { key: 'Improve', shortcut: 'Ctrl + Shift + I', status: 'enabled', type: 'Command' },
{ key: 'Ask', shortcut: 'Alt+A', status: 'enabled', type: 'Command' }, { key: 'Ask', shortcut: 'Ctrl + Shift + A', status: 'enabled', type: 'Command' },
{ key: 'RequestConfiguration', value: defaultConfigurations, type: 'Configuration' } { key: 'RequestConfiguration', value: defaultConfigurations, type: 'Configuration' }
] ]
@@ -89,6 +89,7 @@ async function setup() {
addListener('Improve') addListener('Improve')
addListener('Complete') addListener('Complete')
addListener('Ask') addListener('Ask')
console.log('LeafLLM service worker installed')
} }
setup() setup()