dashscope 1.24.8__py3-none-any.whl → 1.24.10__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.
Potentially problematic release.
This version of dashscope might be problematic. Click here for more details.
- dashscope/api_entities/base_request.py +12 -2
- dashscope/audio/asr/recognition.py +1 -1
- dashscope/audio/qwen_tts_realtime/qwen_tts_realtime.py +31 -0
- dashscope/multimodal/multimodal_request_params.py +2 -1
- dashscope/version.py +1 -1
- {dashscope-1.24.8.dist-info → dashscope-1.24.10.dist-info}/METADATA +1 -1
- {dashscope-1.24.8.dist-info → dashscope-1.24.10.dist-info}/RECORD +11 -11
- {dashscope-1.24.8.dist-info → dashscope-1.24.10.dist-info}/WHEEL +0 -0
- {dashscope-1.24.8.dist-info → dashscope-1.24.10.dist-info}/entry_points.txt +0 -0
- {dashscope-1.24.8.dist-info → dashscope-1.24.10.dist-info}/licenses/LICENSE +0 -0
- {dashscope-1.24.8.dist-info → dashscope-1.24.10.dist-info}/top_level.txt +0 -0
|
@@ -10,11 +10,21 @@ from dashscope.version import __version__
|
|
|
10
10
|
|
|
11
11
|
class BaseRequest(ABC):
|
|
12
12
|
def __init__(self) -> None:
|
|
13
|
+
try:
|
|
14
|
+
platform_info = platform.platform()
|
|
15
|
+
except Exception:
|
|
16
|
+
platform_info = "unknown"
|
|
17
|
+
|
|
18
|
+
try:
|
|
19
|
+
processor_info = platform.processor()
|
|
20
|
+
except Exception:
|
|
21
|
+
processor_info = "unknown"
|
|
22
|
+
|
|
13
23
|
ua = 'dashscope/%s; python/%s; platform/%s; processor/%s' % (
|
|
14
24
|
__version__,
|
|
15
25
|
platform.python_version(),
|
|
16
|
-
|
|
17
|
-
|
|
26
|
+
platform_info,
|
|
27
|
+
processor_info,
|
|
18
28
|
)
|
|
19
29
|
self.headers = {'user-agent': ua}
|
|
20
30
|
disable_data_inspection = os.environ.get(
|
|
@@ -189,7 +189,7 @@ class Recognition(BaseApi):
|
|
|
189
189
|
responses = self.__launch_request()
|
|
190
190
|
for part in responses:
|
|
191
191
|
if part.status_code == HTTPStatus.OK:
|
|
192
|
-
if len(part.output) == 0:
|
|
192
|
+
if len(part.output) == 0 or ('finished' in part.output and part.output['finished'] == True):
|
|
193
193
|
self._on_complete_timestamp = time.time() * 1000
|
|
194
194
|
logger.debug('last package delay {}'.format(
|
|
195
195
|
self.get_last_package_delay()))
|
|
@@ -158,6 +158,12 @@ class QwenTtsRealtime:
|
|
|
158
158
|
response_format: AudioFormat = AudioFormat.
|
|
159
159
|
PCM_24000HZ_MONO_16BIT,
|
|
160
160
|
mode: str = 'server_commit',
|
|
161
|
+
sample_rate: int = None,
|
|
162
|
+
volume: int = None,
|
|
163
|
+
speech_rate: float = None,
|
|
164
|
+
audio_format: str = None,
|
|
165
|
+
pitch_rate: float = None,
|
|
166
|
+
bit_rate: int = None,
|
|
161
167
|
language_type: str = None,
|
|
162
168
|
**kwargs) -> None:
|
|
163
169
|
'''
|
|
@@ -173,6 +179,18 @@ class QwenTtsRealtime:
|
|
|
173
179
|
response mode, server_commit or commit
|
|
174
180
|
language_type: str
|
|
175
181
|
language type for synthesized audio, default is 'auto'
|
|
182
|
+
sample_rate: int
|
|
183
|
+
sampleRate for tts, range [8000,16000,22050,24000,44100,48000] default is 24000
|
|
184
|
+
volume: int
|
|
185
|
+
volume for tts, range [0,100] default is 50
|
|
186
|
+
speech_rate: float
|
|
187
|
+
speech_rate for tts, range [0.5~2.0] default is 1.0
|
|
188
|
+
audio_format: str
|
|
189
|
+
format for tts, support mp3,wav,pcm,opus, default is 'pcm'
|
|
190
|
+
pitch_rate: float
|
|
191
|
+
pitch_rate for tts, range [0.5~2.0] default is 1.0
|
|
192
|
+
bit_rate: int
|
|
193
|
+
bit_rate for tts, support 6~510,default is 128kbps. only work on format: opus/mp3
|
|
176
194
|
'''
|
|
177
195
|
self.config = {
|
|
178
196
|
'voice': voice,
|
|
@@ -180,6 +198,19 @@ class QwenTtsRealtime:
|
|
|
180
198
|
'response_format': response_format.format,
|
|
181
199
|
'sample_rate': response_format.sample_rate,
|
|
182
200
|
}
|
|
201
|
+
if sample_rate is not None: # 如果配置,则更新
|
|
202
|
+
self.config['sample_rate'] = sample_rate
|
|
203
|
+
if volume is not None:
|
|
204
|
+
self.config['volume'] = volume
|
|
205
|
+
if speech_rate is not None:
|
|
206
|
+
self.config['speech_rate'] = speech_rate
|
|
207
|
+
if audio_format is not None:
|
|
208
|
+
self.config['response_format'] = audio_format # 如果配置,则更新
|
|
209
|
+
if pitch_rate is not None:
|
|
210
|
+
self.config['pitch_rate'] = pitch_rate
|
|
211
|
+
if bit_rate is not None:
|
|
212
|
+
self.config['bit_rate'] = bit_rate
|
|
213
|
+
|
|
183
214
|
if language_type is not None:
|
|
184
215
|
self.config['language_type'] = language_type
|
|
185
216
|
self.config.update(kwargs)
|
dashscope/version.py
CHANGED
|
@@ -3,7 +3,7 @@ dashscope/cli.py,sha256=64oGkevgX0RHPPmMg0sevXDgaFLQNA_0vdtjQ7Z2pHM,26492
|
|
|
3
3
|
dashscope/files.py,sha256=vRDQygm3lOqBZR73o7KNHs1iTBVuvLncuwJNxIYjzAU,3981
|
|
4
4
|
dashscope/model.py,sha256=B5v_BtYLPqj6raClejBgdKg6WTGwhH_f-20pvsQqmsk,1491
|
|
5
5
|
dashscope/models.py,sha256=dE4mzXkl85G343qVylSGpURPRdA5pZSqXlx6PcxqC_Q,1275
|
|
6
|
-
dashscope/version.py,sha256=
|
|
6
|
+
dashscope/version.py,sha256=UaLPrZoMfhMjtizKqPyvCUg1ygoSzN3XtdK4zd1hgTE,75
|
|
7
7
|
dashscope/aigc/__init__.py,sha256=kYvYEoRK-NUHyMWpBDNQBz4fVA__uOhHRK2kDTBaWgk,617
|
|
8
8
|
dashscope/aigc/chat_completion.py,sha256=ONlyyssIbfaKKcFo7cEKhHx5OCF2XX810HFzIExW1ho,14813
|
|
9
9
|
dashscope/aigc/code_generation.py,sha256=p_mxDKJLQMW0IjFD46JRlZuEZCRESSVKEfLlAevBtqw,10936
|
|
@@ -16,7 +16,7 @@ dashscope/api_entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3
|
|
|
16
16
|
dashscope/api_entities/aiohttp_request.py,sha256=1L7XdIJ9L65cQmX8x9JCR4t5hNIMDrbiWADfKKp9yfo,10280
|
|
17
17
|
dashscope/api_entities/api_request_data.py,sha256=04rpYPNK1HkT3iTPJmZpquH621xcBbe8R8EGrDJSLt0,5514
|
|
18
18
|
dashscope/api_entities/api_request_factory.py,sha256=ynpbFmxSne4dJkv5m40Vlwt4hJSxQPprAuUgMSQIQDg,5639
|
|
19
|
-
dashscope/api_entities/base_request.py,sha256=
|
|
19
|
+
dashscope/api_entities/base_request.py,sha256=3_QvQ9g_m2G4qvSc46OM5k-lKvF98Gc1HvHo1CVy5cQ,1220
|
|
20
20
|
dashscope/api_entities/chat_completion_types.py,sha256=1WMWPszhM3HaJBVz-ZXx-El4D8-RfVUL3ym65xsDRLk,11435
|
|
21
21
|
dashscope/api_entities/dashscope_response.py,sha256=31guU41ePkLyFsVVN-1WODXdOHiURzRyxxhrUmX9dGM,22835
|
|
22
22
|
dashscope/api_entities/encryption.py,sha256=rUCZx3wwVvS5oyKXEeWgyWPxM8Y5d4AaVdgxLhizBqA,5517
|
|
@@ -32,7 +32,7 @@ dashscope/assistants/files.py,sha256=CaQkZK7TFeMaAxtqMi-1rBVJrlKXdehZG9plNZ6zslo
|
|
|
32
32
|
dashscope/audio/__init__.py,sha256=7e3ejVsDJxEbMHN-9E0nEDfU-CnnQ4JgtgUxqNs0IG4,192
|
|
33
33
|
dashscope/audio/asr/__init__.py,sha256=JoCenJAUVOQXPmAn1toKeFYCfc8BqNn0NKpqjuJvNJc,1055
|
|
34
34
|
dashscope/audio/asr/asr_phrase_manager.py,sha256=vHOLExaKCtjedkihIu7gyfQyarR9rN5JZn79LvlCpco,7693
|
|
35
|
-
dashscope/audio/asr/recognition.py,sha256
|
|
35
|
+
dashscope/audio/asr/recognition.py,sha256=-xMcdwHbjTV1RIQRQguzBzB5pKd1tskrDukLgzsJDi8,20999
|
|
36
36
|
dashscope/audio/asr/transcription.py,sha256=lYzPjh7jJQwjMoxx8-AY0YCMBKNKO0bi7xd5tZGSHPc,9094
|
|
37
37
|
dashscope/audio/asr/translation_recognizer.py,sha256=JgBmhkIl_kqH8uVwop6Fba5KlXccftKFrhaygN9PKjU,39680
|
|
38
38
|
dashscope/audio/asr/vocabulary.py,sha256=N0pMS2x1lDxqJ14FgTGKctfuVkR2_hlEsCNWFcgYpTY,6717
|
|
@@ -41,7 +41,7 @@ dashscope/audio/qwen_omni/omni_realtime.py,sha256=b7t14nsciA8YcJ4MGr2GzmDxbgBR2w
|
|
|
41
41
|
dashscope/audio/qwen_tts/__init__.py,sha256=JS3axY1grqO0aTIJufZ3KS1JsU6yf6y4K2CQlNvUK9I,132
|
|
42
42
|
dashscope/audio/qwen_tts/speech_synthesizer.py,sha256=7LHR-PXhn-VE1cCOp_82Jq0zE9rMc3xy3dszUeyLLNs,2927
|
|
43
43
|
dashscope/audio/qwen_tts_realtime/__init__.py,sha256=vVkmeJr_mEAn_O0Rh5AU3ICg6qIZqppUryJ5lY8VYPo,254
|
|
44
|
-
dashscope/audio/qwen_tts_realtime/qwen_tts_realtime.py,sha256=
|
|
44
|
+
dashscope/audio/qwen_tts_realtime/qwen_tts_realtime.py,sha256=VwIvB4OwS8RP5JC5AO_ktdE2v3bZzvEQmBGNHOoBUJo,12046
|
|
45
45
|
dashscope/audio/tts/__init__.py,sha256=xYpMFseUZGgqgj_70zcX2VsLv-L7qxJ3d-bbdj_hO0I,245
|
|
46
46
|
dashscope/audio/tts/speech_synthesizer.py,sha256=vD1xQV-rew8qAsIaAGH5amsNtB0SqdtNhVHhJHGQ-xk,7622
|
|
47
47
|
dashscope/audio/tts_v2/__init__.py,sha256=me9a3_7KsHQxcJ8hx4SeKlY1e_ThHVvGMw7Yn0uoscM,333
|
|
@@ -73,7 +73,7 @@ dashscope/multimodal/__init__.py,sha256=fyqeolbDLWVn5wSpPZ3nAOnUBRF9k6mlsy6dCmgj
|
|
|
73
73
|
dashscope/multimodal/dialog_state.py,sha256=CtOdfGWhq0ePG3bc8-7inhespETtPD4QDli1513hd1A,1522
|
|
74
74
|
dashscope/multimodal/multimodal_constants.py,sha256=z_QVq01E43FAqKQnDu9vdf89d1zuYlWyANewWTEXVJM,1282
|
|
75
75
|
dashscope/multimodal/multimodal_dialog.py,sha256=HymlaQYp7SgJdoKbT27SNiviyRRoM91zklNBwTHmm1Q,23939
|
|
76
|
-
dashscope/multimodal/multimodal_request_params.py,sha256=
|
|
76
|
+
dashscope/multimodal/multimodal_request_params.py,sha256=XcPhr6lhz7DdGKPmQxVIzh2Nn4t25VhY0LABF1UmVXk,9385
|
|
77
77
|
dashscope/multimodal/tingwu/__init__.py,sha256=Gi9GEM0bdeJlZpvyksSeHOc2--_tG5aF6QAx6TAS2fE,225
|
|
78
78
|
dashscope/multimodal/tingwu/tingwu.py,sha256=01d-QOeuB1QmRhiZqbXJ8pHoGqT0C-xZTjIs_ZBXOyw,2613
|
|
79
79
|
dashscope/multimodal/tingwu/tingwu_realtime.py,sha256=oBeqrZit3uBZHuyI7m9VILz2qaqJRMO0-Nm2eJ5Q63g,20215
|
|
@@ -100,9 +100,9 @@ dashscope/tokenizers/tokenizer.py,sha256=3FQVDvMNkCW9ccYeJdjrd_PIMMD3Xv7aNZkaYOE
|
|
|
100
100
|
dashscope/tokenizers/tokenizer_base.py,sha256=5EJIFuizMWESEmLmbd38yJnfeHmPnzZPwsO4aOGjpl4,707
|
|
101
101
|
dashscope/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
102
102
|
dashscope/utils/oss_utils.py,sha256=aZIHlMN2JOfVw6kp0SVrMw_N1MfoTcR_-wiRbJ7DgHw,7501
|
|
103
|
-
dashscope-1.24.
|
|
104
|
-
dashscope-1.24.
|
|
105
|
-
dashscope-1.24.
|
|
106
|
-
dashscope-1.24.
|
|
107
|
-
dashscope-1.24.
|
|
108
|
-
dashscope-1.24.
|
|
103
|
+
dashscope-1.24.10.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
104
|
+
dashscope-1.24.10.dist-info/METADATA,sha256=LkFkHfmAxlARg_pNjufd7N664cKhr_KdP4eZuZ5QdjU,7147
|
|
105
|
+
dashscope-1.24.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
106
|
+
dashscope-1.24.10.dist-info/entry_points.txt,sha256=e9C3sOf9zDYL0O5ROEGX6FT8w-QK_kaGRWmPZDHAFys,49
|
|
107
|
+
dashscope-1.24.10.dist-info/top_level.txt,sha256=woqavFJK9zas5xTqynmALqOtlafghjsk63Xk86powTU,10
|
|
108
|
+
dashscope-1.24.10.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|