-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1f76088
commit 411eb9e
Showing
5 changed files
with
109 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[tool.poetry] | ||
name = "elo" | ||
version = "0.1.0" | ||
description = "" | ||
authors = ["Roderick Bishop <[email protected]>"] | ||
readme = "README.md" | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.11" | ||
|
||
|
||
[build-system] | ||
requires = ["poetry-core"] | ||
build-backend = "poetry.core.masonry.api" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters