livekit-plugins-speechmatics 1.1.1__py3-none-any.whl → 1.1.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25,6 +25,7 @@ import aiohttp
25
25
 
26
26
  from livekit.agents import (
27
27
  DEFAULT_API_CONNECT_OPTIONS,
28
+ APIConnectionError,
28
29
  APIConnectOptions,
29
30
  APIStatusError,
30
31
  stt,
@@ -235,7 +236,8 @@ class SpeechStream(stt.SpeechStream):
235
236
  self._reconnect_event.clear()
236
237
  finally:
237
238
  await utils.aio.gracefully_cancel(*tasks, wait_reconnect_task)
238
- await tasks_group
239
+ tasks_group.cancel()
240
+ tasks_group.exception() # retrieve the exception
239
241
  finally:
240
242
  if ws is not None:
241
243
  await ws.close()
@@ -255,11 +257,18 @@ class SpeechStream(stt.SpeechStream):
255
257
  **self._extra_headers,
256
258
  }
257
259
  url = sanitize_url(self._connection_settings.url, self._transcription_config.language)
258
- return await self._session.ws_connect(
259
- url,
260
- ssl=self._connection_settings.ssl_context,
261
- headers=headers,
262
- )
260
+ try:
261
+ ws = await asyncio.wait_for(
262
+ self._session.ws_connect(
263
+ url,
264
+ ssl=self._connection_settings.ssl_context,
265
+ headers=headers,
266
+ ),
267
+ self._conn_options.timeout,
268
+ )
269
+ except (aiohttp.ClientConnectorError, asyncio.TimeoutError) as e:
270
+ raise APIConnectionError("failed to connect to speechmatics") from e
271
+ return ws
263
272
 
264
273
  def _process_stream_event(self, data: dict, closing_ws: bool) -> None:
265
274
  message_type = data["message"]
@@ -12,4 +12,4 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- __version__ = "1.1.1"
15
+ __version__ = "1.1.2"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: livekit-plugins-speechmatics
3
- Version: 1.1.1
3
+ Version: 1.1.2
4
4
  Summary: Agent Framework plugin for Speechmatics
5
5
  Project-URL: Documentation, https://docs.livekit.io
6
6
  Project-URL: Website, https://livekit.io/
@@ -18,7 +18,7 @@ Classifier: Topic :: Multimedia :: Sound/Audio
18
18
  Classifier: Topic :: Multimedia :: Video
19
19
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
20
20
  Requires-Python: >=3.9.0
21
- Requires-Dist: livekit-agents>=1.1.1
21
+ Requires-Dist: livekit-agents>=1.1.2
22
22
  Description-Content-Type: text/markdown
23
23
 
24
24
  # Speechmatics STT plugin for LiveKit Agents
@@ -1,10 +1,10 @@
1
1
  livekit/plugins/speechmatics/__init__.py,sha256=LpY2NZfiSfEeqmjB37anBHdPMbNkSiNsnJ9GZ6Jf6Ac,1236
2
2
  livekit/plugins/speechmatics/log.py,sha256=O1iyAF7cHUu_iMXh6l7KRwwWeDB5QyABI_qzAb0cs04,75
3
3
  livekit/plugins/speechmatics/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- livekit/plugins/speechmatics/stt.py,sha256=10SRGs9j_8m0Enh3uw7tKvszNNErK90h4bD0mEHTO58,12000
4
+ livekit/plugins/speechmatics/stt.py,sha256=mHbGvaAyP_1nHCcJHnFcy0E6yvjCMogpQ99s7MQSH_8,12410
5
5
  livekit/plugins/speechmatics/types.py,sha256=x9Jl5yABOU4hkN0adKEIhv0WLR32QWnVRo53qvyIPkY,4970
6
6
  livekit/plugins/speechmatics/utils.py,sha256=qVg7MenwUvp_f2AngntQlmZ4xb9b8c8NB5ftqGk1Wr0,1907
7
- livekit/plugins/speechmatics/version.py,sha256=-n_ZAjtAMENfDiEhb2um_Qh7c5Ek0FcJYKesPn0TC8M,600
8
- livekit_plugins_speechmatics-1.1.1.dist-info/METADATA,sha256=AH-Il0lU9nqUCEDTiqhz5DozC_wHYvV1-e9uIp97ytU,2049
9
- livekit_plugins_speechmatics-1.1.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
10
- livekit_plugins_speechmatics-1.1.1.dist-info/RECORD,,
7
+ livekit/plugins/speechmatics/version.py,sha256=4xsDvsWzcXeZXE5EyuyHcgChwWFQ5CWlSlCFmYyXwqw,600
8
+ livekit_plugins_speechmatics-1.1.2.dist-info/METADATA,sha256=a9lJI81PQ9r-kLdfdYjtJ5kenoujwQpMj0IGHWpz8nQ,2049
9
+ livekit_plugins_speechmatics-1.1.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
10
+ livekit_plugins_speechmatics-1.1.2.dist-info/RECORD,,