Skip to content

Commit

Permalink
all working maybe
Browse files Browse the repository at this point in the history
  • Loading branch information
abutala committed Mar 20, 2024
1 parent 0a9edef commit 97c5bea
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions RAG/aiy_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,14 @@
from aiy.assistant import auth_helpers
from aiy.assistant.library import Assistant
from aiy.board import Board, Led
from aiy.voice import tts

# import requests module
import requests
from requests.auth import HTTPBasicAuth
from urllib.parse import urljoin
BASE_URL = "http://aiy.deviationlabs.com:8080/api/v1/"

logging.getLogger().setLevel(logging.DEBUG)
#logger = logging.getLogger(__name__)
#logger.setLevel(logging.DEBUG)

class MyAssistant:
"""An assistant that runs in the background.
Expand All @@ -56,6 +53,7 @@ class MyAssistant:
"""

def __init__(self):
logging.warning("Initializing...")
self._task = threading.Thread(target=self._run_task)
self._can_start_conversation = False
self._assistant = None
Expand Down Expand Up @@ -145,6 +143,7 @@ def _summarize(self, text):
json=dict(summary_question=text)
)
print(response)
tts.say(response.message)
except Exception as e:
logging.warning(f"Caught and ignored the following exception {e}")

Expand All @@ -155,7 +154,7 @@ def __call__(self, r):
return "validated_user"

def main():
logging.basicConfig(level=logging.INFO)
logging.basicConfig(level=logging.DEBUG)
MyAssistant().start()


Expand Down

0 comments on commit 97c5bea

Please sign in to comment.