Skip to content

Commit

Permalink
refactor/remove_stt+tts_prefs (#91)
Browse files Browse the repository at this point in the history
* refactor/remove_stt+tts_prefs

deeper changes are needed in listener/audio to support this properly, removing from session until this is more fleshed out

there will be some overlap with user_id later and maybe makes more sense to retrieve this out of bounds instead of passing full plugin configs in message.context

perhaps in the future ovos-audio/listener can load multiple plugins at once and this functionality restored

* deprecation
  • Loading branch information
JarbasAl authored Apr 25, 2024
1 parent aa7fe2f commit 25e4b4d
Showing 1 changed file with 4 additions and 19 deletions.
23 changes: 4 additions & 19 deletions ovos_bus_client/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,10 @@ def __init__(self, session_id: str = None,
@param lang: language associated with this Session
@param context: IntentContextManager for this Session
"""
if tts_prefs:
LOG.warning("tts_prefs have been deprecated! value will be ignored and fully removed in 0.1.0")
if stt_prefs:
LOG.warning("stt_prefs have been deprecated! value will be ignored and fully removed in 0.1.0")
self.session_id = session_id or str(uuid4())

self.lang = lang or get_default_lang()
Expand Down Expand Up @@ -315,19 +319,6 @@ def __init__(self, session_id: str = None,
]
self.context = context or IntentContextManager()

if not stt_prefs:
stt = Configuration().get("stt", {})
sttm = stt.get("module", "ovos-stt-plugin-server")
stt_prefs = {"plugin_id": sttm,
"config": stt.get(sttm) or {}}
self.stt_preferences = stt_prefs

if not tts_prefs:
tts = Configuration().get("tts", {})
ttsm = tts.get("module", "ovos-tts-plugin-server")
tts_prefs = {"plugin_id": ttsm,
"config": tts.get(ttsm) or {}}
self.tts_preferences = tts_prefs
self.location_preferences = location_prefs or Configuration().get("location", {})

@property
Expand Down Expand Up @@ -424,8 +415,6 @@ def serialize(self) -> dict:
"context": self.context.serialize(),
"site_id": self.site_id,
"pipeline": self.pipeline,
"stt": self.stt_preferences,
"tts": self.tts_preferences,
"location": self.location_preferences,
"system_unit": self.system_unit,
"time_format": self.time_format,
Expand Down Expand Up @@ -454,8 +443,6 @@ def deserialize(data: Dict):
context = IntentContextManager.deserialize(data.get("context", {}))
site_id = data.get("site_id", "unknown")
pipeline = data.get("pipeline", [])
tts = data.get("tts", {})
stt = data.get("stt", {})
location = data.get("location", {})
system_unit = data.get("system_unit")
date_format = data.get("date_format")
Expand All @@ -467,8 +454,6 @@ def deserialize(data: Dict):
context=context,
pipeline=pipeline,
site_id=site_id,
tts_prefs=tts,
stt_prefs=stt,
location_prefs=location,
system_unit=system_unit,
date_format=date_format,
Expand Down

0 comments on commit 25e4b4d

Please sign in to comment.