ts-chatgpt-api
Version:
ChatGPT API is a powerful tool developed on TypeScript that allows developers to easily integrate natural language processing capabilities into their applications. As a large language model trained by OpenAI, ChatGPT is capable of understanding and gener
10 lines (8 loc) • 329 B
text/typescript
import {API_KEY} from './api-key';
import ChatGptApi from '../src/chat-gpt-api';
(async () => {
const chatGptApi = new ChatGptApi(API_KEY);
chatGptApi.enableDebugging();
const response = await chatGptApi.getAnswer('write a short story about space');
console.log('resp', JSON.stringify(response, null, 4));
})();