# bettergpt

> bettergpt is a node module that allows you to easily interact with the [ChatGPT](https://chat.openai.com/)

Latest version **1.0.5** (published 2023-09-10) · 0 weekly downloads

## Install

```sh
npm install bettergpt
pnpm add bettergpt
yarn add bettergpt
bun add bettergpt
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2023-09-10 |
| First published | 2023-09-10 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 20.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | borsuczyna |
| Keywords | openai, chatgpt, chat, gpt, gpt-3, gpt3, gpt-4, gpt4, chatbot, machine learning, ai, conversation, bot |

## Links

- npm: https://www.npmjs.com/package/bettergpt
- npm.io page: https://npm.io/package/bettergpt

## Dependencies (1)

- [eventsource-parser](https://npm.io/package/eventsource-parser.md) ^1.0.0

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 1.0.5 (latest) — 2023-09-10
- 1.0.4 — 2023-09-10
- 1.0.3 — 2023-09-10
- 1.0.2 — 2023-09-10
- 1.0.1 — 2023-09-10
- 1.0.0 — 2023-09-10

## README

# About

bettergpt is a node module that allows you to easily interact with the [ChatGPT](https://chat.openai.com/)

# Install
```bash
npm install bettergpt
```

# Example
```js
const { GPT } = require("bettergpt")

async function example() {
    let gpt = new GPT('your_api_key');
    gpt.useProxy('https://ai.fakeopen.com/api/conversation');

    let response = await gpt.sendMessage('hey!');
    console.log(response)
}

example()
```

### History
```ts
import GPT, { Message } from './bettergpt';

function example() {
    let gpt = new GPT('your_api_key');
    gpt.useProxy('https://ai.fakeopen.com/api/conversation');

    gpt.addMessage({
        role: 'system',
        text: `You can only response with JSON format from now, {
            message: "your message",
        }`,
    })

    gpt.onProgress = (message: Message) => {
        console.log(message.text);
    }

    let result = await gpt.sendMessage("hey!");
    console.log(result);
}

example();
```

# GitHub Repository
[Repository](https://github.com/borsuczyna/bettergpt)

---
_Source: https://npm.io/package/bettergpt · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
