From 411eb9e2f8ba20a32edfcd49a5fa7860871eb0ed Mon Sep 17 00:00:00 2001 From: Roderick Bishop Date: Tue, 12 Mar 2024 19:26:28 -0500 Subject: [PATCH] high level updates --- .gitignore | 2 +- ELO/pyproject.toml | 14 ++++++++++++ ELO/src/main.py | 54 +++++++++++++++++++++++++++++++++++++++++++++ README.md | 28 +++++++++++++++++++++-- assistant/README.md | 14 ++++++++++++ 5 files changed, 109 insertions(+), 3 deletions(-) create mode 100644 ELO/pyproject.toml create mode 100644 ELO/src/main.py diff --git a/.gitignore b/.gitignore index 68bc17f..19603ef 100644 --- a/.gitignore +++ b/.gitignore @@ -157,4 +157,4 @@ cython_debug/ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. -#.idea/ +*.idea/ diff --git a/ELO/pyproject.toml b/ELO/pyproject.toml new file mode 100644 index 0000000..a7782dd --- /dev/null +++ b/ELO/pyproject.toml @@ -0,0 +1,14 @@ +[tool.poetry] +name = "elo" +version = "0.1.0" +description = "" +authors = ["Roderick Bishop "] +readme = "README.md" + +[tool.poetry.dependencies] +python = "^3.11" + + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" diff --git a/ELO/src/main.py b/ELO/src/main.py new file mode 100644 index 0000000..82544bb --- /dev/null +++ b/ELO/src/main.py @@ -0,0 +1,54 @@ +import speech_recognition as sr +from gtts import gTTS +import os +import openai + +# Set your OpenAI API key +openai.api_key = 'your-api-key' + +def recognize_speech(): + recognizer = sr.Recognizer() + + with sr.Microphone() as source: + print("Say something:") + recognizer.adjust_for_ambient_noise(source) + audio = recognizer.listen(source) + + try: + print("Recognizing...") + text = recognizer.recognize_google(audio) + print(f"You said: {text}") + return text + except sr.UnknownValueError: + print("Could not understand audio.") + return None + except sr.RequestError as e: + print(f"Error with the speech recognition service; {e}") + return None + +def chat_with_gpt(prompt): + response = openai.Completion.create( + engine="text-davinci-002", + prompt=prompt, + max_tokens=150 + ) + + return response['choices'][0]['text'] + +def speak_text(text): + tts = gTTS(text=text, lang='en') + tts.save("output.mp3") + os.system("mpg321 output.mp3") + +def main(): + while True: + user_input = recognize_speech() + + if user_input: + gpt_response = chat_with_gpt(user_input) + print(f"Assistant: {gpt_response}") + + speak_text(gpt_response) + +if __name__ == "__main__": + main() \ No newline at end of file diff --git a/README.md b/README.md index bb0f512..5f5b4fd 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,26 @@ -# ELO -ELO is the Enhanced Logical Organism. An AI powered personal robot for the lab. +# ELO = Enhanced Logic Operative + +## Objective + +To create an environment control plane entity powered by AI. + +## Overview + +This project has 3 parts + +- [assistant](https://github.com/roderick-bishop11/ELO/tree/main/assistant): the AI powered assistant +- [ui](https://github.com/roderick-bishop11/ELO/tree/main/ui): the desktop UI for this application +- [v1 enclosure](https://github.com/roderick-bishop11/ELO/tree/main/enclosure): the project detailing the physical enclosure of the ELO protoype + +## to do + +- [ ] CI/CD pipeline +- [ ] Readme's +- [ ] Feature set +- [ ] wireframes +- [x] module separation +- [ ] startup/config function for assistant +- [ ] What does the SDLC look like for this project +- [ ] delivery spec -> when it's delivered v1, how will it be delieverd? + - `python main.py` + - executable? diff --git a/assistant/README.md b/assistant/README.md index 385b01c..05150b3 100644 --- a/assistant/README.md +++ b/assistant/README.md @@ -34,6 +34,20 @@ Tony Stark, J.A.R.V.I.S. and Robert Elo Bishop(my grandfather). ELO is meant to - [OpenAI API](https://platform.openai.com/docs/overview)- interact with models - [Exa](https://github.com/exa-labs/exa-py)- Search for AI +## to do + +- [ ] CI/CD pipeline +- [ ] Readme's +- Feature set +- wireframes +- module separation +- startup/config function +- What does the SDLC look like +- delivery spec -> when it's delivered v1, how will it be delieverd? + - `python main.py` + - executable? + + ## Changelog - 3.8.24: Got instruction on project organization/implementation. Separate part into epics/bodies of work. Could use JIRA or some other tool to organize and stay on track. Simplify README & develop a more clear project.