Skip to content

Commit

Permalink
fix: circular imports because of typing
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl committed Dec 28, 2024
1 parent 6e0979b commit 92a01f4
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions hivemind_plugin_manager/protocols.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
from ovos_utils.log import LOG

from hivemind_bus_client.identity import NodeIdentity
from hivemind_core.database import ClientDatabase
from hivemind_core.protocol import HiveMindClientConnection


@dataclass
Expand All @@ -23,11 +21,11 @@ def identity(self) -> NodeIdentity:
return self.hm_protocol.identity

@property
def database(self) -> ClientDatabase:
def database(self) -> 'ClientDatabase':
return self.hm_protocol.db

@property
def clients(self) -> Dict[str, HiveMindClientConnection]:
def clients(self) -> Dict[str, 'HiveMindClientConnection']:
return self.hm_protocol.clients


Expand Down Expand Up @@ -60,36 +58,36 @@ class BinaryDataHandlerProtocol(_SubProtocol):
def handle_microphone_input(self, bin_data: bytes,
sample_rate: int,
sample_width: int,
client: HiveMindClientConnection):
client: 'HiveMindClientConnection'):
LOG.warning(f"Ignoring received binary audio input: {len(bin_data)} bytes at sample_rate: {sample_rate}")

def handle_stt_transcribe_request(self, bin_data: bytes,
sample_rate: int,
sample_width: int,
lang: str,
client: HiveMindClientConnection):
client: 'HiveMindClientConnection'):
LOG.warning(f"Ignoring received binary STT input: {len(bin_data)} bytes")

def handle_stt_handle_request(self, bin_data: bytes,
sample_rate: int,
sample_width: int,
lang: str,
client: HiveMindClientConnection):
client: 'HiveMindClientConnection'):
LOG.warning(f"Ignoring received binary STT input: {len(bin_data)} bytes")

def handle_numpy_image(self, bin_data: bytes,
camera_id: str,
client: HiveMindClientConnection):
client: 'HiveMindClientConnection'):
LOG.warning(f"Ignoring received binary image: {len(bin_data)} bytes")

def handle_receive_tts(self, bin_data: bytes,
utterance: str,
lang: str,
file_name: str,
client: HiveMindClientConnection):
client: 'HiveMindClientConnection'):
LOG.warning(f"Ignoring received binary TTS audio: {utterance} with {len(bin_data)} bytes")

def handle_receive_file(self, bin_data: bytes,
file_name: str,
client: HiveMindClientConnection):
client: 'HiveMindClientConnection'):
LOG.warning(f"Ignoring received binary file: {file_name} with {len(bin_data)} bytes")

0 comments on commit 92a01f4

Please sign in to comment.