A nodejs implementation of AI Explained on youtube's SmartGPT prompting strategy for getting better responses from gpt4.

Overview

SmartGPT

A Node.js script implementation of the SmartGPT prompting system by AI Explained on youtube, see the video here

Prerequisites

  • Node.js (node >= 18 to support chatgpt lib) installed on your machine. You can download it from here.
  • An OpenAI API key. You can get one by signing up on the OpenAI platform.

Installation

  1. Clone this repository or download the files.

  2. In the directory containing the smartgpt.js file, run the following command to install the required dependencies:

    npm install
  3. Create a copy of the .example.env file in the same directory as smartgpt.js and rename it to .env (literally nothing before the dot).

  4. Open the .env file and replace your_api_key_here with your actual OpenAI API key.

Usage

To run the script, execute the following command:

node smartgpt.js "Your prompt goes here" [options]

Outputs are logged to console and the entire conversations are saved in the output folder for later review.

Options

  • --model: Specify the model name to use (default: "gpt-4"). Example: --model "gpt-3.5-turbo"

  • --numAsks: Specify the number of response options to generate (default: 3). Example: --numAsks 4

  • --logging: Enable verbose logging (default: false). Example: --logging

Example

node smartgpt.js "I left 5 clothes out to dry in the sun. It took them 5 hours to dry completely. How long would it take to dry 30 clothes?" --model "gpt-3.5-turbo" --numAsks 4 --logging

This command will use the "gpt-3.5-turbo" model, generate 4 response options, and enable verbose logging.

You might also like...

Debut plugin that provides additional candles of specified tickers to strategy.

debut-plugin-candles A plugin for Debut platform that provides additional candles of specified tickers to strategy. Install @debut/community-core shou

Dec 15, 2022

An open-development real-time strategy (RTS) game project made in Construct.

Command & Construct This is an open-development real-time strategy (RTS) game project made in Construct. Read more about it and follow along the devel

Dec 20, 2022

Bloxflip crash automation using the martingale strategy. Earn robux passively while you sit back!

bloxflip-autocrash Bloxflip crash automation using the martingale strategy. Earn robux passively while you sit back! ⚠️ WARNING This automation softwa

Dec 30, 2022

The Next.js reference implementation on how to design better APIs

The Next.js reference implementation on how to design better APIs

This is the Next.js reference implementation of my blog bost on How to design better APIs. Getting Started Clone the repository git clone https://gith

Nov 22, 2022

Build redux logic, without getting nervous 😬

Build redux logic, without getting nervous 😬

Redux Cool Build redux logic, without getting nervous 😬 Description Redux Cool is an awesome tiny package that allows you to easily and intuitively w

Nov 3, 2022

Functions Recipes is a library of examples to help you getting started with Salesforce Functions and get used to their main features.

Functions Recipes is a library of examples to help you getting started with Salesforce Functions and get used to their main features.

Functions Recipes Introduction Salesforce Functions lets you use the Salesforce Platform for building event-driven, elastically scalable apps and expe

Dec 29, 2022

A util for getting data and metadata for all markdown files in a given dir. Useful for building static site generators

extract-md-data A util for getting data and metadata for all markdown files in a given dir. Useful for building static site generators. Usage Given th

Jan 6, 2022

With monitors getting wider and websites more compact, maximizing the browser is a waste of space.

With monitors getting wider and websites more compact, maximizing the browser is a waste of space.

With monitors getting wider and websites more compact, maximizing the browser is a waste of space. Widefox utilizes all available vertical real estate while adding extra features to your browsing experience!

Dec 18, 2022

An NODE Module For Getting Data From Discord API Called Discord Info

An NODE Module For Getting Data From Discord API Called Discord Info

An NODE Module For Getting Data From Discord API Called Discord Info

Jun 7, 2022
Comments
  • Error: Invalid environment; fetch is not defined

    Error: Invalid environment; fetch is not defined

    I decided to try SmartGPT, and made everything according to description of this repo. Unfortunately I have troubles with running it. Here is my bash:
    node -v v16.15.0

    node smartgpt.js "I left 5 clothes out to dry in the sun. It took them 5 hours to dry completely. How long would it take to dry 30 clothes?" --model "gpt-3.5-turbo" --numAsks 4 --logging Error: Invalid environment; fetch is not defined at new ChatGPTAPI (file:../SmartGPT/node_modules/chatgpt/bui ld/index.js:174:13) at main (file:/SmartGPT/smartgpt.js:16:21) at file:/SmartGPT/smartgpt.js:82:1 at ModuleJob.run (node:internal/modules/esm/module_job:198:25) at async Promise.all (index 0) at async ESMLoader.import (node:internal/modules/esm/loader:385:24) at async loadESM (node:internal/process/esm_loader:88:5) at async handleMainPromise (node:internal/modules/run_main:61:12)

    Maybe I need certain node version?

    opened by Ilia-Khalizev 1
Owner
Caleb O'Leary
Just a developer from the Midwest US. I like space and JavaScript.
Caleb O'Leary
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
NestJS implementation of client and strategy hasn't enough features for work with RabbitMQ so i developed this one (basically, just a wrapper for amqp-connection-manager)

NestJS RabbitMQ Client and strategy NestJS implementation of client and strategy hasn't enough features for work with RabbitMQ so i developed this one

ilink 5 Sep 6, 2022
Patronum: Ethereum RPC proxy that verifies RPC responses against given trusted block hashes

Patronum Ethereum RPC proxy that verifies RPC responses against given trusted block hashes. Currently, most of the DAPPs and Wallets interact with Eth

null 14 Dec 7, 2022
Use pulsar to make custom trading strategy that uses Flashloans at low cost. No contract deployment required.

PULSAR Pulsar is a contract that will let you execute custom call on the blockchain and let you make use of the Flasloans in your trading sequences. Y

idecentralize.finance 9 Jun 6, 2022
A Remix Auth strategy for working with forms.

FormStrategy A Remix Auth strategy to work with any form. Supported runtimes Runtime Has Support Node.js ✅ Cloudflare ✅ How to use This Strategy gives

Sergio Xalambrí 40 Jan 2, 2023
A template application for setting up a mobile app video game with IONIC, PHASER, ANGULAR and a Monorepo strategy

OpenForge Ionic Monorepo Example This is a template project for all you aspiring video game developers out there! Want to use your web application ski

OpenForge 67 Dec 22, 2022
True P2P concept for your p2p powered website/app/client. MSC/MEP (Multiple Strategy Concept/Multiple Entry Points)

TRUE P2P CONCEPT - Lets redecentralize the web This repo is just conceptual. Active development of the endproduct (TRUE P2P) happens here https://gith

Bo 6 Mar 29, 2022
FCIV.NET is a open source strategy game loosely based on Freeciv

FCIV.NET FCIV.NET is an open-source turn-based strategy game. It can be played in any HTML5 capable web-browser and features in-depth game-play and a

FCIV.NET 13 Nov 22, 2022