-
Notifications
You must be signed in to change notification settings - Fork 855
Expand file tree
/
Copy pathindex.mjs
More file actions
24 lines (22 loc) · 969 Bytes
/
index.mjs
File metadata and controls
24 lines (22 loc) · 969 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { cropText } from '../../../utils'
export default {
inputQuery: async () => {
try {
const title = document.querySelector('.title')?.textContent.trim()
const authors = document.querySelector('.authors')?.textContent
const abstract = document.querySelector('blockquote.abstract')?.textContent.trim()
return await cropText(
`You are a research assistant skilled in academic paper analysis. ` +
`Based on the provided paper abstract from a preprint site, generate a structured summary. ` +
`The summary should clearly outline: key findings, methodology, and conclusions. ` +
`Pay special attention to highlighting the main contributions of the paper. ` +
`Ensure the summary is concise and maintains an academic tone.\n` +
`Title: ${title}\n` +
`Authors: ${authors}\n` +
`Abstract: ${abstract}`,
)
} catch (e) {
console.log(e)
}
},
}