dashscope 1.24.0__py3-none-any.whl → 1.24.1__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.

@@ -81,6 +81,7 @@ class Upstream:
81
81
  type: str = field(default="AudioOnly") # 上行类型:AudioOnly 仅语音通话; AudioAndVideo 上传视频
82
82
  mode: str = field(default="tap2talk") # 客户端交互模式 push2talk/tap2talk/duplex
83
83
  # sample_rate: int # 合成音频采样率
84
+ pass_through_params: dict = field(default=None)
84
85
 
85
86
  def to_dict(self):
86
87
  upstream: dict = {
File without changes
@@ -0,0 +1,80 @@
1
+ from typing import Dict, Any
2
+
3
+ from dashscope.api_entities.api_request_factory import _build_api_request
4
+ from dashscope.api_entities.dashscope_response import DashScopeAPIResponse
5
+ from dashscope.client.base_api import BaseApi
6
+ from dashscope.common.error import ModelRequired
7
+
8
+
9
+ class TingWu(BaseApi):
10
+ """API for TingWu APP.
11
+
12
+ """
13
+
14
+ task = None
15
+ task_group = None
16
+ function = None
17
+
18
+ @classmethod
19
+ def call(
20
+ cls,
21
+ model: str,
22
+ user_defined_input: Dict[str, Any],
23
+ parameters: Dict[str, Any] = None,
24
+ api_key: str = None,
25
+ **kwargs
26
+ ) -> DashScopeAPIResponse:
27
+ """Call generation model service.
28
+
29
+ Args:
30
+ model (str): The requested model, such as qwen-turbo
31
+ api_key (str, optional): The api api_key, can be None,
32
+ if None, will get by default rule(TODO: api key doc).
33
+ user_defined_input: custom input
34
+ parameters: custom parameters
35
+ **kwargs:
36
+ base_address: base address
37
+ additional parameters for request
38
+
39
+ Raises:
40
+ InvalidInput: The history and auto_history are mutually exclusive.
41
+
42
+ Returns:
43
+ Union[GenerationResponse,
44
+ Generator[GenerationResponse, None, None]]: If
45
+ stream is True, return Generator, otherwise GenerationResponse.
46
+ """
47
+ if model is None or not model:
48
+ raise ModelRequired('Model is required!')
49
+ input_config, parameters = cls._build_input_parameters(input_config=user_defined_input,
50
+ params=parameters,
51
+ **kwargs)
52
+
53
+ request = _build_api_request(
54
+ model=model,
55
+ input=input_config,
56
+ api_key=api_key,
57
+ task_group=TingWu.task_group,
58
+ task=TingWu.task,
59
+ function=TingWu.function,
60
+ is_service=False,
61
+ **parameters)
62
+ response = request.call()
63
+
64
+ return response
65
+
66
+ @classmethod
67
+ def _build_input_parameters(cls,
68
+ input_config,
69
+ params: Dict[str, Any] = None,
70
+ **kwargs):
71
+ parameters = {}
72
+ if params is not None:
73
+ parameters = params
74
+
75
+ input_param = input_config
76
+
77
+ if kwargs.keys() is not None:
78
+ for key in kwargs.keys():
79
+ parameters[key] = kwargs[key]
80
+ return input_param, {**parameters, **kwargs}
dashscope/version.py CHANGED
@@ -1,3 +1,3 @@
1
1
  # Copyright (c) Alibaba, Inc. and its affiliates.
2
2
 
3
- __version__ = '1.24.0'
3
+ __version__ = '1.24.1'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dashscope
3
- Version: 1.24.0
3
+ Version: 1.24.1
4
4
  Summary: dashscope client sdk library
5
5
  Home-page: https://dashscope.aliyun.com/
6
6
  Author: Alibaba Cloud
@@ -3,7 +3,7 @@ dashscope/cli.py,sha256=BfABF8T7uVttfHTSCqGiIcA_XuiYUfCnQ9WLvSUV0Ys,25646
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=Jh_ywQtA3fN22w5spp6Y1H_sgZduUBIV7g5eOVdEETE,74
6
+ dashscope/version.py,sha256=nxaFMFG8XljEkSkDtFtMZoYaJS2vs0B00JCGab12YHI,74
7
7
  dashscope/aigc/__init__.py,sha256=AuRhu_vA1K0tbs_C6DgcZYhTvxMuzDgpwHJNHzEPIHg,442
8
8
  dashscope/aigc/chat_completion.py,sha256=ONlyyssIbfaKKcFo7cEKhHx5OCF2XX810HFzIExW1ho,14813
9
9
  dashscope/aigc/code_generation.py,sha256=p_mxDKJLQMW0IjFD46JRlZuEZCRESSVKEfLlAevBtqw,10936
@@ -73,7 +73,9 @@ dashscope/multimodal/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hS
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=9Dlvyy0u67K5FtMfWkCRLHKsevTM8jvT2V-OljZP5sM,8350
76
+ dashscope/multimodal/multimodal_request_params.py,sha256=Lbxf_kLnFUkhty8AU9wL7ws9tYbmhHPVmsiXLdynlJg,8402
77
+ dashscope/multimodal/tingwu/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
78
+ dashscope/multimodal/tingwu/tingwu.py,sha256=01d-QOeuB1QmRhiZqbXJ8pHoGqT0C-xZTjIs_ZBXOyw,2613
77
79
  dashscope/nlp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
78
80
  dashscope/nlp/understanding.py,sha256=00ado-ibYEzBRT0DgKGd3bohQDNW73xnFhJ_1aa87lw,2880
79
81
  dashscope/protocol/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -97,9 +99,9 @@ dashscope/tokenizers/tokenizer.py,sha256=3FQVDvMNkCW9ccYeJdjrd_PIMMD3Xv7aNZkaYOE
97
99
  dashscope/tokenizers/tokenizer_base.py,sha256=5EJIFuizMWESEmLmbd38yJnfeHmPnzZPwsO4aOGjpl4,707
98
100
  dashscope/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
99
101
  dashscope/utils/oss_utils.py,sha256=VHdHBVYNmWEWS2Kgz_2xMwCtqJqDVjWb5logIkESBsA,7497
100
- dashscope-1.24.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
101
- dashscope-1.24.0.dist-info/METADATA,sha256=eQBLGwKE2J2qwexyNLfsvm8bAcyzyAMgYnBY6EIrSBU,7123
102
- dashscope-1.24.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
103
- dashscope-1.24.0.dist-info/entry_points.txt,sha256=e9C3sOf9zDYL0O5ROEGX6FT8w-QK_kaGRWmPZDHAFys,49
104
- dashscope-1.24.0.dist-info/top_level.txt,sha256=woqavFJK9zas5xTqynmALqOtlafghjsk63Xk86powTU,10
105
- dashscope-1.24.0.dist-info/RECORD,,
102
+ dashscope-1.24.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
103
+ dashscope-1.24.1.dist-info/METADATA,sha256=2bnSvO77hyC19Y8iu_nSz9CB_yocV6f1ksqYMqbdLgE,7123
104
+ dashscope-1.24.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
105
+ dashscope-1.24.1.dist-info/entry_points.txt,sha256=e9C3sOf9zDYL0O5ROEGX6FT8w-QK_kaGRWmPZDHAFys,49
106
+ dashscope-1.24.1.dist-info/top_level.txt,sha256=woqavFJK9zas5xTqynmALqOtlafghjsk63Xk86powTU,10
107
+ dashscope-1.24.1.dist-info/RECORD,,