1.6.2 • Published 2 years ago

easygpt v1.6.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

easyGPT: ChatGPT API wrapper 🤖

Generate human-like text effortlessly with easyGPT - the powerful ChatGPT API wrapper.

import EasyGPT from "easygpt";
const gpt = new EasyGPT();

gpt
    .setApiKey("<YOUR API KEY HERE>")
    .addMessage("Hello ChatGPT!");
    .then(response => console.log(response))    

Installation

Before installing make sure your Node.js version is at least v14.

Your project must be running ES Modules.

$ npm i easygpt

Docs

Quick Start

Import the package.

import EasyGpt from "easygpt";

Create a new instance of EasyGpt.

const gpt = new EasyGpt();

Set your API key.

gpt.setApiKey("your API key goes here.");

Create one for free @ https://platform.openai.com/account/api-keys

Basic Example

// Add a prompt you would like to say to ChatGPT.
gpt
  .addMessage("Hello ChatGPT!")
  // Give some instructions to the AI
  .addRule("Use emoticons in every answer and use a friendly tone.");

// Get the response from ChatGPT.
const response = await gpt.ask();

console.log(response.content);

Response

Hello! How can I assist you today? 😊

Multiple Messages Example

gpt.addMessage("Hello ChatGPT! My name is Adam!");

let response = await gpt.ask();

console.log(response.content);

// Add an additional  message to the stack.
gpt.addMessage("What was my name again?");

response = await gpt.ask();

console.log(response.content);

Responses

Hello Adam! It's nice to meet you. How can I assist you today?

Your name is Adam.

Further Examples

There is a long list of tested examples on our documentation site.

easygpt.dev/guide/examples

Created By

Francesco Gruosso - Github / LinkedIn / Website

Adam Govier - Github / LinkedIn / Website

1.6.2

2 years ago

1.6.0

2 years ago

1.5.0

2 years ago

1.4.3

2 years ago

1.4.2

2 years ago

1.4.1

2 years ago

1.4.0

2 years ago

1.3.13

2 years ago

1.3.12

2 years ago

1.3.11

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.9

2 years ago

1.2.8

2 years ago

1.2.7

2 years ago

1.2.64

2 years ago

1.2.63

2 years ago

1.2.61

2 years ago

1.2.6

2 years ago

1.2.5

2 years ago

1.2.4

2 years ago

1.2.3

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.0

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago