You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Name: Fix Spelling and Grammar// Author: Kevin Kipp// Email: [email protected]// Twitter: https://twitter.com/kevin_kipp// Github: https://github.com/third774import'@johnlindquist/kit';importOpenAIfrom'openai';constopenai=newOpenAI({apiKey: awaitenv('OPENAI_API_KEY',{secret: true,}),});consttext=awaitgetSelectedText();constcompletion=awaitopenai.chat.completions.create({messages: [{role: 'user',content: `You are an editor and you are tasked with fixing the spelling and grammar of the following text:---Text to fix:${text}---The corrected text is:`,},],model: 'gpt-3.5-turbo',temperature: 0,});constinsertText=awaiteditor(completion.choices[0].message.content);awaitsetSelectedText(insertText);
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Open fix-spelling-and-grammar in Script Kit
Beta Was this translation helpful? Give feedback.
All reactions