diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..0ef8388 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,23 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "ts-node", + "type": "node", + "request": "launch", + "args": [ + "${relativeFile}" + ], + "runtimeArgs": [ + "-r", + "ts-node/register" + ], + "cwd": "${workspaceRoot}", + "protocol": "inspector", + "internalConsoleOptions": "openOnSessionStart" + } + ] +} \ No newline at end of file diff --git a/commenter.ts b/commenter.ts new file mode 100644 index 0000000..66af5a6 --- /dev/null +++ b/commenter.ts @@ -0,0 +1,12 @@ +import { ChatGPTAPI } from 'chatgpt' + +const api_key = "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" + +async function example() { + const api = new ChatGPTAPI({ + apiKey: api_key, + }) + + const res = await api.sendMessage('beri satu kata-kata bijak atau motivasi atau galau') + console.log(res.text) +}