-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathp.js
14 lines (12 loc) · 1.48 KB
/
p.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import {ChatGPTUnofficialProxyAPI} from 'chatgpt';
async function example() {
const api = new ChatGPTUnofficialProxyAPI({
accessToken:
'eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Ik1UaEVOVUpHTkVNMVFURTRNMEZCTWpkQ05UZzVNRFUxUlRVd1FVSkRNRU13UmtGRVFrRXpSZyJ9.eyJodHRwczovL2FwaS5vcGVuYWkuY29tL3Byb2ZpbGUiOnsiZW1haWwiOiIwMW11cXNpdGhAZ21haWwuY29tIiwiZW1haWxfdmVyaWZpZWQiOnRydWV9LCJodHRwczovL2FwaS5vcGVuYWkuY29tL2F1dGgiOnsicG9pZCI6Im9yZy1HM3l5bDNrb3hlMEpGMEJzeVNEdmI4NUciLCJ1c2VyX2lkIjoidXNlci1Ba0N4REVTbGlrU29rR2xOOEJKcXdCcmUifSwiaXNzIjoiaHR0cHM6Ly9hdXRoMC5vcGVuYWkuY29tLyIsInN1YiI6Imdvb2dsZS1vYXV0aDJ8MTEyMzUwNjQ4NzUzMzMwMjM5NTExIiwiYXVkIjpbImh0dHBzOi8vYXBpLm9wZW5haS5jb20vdjEiLCJodHRwczovL29wZW5haS5vcGVuYWkuYXV0aDBhcHAuY29tL3VzZXJpbmZvIl0sImlhdCI6MTcwNTY4NjIzNywiZXhwIjoxNzA2NTUwMjM3LCJhenAiOiJUZEpJY2JlMTZXb1RIdE45NW55eXdoNUU0eU9vNkl0RyIsInNjb3BlIjoib3BlbmlkIGVtYWlsIHByb2ZpbGUgbW9kZWwucmVhZCBtb2RlbC5yZXF1ZXN0IG9yZ2FuaXphdGlvbi5yZWFkIG9yZ2FuaXphdGlvbi53cml0ZSBvZmZsaW5lX2FjY2VzcyJ9.NlFCfAxOmyB1rqMfruJdR3UpvGb3jHKkYMGyiB0CHGHhsV4PVNVO7FFfJMbBsWDP-t_zGrpbahOHFWWMyLLkvReFXi5dY22TyxadIWIjHqK3J6TK9WCDokkdGtizzhupFVi6A1YCeS8SFXPT7D8bWuvuoARexw7JCQ6Q9Letpf1LE5ftNwCknLBvywWYAFJyZHz373GArU9mAXM4V35MBpCSkBW6l_ppoF7IrEQnNFBzCiTOOO8E9vjVmPPHbYVU1zUOJCwHOCDbSr8rPQRfCVPaEu3fdDFTolkEcjdmrgfoD_r5Rk6wIhJnnDK004r91J4QybxieppFpyg6OEwCGQ',
debug: false,
apiReverseProxyUrl: 'https://api.pawan.krd/v1/completions',
});
const res = await api.sendMessage('Hello World!');
console.log(res.text);
}
example();