alexellis2010 / lasa_ai

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Xander: My personal assistant

This project is for LASA in which I describe myself using an AI that talks about me and pokes at me.

lasa_ai_xander_demo.mp4

Usage

$ npm i
$ export OPENAI_API_KEY=...
$ node index.js
(Wait for Xander to speak to you, then when "Recording" appears, you can speak to him. Press Space when you finish talking and then Xander will respond. Press Ctrl+C to quit)

About

This LASA project is about an AI I created that knows about me from a question and answer document I filled out about me. His name is Xander. He starts with a greeting we made him say because with no prompting it sometimes generates whole conversations instead of just a greeting. He talks to me via another AI known as tts-1 using the onyx voice that turns his text into speech. I would then respond and another AI known as whisper-1 turns my speech into text.

The index.js file has the high-level logic of the project and utilizes other files to handle the details. Those include the stt.js, tts.js, db.js, and llm.js files. "STT" stands for speech to text. It converts my voice into text the LLM (Large Language Model) can understand. TTS is similar. It stands for text to speech. It converts my AI's (Xander's) text into speech using another AI that converts text to speech called tts-1 using the onyx voice. db.js uses the vectors in qavector.json to pop up three questions like the question you have asked. llm.js configures the llm and makes it easier to use said llm. In this case, it is gpt-3.5-turbo in ChatGPT mode (GPT stands for Generative Pre-trained Transformer).

If you want to change the questions and answers Xander is aware of, you have to first modify the qa.json file to have your own questions and anwsers. Then re-run node vector.js > qavector.json. This recreates the vector file. Next, delete the index directory that was created by Vectra using the old vector file. Preferably, the amount of questions you have is greater than or equal to the amount already present.

About

License:MIT License


Languages

Language:JavaScript 100.0%