Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bettergpt

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bettergpt

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

  • 1.0.5
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

About

bettergpt is a node module that allows you to easily interact with the ChatGPT

Install

npm install bettergpt

Example

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

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

Keywords

FAQs

Package last updated on 10 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc