@sl-code-lords/openai-chatgpt
Version:
Open AI chatgpt - API
78 lines (49 loc) • 1.58 kB
Markdown
<p align="center">
<a href="" rel="noopener">
<img width=100px height=100px src="https://1000logos.net/wp-content/uploads/2023/02/ChatGPT-Logo.png" alt="YT5S"></a>
</p>
<h2 align="center">OpenAI chatGPT - API</h2>
- [About](
- [Getting Started](
- [Usage](
- [Authors](
API <a href="https://openai.com/" > [https://openai.com/] </a>
This project was created using chatgpt 3.5 edition
You can find your API key at https://platform.openai.com/account/api-keys
```sh
yarn add @sl-code-lords/openai-chatgpt
```
or
```sh
npm i @sl-code-lords/openai-chatgpt
```
```ts
const openai = require("@sl-code-lords/openai-chatgpt")
```
```ts
var result = await openai.chatgpt({api_key: "your_chatgpt_api", message: "Hello World!"})
```
```ts
//result
{
status: true,
code_creator: { name: 'Sisula Welgamage', github: '@sisula' },
result: {
model: 'gpt-3.5-turbo-0613',
created: 1690112224,
message: 'Hello! How can I assist you today?'
}
}
```
```ts
await openai.reset_session()
```
- [@sisula welgamage](https://github.com/sisula) - project author
See also the list of [contributors](https://github.com/SL-CODE-LORDS/openai-chatgpt/contributors) who participated in this project.