sunholo 0.107.0__py3-none-any.whl → 0.108.0__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.
- sunholo/database/alloydb.py +6 -4
- sunholo/senses/stream_voice.py +39 -0
- {sunholo-0.107.0.dist-info → sunholo-0.108.0.dist-info}/METADATA +2 -2
- {sunholo-0.107.0.dist-info → sunholo-0.108.0.dist-info}/RECORD +8 -8
- {sunholo-0.107.0.dist-info → sunholo-0.108.0.dist-info}/LICENSE.txt +0 -0
- {sunholo-0.107.0.dist-info → sunholo-0.108.0.dist-info}/WHEEL +0 -0
- {sunholo-0.107.0.dist-info → sunholo-0.108.0.dist-info}/entry_points.txt +0 -0
- {sunholo-0.107.0.dist-info → sunholo-0.108.0.dist-info}/top_level.txt +0 -0
sunholo/database/alloydb.py
CHANGED
|
@@ -275,17 +275,19 @@ def _list_sources_from_docstore(sources, vector_name, search_type="OR"):
|
|
|
275
275
|
if sources:
|
|
276
276
|
conditions = and_or_ilike(sources, search_type=search_type)
|
|
277
277
|
query = f"""
|
|
278
|
-
SELECT
|
|
278
|
+
SELECT source AS objectId
|
|
279
279
|
FROM {table_name}
|
|
280
280
|
WHERE {conditions}
|
|
281
|
-
|
|
281
|
+
GROUP BY source
|
|
282
|
+
ORDER BY source ASC
|
|
282
283
|
LIMIT 500;
|
|
283
284
|
"""
|
|
284
285
|
else:
|
|
285
286
|
query = f"""
|
|
286
|
-
SELECT
|
|
287
|
+
SELECT source AS objectId
|
|
287
288
|
FROM {table_name}
|
|
288
|
-
|
|
289
|
+
GROUP BY source
|
|
290
|
+
ORDER BY source ASC
|
|
289
291
|
LIMIT 500;
|
|
290
292
|
"""
|
|
291
293
|
|
sunholo/senses/stream_voice.py
CHANGED
|
@@ -23,6 +23,8 @@ import queue
|
|
|
23
23
|
import threading
|
|
24
24
|
import time
|
|
25
25
|
from concurrent.futures import ThreadPoolExecutor
|
|
26
|
+
import io
|
|
27
|
+
import wave
|
|
26
28
|
|
|
27
29
|
import argparse
|
|
28
30
|
import json
|
|
@@ -131,6 +133,43 @@ class StreamingTTS:
|
|
|
131
133
|
# Convert audio bytes to numpy array for playback
|
|
132
134
|
audio_np = np.frombuffer(response.audio_content, dtype=np.int16)
|
|
133
135
|
return audio_np
|
|
136
|
+
|
|
137
|
+
def generate_audio_stream(self, text):
|
|
138
|
+
"""
|
|
139
|
+
Generate a stream of audio data from a text chunk.
|
|
140
|
+
Returns audio in WAV format for streaming.
|
|
141
|
+
|
|
142
|
+
Args:
|
|
143
|
+
text (str): Text to convert to speech
|
|
144
|
+
|
|
145
|
+
Yields:
|
|
146
|
+
bytes: WAV-formatted audio data
|
|
147
|
+
"""
|
|
148
|
+
try:
|
|
149
|
+
# Convert text to audio using existing method
|
|
150
|
+
audio_chunk = self.text_to_audio(text)
|
|
151
|
+
|
|
152
|
+
# Process audio chunk with fading
|
|
153
|
+
processed_chunk = self._apply_fade(
|
|
154
|
+
audio_chunk,
|
|
155
|
+
fade_duration=self.file_fade_duration,
|
|
156
|
+
fade_in=True,
|
|
157
|
+
fade_out=True
|
|
158
|
+
)
|
|
159
|
+
|
|
160
|
+
# Convert to WAV format
|
|
161
|
+
wav_buffer = io.BytesIO()
|
|
162
|
+
with wave.open(wav_buffer, 'wb') as wav_file:
|
|
163
|
+
wav_file.setnchannels(1)
|
|
164
|
+
wav_file.setsampwidth(2)
|
|
165
|
+
wav_file.setframerate(self.sample_rate)
|
|
166
|
+
wav_file.writeframes(processed_chunk.tobytes())
|
|
167
|
+
|
|
168
|
+
yield wav_buffer.getvalue()
|
|
169
|
+
|
|
170
|
+
except Exception as e:
|
|
171
|
+
log.error(f"Error generating audio stream: {e}")
|
|
172
|
+
yield b''
|
|
134
173
|
|
|
135
174
|
def _initialize_audio_device(self):
|
|
136
175
|
"""Initialize audio device with proper settings."""
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sunholo
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.108.0
|
|
4
4
|
Summary: Large Language Model DevOps - a package to help deploy LLMs to the Cloud.
|
|
5
5
|
Home-page: https://github.com/sunholo-data/sunholo-py
|
|
6
|
-
Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.
|
|
6
|
+
Download-URL: https://github.com/sunholo-data/sunholo-py/archive/refs/tags/v0.108.0.tar.gz
|
|
7
7
|
Author: Holosun ApS
|
|
8
8
|
Author-email: multivac@sunholo.com
|
|
9
9
|
License: Apache License, Version 2.0
|
|
@@ -58,7 +58,7 @@ sunholo/components/llm.py,sha256=8iyY6K1ZiiJx9MGL1fY5CHh8CD3YYhwEA6O8B44tkxE,130
|
|
|
58
58
|
sunholo/components/retriever.py,sha256=bKIVT7_18Ut3OJd0E0jyiISPnD9qkHWVjcQPT4i1_G8,7720
|
|
59
59
|
sunholo/components/vectorstore.py,sha256=xKk7micTRwZckaI7U6PxvFz_ZSjCH48xPTDYiDcv2tc,5913
|
|
60
60
|
sunholo/database/__init__.py,sha256=bpB5Nk21kwqYj-qdVnvNgXjLsbflnH4g-San7OHMqR4,283
|
|
61
|
-
sunholo/database/alloydb.py,sha256=
|
|
61
|
+
sunholo/database/alloydb.py,sha256=x1zUMB-EVWbE2Zvp4nAs2Z-tB_kOZmS45H2lwVHdYnk,11678
|
|
62
62
|
sunholo/database/alloydb_client.py,sha256=kg6J8pCqBkjfEkXdhU8mwxdaI7w-cSE9AxKHWuYmzaM,18943
|
|
63
63
|
sunholo/database/database.py,sha256=VqhZdkXUNdvWn8sUcUV3YNby1JDVf7IykPVXWBtxo9U,7361
|
|
64
64
|
sunholo/database/lancedb.py,sha256=DyfZntiFKBlVPaFooNN1Z6Pl-LAs4nxWKKuq8GBqN58,715
|
|
@@ -116,7 +116,7 @@ sunholo/qna/__init__.py,sha256=F8q1uR_HreoSX0IfmKY1qoSwIgXhO2Q8kuDSxh9_-EE,28
|
|
|
116
116
|
sunholo/qna/parsers.py,sha256=YpOaK5S_LxJ6FbliSYDc3AVOJ62RVduayoNnzi_p8CM,2494
|
|
117
117
|
sunholo/qna/retry.py,sha256=yMw7RTkw-RXCzfENPJOt8c32mXlpvOR589EGkvK-6yI,2028
|
|
118
118
|
sunholo/senses/__init__.py,sha256=fbWqVwwzkV5uRSb8lQzo4pn0ja_VYVWbUYapurSowBs,39
|
|
119
|
-
sunholo/senses/stream_voice.py,sha256=
|
|
119
|
+
sunholo/senses/stream_voice.py,sha256=tQL5TDH43OuXRlxWRLiIAceYApXyqNczN1D3jUiNMUo,18092
|
|
120
120
|
sunholo/streaming/__init__.py,sha256=MpbydI2UYo_adttPQFkxNM33b-QRyNEbrKJx0C2AGPc,241
|
|
121
121
|
sunholo/streaming/content_buffer.py,sha256=0LHMwH4ctq5kjhIgMFNH0bA1RL0jMISlLVzzLcFrvv4,12766
|
|
122
122
|
sunholo/streaming/langserve.py,sha256=hi7q8WY8DPKrALl9m_dOMxWOdE-iEuk7YW05SVDFIX8,6514
|
|
@@ -149,9 +149,9 @@ sunholo/vertex/init.py,sha256=1OQwcPBKZYBTDPdyU7IM4X4OmiXLdsNV30C-fee2scQ,2875
|
|
|
149
149
|
sunholo/vertex/memory_tools.py,sha256=tBZxqVZ4InTmdBvLlOYwoSEWu4-kGquc-gxDwZCC4FA,7667
|
|
150
150
|
sunholo/vertex/safety.py,sha256=S9PgQT1O_BQAkcqauWncRJaydiP8Q_Jzmu9gxYfy1VA,2482
|
|
151
151
|
sunholo/vertex/type_dict_to_json.py,sha256=uTzL4o9tJRao4u-gJOFcACgWGkBOtqACmb6ihvCErL8,4694
|
|
152
|
-
sunholo-0.
|
|
153
|
-
sunholo-0.
|
|
154
|
-
sunholo-0.
|
|
155
|
-
sunholo-0.
|
|
156
|
-
sunholo-0.
|
|
157
|
-
sunholo-0.
|
|
152
|
+
sunholo-0.108.0.dist-info/LICENSE.txt,sha256=SdE3QjnD3GEmqqg9EX3TM9f7WmtOzqS1KJve8rhbYmU,11345
|
|
153
|
+
sunholo-0.108.0.dist-info/METADATA,sha256=NoRyTCRajNC5x0uAVpyUs8Ogp9oCuChGi2rcMdpG5QQ,8670
|
|
154
|
+
sunholo-0.108.0.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
|
|
155
|
+
sunholo-0.108.0.dist-info/entry_points.txt,sha256=bZuN5AIHingMPt4Ro1b_T-FnQvZ3teBes-3OyO0asl4,49
|
|
156
|
+
sunholo-0.108.0.dist-info/top_level.txt,sha256=wt5tadn5--5JrZsjJz2LceoUvcrIvxjHJe-RxuudxAk,8
|
|
157
|
+
sunholo-0.108.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|