Updated OI, added try
This commit is contained in:
parent
a82b4b264f
commit
83b776bd1a
|
@ -1,6 +1,7 @@
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
load_dotenv() # take environment variables from .env.
|
load_dotenv() # take environment variables from .env.
|
||||||
|
|
||||||
|
import traceback
|
||||||
from platformdirs import user_data_dir
|
from platformdirs import user_data_dir
|
||||||
import ast
|
import ast
|
||||||
import json
|
import json
|
||||||
|
@ -183,6 +184,7 @@ async def send_messages(websocket: WebSocket):
|
||||||
async def listener():
|
async def listener():
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
|
try:
|
||||||
while True:
|
while True:
|
||||||
if not from_user.empty():
|
if not from_user.empty():
|
||||||
chunk = await from_user.get()
|
chunk = await from_user.get()
|
||||||
|
@ -205,7 +207,7 @@ async def listener():
|
||||||
|
|
||||||
if message["type"] == "audio" and message["format"].startswith("bytes"):
|
if message["type"] == "audio" and message["format"].startswith("bytes"):
|
||||||
|
|
||||||
if not message["content"]: # If it was nothing / silence
|
if "content" not in message or message["content"] == None: # If it was nothing / silence
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# Convert bytes to audio file
|
# Convert bytes to audio file
|
||||||
|
@ -312,7 +314,8 @@ async def listener():
|
||||||
|
|
||||||
logger.info("New computer message recieved. Breaking.")
|
logger.info("New computer message recieved. Breaking.")
|
||||||
break
|
break
|
||||||
|
except:
|
||||||
|
traceback.print_exc()
|
||||||
|
|
||||||
async def stream_tts_to_device(sentence):
|
async def stream_tts_to_device(sentence):
|
||||||
force_task_completion_responses = [
|
force_task_completion_responses = [
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -24,11 +24,11 @@ pydub = "^0.25.1"
|
||||||
ngrok = "^1.0.0"
|
ngrok = "^1.0.0"
|
||||||
simpleaudio = "^1.0.4"
|
simpleaudio = "^1.0.4"
|
||||||
opencv-python = "^4.9.0.80"
|
opencv-python = "^4.9.0.80"
|
||||||
open-interpreter = { git = "https://github.com/KillianLucas/open-interpreter.git", branch = "development" }
|
|
||||||
psutil = "^5.9.8"
|
psutil = "^5.9.8"
|
||||||
typer = "^0.9.0"
|
typer = "^0.9.0"
|
||||||
platformdirs = "^4.2.0"
|
platformdirs = "^4.2.0"
|
||||||
rich = "^13.7.1"
|
rich = "^13.7.1"
|
||||||
|
open-interpreter = "^0.2.2"
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["poetry-core"]
|
requires = ["poetry-core"]
|
||||||
|
|
Loading…
Reference in New Issue