@danitech/chatgpt-api
Version:
ChatGPT API - TypeScript/JavaScript. ChatGPT API ini ditenagai oleh: https://daniapi.biz.id
76 lines (65 loc) • 1.74 kB
Markdown
ChatGPT API ini ditenagai oleh: <a href="https://daniapi.biz.id">daniapi.biz.id</a>
```bash
npm i @danitech/chatgpt-api
```
```bash
yarn add @danitech/chatgpt-api
```
```javascript
const chatGPTAPI = require('@danitech/chatgpt-api');
```
```javascript
import chatGPTAPI from '@danitech/chatgpt-api';
```
```javascript
const { models } = chatGPTAPI;
const { chatGPT3, chatGPT35, chatGPT4 } = models;
// GPT-3 model
(async () => {
try {
const response = await chatGPT3('Hello, AI.');
console.log('ChatGPT-3:', response);
} catch (error) {
console.error('Error:', error);
}
})();
// GPT-3.5 model
(async () => {
try {
const response = await chatGPT35('Hello, AI.');
console.log('ChatGPT-3.5:', response);
} catch (error) {
console.error('Error:', error);
}
})();
// GPT-4 model
(async () => {
try {
const response = await chatGPT4('Hello, AI.');
console.log('ChatGPT-4:', response);
} catch (error) {
console.error('Error:', error);
}
})();
```
```text
ChatGPT-3: Hello! How can I assist you today?
ChatGPT-3.5: Hello! How can I assist you today?
ChatGPT-4: Hello! How can I assist you today?
```
* Pembuat / Pengembang: Dani Ramdani (Dani Techno.) - FullStack Engineer
* Kontak Pembuat / Pengembang: 0895 1254 5999 (WhatsApp), contact@danitechno.com (Email)
## Terimakasih Kepada
* Dani Techno. - FullStack Engineer (Pembuat / Pengembang)
* daniapi.biz.id (Penyedia JSON-API)