Skip to content

Commit

Permalink
feat: update
Browse files Browse the repository at this point in the history
  • Loading branch information
dhohirpradana authored Mar 7, 2023
1 parent ce42920 commit a576414
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
12 changes: 12 additions & 0 deletions commenter.ts
Original file line number Diff line number Diff line change
@@ -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)
}

0 comments on commit a576414

Please sign in to comment.