Script Kit Logo
Script Kit
by John Lindquist

Scripts by ivryb

Correct selection with ChatGPT

ivryb's avatar
Ivan Rybnikov
// Name: Correct selection
// Description: Fix grammar and spelling mistakes in any text field.
// Author: Evan Fisher
// Twitter: @ivryb
// Shortcut: cmd option g
import '@johnlindquist/kit';
import Bottleneck from 'bottleneck';
import { createChat } from 'completions';
const openAiKey = await env('OPENAI_API_KEY', {
hint: `Grab a key from <a href="https://platform.openai.com/account/api-keys">here</a>`,
});
const chat = createChat({
apiKey: openAiKey,
model: 'gpt-3.5-turbo',
});
32 lines below • View full script