dashscope 1.20.11__py3-none-any.whl → 1.20.13__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/api_request_factory.py +9 -2
- dashscope/common/utils.py +1 -1
- dashscope/version.py +1 -1
- {dashscope-1.20.11.dist-info → dashscope-1.20.13.dist-info}/METADATA +1 -1
- {dashscope-1.20.11.dist-info → dashscope-1.20.13.dist-info}/RECORD +9 -9
- {dashscope-1.20.11.dist-info → dashscope-1.20.13.dist-info}/LICENSE +0 -0
- {dashscope-1.20.11.dist-info → dashscope-1.20.13.dist-info}/WHEEL +0 -0
- {dashscope-1.20.11.dist-info → dashscope-1.20.13.dist-info}/entry_points.txt +0 -0
- {dashscope-1.20.11.dist-info → dashscope-1.20.13.dist-info}/top_level.txt +0 -0
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from urllib.parse import urlencode
|
|
2
|
+
|
|
1
3
|
import dashscope
|
|
2
4
|
from dashscope.api_entities.api_request_data import ApiRequestData
|
|
3
5
|
from dashscope.api_entities.http_request import HttpRequest
|
|
@@ -26,9 +28,10 @@ def _get_protocol_params(kwargs):
|
|
|
26
28
|
resources = kwargs.pop('resources', None)
|
|
27
29
|
base_address = kwargs.pop('base_address', None)
|
|
28
30
|
flattened_output = kwargs.pop('flattened_output', False)
|
|
31
|
+
extra_url_parameters = kwargs.pop('extra_url_parameters', None)
|
|
29
32
|
return (api_protocol, ws_stream_mode, is_binary_input, http_method, stream,
|
|
30
33
|
async_request, query, headers, request_timeout, form, resources,
|
|
31
|
-
base_address, flattened_output)
|
|
34
|
+
base_address, flattened_output, extra_url_parameters)
|
|
32
35
|
|
|
33
36
|
|
|
34
37
|
def _build_api_request(model: str,
|
|
@@ -41,7 +44,8 @@ def _build_api_request(model: str,
|
|
|
41
44
|
**kwargs):
|
|
42
45
|
(api_protocol, ws_stream_mode, is_binary_input, http_method, stream,
|
|
43
46
|
async_request, query, headers, request_timeout, form, resources,
|
|
44
|
-
base_address, flattened_output
|
|
47
|
+
base_address, flattened_output,
|
|
48
|
+
extra_url_parameters) = _get_protocol_params(kwargs)
|
|
45
49
|
task_id = kwargs.pop('task_id', None)
|
|
46
50
|
if api_protocol in [ApiProtocol.HTTP, ApiProtocol.HTTPS]:
|
|
47
51
|
if base_address is None:
|
|
@@ -60,6 +64,9 @@ def _build_api_request(model: str,
|
|
|
60
64
|
http_url += '%s/' % task
|
|
61
65
|
if function:
|
|
62
66
|
http_url += function
|
|
67
|
+
if extra_url_parameters is not None and extra_url_parameters:
|
|
68
|
+
http_url += '?' + urlencode(extra_url_parameters)
|
|
69
|
+
|
|
63
70
|
request = HttpRequest(url=http_url,
|
|
64
71
|
api_key=api_key,
|
|
65
72
|
http_method=http_method,
|
dashscope/common/utils.py
CHANGED
|
@@ -314,7 +314,7 @@ async def _handle_aiohttp_failed_response(
|
|
|
314
314
|
flattened_output: bool = False) -> DashScopeAPIResponse:
|
|
315
315
|
request_id = ''
|
|
316
316
|
if 'application/json' in response.content_type:
|
|
317
|
-
error = response.json()
|
|
317
|
+
error = await response.json()
|
|
318
318
|
return _handle_error_message(error, response.status, flattened_output)
|
|
319
319
|
elif SSE_CONTENT_TYPE in response.content_type:
|
|
320
320
|
async for _, _, data in _handle_aio_stream(response):
|
dashscope/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = '1.20.
|
|
1
|
+
__version__ = '1.20.13'
|
|
@@ -6,7 +6,7 @@ dashscope/files.py,sha256=QgJjwhtn9F548nCA8jD8OvE6aQEj-20hZqJgYXsUdQU,3930
|
|
|
6
6
|
dashscope/finetune.py,sha256=_tflDUvu0KagSoCzLaf0hofpG_P8NU6PylL8CPjVhrA,6243
|
|
7
7
|
dashscope/model.py,sha256=UPOn1qMYFhX-ovXi3BMxZEBk8qOK7WLJOYHMbPZwYBo,1440
|
|
8
8
|
dashscope/models.py,sha256=1-bc-Ue68zurgu_y6RhfFr9uzeQMF5AZq-C32lJGMGU,1224
|
|
9
|
-
dashscope/version.py,sha256=
|
|
9
|
+
dashscope/version.py,sha256=S_Jpp_0DyAr58XdPBnt8Vp3igXO6V6giLNnGEK_HJHQ,24
|
|
10
10
|
dashscope/aigc/__init__.py,sha256=s-MCA87KYiVumYtKtJi5IMN7xelSF6TqEU3s3_7RF-Y,327
|
|
11
11
|
dashscope/aigc/code_generation.py,sha256=KAJVrGp6tiNFBBg64Ovs9RfcP5SrIhrbW3wdA89NKso,10885
|
|
12
12
|
dashscope/aigc/conversation.py,sha256=xRoJlCR-IXHjSdkDrK74a9ut1FJg0FZhTNXZAJC18MA,14231
|
|
@@ -16,7 +16,7 @@ dashscope/aigc/multimodal_conversation.py,sha256=SlNnnsUPV19gdx8fYJAtsMFWPNGY6vh
|
|
|
16
16
|
dashscope/api_entities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
17
|
dashscope/api_entities/aiohttp_request.py,sha256=aE3AeWba8Ig_xHMYjrAdkq0N61l_L2VFTG6HYh912X0,10229
|
|
18
18
|
dashscope/api_entities/api_request_data.py,sha256=JUMcfpJjKXEZLCBSFIDpgoaeQYk5uK9-CwhM4OHIHFQ,5463
|
|
19
|
-
dashscope/api_entities/api_request_factory.py,sha256=
|
|
19
|
+
dashscope/api_entities/api_request_factory.py,sha256=j4VOA1qKzvsK6-BOHGyA35oqsMkNoc4xZe9GHefV0fU,4947
|
|
20
20
|
dashscope/api_entities/base_request.py,sha256=cXUL7xqSV8wBr5d-1kx65AO3IsRR9A_ps6Lok-v-MKM,926
|
|
21
21
|
dashscope/api_entities/dashscope_response.py,sha256=Bp1T7HwVlkOvpMNg-AEjz-BScxhLUXMXlE8ApXTtfhQ,17872
|
|
22
22
|
dashscope/api_entities/http_request.py,sha256=pYE8qRMu9CaQDiugPlXeYoaj_diBv-ZDExCD3WNhehI,13259
|
|
@@ -50,7 +50,7 @@ dashscope/common/env.py,sha256=oQOZW5JyEeTSde394un2lpDJ5RBh4fMU9hBfbtrKKkc,869
|
|
|
50
50
|
dashscope/common/error.py,sha256=Q7GRhniP-7ap4HBpU69frRdKgKLwmH4ySYxCtupsr60,2638
|
|
51
51
|
dashscope/common/logging.py,sha256=ecGxylG3bWES_Xv5-BD6ep4_0Ciu7F6ZPBjiZtu9Jx4,984
|
|
52
52
|
dashscope/common/message_manager.py,sha256=i5149WzDk6nWmdFaHzYx4USXMBeX18GKSI-F4fLwbN0,1097
|
|
53
|
-
dashscope/common/utils.py,sha256=
|
|
53
|
+
dashscope/common/utils.py,sha256=pMrJJWO3YV77VUFRhoKT7SdCMlopmXx0TgSzPuI3OYM,15388
|
|
54
54
|
dashscope/customize/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
55
55
|
dashscope/customize/customize_types.py,sha256=ZtEwSXA4dbjIYr5vgQQNkMuXyC2BNmznGuaF6b7jwr0,4803
|
|
56
56
|
dashscope/customize/deployments.py,sha256=LIkM-hmJHcJZCKV6WJIPSXQ5CAhB5PUxnt5mqKbVbfE,5189
|
|
@@ -85,9 +85,9 @@ dashscope/tokenizers/tokenizer.py,sha256=y6P91qTCYo__pEx_0VHAcj9YECfbUdRqZU1fdGT
|
|
|
85
85
|
dashscope/tokenizers/tokenizer_base.py,sha256=REDhzRyDT13iequ61-a6_KcTy0GFKlihQve5HkyoyRs,656
|
|
86
86
|
dashscope/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
87
87
|
dashscope/utils/oss_utils.py,sha256=7vZ2Lypxwiit8VcAqAvr3cCyhVfaLapDiNuF-H3ZCD4,7332
|
|
88
|
-
dashscope-1.20.
|
|
89
|
-
dashscope-1.20.
|
|
90
|
-
dashscope-1.20.
|
|
91
|
-
dashscope-1.20.
|
|
92
|
-
dashscope-1.20.
|
|
93
|
-
dashscope-1.20.
|
|
88
|
+
dashscope-1.20.13.dist-info/LICENSE,sha256=Izp5L1DF1Mbza6qojkqNNWlE_mYLnr4rmzx2EBF8YFw,11413
|
|
89
|
+
dashscope-1.20.13.dist-info/METADATA,sha256=LdYg6imH5DQJpKnK2iRS77l5js8bPweeV2yO-M6AfcA,6642
|
|
90
|
+
dashscope-1.20.13.dist-info/WHEEL,sha256=G16H4A3IeoQmnOrYV4ueZGKSjhipXx8zc8nu9FGlvMA,92
|
|
91
|
+
dashscope-1.20.13.dist-info/entry_points.txt,sha256=raEp5dOuj8whJ7yqZlDM8WQ5p2RfnGrGNo0QLQEnatY,50
|
|
92
|
+
dashscope-1.20.13.dist-info/top_level.txt,sha256=woqavFJK9zas5xTqynmALqOtlafghjsk63Xk86powTU,10
|
|
93
|
+
dashscope-1.20.13.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|