Coder Social home page Coder Social logo

whatever's Introduction

whatever

Whatever is a way to use ChatGPT on a WhatsApp number, with the capability to listen to and respond as voice notes.

Installation

  1. Run npm run install to set up the app.

  2. Create a .env file in the root directory of the project. Add two variables to it:

  • OPENAI_API_KEY Required
  • ELEVENLABS_API_KEY (Optional, if you want Whatever to respond in voice notes).

Run

npm run dev will start the app. You'll need to scan the QR code printed on the terminal of your phone's WhatsApp. npm run cli will initialize a CLI you can use to talk with ChatGPT.

That's it!

whatever's People

Contributors

zlenner avatar

Stargazers

 avatar  avatar Realm Chua avatar  avatar Siyabonga Buthelezi avatar  avatar Lim Sze Seong avatar  avatar

Watchers

 avatar

whatever's Issues

help!

thisi is a error:"trace":"Error: WebSocket Error (Opening handshake has timed out),
please help me

noob: 'npm run install' error

I'm a noob so bear with me. I've cloned the git, entered the cloned git folder 'whatever' and run npm run install but it results in the error npm ERR! Missing script: "install" and, indeed, the package.json doesn't have an "install" script section:

  "scripts": {
    "dev": "ts-node src/index",
    "cli": "ts-node dist/cli.ts",
    "test": "echo \"Error: no test specified\" && exit 1",
    "build": "npx tsc"

I would appreciate some help getting this running. I tried npm run build but also got a bunch of errors.

EDIT: I ran npm install typescript and then npm run build completes and now I have a couple new folders 'dist' and 'node_modules' but can't make out how to use them

EDIT: npm install -g ts-node got me further but still not working:

npm run dev

> [email protected] dev
> ts-node src/index

/Users/[redacted]/whatever/src/index.ts:4
assert(process.env.OPENAI_API_KEY, "OPENAI_API_KEY is required to run the app.")
      ^
AssertionError [ERR_ASSERTION]: OPENAI_API_KEY is required to run the app.
    at Object.<anonymous> (/Users/[redacted]/whatever/src/index.ts:4:7)
    at Module._compile (node:internal/modules/cjs/loader:1275:14)
    at Module.m._compile (/usr/local/lib/node_modules/ts-node/src/index.ts:1618:23)
    at Module._extensions..js (node:internal/modules/cjs/loader:1329:10)
    at Object.require.extensions.<computed> [as .ts] (/usr/local/lib/node_modules/ts-node/src/index.ts:1621:12)
    at Module.load (node:internal/modules/cjs/loader:1133:32)
    at Function.Module._load (node:internal/modules/cjs/loader:972:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)
    at phase4 (/usr/local/lib/node_modules/ts-node/src/bin.ts:649:14)
    at bootstrap (/usr/local/lib/node_modules/ts-node/src/bin.ts:95:10) {
  generatedMessage: false,
  code: 'ERR_ASSERTION',
  actual: undefined,
  expected: true,
  operator: '=='
}

P.S. I do have an .env file in the 'root directory of the project' whatever with the following contents OPENAI_API_KEY [redacted]

EDIT: changed syntax in .env file to OPENAI_API_KEY=[redacted] and now it's generating a QR Code, which I scanned with WhatsApp, so getting further! Not sure what to do next to actually 'chat' with ChatGPT

EDIT: I've got npm run dev in one terminal session. Not sure how to use it so I ran npm run cli in another terminal but it results in:

npm run cli

> [email protected] cli
> ts-node dist/cli.ts

node:internal/modules/cjs/loader:1093
  throw err;
  ^

Error: Cannot find module './cli.ts'
Require stack:

EDIT: having left it running in a terminal window, I suddenly got a WhatsApp message in WhatsApp Desktop from this interesting app you've made. But I cannot figure out how to cause it to happen. Sending a question to myself in a chat to myself doesn't seem to get intercepted. How do you use this thing? Does it intercept anything terminating with a question mark and generate a ChatGPT based response in the same chat?

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.