Giter Club home page Giter Club logo

openai-node's Introduction

Playground for OpenAI

NodeJS scripts to interact with openai in different ways, mainly created as a way to challenge myself

Note: this is work in progress and mostly me playing around with the openai API

Usage

  • Install node in your local machine
  • cp .env.example .env and paste your openai API key to the .env file
pnpm i # Install dependencies
pnpm build # you'll need to run this every time you change the code
# Run any of the bots
pnpm nemo
pnpm dalla
pnpm hal
pnpm dot
pnpm oct

Bots

  • Nemo: A very dumb bot with zero memory, ask it anything.
  • Dalla: A prompt generator for ai image generation tools such as Midjourney. It uses the davinci model because cheaper models won't work at all.
  • Hal: A rather unfriendly bot with short memory (it remembers up to the last 10 answers). Quitting will reset the memory.
  • Dot: Bot with limited memory (it remembers the last 4 answers and a summary of the rest of the conversation). Quitting will reset the memory.
  • Oct: Pretty smart, long term memory bot, it uses embeddings and summarization to include info related to the current prompt. Quitting does NOT reset the memory. Pretty much LongtermChatExternalSources repo converted to NodeJS.

Dev tasks

  • Create a script that sends an input and returns response
  • Convert to typescript
  • Dalla: give a random prompt for AI art generation
  • Apply chatGPT refactoring suggestions
  • It prepends the history (up to a prompt + character limit) to the input and sends it
  • Add eslint and prettier
  • It keeps a summary of the history and prepends it to input
  • It searches related history entries using embedding and prepends it to prompt, it saves embeddings to log so it's persistent
  • Refactoring, cleanup

openai-node's People

Contributors

luismartinezs avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.