1.1.2 • Published 6 months ago

@danitech/chatgpt-api v1.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

ChatGPT API - TypeScript/JavaScript

ChatGPT API ini ditenagai oleh: daniapi.biz.id

Instalasi

Menggunakan Npm

npm i @danitech/chatgpt-api

Atau Menggunakan Yarn

yarn add @danitech/chatgpt-api

Cara Menggunakan

Import Module @danitech/chatgpt-api

CJS

const chatGPTAPI = require('@danitech/chatgpt-api');

ESM

import chatGPTAPI from '@danitech/chatgpt-api';

Contoh Kode Lengkap

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);
  }
})();

Hasil

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?

Informasi

  • 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)
1.1.2

6 months ago

1.1.1

6 months ago

1.1.0

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago