OpenVoiceOS / ovos-stt-plugin-server

Apache License 2.0
1 stars 4 forks source link

response json format problems with streaming stt #6

Open emphasize opened 1 year ago

emphasize commented 1 year ago

endpoint https://stt.openvoiceos.com/stt

 Exception in thread Thread-6:
Apr 21 21:54:48 ovos ovos-systemd-voice[832]: Traceback (most recent call last):
Apr 21 21:54:48 ovos ovos-systemd-voice[832]:   File "/usr/local/lib/python3.9/dist-packages/requests/models.py", line 971, in json
Apr 21 21:54:48 ovos ovos-systemd-voice[832]:     return complexjson.loads(self.text, **kwargs)
Apr 21 21:54:48 ovos ovos-systemd-voice[832]:   File "/usr/lib/python3.9/json/__init__.py", line 346, in loads
Apr 21 21:54:48 ovos ovos-systemd-voice[832]:     return _default_decoder.decode(s)
Apr 21 21:54:48 ovos ovos-systemd-voice[832]:   File "/usr/lib/python3.9/json/decoder.py", line 337, in decode
Apr 21 21:54:48 ovos ovos-systemd-voice[832]:     obj, end = self.raw_decode(s, idx=_w(s, 0).end())
Apr 21 21:54:48 ovos ovos-systemd-voice[832]:   File "/usr/lib/python3.9/json/decoder.py", line 355, in raw_decode
Apr 21 21:54:48 ovos ovos-systemd-voice[832]:     raise JSONDecodeError("Expecting value", s, err.value) from None
Apr 21 21:54:48 ovos ovos-systemd-voice[832]: json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Apr 21 21:54:48 ovos ovos-systemd-voice[832]: During handling of the above exception, another exception occurred:
Apr 21 21:54:48 ovos ovos-systemd-voice[832]: Traceback (most recent call last):
Apr 21 21:54:48 ovos ovos-systemd-voice[832]:   File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
Apr 21 21:54:48 ovos ovos-systemd-voice[832]:     self.run()
Apr 21 21:54:48 ovos ovos-systemd-voice[832]:   File "/usr/local/lib/python3.9/dist-packages/ovos_plugin_manager/templates/stt.py", line 167, in run
Apr 21 21:54:48 ovos ovos-systemd-voice[832]:     return self.handle_audio_stream(self._get_data(), self.language)
Apr 21 21:54:48 ovos ovos-systemd-voice[832]:   File "/usr/local/lib/python3.9/dist-packages/ovos_stt_plugin_server/__init__.py", line 42, in handle_audio_stream
Apr 21 21:54:48 ovos ovos-systemd-voice[832]:     self.text = response.json()["transcript"]
Apr 21 21:54:48 ovos ovos-systemd-voice[832]:   File "/usr/local/lib/python3.9/dist-packages/requests/models.py", line 975, in json
Apr 21 21:54:48 ovos ovos-systemd-voice[832]:     raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
Apr 21 21:54:48 ovos ovos-systemd-voice[832]: requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
builderjer commented 7 months ago

we removed this server from the public servers, can this issue be closed?

mikejgray commented 6 months ago

Some defensive error handling might be good for future scenarios