Skip to content

Commit

Permalink
run function
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkParker5 committed Sep 17, 2023
1 parent 0f56ffe commit f3163a6
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 83 deletions.
31 changes: 31 additions & 0 deletions stark/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import asyncer

from stark.interfaces.protocols import SpeechRecognizer, SpeechSynthesizer
from stark.core import CommandsContext, CommandsManager
from stark.voice_assistant import VoiceAssistant
from stark.general.blockage_detector import BlockageDetector


async def run(
manager: CommandsManager,
speech_recognizer: SpeechRecognizer,
speech_synthesizer: SpeechSynthesizer
):
async with asyncer.create_task_group() as main_task_group:
context = CommandsContext(
task_group = main_task_group,
commands_manager = manager
)
voice_assistant = VoiceAssistant(
speech_recognizer = speech_recognizer,
speech_synthesizer = speech_synthesizer,
commands_context = context
)
speech_recognizer.delegate = voice_assistant
context.delegate = voice_assistant

main_task_group.soonify(speech_recognizer.start_listening)()
main_task_group.soonify(context.handle_responses)()

detector = BlockageDetector(threshold = 1)
main_task_group.soonify(detector.monitor)()
68 changes: 0 additions & 68 deletions stark/__main__.py

This file was deleted.

15 changes: 0 additions & 15 deletions stark/config.py

This file was deleted.

0 comments on commit f3163a6

Please sign in to comment.