Created
April 24, 2023 17:55
-
-
Save adasq/bc3411716fec2dfd16aeebc5755bbc45 to your computer and use it in GitHub Desktop.
Keyboard Maestor > Actions > Execute Javascipt For Automation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var app = Application.currentApplication(); | |
app.includeStandardAdditions = true; | |
var OPENAI_TOKEN = 'YOUR TOKEN'; | |
result = JSON.parse(app.doShellScript(`curl https://api.openai.com/v1/completions -H "Content-Type: application/json" -H "Authorization: Bearer ${OPENAI_TOKEN}" -d '{"model": "text-davinci-003", "prompt": "how are you?", "temperature": 0.9, "max_tokens": 150}'`)) | |
app.displayAlert(result.choices[0].text); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment