Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e1618679eb | ||
|
|
42960a01a2 | ||
|
|
3a09eb1432 | ||
|
|
261a34484c | ||
|
|
32b11efa1a |
@@ -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.
|
||||
|
||||
Change shortcuts: `chrome://extensions/shortcuts`
|
||||
|
||||
## Usage
|
||||
These are the tools that are currently available:
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"content_scripts": [
|
||||
{
|
||||
"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",
|
||||
@@ -18,21 +18,21 @@
|
||||
"commands": {
|
||||
"Complete": {
|
||||
"suggested_key": {
|
||||
"default": "Alt+C"
|
||||
"default": "Ctrl + Shift + C"
|
||||
},
|
||||
"description": "Complete selected text"
|
||||
"description": "Completa il testo selezionato"
|
||||
},
|
||||
"Improve": {
|
||||
"suggested_key": {
|
||||
"default": "Alt+I"
|
||||
"default": "Ctrl + Shift + I"
|
||||
},
|
||||
"description": "Improve selected text"
|
||||
"description": "Migliora il testo selezionato"
|
||||
},
|
||||
"Ask": {
|
||||
"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": {
|
||||
|
||||
@@ -7,18 +7,18 @@
|
||||
<link rel="stylesheet" href="/popup/jsoneditor.min.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<h1 class="extension-title">LeafLLM: an AI-powered Overleaf</h1>
|
||||
<h1 class="extension-title">LeafLLM</h1>
|
||||
<div id="controls" class="form-container">
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
</div>
|
||||
|
||||
@@ -11,19 +11,19 @@ const defaultConfigurations = {
|
||||
max_tokens: 512,
|
||||
messages: [{
|
||||
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: {
|
||||
messages: [{
|
||||
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: {
|
||||
messages: [{
|
||||
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.'
|
||||
}]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,34 +5,34 @@ const defaultConfigurations = {
|
||||
base: {
|
||||
n: 1,
|
||||
temperature: 0.5,
|
||||
model: 'gpt-3.5-turbo'
|
||||
model: 'gpt-4-turbo'
|
||||
},
|
||||
Complete: {
|
||||
max_tokens: 512,
|
||||
messages: [{
|
||||
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: {
|
||||
messages: [{
|
||||
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: {
|
||||
messages: [{
|
||||
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 = [
|
||||
{ key: 'Complete', shortcut: 'Alt+C', status: 'enabled', type: 'Command' },
|
||||
{ key: 'Improve', shortcut: 'Alt+I', status: 'enabled', type: 'Command' },
|
||||
{ key: 'Ask', shortcut: 'Alt+A', status: 'enabled', type: 'Command' },
|
||||
{ key: 'Complete', shortcut: 'Ctrl + Shift + C', status: 'enabled', type: 'Command' },
|
||||
{ key: 'Improve', shortcut: 'Ctrl + Shift + I', status: 'enabled', type: 'Command' },
|
||||
{ key: 'Ask', shortcut: 'Ctrl + Shift + A', status: 'enabled', type: 'Command' },
|
||||
{ key: 'RequestConfiguration', value: defaultConfigurations, type: 'Configuration' }
|
||||
]
|
||||
|
||||
@@ -89,6 +89,7 @@ async function setup() {
|
||||
addListener('Improve')
|
||||
addListener('Complete')
|
||||
addListener('Ask')
|
||||
console.log('LeafLLM service worker installed')
|
||||
}
|
||||
|
||||
setup()
|
||||
setup()
|
||||
|
||||
Reference in New Issue
Block a user