dashscope 2.1.1__tar.gz → 2.1.2__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.
Files changed (505) hide show
  1. {dashscope-2.1.1 → dashscope-2.1.2}/PKG-INFO +1 -1
  2. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/agentstudio/resources/usage.py +2 -0
  3. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/api_entities/api_request_factory.py +18 -0
  4. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/api_entities/dashscope_response.py +1 -1
  5. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/audio/tts/speech_synthesizer.py +8 -3
  6. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/common/utils.py +17 -0
  7. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/transport/sse.py +4 -0
  8. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/version.py +1 -1
  9. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope.egg-info/PKG-INFO +1 -1
  10. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope.egg-info/SOURCES.txt +2 -0
  11. {dashscope-2.1.1 → dashscope-2.1.2}/setup.py +5 -18
  12. dashscope-2.1.2/tests/test_docs_reference.py +199 -0
  13. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_finetune_rl_shim.py +48 -15
  14. dashscope-2.1.2/tests/test_release_notes_script.py +162 -0
  15. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_sse.py +57 -15
  16. {dashscope-2.1.1 → dashscope-2.1.2}/LICENSE +0 -0
  17. {dashscope-2.1.1 → dashscope-2.1.2}/LICENSE.certifi +0 -0
  18. {dashscope-2.1.1 → dashscope-2.1.2}/MANIFEST.in +0 -0
  19. {dashscope-2.1.1 → dashscope-2.1.2}/NOTICE +0 -0
  20. {dashscope-2.1.1 → dashscope-2.1.2}/README.md +0 -0
  21. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/__init__.py +0 -0
  22. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/__init__.pyi +0 -0
  23. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/_config.py +0 -0
  24. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/_error_registry.py +0 -0
  25. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/_logging.py +0 -0
  26. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/_quickstart.py +0 -0
  27. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/_shared/__init__.py +0 -0
  28. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/_shared/_errors.py +0 -0
  29. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/_shared/_sdk_ident.py +0 -0
  30. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/_shared/_sdk_session.py +0 -0
  31. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/_shared/_validation.py +0 -0
  32. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/__init__.py +0 -0
  33. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/agentstudio/__init__.py +0 -0
  34. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/agentstudio/client.py +0 -0
  35. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/agentstudio/constants.py +0 -0
  36. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/agentstudio/exceptions.py +0 -0
  37. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/agentstudio/pagination.py +0 -0
  38. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/agentstudio/resources/__init__.py +0 -0
  39. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/agentstudio/resources/_helpers.py +0 -0
  40. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/agentstudio/resources/agents.py +0 -0
  41. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/agentstudio/resources/deployments.py +0 -0
  42. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/agentstudio/resources/environments.py +0 -0
  43. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/agentstudio/resources/files.py +0 -0
  44. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/agentstudio/resources/memory_stores.py +0 -0
  45. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/agentstudio/resources/security.py +0 -0
  46. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/agentstudio/resources/session_events.py +0 -0
  47. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/agentstudio/resources/session_resources.py +0 -0
  48. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/agentstudio/resources/session_threads.py +0 -0
  49. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/agentstudio/resources/sessions.py +0 -0
  50. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/agentstudio/resources/skills.py +0 -0
  51. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/agentstudio/resources/vaults.py +0 -0
  52. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/agentstudio/resources/webhook_endpoints.py +0 -0
  53. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/agentstudio/streaming.py +0 -0
  54. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/agentstudio/transport.py +0 -0
  55. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/agentstudio/types/__init__.py +0 -0
  56. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/agentstudio/types/models.py +0 -0
  57. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/agentstudio/types/params.py +0 -0
  58. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/__init__.py +0 -0
  59. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/_submit.py +0 -0
  60. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/agentic_rl.py +0 -0
  61. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/reinforcement/__init__.py +0 -0
  62. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/reinforcement/common/__init__.py +0 -0
  63. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/reinforcement/common/_legacy_errors.py +0 -0
  64. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/reinforcement/common/constants.py +0 -0
  65. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/reinforcement/common/errors.py +0 -0
  66. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/reinforcement/common/log.py +0 -0
  67. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/reinforcement/common/model.py +0 -0
  68. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/reinforcement/common/model_types.py +0 -0
  69. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/reinforcement/common/utils.py +0 -0
  70. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/reinforcement/component/__init__.py +0 -0
  71. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/reinforcement/component/data/__init__.py +0 -0
  72. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/reinforcement/component/data/base_data_model.py +0 -0
  73. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/reinforcement/component/data/group_reward_input.py +0 -0
  74. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/reinforcement/component/data/group_reward_output.py +0 -0
  75. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/reinforcement/component/data/reward_input.py +0 -0
  76. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/reinforcement/component/data/reward_output.py +0 -0
  77. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/reinforcement/component/data/rollout_input.py +0 -0
  78. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/reinforcement/component/data/rollout_output.py +0 -0
  79. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/reinforcement/component/demo/__init__.py +0 -0
  80. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/reinforcement/component/demo/group_reward_processor_demo.py +0 -0
  81. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/reinforcement/component/demo/reward_processor_demo.py +0 -0
  82. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/reinforcement/component/demo/rollout_processor_demo.py +0 -0
  83. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/reinforcement/component/func_decorator.py +0 -0
  84. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/reinforcement/component/func_manager.py +0 -0
  85. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/reinforcement/component/observability/__init__.py +0 -0
  86. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/reinforcement/component/observability/genai/__init__.py +0 -0
  87. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/reinforcement/component/observability/genai/_core.py +0 -0
  88. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/reinforcement/component/observability/genai/llm_dashscope.py +0 -0
  89. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/reinforcement/component/observability/genai/llm_openai.py +0 -0
  90. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/reinforcement/component/observability/genai/llm_span.py +0 -0
  91. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/reinforcement/component/observability/genai/messages.py +0 -0
  92. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/reinforcement/component/observability/genai/tools.py +0 -0
  93. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/reinforcement/component/observability/processor_span.py +0 -0
  94. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/reinforcement/component/observability/tracing.py +0 -0
  95. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/reinforcement/component/parser/__init__.py +0 -0
  96. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/reinforcement/component/parser/base_parser.py +0 -0
  97. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/reinforcement/component/parser/group_reward_parser.py +0 -0
  98. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/reinforcement/component/parser/reward_parser.py +0 -0
  99. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/reinforcement/component/parser/rollout_parser.py +0 -0
  100. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/reinforcement/component/processor/__init__.py +0 -0
  101. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/reinforcement/component/processor/abstract_group_reward_processor.py +0 -0
  102. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/reinforcement/component/processor/abstract_processor.py +0 -0
  103. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/reinforcement/component/processor/abstract_reward_processor.py +0 -0
  104. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/reinforcement/component/processor/abstract_rollout_processor.py +0 -0
  105. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/reinforcement/component/server/__init__.py +0 -0
  106. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/applications/finetune/reinforcement/component/server/server.py +0 -0
  107. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/cli/__init__.py +0 -0
  108. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/cli/__main__.py +0 -0
  109. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/cli/app.py +0 -0
  110. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/cli/commands/__init__.py +0 -0
  111. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/cli/commands/agentstudio.py +0 -0
  112. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/cli/commands/apps.py +0 -0
  113. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/cli/commands/audio.py +0 -0
  114. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/cli/commands/audio_customization.py +0 -0
  115. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/cli/commands/auth.py +0 -0
  116. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/cli/commands/chat.py +0 -0
  117. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/cli/commands/config.py +0 -0
  118. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/cli/commands/decision.py +0 -0
  119. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/cli/commands/deployments.py +0 -0
  120. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/cli/commands/embeddings.py +0 -0
  121. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/cli/commands/files.py +0 -0
  122. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/cli/commands/ft.py +0 -0
  123. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/cli/commands/images.py +0 -0
  124. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/cli/commands/models.py +0 -0
  125. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/cli/commands/multimodal.py +0 -0
  126. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/cli/commands/oss.py +0 -0
  127. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/cli/commands/rerank.py +0 -0
  128. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/cli/commands/rl.py +0 -0
  129. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/cli/commands/tingwu.py +0 -0
  130. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/cli/commands/tokenization.py +0 -0
  131. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/cli/commands/videos.py +0 -0
  132. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/cli/config_store.py +0 -0
  133. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/cli/confirm.py +0 -0
  134. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/cli/context.py +0 -0
  135. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/cli/errors.py +0 -0
  136. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/cli/input.py +0 -0
  137. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/cli/main.py +0 -0
  138. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/cli/output.py +0 -0
  139. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/cli/progress.py +0 -0
  140. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/cli/sdk.py +0 -0
  141. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/client.py +0 -0
  142. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/devkit/__init__.py +0 -0
  143. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/devkit/diagnosis.py +0 -0
  144. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/devkit/mock.py +0 -0
  145. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/errors.py +0 -0
  146. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/expert.py +0 -0
  147. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/__init__.py +0 -0
  148. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/_shim.py +0 -0
  149. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/agentstudio/__init__.py +0 -0
  150. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/agentstudio/client.py +0 -0
  151. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/agentstudio/exceptions.py +0 -0
  152. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/agentstudio/streaming.py +0 -0
  153. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/agentstudio/transport.py +0 -0
  154. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/aigc/__init__.py +0 -0
  155. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/aigc/chat_completion.py +0 -0
  156. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/aigc/code_generation.py +0 -0
  157. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/aigc/conversation.py +0 -0
  158. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/aigc/generation.py +0 -0
  159. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/aigc/image_generation.py +0 -0
  160. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/aigc/image_synthesis.py +0 -0
  161. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/aigc/multimodal_conversation.py +0 -0
  162. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/aigc/video_synthesis.py +0 -0
  163. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/api_entities/__init__.py +0 -0
  164. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/api_entities/aio_session.py +0 -0
  165. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/api_entities/aiohttp_request.py +0 -0
  166. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/api_entities/api_request_data.py +0 -0
  167. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/api_entities/base_request.py +0 -0
  168. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/api_entities/chat_completion_types.py +0 -0
  169. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/api_entities/encryption.py +0 -0
  170. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/api_entities/http_request.py +0 -0
  171. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/api_entities/websocket_request.py +0 -0
  172. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/app/__init__.py +0 -0
  173. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/app/application.py +0 -0
  174. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/app/application_response.py +0 -0
  175. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/assistants/__init__.py +0 -0
  176. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/assistants/assistant_types.py +0 -0
  177. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/assistants/assistants.py +0 -0
  178. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/assistants/files.py +0 -0
  179. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/audio/__init__.py +0 -0
  180. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/audio/asr/__init__.py +0 -0
  181. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/audio/asr/asr_phrase_manager.py +0 -0
  182. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/audio/asr/recognition.py +0 -0
  183. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/audio/asr/transcription.py +0 -0
  184. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/audio/asr/translation_recognizer.py +0 -0
  185. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/audio/asr/vocabulary.py +0 -0
  186. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/audio/http_tts/__init__.py +0 -0
  187. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/audio/http_tts/http_speech_synthesizer.py +0 -0
  188. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/audio/qwen_asr/__init__.py +0 -0
  189. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/audio/qwen_asr/qwen_transcription.py +0 -0
  190. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/audio/qwen_omni/__init__.py +0 -0
  191. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/audio/qwen_omni/omni_realtime.py +0 -0
  192. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/audio/qwen_tts/__init__.py +0 -0
  193. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/audio/qwen_tts/speech_synthesizer.py +0 -0
  194. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/audio/qwen_tts_realtime/__init__.py +0 -0
  195. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/audio/qwen_tts_realtime/qwen_tts_realtime.py +0 -0
  196. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/audio/tts/__init__.py +0 -0
  197. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/audio/tts_v2/__init__.py +0 -0
  198. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/audio/tts_v2/enrollment.py +0 -0
  199. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/audio/tts_v2/speech_synthesizer.py +0 -0
  200. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/cli/__init__.py +0 -0
  201. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/cli/__main__.py +0 -0
  202. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/cli/agentic_rl.py +0 -0
  203. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/cli/application.py +0 -0
  204. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/cli/auth.py +0 -0
  205. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/cli/code_generation.py +0 -0
  206. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/cli/common.py +0 -0
  207. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/cli/deployments.py +0 -0
  208. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/cli/embeddings.py +0 -0
  209. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/cli/files.py +0 -0
  210. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/cli/fine_tunes.py +0 -0
  211. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/cli/generation.py +0 -0
  212. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/cli/image_generation.py +0 -0
  213. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/cli/image_synthesis.py +0 -0
  214. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/cli/models.py +0 -0
  215. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/cli/multimodal_conversation.py +0 -0
  216. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/cli/multimodal_embedding.py +0 -0
  217. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/cli/oss.py +0 -0
  218. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/cli/rerank.py +0 -0
  219. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/cli/speech_synthesis.py +0 -0
  220. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/cli/tokenization.py +0 -0
  221. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/cli/transcription.py +0 -0
  222. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/cli/understanding.py +0 -0
  223. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/cli/video_synthesis.py +0 -0
  224. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/client/__init__.py +0 -0
  225. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/client/base_api.py +0 -0
  226. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/common/__init__.py +0 -0
  227. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/common/_sdk_session.py +0 -0
  228. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/common/api_key.py +0 -0
  229. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/common/base_type.py +0 -0
  230. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/common/constants.py +0 -0
  231. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/common/env.py +0 -0
  232. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/common/error.py +0 -0
  233. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/common/logging.py +0 -0
  234. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/common/message_manager.py +0 -0
  235. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/embeddings/__init__.py +0 -0
  236. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/embeddings/batch_text_embedding.py +0 -0
  237. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/embeddings/batch_text_embedding_response.py +0 -0
  238. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/embeddings/multimodal_embedding.py +0 -0
  239. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/embeddings/text_embedding.py +0 -0
  240. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/files.py +0 -0
  241. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/finetune/__init__.py +0 -0
  242. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/finetune/agentic_rl.py +0 -0
  243. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/finetune/customize_types.py +0 -0
  244. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/finetune/deployments.py +0 -0
  245. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/finetune/finetunes.py +0 -0
  246. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/finetune/reinforcement/__init__.py +0 -0
  247. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/finetune/reinforcement/common/__init__.py +0 -0
  248. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/finetune/reinforcement/common/errors.py +0 -0
  249. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/io/__init__.py +0 -0
  250. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/io/input_output.py +0 -0
  251. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/model.py +0 -0
  252. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/models.py +0 -0
  253. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/multimodal/__init__.py +0 -0
  254. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/multimodal/dialog_state.py +0 -0
  255. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/multimodal/multimodal_constants.py +0 -0
  256. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/multimodal/multimodal_dialog.py +0 -0
  257. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/multimodal/multimodal_request_params.py +0 -0
  258. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/multimodal/tingwu/__init__.py +0 -0
  259. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/multimodal/tingwu/tingwu.py +0 -0
  260. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/multimodal/tingwu/tingwu_realtime.py +0 -0
  261. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/nlp/__init__.py +0 -0
  262. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/nlp/understanding.py +0 -0
  263. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/protocol/__init__.py +0 -0
  264. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/protocol/websocket.py +0 -0
  265. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/rerank/__init__.py +0 -0
  266. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/rerank/text_rerank.py +0 -0
  267. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/threads/__init__.py +0 -0
  268. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/threads/messages/__init__.py +0 -0
  269. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/threads/messages/files.py +0 -0
  270. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/threads/messages/messages.py +0 -0
  271. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/threads/runs/__init__.py +0 -0
  272. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/threads/runs/runs.py +0 -0
  273. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/threads/runs/steps.py +0 -0
  274. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/threads/thread_types.py +0 -0
  275. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/threads/threads.py +0 -0
  276. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/tokenizers/__init__.py +0 -0
  277. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/tokenizers/qwen_tokenizer.py +0 -0
  278. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/tokenizers/tokenization.py +0 -0
  279. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/tokenizers/tokenizer.py +0 -0
  280. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/tokenizers/tokenizer_base.py +0 -0
  281. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/utils/__init__.py +0 -0
  282. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/utils/message_utils.py +0 -0
  283. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/utils/oss_utils.py +0 -0
  284. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/legacy_1x/utils/param_utils.py +0 -0
  285. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/protocols/__init__.py +0 -0
  286. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/protocols/anthropic.py +0 -0
  287. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/protocols/base.py +0 -0
  288. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/protocols/native.py +0 -0
  289. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/protocols/openai.py +0 -0
  290. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/py.typed +0 -0
  291. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/resources/__init__.py +0 -0
  292. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/resources/_blocking.py +0 -0
  293. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/resources/_jobs.py +0 -0
  294. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/resources/_oss.py +0 -0
  295. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/resources/_oss_upload.py +0 -0
  296. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/resources/_sse.py +0 -0
  297. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/resources/apps.py +0 -0
  298. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/resources/audio/__init__.py +0 -0
  299. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/resources/audio/_callbacks.py +0 -0
  300. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/resources/audio/_ws_session.py +0 -0
  301. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/resources/audio/asr.py +0 -0
  302. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/resources/audio/customization.py +0 -0
  303. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/resources/audio/http_tts.py +0 -0
  304. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/resources/audio/live.py +0 -0
  305. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/resources/audio/phrases.py +0 -0
  306. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/resources/audio/realtime.py +0 -0
  307. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/resources/audio/tts.py +0 -0
  308. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/resources/chat/__init__.py +0 -0
  309. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/resources/chat/_params.py +0 -0
  310. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/resources/chat/completions.py +0 -0
  311. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/resources/decision.py +0 -0
  312. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/resources/deployments.py +0 -0
  313. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/resources/embeddings.py +0 -0
  314. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/resources/files.py +0 -0
  315. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/resources/fine_tunes.py +0 -0
  316. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/resources/images.py +0 -0
  317. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/resources/models.py +0 -0
  318. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/resources/multimodal/__init__.py +0 -0
  319. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/resources/multimodal/chat.py +0 -0
  320. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/resources/multimodal/embeddings.py +0 -0
  321. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/resources/reinforcement_learning.py +0 -0
  322. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/resources/rerank.py +0 -0
  323. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/resources/tingwu.py +0 -0
  324. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/resources/tokenization.py +0 -0
  325. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/resources/videos.py +0 -0
  326. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/transport/__init__.py +0 -0
  327. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/transport/_ident.py +0 -0
  328. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/transport/_options.py +0 -0
  329. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/transport/_response.py +0 -0
  330. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/transport/_retry.py +0 -0
  331. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/transport/http.py +0 -0
  332. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/transport/ws.py +0 -0
  333. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/transport/ws_connection.py +0 -0
  334. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/types/__init__.py +0 -0
  335. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/types/_parse.py +0 -0
  336. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/types/common.py +0 -0
  337. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/types/completions.py +0 -0
  338. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/types/messages.py +0 -0
  339. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope/types/pagination.py +0 -0
  340. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope.egg-info/dependency_links.txt +0 -0
  341. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope.egg-info/entry_points.txt +0 -0
  342. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope.egg-info/not-zip-safe +0 -0
  343. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope.egg-info/requires.txt +0 -0
  344. {dashscope-2.1.1 → dashscope-2.1.2}/dashscope.egg-info/top_level.txt +0 -0
  345. {dashscope-2.1.1 → dashscope-2.1.2}/examples/01_atomic_capabilities/applications/apps.py +0 -0
  346. {dashscope-2.1.1 → dashscope-2.1.2}/examples/01_atomic_capabilities/audio/README.md +0 -0
  347. {dashscope-2.1.1 → dashscope-2.1.2}/examples/01_atomic_capabilities/audio/_common.py +0 -0
  348. {dashscope-2.1.1 → dashscope-2.1.2}/examples/01_atomic_capabilities/audio/asr_file.py +0 -0
  349. {dashscope-2.1.1 → dashscope-2.1.2}/examples/01_atomic_capabilities/audio/asr_http_stream.py +0 -0
  350. {dashscope-2.1.1 → dashscope-2.1.2}/examples/01_atomic_capabilities/audio/asr_microphone.py +0 -0
  351. {dashscope-2.1.1 → dashscope-2.1.2}/examples/01_atomic_capabilities/audio/asr_websocket.py +0 -0
  352. {dashscope-2.1.1 → dashscope-2.1.2}/examples/01_atomic_capabilities/audio/connection_reuse.py +0 -0
  353. {dashscope-2.1.1 → dashscope-2.1.2}/examples/01_atomic_capabilities/audio/direct_call/_common.py +0 -0
  354. {dashscope-2.1.1 → dashscope-2.1.2}/examples/01_atomic_capabilities/audio/direct_call/asr_file.py +0 -0
  355. {dashscope-2.1.1 → dashscope-2.1.2}/examples/01_atomic_capabilities/audio/direct_call/asr_http_stream.py +0 -0
  356. {dashscope-2.1.1 → dashscope-2.1.2}/examples/01_atomic_capabilities/audio/direct_call/asr_microphone.py +0 -0
  357. {dashscope-2.1.1 → dashscope-2.1.2}/examples/01_atomic_capabilities/audio/direct_call/asr_websocket.py +0 -0
  358. {dashscope-2.1.1 → dashscope-2.1.2}/examples/01_atomic_capabilities/audio/direct_call/connection_reuse.py +0 -0
  359. {dashscope-2.1.1 → dashscope-2.1.2}/examples/01_atomic_capabilities/audio/direct_call/realtime_omni.py +0 -0
  360. {dashscope-2.1.1 → dashscope-2.1.2}/examples/01_atomic_capabilities/audio/direct_call/realtime_qwen_audio.py +0 -0
  361. {dashscope-2.1.1 → dashscope-2.1.2}/examples/01_atomic_capabilities/audio/direct_call/realtime_translation.py +0 -0
  362. {dashscope-2.1.1 → dashscope-2.1.2}/examples/01_atomic_capabilities/audio/direct_call/tts_http.py +0 -0
  363. {dashscope-2.1.1 → dashscope-2.1.2}/examples/01_atomic_capabilities/audio/direct_call/tts_http_stream.py +0 -0
  364. {dashscope-2.1.1 → dashscope-2.1.2}/examples/01_atomic_capabilities/audio/direct_call/tts_websocket.py +0 -0
  365. {dashscope-2.1.1 → dashscope-2.1.2}/examples/01_atomic_capabilities/audio/direct_call/voice_clone.py +0 -0
  366. {dashscope-2.1.1 → dashscope-2.1.2}/examples/01_atomic_capabilities/audio/realtime_live.py +0 -0
  367. {dashscope-2.1.1 → dashscope-2.1.2}/examples/01_atomic_capabilities/audio/realtime_omni.py +0 -0
  368. {dashscope-2.1.1 → dashscope-2.1.2}/examples/01_atomic_capabilities/audio/realtime_qwen_audio.py +0 -0
  369. {dashscope-2.1.1 → dashscope-2.1.2}/examples/01_atomic_capabilities/audio/realtime_translation.py +0 -0
  370. {dashscope-2.1.1 → dashscope-2.1.2}/examples/01_atomic_capabilities/audio/tingwu.py +0 -0
  371. {dashscope-2.1.1 → dashscope-2.1.2}/examples/01_atomic_capabilities/audio/tts_http.py +0 -0
  372. {dashscope-2.1.1 → dashscope-2.1.2}/examples/01_atomic_capabilities/audio/tts_http_stream.py +0 -0
  373. {dashscope-2.1.1 → dashscope-2.1.2}/examples/01_atomic_capabilities/audio/tts_websocket.py +0 -0
  374. {dashscope-2.1.1 → dashscope-2.1.2}/examples/01_atomic_capabilities/audio/voice_clone.py +0 -0
  375. {dashscope-2.1.1 → dashscope-2.1.2}/examples/01_atomic_capabilities/decision/decision.py +0 -0
  376. {dashscope-2.1.1 → dashscope-2.1.2}/examples/01_atomic_capabilities/embeddings/embeddings.py +0 -0
  377. {dashscope-2.1.1 → dashscope-2.1.2}/examples/01_atomic_capabilities/files/files.py +0 -0
  378. {dashscope-2.1.1 → dashscope-2.1.2}/examples/01_atomic_capabilities/fine_tuning/fine_tunes.py +0 -0
  379. {dashscope-2.1.1 → dashscope-2.1.2}/examples/01_atomic_capabilities/fine_tuning/reinforcement_learning.py +0 -0
  380. {dashscope-2.1.1 → dashscope-2.1.2}/examples/01_atomic_capabilities/image_video_synthesis/images.py +0 -0
  381. {dashscope-2.1.1 → dashscope-2.1.2}/examples/01_atomic_capabilities/image_video_synthesis/videos.py +0 -0
  382. {dashscope-2.1.1 → dashscope-2.1.2}/examples/01_atomic_capabilities/models/models.py +0 -0
  383. {dashscope-2.1.1 → dashscope-2.1.2}/examples/01_atomic_capabilities/multimodal_vision/multimodal_chat.py +0 -0
  384. {dashscope-2.1.1 → dashscope-2.1.2}/examples/01_atomic_capabilities/rerank/rerank.py +0 -0
  385. {dashscope-2.1.1 → dashscope-2.1.2}/examples/01_atomic_capabilities/text_generation/chat.py +0 -0
  386. {dashscope-2.1.1 → dashscope-2.1.2}/examples/01_atomic_capabilities/text_generation/tokenization.py +0 -0
  387. {dashscope-2.1.1 → dashscope-2.1.2}/examples/02_advanced_engineering/circuit_breaker_retry.py +0 -0
  388. {dashscope-2.1.1 → dashscope-2.1.2}/examples/02_advanced_engineering/client_side_cache.py +0 -0
  389. {dashscope-2.1.1 → dashscope-2.1.2}/examples/02_advanced_engineering/local_mock_debugging.py +0 -0
  390. {dashscope-2.1.1 → dashscope-2.1.2}/examples/03_agent_recipes/agentstudio.py +0 -0
  391. {dashscope-2.1.1 → dashscope-2.1.2}/examples/03_agent_recipes/agentstudio_deployments.py +0 -0
  392. {dashscope-2.1.1 → dashscope-2.1.2}/examples/03_agent_recipes/mcp_server_demo/README.md +0 -0
  393. {dashscope-2.1.1 → dashscope-2.1.2}/examples/03_agent_recipes/mcp_server_demo/client_demo.py +0 -0
  394. {dashscope-2.1.1 → dashscope-2.1.2}/examples/03_agent_recipes/mcp_server_demo/server.py +0 -0
  395. {dashscope-2.1.1 → dashscope-2.1.2}/examples/03_agent_recipes/rag_expert_system.py +0 -0
  396. {dashscope-2.1.1 → dashscope-2.1.2}/examples/03_agent_recipes/tool_call_loop.py +0 -0
  397. {dashscope-2.1.1 → dashscope-2.1.2}/examples/04_real_world_scenarios/README.md +0 -0
  398. {dashscope-2.1.1 → dashscope-2.1.2}/examples/04_real_world_scenarios/README_zh.md +0 -0
  399. {dashscope-2.1.1 → dashscope-2.1.2}/examples/04_real_world_scenarios/customer_service_assistant.py +0 -0
  400. {dashscope-2.1.1 → dashscope-2.1.2}/examples/04_real_world_scenarios/production_ready_rag_harness.py +0 -0
  401. {dashscope-2.1.1 → dashscope-2.1.2}/examples/04_real_world_scenarios/realtime_audio_meeting_harness.py +0 -0
  402. {dashscope-2.1.1 → dashscope-2.1.2}/examples/04_real_world_scenarios/ticket_triage_harness.py +0 -0
  403. {dashscope-2.1.1 → dashscope-2.1.2}/examples/05_cli/cli_ci_harness.py +0 -0
  404. {dashscope-2.1.1 → dashscope-2.1.2}/examples/05_cli/cli_output_and_errors.py +0 -0
  405. {dashscope-2.1.1 → dashscope-2.1.2}/examples/README.md +0 -0
  406. {dashscope-2.1.1 → dashscope-2.1.2}/examples/README_zh.md +0 -0
  407. {dashscope-2.1.1 → dashscope-2.1.2}/examples/legacy_1x/aio_generation/basic.py +0 -0
  408. {dashscope-2.1.1 → dashscope-2.1.2}/examples/legacy_1x/aio_generation/custom_session.py +0 -0
  409. {dashscope-2.1.1 → dashscope-2.1.2}/examples/legacy_1x/aio_generation/deep_research.py +0 -0
  410. {dashscope-2.1.1 → dashscope-2.1.2}/examples/legacy_1x/aio_generation/reasoning.py +0 -0
  411. {dashscope-2.1.1 → dashscope-2.1.2}/examples/legacy_1x/aio_generation/tool_calls.py +0 -0
  412. {dashscope-2.1.1 → dashscope-2.1.2}/examples/legacy_1x/aio_image_synthesis.py +0 -0
  413. {dashscope-2.1.1 → dashscope-2.1.2}/examples/legacy_1x/aio_multimodal_conversation/asr.py +0 -0
  414. {dashscope-2.1.1 → dashscope-2.1.2}/examples/legacy_1x/aio_multimodal_conversation/image.py +0 -0
  415. {dashscope-2.1.1 → dashscope-2.1.2}/examples/legacy_1x/aio_multimodal_conversation/ocr.py +0 -0
  416. {dashscope-2.1.1 → dashscope-2.1.2}/examples/legacy_1x/aio_multimodal_conversation/tool_calls.py +0 -0
  417. {dashscope-2.1.1 → dashscope-2.1.2}/examples/legacy_1x/aio_video_synthesis.py +0 -0
  418. {dashscope-2.1.1 → dashscope-2.1.2}/examples/legacy_1x/application.py +0 -0
  419. {dashscope-2.1.1 → dashscope-2.1.2}/examples/legacy_1x/assistant_api.py +0 -0
  420. {dashscope-2.1.1 → dashscope-2.1.2}/examples/legacy_1x/assistant_api_file.py +0 -0
  421. {dashscope-2.1.1 → dashscope-2.1.2}/examples/legacy_1x/assistant_api_simple.py +0 -0
  422. {dashscope-2.1.1 → dashscope-2.1.2}/examples/legacy_1x/cv_models.py +0 -0
  423. {dashscope-2.1.1 → dashscope-2.1.2}/examples/legacy_1x/generation/basic.py +0 -0
  424. {dashscope-2.1.1 → dashscope-2.1.2}/examples/legacy_1x/generation/custom_session.py +0 -0
  425. {dashscope-2.1.1 → dashscope-2.1.2}/examples/legacy_1x/generation/deep_research.py +0 -0
  426. {dashscope-2.1.1 → dashscope-2.1.2}/examples/legacy_1x/generation/reasoning.py +0 -0
  427. {dashscope-2.1.1 → dashscope-2.1.2}/examples/legacy_1x/generation/tool_calls.py +0 -0
  428. {dashscope-2.1.1 → dashscope-2.1.2}/examples/legacy_1x/image_generation.py +0 -0
  429. {dashscope-2.1.1 → dashscope-2.1.2}/examples/legacy_1x/image_synthesis.py +0 -0
  430. {dashscope-2.1.1 → dashscope-2.1.2}/examples/legacy_1x/multimodal_conversation/asr.py +0 -0
  431. {dashscope-2.1.1 → dashscope-2.1.2}/examples/legacy_1x/multimodal_conversation/image.py +0 -0
  432. {dashscope-2.1.1 → dashscope-2.1.2}/examples/legacy_1x/multimodal_conversation/ocr.py +0 -0
  433. {dashscope-2.1.1 → dashscope-2.1.2}/examples/legacy_1x/multimodal_conversation/reasoning.py +0 -0
  434. {dashscope-2.1.1 → dashscope-2.1.2}/examples/legacy_1x/multimodal_conversation/tool_calls.py +0 -0
  435. {dashscope-2.1.1 → dashscope-2.1.2}/examples/legacy_1x/multimodal_conversation/video.py +0 -0
  436. {dashscope-2.1.1 → dashscope-2.1.2}/examples/legacy_1x/multimodal_embedding.py +0 -0
  437. {dashscope-2.1.1 → dashscope-2.1.2}/examples/legacy_1x/qwen_asr.py +0 -0
  438. {dashscope-2.1.1 → dashscope-2.1.2}/examples/legacy_1x/qwen_tts.py +0 -0
  439. {dashscope-2.1.1 → dashscope-2.1.2}/examples/legacy_1x/set_region_example.py +0 -0
  440. {dashscope-2.1.1 → dashscope-2.1.2}/examples/legacy_1x/text_rerank.py +0 -0
  441. {dashscope-2.1.1 → dashscope-2.1.2}/examples/legacy_1x/tingwu_realtime.py +0 -0
  442. {dashscope-2.1.1 → dashscope-2.1.2}/examples/legacy_1x/tingwu_usages.py +0 -0
  443. {dashscope-2.1.1 → dashscope-2.1.2}/examples/legacy_1x/video_synthesis.py +0 -0
  444. {dashscope-2.1.1 → dashscope-2.1.2}/pyproject.toml +0 -0
  445. {dashscope-2.1.1 → dashscope-2.1.2}/requirements.txt +0 -0
  446. {dashscope-2.1.1 → dashscope-2.1.2}/setup.cfg +0 -0
  447. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_agentic_rl_datasets_upload.py +0 -0
  448. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_agentic_rl_fc_errors.py +0 -0
  449. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_agentic_rl_review_regressions.py +0 -0
  450. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_agentic_rl_script.py +0 -0
  451. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_agentic_rl_server_hardening.py +0 -0
  452. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_agentstudio_errors.py +0 -0
  453. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_agentstudio_models.py +0 -0
  454. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_agentstudio_protocol.py +0 -0
  455. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_agentstudio_shim.py +0 -0
  456. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_agentstudio_usage.py +0 -0
  457. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_apps.py +0 -0
  458. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_audio.py +0 -0
  459. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_audio_connection.py +0 -0
  460. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_audio_live_session.py +0 -0
  461. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_audio_management.py +0 -0
  462. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_audio_omni_session.py +0 -0
  463. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_audio_samples.py +0 -0
  464. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_audio_samples_direct_call.py +0 -0
  465. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_audio_tts_http.py +0 -0
  466. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_audio_tts_realtime.py +0 -0
  467. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_audio_tts_session.py +0 -0
  468. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_audio_ws_integration.py +0 -0
  469. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_audio_ws_session.py +0 -0
  470. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_base_url_routing.py +0 -0
  471. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_chat.py +0 -0
  472. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_chat_params.py +0 -0
  473. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_config.py +0 -0
  474. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_decision.py +0 -0
  475. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_devkit_diagnosis.py +0 -0
  476. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_devkit_mock.py +0 -0
  477. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_error_registry.py +0 -0
  478. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_errors.py +0 -0
  479. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_files_models.py +0 -0
  480. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_finetune_deployments.py +0 -0
  481. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_http_pool.py +0 -0
  482. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_images_videos.py +0 -0
  483. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_jobs.py +0 -0
  484. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_layer_decoupling.py +0 -0
  485. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_legacy_import_aliases.py +0 -0
  486. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_logging.py +0 -0
  487. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_multimodal.py +0 -0
  488. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_oss_upload.py +0 -0
  489. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_package_root.py +0 -0
  490. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_pagination.py +0 -0
  491. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_parse_model.py +0 -0
  492. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_protocols.py +0 -0
  493. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_request_options.py +0 -0
  494. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_resource_request_options.py +0 -0
  495. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_response.py +0 -0
  496. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_response_drift.py +0 -0
  497. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_rl.py +0 -0
  498. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_settings.py +0 -0
  499. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_sse_comprehensive_verify.py +0 -0
  500. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_tingwu.py +0 -0
  501. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_tools_resources.py +0 -0
  502. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_transport.py +0 -0
  503. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_types_messages.py +0 -0
  504. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_user_agent_suffix.py +0 -0
  505. {dashscope-2.1.1 → dashscope-2.1.2}/tests/test_ws_connection.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dashscope
3
- Version: 2.1.1
3
+ Version: 2.1.2
4
4
  Summary: dashscope client sdk library
5
5
  Home-page: https://dashscope.aliyun.com/
6
6
  Author: Alibaba Cloud
@@ -6,6 +6,8 @@ from __future__ import annotations
6
6
 
7
7
  from typing import Any, Dict
8
8
 
9
+ __all__ = ["AsyncUsage", "Usage"]
10
+
9
11
  _PATH_USAGE_SUMMARY = "/usage/summary"
10
12
  _PATH_USAGE_TREND = "/usage/trend"
11
13
 
@@ -120,6 +120,24 @@ def _build_api_request( # pylint: disable=too-many-branches
120
120
  InputDataRequired: If input data is missing or invalid.
121
121
  UnsupportedApiProtocol: If the API protocol is not supported.
122
122
  """
123
+ # ``timeout`` is the OpenAI-style spelling of ``request_timeout``.
124
+ # Without this alias it falls through to ``**kwargs`` and is sent to
125
+ # the service as a model parameter, while the client timeout silently
126
+ # stays at its default (see error-code report P2-1).
127
+ if "timeout" in kwargs:
128
+ alias_timeout = kwargs.pop("timeout")
129
+ if request_timeout is None:
130
+ logger.warning(
131
+ "'timeout' is treated as the client request timeout; "
132
+ "the canonical keyword is 'request_timeout'.",
133
+ )
134
+ request_timeout = alias_timeout
135
+ else:
136
+ logger.warning(
137
+ "Both 'timeout' and 'request_timeout' were provided; "
138
+ "using 'request_timeout' and ignoring 'timeout'.",
139
+ )
140
+
123
141
  # Handle stream mode for WebSocket
124
142
  if not stream and ws_stream_mode == WebsocketStreamingMode.OUT:
125
143
  ws_stream_mode = WebsocketStreamingMode.NONE
@@ -493,7 +493,7 @@ class RecognitionResponse(DashScopeAPIResponse):
493
493
  class SpeechSynthesisOutput(DictMixin):
494
494
  sentence: Dict[str, Any]
495
495
 
496
- def __init__(self, sentence: Dict[str, Any], **kwargs):
496
+ def __init__(self, sentence: Dict[str, Any] = None, **kwargs):
497
497
  super().__init__(sentence=sentence, **kwargs)
498
498
 
499
499
 
@@ -184,9 +184,14 @@ class SpeechSynthesizer(BaseApi):
184
184
  not isinstance(part.output, dict)
185
185
  or "sentence" not in part.output
186
186
  ):
187
- # Non-timestamp message (e.g. extra messages returned
188
- # in the SSML/bgm scenario). Skip it safely instead of
189
- # raising KeyError on part.output["sentence"].
187
+ # Non-timestamp message (e.g. a usage-only
188
+ # task-finished payload or extra messages in the
189
+ # SSML/bgm scenario). Keep it as the final
190
+ # response candidate so usage/status is not lost;
191
+ # a later output=None final message overwrites it.
192
+ _the_final_response = SpeechSynthesisResponse.from_api_response( # noqa E501 # pylint: disable=line-too-long
193
+ part,
194
+ )
190
195
  continue
191
196
  if _callback is not None:
192
197
  sentence = SpeechSynthesisResult(
@@ -340,6 +340,16 @@ def _handle_http_failed_response(
340
340
  )
341
341
  else:
342
342
  msg = response.content.decode("utf-8")
343
+ # A bare gateway error (empty body, no content-type) used to
344
+ # surface as message="" / request_id="", leaving the caller no
345
+ # clue it was not a model-level 404. Keep the server's real
346
+ # status, but explain the shape and salvage the header id.
347
+ request_id = response.headers.get("x-request-id", "")
348
+ if not msg:
349
+ msg = (
350
+ f"HTTP {response.status_code} with empty response body "
351
+ "and no content-type (bare gateway response)."
352
+ )
343
353
  if flattened_output:
344
354
  return {"status_code": response.status_code, "message": msg} # type: ignore[return-value] # pylint: disable=line-too-long # noqa: E501
345
355
  return DashScopeAPIResponse(
@@ -412,6 +422,13 @@ async def _handle_aiohttp_failed_response(
412
422
  )
413
423
  else:
414
424
  msg = await response.text()
425
+ # Same bare-gateway treatment as the sync path above.
426
+ request_id = response.headers.get("x-request-id", "")
427
+ if not msg:
428
+ msg = (
429
+ f"HTTP {response.status} with empty response body "
430
+ "and no content-type (bare gateway response)."
431
+ )
415
432
  if flattened_output:
416
433
  return {"status_code": response.status, "message": msg} # type: ignore[return-value] # pylint: disable=line-too-long # noqa: E501
417
434
  return DashScopeAPIResponse(
@@ -189,6 +189,8 @@ class Stream(Generic[T]):
189
189
  def __iter__(self) -> Iterator[T]:
190
190
  try:
191
191
  for sse in EventSource(self._response).iter_sse():
192
+ if sse.data == DONE_MARKER:
193
+ break
192
194
  body = _next_event(
193
195
  sse.data,
194
196
  self._response.headers,
@@ -247,6 +249,8 @@ class AsyncStream(Generic[T]):
247
249
  async def _iterate(self):
248
250
  try:
249
251
  async for sse in EventSource(self._response).aiter_sse():
252
+ if sse.data == DONE_MARKER:
253
+ break
250
254
  body = _next_event(
251
255
  sse.data,
252
256
  self._response.headers,
@@ -1,4 +1,4 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  # Copyright (c) Alibaba, Inc. and its affiliates.
3
3
 
4
- __version__ = "2.1.1"
4
+ __version__ = "2.1.2"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dashscope
3
- Version: 2.1.1
3
+ Version: 2.1.2
4
4
  Summary: dashscope client sdk library
5
5
  Home-page: https://dashscope.aliyun.com/
6
6
  Author: Alibaba Cloud
@@ -469,6 +469,7 @@ tests/test_config.py
469
469
  tests/test_decision.py
470
470
  tests/test_devkit_diagnosis.py
471
471
  tests/test_devkit_mock.py
472
+ tests/test_docs_reference.py
472
473
  tests/test_error_registry.py
473
474
  tests/test_errors.py
474
475
  tests/test_files_models.py
@@ -486,6 +487,7 @@ tests/test_package_root.py
486
487
  tests/test_pagination.py
487
488
  tests/test_parse_model.py
488
489
  tests/test_protocols.py
490
+ tests/test_release_notes_script.py
489
491
  tests/test_request_options.py
490
492
  tests/test_resource_request_options.py
491
493
  tests/test_response.py
@@ -40,20 +40,18 @@ def readme():
40
40
 
41
41
 
42
42
  class build_py(_build_py):
43
- """Build one clean package tree and bundle the top-level examples.
43
+ """Build one clean package tree.
44
44
 
45
45
  Setuptools incrementally copies files into ``build/lib`` but does not
46
46
  delete modules removed from the source tree. That is unsafe for the 2.0
47
47
  package migration: a stale ``dashscope/client/__init__.py`` shadows the
48
48
  new ``dashscope/client.py`` and makes ``from dashscope.client import
49
49
  Client`` fail in the built wheel. Remove the package build directory
50
- before every build, then copy the current sources and examples only.
50
+ before every build, then copy the current sources only.
51
51
 
52
- ``examples/`` lives at the repository root (a sibling of
53
- ``dashscope/``) for visibility, but a wheel can only bundle files
54
- that sit inside a package directory. Copy the tree into
55
- ``<build_lib>/dashscope/examples`` so an installed wheel exposes
56
- ``site-packages/dashscope/examples/``.
52
+ ``examples/`` ships in the sdist (via MANIFEST.in) but not in the
53
+ wheel: nothing consumes an installed copy since the agent runtime
54
+ moved to the published dashscope-agenticx package.
57
55
  """
58
56
 
59
57
  def run(self):
@@ -66,17 +64,6 @@ class build_py(_build_py):
66
64
  if os.path.isdir(built_package):
67
65
  shutil.rmtree(built_package)
68
66
  super().run()
69
- src = os.path.join(package_root, "examples")
70
- dst = os.path.join(self.build_lib, "dashscope", "examples")
71
- if not os.path.isdir(src):
72
- return
73
- if os.path.exists(dst):
74
- shutil.rmtree(dst)
75
- shutil.copytree(
76
- src,
77
- dst,
78
- ignore=shutil.ignore_patterns("__pycache__", "*.pyc"),
79
- )
80
67
 
81
68
 
82
69
  # Hoisted to a module-level name (like ``name``/``url`` above) so the
@@ -0,0 +1,199 @@
1
+ # -*- coding: utf-8 -*-
2
+ """CI guard: the MkDocs API reference must cover the package's public API.
3
+
4
+ Runs tools/gen_reference.py in --check mode: every ``:::`` directive
5
+ must resolve, both locales must document the same symbols, and no public
6
+ API symbol may be missing from the pages. A failure prints the exact
7
+ directives to add — fix by running ``python tools/gen_reference.py``.
8
+ """
9
+ import importlib
10
+ import importlib.util
11
+ import sys
12
+ import types
13
+ from pathlib import Path
14
+
15
+ REPO_ROOT = Path(__file__).resolve().parent.parent
16
+ SCRIPT_PATH = REPO_ROOT / "tools" / "gen_reference.py"
17
+
18
+ spec = importlib.util.spec_from_file_location("gen_reference", SCRIPT_PATH)
19
+ gen = importlib.util.module_from_spec(spec)
20
+ spec.loader.exec_module(gen)
21
+
22
+
23
+ def _page_text(locale, page):
24
+ return (gen.REFERENCE_DIRS[locale] / page).read_text(encoding="utf-8")
25
+
26
+
27
+ def test_every_directive_resolves():
28
+ for locale in gen.REFERENCE_DIRS:
29
+ for page in gen.PAGE_SUBTREES:
30
+ for _, target in gen.parse_entries(
31
+ _page_text(locale, page).splitlines(),
32
+ ):
33
+ _, status = gen.resolve(target)
34
+ assert status == "ok", f"{locale}/{page}: {target} ({status})"
35
+
36
+
37
+ def test_reference_pages_in_sync_with_public_api():
38
+ assert gen.main(["--check"]) == 0, (
39
+ "Reference pages drifted from the public API. "
40
+ "Run: python tools/gen_reference.py"
41
+ )
42
+
43
+
44
+ def test_locales_document_same_symbols():
45
+ for page in gen.PAGE_SUBTREES:
46
+ en = gen.collect_targets(_page_text("en", page))
47
+ zh = gen.collect_targets(_page_text("zh", page))
48
+ assert sorted(en) == sorted(zh), f"{page}: en/zh entry sets differ"
49
+
50
+
51
+ def test_new_public_class_is_discovered(monkeypatch):
52
+ """A class added to a referenced module (and its __all__) is picked up."""
53
+ embeddings = importlib.import_module("dashscope.resources.embeddings")
54
+ fake = type(
55
+ "FakeNewModel",
56
+ (),
57
+ {"__module__": "dashscope.resources.embeddings"},
58
+ )
59
+ monkeypatch.setitem(vars(embeddings), "FakeNewModel", fake)
60
+ monkeypatch.setattr(
61
+ embeddings,
62
+ "__all__",
63
+ list(embeddings.__all__) + ["FakeNewModel"],
64
+ )
65
+ text = _page_text("en", "resources.md")
66
+ new_text, added, removed = gen.sync_page(text, "resources.md")
67
+ directive = "::: dashscope.resources.embeddings.FakeNewModel"
68
+ assert directive in added
69
+ assert not removed
70
+ # inserted right after the module's last existing entry, prose intact
71
+ anchor = "::: dashscope.resources.embeddings.EmbeddingResponse"
72
+ assert new_text.index(anchor) < new_text.index(directive)
73
+ assert "## TingWu" in new_text
74
+
75
+
76
+ def test_new_module_with_all_gets_own_section(monkeypatch):
77
+ name = "dashscope.resources.fake_new"
78
+ module = types.ModuleType(name)
79
+ module.__all__ = ["Widget"]
80
+ module.Widget = type("Widget", (), {"__module__": name})
81
+ monkeypatch.setitem(sys.modules, name, module)
82
+ monkeypatch.setattr(
83
+ gen,
84
+ "walk_subtree",
85
+ lambda prefix: [prefix, name],
86
+ )
87
+ new_text, added, _ = gen.sync_page(
88
+ _page_text("en", "resources.md"),
89
+ "resources.md",
90
+ )
91
+ assert "::: dashscope.resources.fake_new.Widget" in added
92
+ assert "## Fake New" in new_text
93
+
94
+
95
+ def test_unexported_class_is_not_discovered(monkeypatch):
96
+ """Without __all__ membership a new class stays undocumented."""
97
+ embeddings = importlib.import_module("dashscope.resources.embeddings")
98
+ fake = type(
99
+ "InternalHelper",
100
+ (),
101
+ {"__module__": "dashscope.resources.embeddings"},
102
+ )
103
+ monkeypatch.setitem(vars(embeddings), "InternalHelper", fake)
104
+ _, added, _ = gen.sync_page(
105
+ _page_text("en", "resources.md"),
106
+ "resources.md",
107
+ )
108
+ assert "::: dashscope.resources.embeddings.InternalHelper" not in added
109
+
110
+
111
+ def test_stale_entry_is_removed():
112
+ text = (
113
+ "# Page\n\n## Section\n\n"
114
+ "::: dashscope.resources.embeddings.Embeddings\n\n"
115
+ "::: dashscope.resources.embeddings.NoSuchSymbol\n"
116
+ )
117
+ new_text, _, removed = gen.sync_page(text, "resources.md")
118
+ assert removed == ["dashscope.resources.embeddings.NoSuchSymbol"]
119
+ assert "NoSuchSymbol" not in new_text
120
+ assert "::: dashscope.resources.embeddings.Embeddings" in new_text
121
+
122
+
123
+ def test_legacy_page_is_frozen(monkeypatch):
124
+ """legacy_1x entries are checked but the page never grows."""
125
+ generation = importlib.import_module(
126
+ "dashscope.legacy_1x.aigc.generation",
127
+ )
128
+ fake = type(
129
+ "LegacyNewThing",
130
+ (),
131
+ {"__module__": "dashscope.legacy_1x.aigc.generation"},
132
+ )
133
+ monkeypatch.setitem(vars(generation), "LegacyNewThing", fake)
134
+ _, added, _ = gen.sync_page(_page_text("en", "legacy.md"), "legacy.md")
135
+ assert added == []
136
+
137
+
138
+ def _fake_public_module(monkeypatch, name, with_all):
139
+ module = types.ModuleType(name)
140
+ module.Widget = type("Widget", (), {"__module__": name})
141
+ if with_all:
142
+ module.__all__ = ["Widget"]
143
+ monkeypatch.setitem(sys.modules, name, module)
144
+ original_walk = gen.walk_subtree
145
+
146
+ def patched_walk(prefix):
147
+ names = original_walk(prefix)
148
+ if prefix == "dashscope.resources":
149
+ names = names + [name]
150
+ return names
151
+
152
+ monkeypatch.setattr(gen, "walk_subtree", patched_walk)
153
+
154
+
155
+ def test_unclassified_public_module_fails_check(monkeypatch):
156
+ """Blind-spot guard: a new public module without __all__ or an
157
+ internal classification must fail --check, not slip through."""
158
+ _fake_public_module(
159
+ monkeypatch,
160
+ "dashscope.resources.sneaky_new",
161
+ with_all=False,
162
+ )
163
+ assert gen.main(["--check"]) == 1
164
+
165
+
166
+ def test_declaring_module_internal_passes_check(monkeypatch):
167
+ name = "dashscope.resources.sneaky_new"
168
+ _fake_public_module(monkeypatch, name, with_all=False)
169
+ monkeypatch.setattr(gen, "INTERNAL_MODULES", gen.INTERNAL_MODULES | {name})
170
+ assert gen.main(["--check"]) == 0
171
+
172
+
173
+ def test_publishing_module_with_all_is_discovered(monkeypatch):
174
+ """With __all__ the module is published: --check reports the missing
175
+ page entries (drift) rather than an unclassified gap."""
176
+ _fake_public_module(
177
+ monkeypatch,
178
+ "dashscope.resources.sneaky_new",
179
+ with_all=True,
180
+ )
181
+ assert gen.main(["--check"]) == 1 # pages need the new entries
182
+ _, added, _ = gen.sync_page(
183
+ _page_text("en", "resources.md"),
184
+ "resources.md",
185
+ )
186
+ assert "::: dashscope.resources.sneaky_new.Widget" in added
187
+
188
+
189
+ def test_import_warnings_are_collected(monkeypatch):
190
+ gen.IMPORT_WARNINGS.clear()
191
+ # No importable prefix at all -> import_error (kept + reported),
192
+ # as opposed to a missing attribute on an importable module (stale).
193
+ text = "# Page\n\n::: totally_missing_pkg.Thing\n"
194
+ gen.sync_page(text, "resources.md")
195
+ assert any(
196
+ "totally_missing_pkg.Thing" in target
197
+ for _, target in gen.IMPORT_WARNINGS
198
+ )
199
+ gen.IMPORT_WARNINGS.clear()
@@ -16,7 +16,7 @@ import importlib.util
16
16
  import json
17
17
  import pathlib
18
18
  import platform
19
- import runpy
19
+ import subprocess
20
20
  import sys
21
21
  from types import SimpleNamespace
22
22
  from unittest.mock import patch
@@ -161,21 +161,55 @@ def test_only_the_1x_surface_keeps_the_job_verbs():
161
161
 
162
162
  # -- laziness -------------------------------------------------------------
163
163
 
164
+ # ``test_docs_reference`` (gen_reference's blind-spot guard) and the
165
+ # server-hardening tests legitimately import ``fastapi`` in the same pytest
166
+ # process, so asserting on this process's ``sys.modules`` would depend on
167
+ # test order. Resolve in a fresh interpreter to keep the laziness guarantee
168
+ # observable no matter what ran before.
169
+
170
+ _FIND_SPEC_SCRIPT = """\
171
+ import importlib.util
172
+ import sys
173
+
174
+ submit_path = {submit_path!r}
175
+ spec = importlib.util.find_spec(submit_path)
176
+ assert spec is not None
177
+ assert "dashscope/applications/finetune/reinforcement" in spec.origin.replace(
178
+ "\\\\", "/"
179
+ )
180
+ assert spec.loader.get_code(submit_path) is not None
181
+ assert "fastapi" not in sys.modules
182
+ """
183
+
184
+ _RUNPY_SCRIPT = """\
185
+ import runpy
186
+ import sys
187
+
188
+ submit_path = {submit_path!r}
189
+ name, _, code = runpy._get_module_details(submit_path)
190
+ assert name == submit_path
191
+ assert code is not None
192
+ assert "fastapi" not in sys.modules
193
+ """
194
+
195
+
196
+ def _assert_in_fresh_interpreter(script):
197
+ proc = subprocess.run(
198
+ [sys.executable, "-c", script],
199
+ capture_output=True,
200
+ text=True,
201
+ cwd=pathlib.Path(__file__).resolve().parent.parent,
202
+ check=False,
203
+ )
204
+ assert proc.returncode == 0, proc.stderr
205
+
164
206
 
165
207
  @pytest.mark.parametrize("alias", PATHS)
166
208
  def test_server_module_resolves_without_importing_fastapi(alias):
167
209
  submit_path = f"{alias}.component.server.server"
168
- spec = importlib.util.find_spec(submit_path)
169
- assert spec is not None
170
- assert (
171
- "dashscope/applications/finetune/reinforcement"
172
- in spec.origin.replace(
173
- "\\",
174
- "/",
175
- )
210
+ _assert_in_fresh_interpreter(
211
+ _FIND_SPEC_SCRIPT.format(submit_path=submit_path),
176
212
  )
177
- assert spec.loader.get_code(submit_path) is not None
178
- assert "fastapi" not in sys.modules
179
213
 
180
214
 
181
215
  @pytest.mark.parametrize("alias", PATHS)
@@ -183,10 +217,9 @@ def test_python_dash_m_resolves_the_compatibility_server_path(alias):
183
217
  # ``runpy`` refuses a loader that yields no code object, which is how
184
218
  # examples/workspace/scripts/start_local_*.sh launches the server.
185
219
  submit_path = f"{alias}.component.server.server"
186
- name, _, code = runpy._get_module_details(submit_path)
187
- assert name == submit_path
188
- assert code is not None
189
- assert "fastapi" not in sys.modules
220
+ _assert_in_fresh_interpreter(
221
+ _RUNPY_SCRIPT.format(submit_path=submit_path),
222
+ )
190
223
 
191
224
 
192
225
  @pytest.mark.skipif(
@@ -0,0 +1,162 @@
1
+ # -*- coding: utf-8 -*-
2
+ """Tests for tools/render_release_notes.py (draft Release body renderer)."""
3
+ import importlib.util
4
+ from pathlib import Path
5
+
6
+ import pytest
7
+
8
+ REPO_ROOT = Path(__file__).resolve().parent.parent
9
+ SCRIPT_PATH = REPO_ROOT / "tools" / "render_release_notes.py"
10
+
11
+ spec = importlib.util.spec_from_file_location(
12
+ "render_release_notes",
13
+ SCRIPT_PATH,
14
+ )
15
+ rrn = importlib.util.module_from_spec(spec)
16
+ spec.loader.exec_module(rrn)
17
+
18
+
19
+ def test_group_commits_by_conventional_type():
20
+ messages = [
21
+ "feat(cli): add expert command",
22
+ "fix(sse): stop at DONE marker",
23
+ "refactor(tokenizer): drop bundled vocab",
24
+ "docs(en): refresh quickstart",
25
+ "chore(release): bump version",
26
+ "ci: pin cryptography",
27
+ "test(cli): cover dumb terminal",
28
+ "perf(http): reuse connections",
29
+ ]
30
+ groups = rrn.group_commits(messages)
31
+ assert groups["FEATURES"] == "- **cli:** add expert command"
32
+ assert groups["BUG_FIXES"] == "- **sse:** stop at DONE marker"
33
+ assert groups["REFACTORING"] == "- **tokenizer:** drop bundled vocab"
34
+ assert groups["DOCUMENTATION"] == "- **en:** refresh quickstart"
35
+ assert groups["CI_CHORE"].splitlines() == [
36
+ "- **release:** bump version",
37
+ "- pin cryptography",
38
+ "- **cli:** cover dumb terminal",
39
+ "- **http:** reuse connections",
40
+ ]
41
+ assert groups["OTHER"] == "None"
42
+ assert groups["BREAKING_CHANGES"] == "None"
43
+
44
+
45
+ def test_unscoped_and_untyped_subjects():
46
+ groups = rrn.group_commits(["feat: bare feature", "random subject"])
47
+ assert groups["FEATURES"] == "- bare feature"
48
+ assert groups["OTHER"] == "- random subject"
49
+
50
+
51
+ def test_breaking_change_detection():
52
+ messages = [
53
+ "feat(api)!: rename chat parameter",
54
+ "fix(core): adjust retry\n\nBREAKING CHANGE: retry default changed",
55
+ ]
56
+ groups = rrn.group_commits(messages)
57
+ assert groups["BREAKING_CHANGES"].splitlines() == [
58
+ "- **api:** rename chat parameter",
59
+ "- **core:** adjust retry",
60
+ ]
61
+ # breaking commits also stay in their normal section
62
+ assert groups["FEATURES"] == "- **api:** rename chat parameter"
63
+ assert groups["BUG_FIXES"] == "- **core:** adjust retry"
64
+
65
+
66
+ def test_duplicate_subjects_collapse():
67
+ groups = rrn.group_commits(["fix(a): same thing", "fix(a): same thing"])
68
+ assert groups["BUG_FIXES"] == "- **a:** same thing"
69
+
70
+
71
+ def test_empty_sections_render_none():
72
+ groups = rrn.group_commits([])
73
+ for name, _, _ in rrn._SECTIONS:
74
+ assert groups[name] == "None"
75
+ assert groups["BREAKING_CHANGES"] == "None"
76
+
77
+
78
+ def test_render_body_fills_template():
79
+ groups = rrn.group_commits(
80
+ ["feat(cli): add expert command", "loose subject"],
81
+ )
82
+ body = rrn.render_body("v9.9.9", "https://example.com/compare", groups)
83
+ assert "## v9.9.9 Release Notes" in body
84
+ assert "pip install --upgrade dashscope==9.9.9" in body
85
+ assert "- **cli:** add expert command" in body
86
+ assert "### 📌 Other\n\n- loose subject" in body
87
+ assert "https://example.com/compare" in body
88
+ # no unsubstituted placeholders survive
89
+ assert "${" not in body
90
+
91
+
92
+ def test_render_body_omits_empty_other_section():
93
+ groups = rrn.group_commits(["fix(a): one"])
94
+ body = rrn.render_body("v1.0.0", "https://example.com", groups)
95
+ assert "### 📌 Other" not in body
96
+ assert "### ⚠️ Breaking Changes\n\nNone" in body
97
+
98
+
99
+ def test_previous_tag_skips_current(monkeypatch):
100
+ monkeypatch.setattr(
101
+ rrn,
102
+ "git",
103
+ lambda *a: "v2.1.2\nv2.1.1\nv2.1.0\n",
104
+ )
105
+ assert rrn.previous_tag("v2.1.2") == "v2.1.1"
106
+ assert rrn.previous_tag("v9.9.9") == "v2.1.2"
107
+
108
+
109
+ def test_previous_tag_first_release(monkeypatch):
110
+ monkeypatch.setattr(rrn, "git", lambda *a: "v1.0.0\n")
111
+ assert rrn.previous_tag("v1.0.0") == ""
112
+
113
+
114
+ def test_commit_messages_splits_on_nul(monkeypatch):
115
+ captured = {}
116
+
117
+ def fake_git(*args):
118
+ captured["args"] = args
119
+ return "feat: a\n\x00fix: b\n\nbody\x00"
120
+
121
+ monkeypatch.setattr(rrn, "git", fake_git)
122
+ messages = rrn.commit_messages("v1..v2")
123
+ assert messages == ["feat: a", "fix: b\n\nbody"]
124
+ assert captured["args"] == (
125
+ "log",
126
+ "--no-merges",
127
+ "--format=%B%x00",
128
+ "v1..v2",
129
+ )
130
+
131
+
132
+ def test_main_writes_body(tmp_path, monkeypatch):
133
+ monkeypatch.setattr(rrn, "previous_tag", lambda tag: "v1.0.0")
134
+ monkeypatch.setattr(
135
+ rrn,
136
+ "commit_messages",
137
+ lambda rev: ["feat(cli): shiny new thing"],
138
+ )
139
+ out = tmp_path / "release-body.md"
140
+ rc = rrn.main(
141
+ [
142
+ "--tag",
143
+ "v1.1.0",
144
+ "--repo",
145
+ "dashscope/dashscope-sdk-python",
146
+ "--output",
147
+ str(out),
148
+ ],
149
+ )
150
+ assert rc == 0
151
+ body = out.read_text(encoding="utf-8")
152
+ assert "- **cli:** shiny new thing" in body
153
+ assert (
154
+ "https://github.com/dashscope/dashscope-sdk-python"
155
+ "/compare/v1.0.0...v1.1.0" in body
156
+ )
157
+
158
+
159
+ @pytest.mark.parametrize("subject", ["Merge pull request #1", ""])
160
+ def test_non_conventional_never_crashes(subject):
161
+ groups = rrn.group_commits([subject] if subject else [])
162
+ assert isinstance(groups["OTHER"], str)