livekit-plugins-clova 1.0.22__tar.gz → 1.1.0__tar.gz

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.

Potentially problematic release.


This version of livekit-plugins-clova might be problematic. Click here for more details.

@@ -146,6 +146,9 @@ venv.bak/
146
146
  .dmypy.json
147
147
  dmypy.json
148
148
 
149
+ # trunk
150
+ .trunk/
151
+
149
152
  # Pyre type checker
150
153
  .pyre/
151
154
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: livekit-plugins-clova
3
- Version: 1.0.22
3
+ Version: 1.1.0
4
4
  Summary: LiveKit Agents Plugin for LINE Clova STT
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.0.22
21
+ Requires-Dist: livekit-agents>=1.1.0
22
22
  Requires-Dist: pydub~=0.25.1
23
23
  Description-Content-Type: text/markdown
24
24
 
@@ -30,10 +30,10 @@ from livekit.agents import Plugin
30
30
 
31
31
 
32
32
  class ClovaSTTPlugin(Plugin):
33
- def __init__(self):
33
+ def __init__(self) -> None:
34
34
  super().__init__(__name__, __version__, __package__)
35
35
 
36
- def download_files(self):
36
+ def download_files(self) -> None:
37
37
  pass
38
38
 
39
39
 
@@ -1,13 +1,13 @@
1
1
  import io
2
2
 
3
- from pydub import AudioSegment
3
+ from pydub import AudioSegment # type: ignore[import-untyped]
4
4
 
5
5
 
6
- def resample_audio(audio_bytes, original_sample_rate, target_sample_rate):
6
+ def resample_audio(audio_bytes: bytes, original_sample_rate: int, target_sample_rate: int) -> bytes:
7
7
  resampled_audio = AudioSegment.from_raw(
8
8
  io.BytesIO(audio_bytes),
9
9
  sample_width=2,
10
10
  frame_rate=original_sample_rate,
11
11
  channels=1,
12
12
  ).set_frame_rate(target_sample_rate)
13
- return resampled_audio.raw_data
13
+ return resampled_audio.raw_data # type: ignore
@@ -62,16 +62,17 @@ class STT(stt.STT):
62
62
  """
63
63
 
64
64
  super().__init__(capabilities=STTCapabilities(streaming=False, interim_results=True))
65
- self._secret = secret if is_given(secret) else os.environ.get("CLOVA_STT_SECRET_KEY")
65
+ clova_secret = secret if is_given(secret) else os.environ.get("CLOVA_STT_SECRET_KEY")
66
66
  self._invoke_url = (
67
67
  invoke_url if is_given(invoke_url) else os.environ.get("CLOVA_STT_INVOKE_URL")
68
68
  )
69
69
  self._language = clova_languages_mapping.get(language, language)
70
70
  self._session = http_session
71
- if self._secret is None:
71
+ if clova_secret is None:
72
72
  raise ValueError(
73
73
  "Clova STT secret key is required. It should be set with env CLOVA_STT_SECRET_KEY"
74
74
  )
75
+ self._secret = clova_secret
75
76
  self.threshold = threshold
76
77
 
77
78
  def update_options(self, *, language: NotGivenOr[str] = NOT_GIVEN) -> None:
@@ -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.0.22"
15
+ __version__ = "1.1.0"
@@ -22,7 +22,7 @@ classifiers = [
22
22
  "Programming Language :: Python :: 3.10",
23
23
  "Programming Language :: Python :: 3 :: Only",
24
24
  ]
25
- dependencies = ["livekit-agents>=1.0.22", "pydub~=0.25.1"]
25
+ dependencies = ["livekit-agents>=1.1.0", "pydub~=0.25.1"]
26
26
 
27
27
  [project.urls]
28
28
  Documentation = "https://docs.livekit.io"