dashscope 1.26.6__tar.gz → 1.27.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 (363) hide show
  1. {dashscope-1.26.6 → dashscope-1.27.2}/MANIFEST.in +1 -0
  2. dashscope-1.27.2/PKG-INFO +214 -0
  3. dashscope-1.27.2/README.md +145 -0
  4. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/__init__.py +2 -0
  5. dashscope-1.27.2/dashscope/acli/__init__.py +18 -0
  6. dashscope-1.27.2/dashscope/acli/__main__.py +7 -0
  7. dashscope-1.27.2/dashscope/acli/agent.py +1163 -0
  8. dashscope-1.27.2/dashscope/acli/agents/__init__.py +2 -0
  9. dashscope-1.27.2/dashscope/acli/agents/delegate.py +383 -0
  10. dashscope-1.27.2/dashscope/acli/agents/subagent.py +317 -0
  11. dashscope-1.27.2/dashscope/acli/agents/subagents.py +335 -0
  12. dashscope-1.27.2/dashscope/acli/audit.py +252 -0
  13. dashscope-1.27.2/dashscope/acli/capabilities/__init__.py +102 -0
  14. dashscope-1.27.2/dashscope/acli/capabilities/local_memory.py +92 -0
  15. dashscope-1.27.2/dashscope/acli/cli/__init__.py +226 -0
  16. dashscope-1.27.2/dashscope/acli/cli/completer.py +316 -0
  17. dashscope-1.27.2/dashscope/acli/cli/constants.py +319 -0
  18. dashscope-1.27.2/dashscope/acli/cli/dispatch.py +542 -0
  19. dashscope-1.27.2/dashscope/acli/cli/examples.py +504 -0
  20. dashscope-1.27.2/dashscope/acli/cli/handlers_capability.py +306 -0
  21. dashscope-1.27.2/dashscope/acli/cli/handlers_config.py +850 -0
  22. dashscope-1.27.2/dashscope/acli/cli/handlers_device.py +432 -0
  23. dashscope-1.27.2/dashscope/acli/cli/handlers_key.py +279 -0
  24. dashscope-1.27.2/dashscope/acli/cli/handlers_misc.py +320 -0
  25. dashscope-1.27.2/dashscope/acli/cli/handlers_profile.py +272 -0
  26. dashscope-1.27.2/dashscope/acli/cli/handlers_provider.py +282 -0
  27. dashscope-1.27.2/dashscope/acli/cli/handlers_session.py +213 -0
  28. dashscope-1.27.2/dashscope/acli/cli/handlers_setup.py +311 -0
  29. dashscope-1.27.2/dashscope/acli/cli/handlers_skill.py +373 -0
  30. dashscope-1.27.2/dashscope/acli/cli/mcp.py +179 -0
  31. dashscope-1.27.2/dashscope/acli/cli/multimodal.py +279 -0
  32. dashscope-1.27.2/dashscope/acli/cli/repl.py +601 -0
  33. dashscope-1.27.2/dashscope/acli/cli/runners.py +387 -0
  34. dashscope-1.27.2/dashscope/acli/cli/startup.py +192 -0
  35. dashscope-1.27.2/dashscope/acli/cli/streaming.py +351 -0
  36. dashscope-1.27.2/dashscope/acli/commands.py +232 -0
  37. dashscope-1.27.2/dashscope/acli/compression.py +313 -0
  38. dashscope-1.27.2/dashscope/acli/config.py +879 -0
  39. dashscope-1.27.2/dashscope/acli/debuglog.py +29 -0
  40. dashscope-1.27.2/dashscope/acli/deliverable.py +171 -0
  41. dashscope-1.27.2/dashscope/acli/dev.py +1295 -0
  42. dashscope-1.27.2/dashscope/acli/eval/__init__.py +248 -0
  43. dashscope-1.27.2/dashscope/acli/examples/basic-chat/.acli/config.toml +4 -0
  44. dashscope-1.27.2/dashscope/acli/examples/basic-chat/.acli/custom-extensions.toml +234 -0
  45. dashscope-1.27.2/dashscope/acli/examples/basic-chat/.acli/hooks.toml +101 -0
  46. dashscope-1.27.2/dashscope/acli/examples/basic-chat/.acli/skills/explain-code.md +17 -0
  47. dashscope-1.27.2/dashscope/acli/examples/basic-chat/.acli/skills/research-topic.md +19 -0
  48. dashscope-1.27.2/dashscope/acli/examples/basic-chat/.acli/skills/translate.md +15 -0
  49. dashscope-1.27.2/dashscope/acli/examples/basic-chat/.acli/skills/write-poem.md +11 -0
  50. dashscope-1.27.2/dashscope/acli/examples/basic-chat/.acli/system-prompt.md +26 -0
  51. dashscope-1.27.2/dashscope/acli/examples/basic-chat/README.md +112 -0
  52. dashscope-1.27.2/dashscope/acli/examples/dashscope-sdk-expert/.acli/config.toml +5 -0
  53. dashscope-1.27.2/dashscope/acli/examples/dashscope-sdk-expert/.acli/custom-extensions.toml +23 -0
  54. dashscope-1.27.2/dashscope/acli/examples/dashscope-sdk-expert/.acli/hooks.toml +25 -0
  55. dashscope-1.27.2/dashscope/acli/examples/dashscope-sdk-expert/.acli/skills/agent.md +97 -0
  56. dashscope-1.27.2/dashscope/acli/examples/dashscope-sdk-expert/.acli/skills/api-doc.md +14 -0
  57. dashscope-1.27.2/dashscope/acli/examples/dashscope-sdk-expert/.acli/skills/cli.md +87 -0
  58. dashscope-1.27.2/dashscope/acli/examples/dashscope-sdk-expert/.acli/skills/diagnose.md +13 -0
  59. dashscope-1.27.2/dashscope/acli/examples/dashscope-sdk-expert/.acli/skills/error-code.md +11 -0
  60. dashscope-1.27.2/dashscope/acli/examples/dashscope-sdk-expert/.acli/skills/explain-code.md +9 -0
  61. dashscope-1.27.2/dashscope/acli/examples/dashscope-sdk-expert/.acli/skills/fine-tuning.md +107 -0
  62. dashscope-1.27.2/dashscope/acli/examples/dashscope-sdk-expert/.acli/skills/multimodal.md +109 -0
  63. dashscope-1.27.2/dashscope/acli/examples/dashscope-sdk-expert/.acli/skills/retrieval.md +131 -0
  64. dashscope-1.27.2/dashscope/acli/examples/dashscope-sdk-expert/.acli/skills/sdk-example.md +13 -0
  65. dashscope-1.27.2/dashscope/acli/examples/dashscope-sdk-expert/.acli/skills/speech.md +110 -0
  66. dashscope-1.27.2/dashscope/acli/examples/dashscope-sdk-expert/.acli/skills/text-generation.md +145 -0
  67. dashscope-1.27.2/dashscope/acli/examples/dashscope-sdk-expert/.acli/skills/translate.md +9 -0
  68. dashscope-1.27.2/dashscope/acli/examples/dashscope-sdk-expert/.acli/system-prompt.md +84 -0
  69. dashscope-1.27.2/dashscope/acli/examples/dashscope-sdk-expert/README.md +111 -0
  70. dashscope-1.27.2/dashscope/acli/executor.py +383 -0
  71. dashscope-1.27.2/dashscope/acli/extensions.py +1304 -0
  72. dashscope-1.27.2/dashscope/acli/hooks.py +426 -0
  73. dashscope-1.27.2/dashscope/acli/mcp_server.py +169 -0
  74. dashscope-1.27.2/dashscope/acli/mcp_stdio.py +313 -0
  75. dashscope-1.27.2/dashscope/acli/memory/__init__.py +2 -0
  76. dashscope-1.27.2/dashscope/acli/memory/directives_learning.py +258 -0
  77. dashscope-1.27.2/dashscope/acli/memory/experience.py +168 -0
  78. dashscope-1.27.2/dashscope/acli/memory/manager.py +148 -0
  79. dashscope-1.27.2/dashscope/acli/memory/plan.py +111 -0
  80. dashscope-1.27.2/dashscope/acli/memory/reflection.py +69 -0
  81. dashscope-1.27.2/dashscope/acli/memory/skill_evolution.py +244 -0
  82. dashscope-1.27.2/dashscope/acli/memory/tool_chains.py +198 -0
  83. dashscope-1.27.2/dashscope/acli/memory/trace.py +197 -0
  84. dashscope-1.27.2/dashscope/acli/permission.py +141 -0
  85. dashscope-1.27.2/dashscope/acli/platforms/__init__.py +74 -0
  86. dashscope-1.27.2/dashscope/acli/platforms/bailian/__init__.py +15 -0
  87. dashscope-1.27.2/dashscope/acli/platforms/bailian/cli.py +178 -0
  88. dashscope-1.27.2/dashscope/acli/platforms/bailian/mcp.py +303 -0
  89. dashscope-1.27.2/dashscope/acli/platforms/base.py +309 -0
  90. dashscope-1.27.2/dashscope/acli/platforms/local/__init__.py +6 -0
  91. dashscope-1.27.2/dashscope/acli/platforms/local/history.py +319 -0
  92. dashscope-1.27.2/dashscope/acli/platforms/local/memory.py +235 -0
  93. dashscope-1.27.2/dashscope/acli/prompt.py +202 -0
  94. dashscope-1.27.2/dashscope/acli/prompt_pipeline.py +303 -0
  95. dashscope-1.27.2/dashscope/acli/providers/__init__.py +133 -0
  96. dashscope-1.27.2/dashscope/acli/providers/adapter.py +331 -0
  97. dashscope-1.27.2/dashscope/acli/providers/anthropic.py +377 -0
  98. dashscope-1.27.2/dashscope/acli/providers/base.py +49 -0
  99. dashscope-1.27.2/dashscope/acli/providers/hardening.py +203 -0
  100. dashscope-1.27.2/dashscope/acli/providers/openai.py +282 -0
  101. dashscope-1.27.2/dashscope/acli/providers/profile.py +305 -0
  102. dashscope-1.27.2/dashscope/acli/providers/tongyi.py +443 -0
  103. dashscope-1.27.2/dashscope/acli/sandbox.py +181 -0
  104. dashscope-1.27.2/dashscope/acli/scheduler.py +641 -0
  105. dashscope-1.27.2/dashscope/acli/sdk.py +189 -0
  106. dashscope-1.27.2/dashscope/acli/session.py +559 -0
  107. dashscope-1.27.2/dashscope/acli/session_events.py +200 -0
  108. dashscope-1.27.2/dashscope/acli/skills/__init__.py +33 -0
  109. dashscope-1.27.2/dashscope/acli/skills/base.py +212 -0
  110. dashscope-1.27.2/dashscope/acli/skills/manager.py +175 -0
  111. dashscope-1.27.2/dashscope/acli/skills/package.py +253 -0
  112. dashscope-1.27.2/dashscope/acli/skills/store.py +589 -0
  113. dashscope-1.27.2/dashscope/acli/tools/__init__.py +6 -0
  114. dashscope-1.27.2/dashscope/acli/tools/browser.py +493 -0
  115. dashscope-1.27.2/dashscope/acli/tools/camera.py +39 -0
  116. dashscope-1.27.2/dashscope/acli/tools/checkpoint.py +167 -0
  117. dashscope-1.27.2/dashscope/acli/tools/evolution.py +75 -0
  118. dashscope-1.27.2/dashscope/acli/tools/filesystem.py +296 -0
  119. dashscope-1.27.2/dashscope/acli/tools/platform.py +546 -0
  120. dashscope-1.27.2/dashscope/acli/tools/registry.py +454 -0
  121. dashscope-1.27.2/dashscope/acli/tools/session.py +414 -0
  122. dashscope-1.27.2/dashscope/acli/tools/shell.py +608 -0
  123. dashscope-1.27.2/dashscope/acli/tools/skills.py +77 -0
  124. dashscope-1.27.2/dashscope/acli/tools/web_search.py +193 -0
  125. dashscope-1.27.2/dashscope/acli/ui/__init__.py +2 -0
  126. dashscope-1.27.2/dashscope/acli/ui/camera.py +208 -0
  127. dashscope-1.27.2/dashscope/acli/ui/embedded.py +135 -0
  128. dashscope-1.27.2/dashscope/acli/ui/tts.py +662 -0
  129. dashscope-1.27.2/dashscope/acli/ui/tui.py +3078 -0
  130. dashscope-1.27.2/dashscope/acli/ui/voice.py +483 -0
  131. dashscope-1.27.2/dashscope/acli/utils/__init__.py +98 -0
  132. dashscope-1.27.2/dashscope/acli/utils/clipboard.py +43 -0
  133. dashscope-1.27.2/dashscope/acli/utils/crypto.py +46 -0
  134. dashscope-1.27.2/dashscope/acli/utils/exceptions.py +19 -0
  135. dashscope-1.27.2/dashscope/acli/utils/ids.py +37 -0
  136. dashscope-1.27.2/dashscope/acli/utils/images.py +31 -0
  137. dashscope-1.27.2/dashscope/acli/utils/keywords.py +52 -0
  138. dashscope-1.27.2/dashscope/acli/utils/messages.py +193 -0
  139. dashscope-1.27.2/dashscope/acli/utils/paths.py +99 -0
  140. dashscope-1.27.2/dashscope/acli/utils/sanitizer.py +104 -0
  141. dashscope-1.27.2/dashscope/acli/utils/spinner.py +108 -0
  142. dashscope-1.27.2/dashscope/acli/utils/template.py +31 -0
  143. dashscope-1.27.2/dashscope/acli/utils/text.py +105 -0
  144. dashscope-1.27.2/dashscope/acli/utils/toml.py +111 -0
  145. dashscope-1.27.2/dashscope/acli/utils/validation.py +116 -0
  146. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/agentstudio/resources/agents.py +8 -0
  147. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/agentstudio/resources/files.py +88 -2
  148. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/agentstudio/resources/sessions.py +4 -0
  149. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/agentstudio/types/__init__.py +2 -0
  150. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/agentstudio/types/models.py +41 -0
  151. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/agentstudio/types/params.py +23 -1
  152. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/api_entities/aio_session.py +24 -1
  153. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/api_entities/aiohttp_request.py +19 -12
  154. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/api_entities/api_request_factory.py +99 -72
  155. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/api_entities/http_request.py +55 -24
  156. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/app/application.py +105 -52
  157. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/audio/asr/recognition.py +88 -3
  158. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/audio/asr/translation_recognizer.py +96 -4
  159. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/audio/http_tts/http_speech_synthesizer.py +9 -0
  160. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/audio/tts_v2/speech_synthesizer.py +100 -30
  161. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/cli/__init__.py +180 -3
  162. dashscope-1.27.2/dashscope/cli/auth.py +116 -0
  163. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/cli/common.py +54 -3
  164. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/cli/generation.py +48 -18
  165. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/tokenizers/tokenization.py +31 -4
  166. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/version.py +1 -1
  167. dashscope-1.27.2/dashscope.egg-info/PKG-INFO +214 -0
  168. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope.egg-info/SOURCES.txt +142 -0
  169. dashscope-1.27.2/dashscope.egg-info/requires.txt +40 -0
  170. dashscope-1.27.2/requirements.txt +15 -0
  171. {dashscope-1.26.6 → dashscope-1.27.2}/setup.cfg +1 -0
  172. {dashscope-1.26.6 → dashscope-1.27.2}/setup.py +11 -0
  173. dashscope-1.26.6/PKG-INFO +0 -568
  174. dashscope-1.26.6/README.md +0 -520
  175. dashscope-1.26.6/dashscope.egg-info/PKG-INFO +0 -568
  176. dashscope-1.26.6/dashscope.egg-info/requires.txt +0 -12
  177. dashscope-1.26.6/requirements.txt +0 -9
  178. {dashscope-1.26.6 → dashscope-1.27.2}/LICENSE +0 -0
  179. {dashscope-1.26.6 → dashscope-1.27.2}/LICENSE.certifi +0 -0
  180. {dashscope-1.26.6 → dashscope-1.27.2}/NOTICE +0 -0
  181. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/__init__.pyi +0 -0
  182. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/agentstudio/__init__.py +0 -0
  183. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/agentstudio/client.py +0 -0
  184. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/agentstudio/constants.py +0 -0
  185. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/agentstudio/exceptions.py +0 -0
  186. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/agentstudio/pagination.py +0 -0
  187. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/agentstudio/resources/__init__.py +0 -0
  188. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/agentstudio/resources/_helpers.py +0 -0
  189. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/agentstudio/resources/deployments.py +0 -0
  190. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/agentstudio/resources/environments.py +0 -0
  191. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/agentstudio/resources/session_events.py +0 -0
  192. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/agentstudio/resources/skills.py +0 -0
  193. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/agentstudio/resources/vaults.py +0 -0
  194. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/agentstudio/streaming.py +0 -0
  195. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/agentstudio/transport.py +0 -0
  196. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/aigc/__init__.py +0 -0
  197. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/aigc/chat_completion.py +0 -0
  198. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/aigc/code_generation.py +0 -0
  199. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/aigc/conversation.py +0 -0
  200. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/aigc/generation.py +0 -0
  201. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/aigc/image_generation.py +0 -0
  202. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/aigc/image_synthesis.py +0 -0
  203. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/aigc/multimodal_conversation.py +0 -0
  204. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/aigc/video_synthesis.py +0 -0
  205. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/api_entities/__init__.py +0 -0
  206. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/api_entities/api_request_data.py +0 -0
  207. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/api_entities/base_request.py +0 -0
  208. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/api_entities/chat_completion_types.py +0 -0
  209. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/api_entities/dashscope_response.py +0 -0
  210. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/api_entities/encryption.py +0 -0
  211. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/api_entities/websocket_request.py +0 -0
  212. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/app/__init__.py +0 -0
  213. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/app/application_response.py +0 -0
  214. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/assistants/__init__.py +0 -0
  215. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/assistants/assistant_types.py +0 -0
  216. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/assistants/assistants.py +0 -0
  217. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/assistants/files.py +0 -0
  218. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/audio/__init__.py +0 -0
  219. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/audio/asr/__init__.py +0 -0
  220. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/audio/asr/asr_phrase_manager.py +0 -0
  221. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/audio/asr/transcription.py +0 -0
  222. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/audio/asr/vocabulary.py +0 -0
  223. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/audio/http_tts/__init__.py +0 -0
  224. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/audio/qwen_asr/__init__.py +0 -0
  225. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/audio/qwen_asr/qwen_transcription.py +0 -0
  226. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/audio/qwen_omni/__init__.py +0 -0
  227. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/audio/qwen_omni/omni_realtime.py +0 -0
  228. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/audio/qwen_tts/__init__.py +0 -0
  229. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/audio/qwen_tts/speech_synthesizer.py +0 -0
  230. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/audio/qwen_tts_realtime/__init__.py +0 -0
  231. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/audio/qwen_tts_realtime/qwen_tts_realtime.py +0 -0
  232. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/audio/tts/__init__.py +0 -0
  233. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/audio/tts/speech_synthesizer.py +0 -0
  234. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/audio/tts_v2/__init__.py +0 -0
  235. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/audio/tts_v2/enrollment.py +0 -0
  236. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/cli/__main__.py +0 -0
  237. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/cli/agentic_rl.py +0 -0
  238. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/cli/application.py +0 -0
  239. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/cli/code_generation.py +0 -0
  240. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/cli/deployments.py +0 -0
  241. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/cli/embeddings.py +0 -0
  242. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/cli/files.py +0 -0
  243. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/cli/fine_tunes.py +0 -0
  244. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/cli/image_generation.py +0 -0
  245. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/cli/image_synthesis.py +0 -0
  246. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/cli/models.py +0 -0
  247. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/cli/multimodal_conversation.py +0 -0
  248. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/cli/multimodal_embedding.py +0 -0
  249. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/cli/oss.py +0 -0
  250. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/cli/rerank.py +0 -0
  251. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/cli/speech_synthesis.py +0 -0
  252. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/cli/tokenization.py +0 -0
  253. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/cli/transcription.py +0 -0
  254. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/cli/understanding.py +0 -0
  255. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/cli/video_synthesis.py +0 -0
  256. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/client/__init__.py +0 -0
  257. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/client/base_api.py +0 -0
  258. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/common/__init__.py +0 -0
  259. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/common/api_key.py +0 -0
  260. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/common/base_type.py +0 -0
  261. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/common/constants.py +0 -0
  262. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/common/env.py +0 -0
  263. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/common/error.py +0 -0
  264. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/common/logging.py +0 -0
  265. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/common/message_manager.py +0 -0
  266. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/common/utils.py +0 -0
  267. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/embeddings/__init__.py +0 -0
  268. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/embeddings/batch_text_embedding.py +0 -0
  269. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/embeddings/batch_text_embedding_response.py +0 -0
  270. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/embeddings/multimodal_embedding.py +0 -0
  271. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/embeddings/text_embedding.py +0 -0
  272. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/files.py +0 -0
  273. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/__init__.py +0 -0
  274. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/agentic_rl.py +0 -0
  275. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/customize_types.py +0 -0
  276. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/deployments.py +0 -0
  277. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/finetunes.py +0 -0
  278. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/__init__.py +0 -0
  279. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/common/__init__.py +0 -0
  280. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/common/constants.py +0 -0
  281. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/common/errors.py +0 -0
  282. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/common/log.py +0 -0
  283. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/common/model.py +0 -0
  284. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/common/model_types.py +0 -0
  285. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/common/utils.py +0 -0
  286. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/__init__.py +0 -0
  287. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/data/__init__.py +0 -0
  288. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/data/base_data_model.py +0 -0
  289. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/data/group_reward_input.py +0 -0
  290. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/data/group_reward_output.py +0 -0
  291. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/data/reward_input.py +0 -0
  292. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/data/reward_output.py +0 -0
  293. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/data/rollout_input.py +0 -0
  294. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/data/rollout_output.py +0 -0
  295. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/demo/__init__.py +0 -0
  296. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/demo/group_reward_processor_demo.py +0 -0
  297. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/demo/reward_processor_demo.py +0 -0
  298. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/demo/rollout_processor_demo.py +0 -0
  299. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/func_decorator.py +0 -0
  300. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/func_manager.py +0 -0
  301. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/observability/__init__.py +0 -0
  302. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/observability/genai/__init__.py +0 -0
  303. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/observability/genai/_core.py +0 -0
  304. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/observability/genai/llm_dashscope.py +0 -0
  305. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/observability/genai/llm_openai.py +0 -0
  306. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/observability/genai/llm_span.py +0 -0
  307. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/observability/genai/messages.py +0 -0
  308. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/observability/genai/tools.py +0 -0
  309. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/observability/processor_span.py +0 -0
  310. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/observability/tracing.py +0 -0
  311. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/parser/__init__.py +0 -0
  312. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/parser/base_parser.py +0 -0
  313. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/parser/group_reward_parser.py +0 -0
  314. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/parser/reward_parser.py +0 -0
  315. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/parser/rollout_parser.py +0 -0
  316. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/processor/__init__.py +0 -0
  317. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/processor/abstract_group_reward_processor.py +0 -0
  318. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/processor/abstract_processor.py +0 -0
  319. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/processor/abstract_reward_processor.py +0 -0
  320. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/processor/abstract_rollout_processor.py +0 -0
  321. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/server/__init__.py +0 -0
  322. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/server/server.py +0 -0
  323. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/io/__init__.py +0 -0
  324. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/io/input_output.py +0 -0
  325. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/model.py +0 -0
  326. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/models.py +0 -0
  327. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/multimodal/__init__.py +0 -0
  328. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/multimodal/dialog_state.py +0 -0
  329. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/multimodal/multimodal_constants.py +0 -0
  330. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/multimodal/multimodal_dialog.py +0 -0
  331. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/multimodal/multimodal_request_params.py +0 -0
  332. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/multimodal/tingwu/__init__.py +0 -0
  333. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/multimodal/tingwu/tingwu.py +0 -0
  334. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/multimodal/tingwu/tingwu_realtime.py +0 -0
  335. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/nlp/__init__.py +0 -0
  336. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/nlp/understanding.py +0 -0
  337. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/protocol/__init__.py +0 -0
  338. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/protocol/websocket.py +0 -0
  339. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/py.typed +0 -0
  340. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/rerank/__init__.py +0 -0
  341. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/rerank/text_rerank.py +0 -0
  342. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/resources/qwen.tiktoken +0 -0
  343. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/threads/__init__.py +0 -0
  344. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/threads/messages/__init__.py +0 -0
  345. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/threads/messages/files.py +0 -0
  346. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/threads/messages/messages.py +0 -0
  347. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/threads/runs/__init__.py +0 -0
  348. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/threads/runs/runs.py +0 -0
  349. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/threads/runs/steps.py +0 -0
  350. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/threads/thread_types.py +0 -0
  351. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/threads/threads.py +0 -0
  352. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/tokenizers/__init__.py +0 -0
  353. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/tokenizers/qwen_tokenizer.py +0 -0
  354. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/tokenizers/tokenizer.py +0 -0
  355. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/tokenizers/tokenizer_base.py +0 -0
  356. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/utils/__init__.py +0 -0
  357. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/utils/message_utils.py +0 -0
  358. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/utils/oss_utils.py +0 -0
  359. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/utils/param_utils.py +0 -0
  360. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope.egg-info/dependency_links.txt +0 -0
  361. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope.egg-info/entry_points.txt +0 -0
  362. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope.egg-info/not-zip-safe +0 -0
  363. {dashscope-1.26.6 → dashscope-1.27.2}/dashscope.egg-info/top_level.txt +0 -0
@@ -3,4 +3,5 @@ include dashscope/py.typed
3
3
  include dashscope/__init__.pyi
4
4
  include NOTICE
5
5
  include LICENSE.certifi
6
+ recursive-include dashscope/acli/examples *.md *.toml *.py
6
7
  include requirements.txt
@@ -0,0 +1,214 @@
1
+ Metadata-Version: 2.4
2
+ Name: dashscope
3
+ Version: 1.27.2
4
+ Summary: dashscope client sdk library
5
+ Home-page: https://dashscope.aliyun.com/
6
+ Author: Alibaba Cloud
7
+ Author-email: dashscope@alibabacloud.com
8
+ License: Apache 2.0
9
+ Platform: Posix; MacOS X; Windows
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved :: Apache Software License
13
+ Classifier: Programming Language :: Python
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.8
16
+ Classifier: Programming Language :: Python :: 3.9
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Requires-Python: >=3.8.0
20
+ Description-Content-Type: text/markdown
21
+ License-File: LICENSE
22
+ License-File: LICENSE.certifi
23
+ License-File: NOTICE
24
+ Requires-Dist: aiohttp
25
+ Requires-Dist: requests
26
+ Requires-Dist: websocket-client
27
+ Requires-Dist: cryptography
28
+ Requires-Dist: certifi
29
+ Requires-Dist: typer>=0.9.0
30
+ Requires-Dist: rich>=13.0.0
31
+ Requires-Dist: httpx>=0.27.0
32
+ Requires-Dist: httpx-sse>=0.4.0
33
+ Requires-Dist: prompt-toolkit>=3.0
34
+ Requires-Dist: pydantic>=2.0
35
+ Requires-Dist: tenacity
36
+ Requires-Dist: tomli>=2.0; python_version < "3.11"
37
+ Requires-Dist: PyYAML>=6.0
38
+ Requires-Dist: textual>=0.50
39
+ Provides-Extra: tokenizer
40
+ Requires-Dist: tiktoken; extra == "tokenizer"
41
+ Provides-Extra: acli-anthropic
42
+ Requires-Dist: anthropic>=0.40; extra == "acli-anthropic"
43
+ Provides-Extra: acli-openai
44
+ Requires-Dist: openai>=1.30; extra == "acli-openai"
45
+ Provides-Extra: acli-voice
46
+ Requires-Dist: sounddevice>=0.4; extra == "acli-voice"
47
+ Requires-Dist: numpy>=1.20; extra == "acli-voice"
48
+ Provides-Extra: acli-camera
49
+ Requires-Dist: opencv-python>=4.5; extra == "acli-camera"
50
+ Provides-Extra: acli-all
51
+ Requires-Dist: anthropic>=0.40; extra == "acli-all"
52
+ Requires-Dist: openai>=1.30; extra == "acli-all"
53
+ Requires-Dist: sounddevice>=0.4; extra == "acli-all"
54
+ Requires-Dist: numpy>=1.20; extra == "acli-all"
55
+ Requires-Dist: opencv-python>=4.5; extra == "acli-all"
56
+ Dynamic: author
57
+ Dynamic: author-email
58
+ Dynamic: classifier
59
+ Dynamic: description
60
+ Dynamic: description-content-type
61
+ Dynamic: home-page
62
+ Dynamic: license
63
+ Dynamic: license-file
64
+ Dynamic: platform
65
+ Dynamic: provides-extra
66
+ Dynamic: requires-dist
67
+ Dynamic: requires-python
68
+ Dynamic: summary
69
+
70
+ # DashScope Python SDK
71
+
72
+ The DashScope Python SDK provides a comprehensive interface to [Alibaba Cloud Model Studio (Bailian)](https://www.alibabacloud.com/help/en/model-studio/) APIs, covering text generation, multi-modal understanding, embeddings, reranking, image/video generation, speech synthesis & recognition, and more.
73
+
74
+ ## What is New
75
+
76
+ **v1.27.0 ships an interactive AI assistant — [DashScope SDK Expert](#ai-assistant-dashscope-sdk-expert).** Run `dashscope` with no arguments (or ask directly, e.g. `dashscope "how do I stream Generation output"`) to get SDK/API answers, runnable examples, CLI usage, and error diagnosis right in your terminal. Guidance is drawn from per-domain quick-reference skills (text, multimodal, speech, retrieval, fine-tuning, agent, cli) built on the SDK's public interfaces — parameters, outputs, and error codes — so you can ask instead of reading the docs. Type `/help` inside the assistant to view available commands.
77
+
78
+ ## Installation
79
+ To install the DashScope Python SDK, simply run:
80
+ ```shell
81
+ pip install dashscope
82
+ ```
83
+
84
+ If you clone the code from github, you can install from source by running:
85
+ ```shell
86
+ pip install -e .
87
+ ```
88
+
89
+ To use tokenizer in local mode without downloading any files, run:
90
+ ```shell
91
+ pip install dashscope[tokenizer]
92
+ ```
93
+
94
+
95
+ ## Quick Start
96
+
97
+ ```python
98
+ from http import HTTPStatus
99
+ from dashscope import Generation
100
+
101
+ responses = Generation.call(
102
+ model="qwen-plus",
103
+ messages=[
104
+ {"role": "system", "content": "You are a helpful assistant."},
105
+ {"role": "user", "content": "Who are you?"},
106
+ ],
107
+ result_format="message",
108
+ )
109
+
110
+ if responses.status_code == HTTPStatus.OK:
111
+ print(responses.output.choices[0].message.content)
112
+ else:
113
+ print(f"Error: {responses.code} - {responses.message}")
114
+ ```
115
+
116
+ ## API Key Authentication
117
+
118
+ The SDK uses API key for authentication. Please refer to [official documentation for alibabacloud china](https://www.alibabacloud.com/help/en/model-studio/) and [official documentation for alibabacloud international](https://www.alibabacloud.com/help/en/model-studio/) regarding how to obtain your api-key.
119
+
120
+ ### Using the API Key
121
+
122
+ 1. Set the API key via code
123
+ ```python
124
+ import dashscope
125
+
126
+ dashscope.api_key = 'YOUR-DASHSCOPE-API-KEY'
127
+ # Or specify the API key file path via code
128
+ # dashscope.api_key_file_path='~/.dashscope/api_key'
129
+
130
+ ```
131
+
132
+ 2. Set the API key via environment variables
133
+
134
+ a. Set the API key directly using the environment variable below
135
+
136
+ ```shell
137
+ export DASHSCOPE_API_KEY='YOUR-DASHSCOPE-API-KEY'
138
+ ```
139
+
140
+ b. Specify the API key file path via an environment variable
141
+
142
+ ```shell
143
+ export DASHSCOPE_API_KEY_FILE_PATH='~/.dashscope/api_key'
144
+ ```
145
+
146
+ 3. Save the API key to a file
147
+ ```python
148
+ from dashscope import save_api_key
149
+
150
+ save_api_key(api_key='YOUR-DASHSCOPE-API-KEY',
151
+ api_key_file_path='api_key_file_location or (None, will save to default location "~/.dashscope/api_key"')
152
+
153
+ ```
154
+
155
+ ## AI Assistant: DashScope SDK Expert
156
+
157
+ The SDK ships with an interactive AI assistant, **DashScope SDK Expert**, built on the bundled Agentic CLI (`dashscope/acli`) framework. For DashScope SDK/CLI users it is the recommended way to get development consultation and AI coding help — answering SDK/API questions, generating runnable examples, showing CLI usage, and diagnosing errors, right in your terminal.
158
+
159
+ - Run `dashscope` with no arguments to start the assistant. On first run it offers to install the SDK Expert knowledge pack (per-domain quick-reference skills: text, multimodal, speech, retrieval, fine-tuning, agent, cli), so guidance comes from the SDK's public interfaces — parameters, outputs, error codes — without reading the source
160
+ - Ask it instead of reading docs — e.g. `dashscope "how do I stream Generation output"` or `dashscope "CLI command to cancel a fine-tuning job"`. Type `/help` inside the assistant to list available commands (`/setup`, `/skill`, `/stats`, ...); classic SDK subcommands still work, and unrecognized commands are routed to the assistant
161
+
162
+ ## Supported Models
163
+
164
+ | Category | Recommended Models | SDK Class |
165
+ |----------|-------------------|-----------|
166
+ | Text Generation | qwen3.8-max, qwen3.7-max, qwen3.7-plus, qwen3.6-flash | `Generation` |
167
+ | Multi-Modal Understanding | qwen3.5-omni-plus, qwen3.7-plus (vision) | `MultiModalConversation` |
168
+ | Text Embedding | text-embedding-v4, text-embedding-v3 | `TextEmbedding` |
169
+ | Multi-Modal Embedding | tongyi-embedding-vision-plus, qwen3-vl-embedding | `MultiModalEmbedding` |
170
+ | Text ReRank | qwen3-rerank, gte-rerank-v2 | `TextReRank` |
171
+ | Image Generation | wan2.7-image-pro, qwen-image-2.0-pro | `ImageSynthesis` |
172
+ | Video Generation | wan2.7-t2v, wan2.7-i2v, happyhorse-1.0-t2v/i2v | `VideoSynthesis` |
173
+ | Speech Synthesis (TTS) | cosyvoice-v3.5-plus, cosyvoice-v1 | `SpeechSynthesizer`, `HttpSpeechSynthesizer` |
174
+ | Speech Recognition (ASR) | fun-asr-realtime, fun-asr, paraformer-v1 | `Transcription` |
175
+ | Omni (Real-time) | qwen3.5-omni-plus-realtime | `MultiModalConversation` |
176
+
177
+ For the latest model list, visit [Bailian Model Plaza](https://bailian.console.aliyun.com/).
178
+
179
+ ## Shell Completion
180
+
181
+ Run the appropriate command once, then restart your shell (or re-source your config file):
182
+
183
+ | Shell | Install command |
184
+ |-------|-----------------|
185
+ | **bash** | `dashscope --install-completion bash` |
186
+ | **zsh** | `dashscope --install-completion zsh` |
187
+ | **fish** | `dashscope --install-completion fish` |
188
+
189
+ To preview the completion script without installing:
190
+ ```shell
191
+ dashscope --show-completion bash
192
+ ```
193
+
194
+ ## Logging
195
+ To output Dashscope logs, you need to configure the logger.
196
+ ```shell
197
+ export DASHSCOPE_LOGGING_LEVEL='info'
198
+
199
+ ```
200
+
201
+ ## Output
202
+ The output contains the following fields:
203
+ ```
204
+ request_id (str): The request id.
205
+ status_code (int): HTTP status code, 200 indicates that the
206
+ request was successful, others indicate an error.
207
+ code (str): Error code if error occurs, otherwise empty str.
208
+ message (str): Set to error message on error.
209
+ output (Any): The request output.
210
+ usage (Any): The request usage information.
211
+ ```
212
+
213
+ ## License
214
+ This project is licensed under the Apache License (Version 2.0).
@@ -0,0 +1,145 @@
1
+ # DashScope Python SDK
2
+
3
+ The DashScope Python SDK provides a comprehensive interface to [Alibaba Cloud Model Studio (Bailian)](https://www.alibabacloud.com/help/en/model-studio/) APIs, covering text generation, multi-modal understanding, embeddings, reranking, image/video generation, speech synthesis & recognition, and more.
4
+
5
+ ## What is New
6
+
7
+ **v1.27.0 ships an interactive AI assistant — [DashScope SDK Expert](#ai-assistant-dashscope-sdk-expert).** Run `dashscope` with no arguments (or ask directly, e.g. `dashscope "how do I stream Generation output"`) to get SDK/API answers, runnable examples, CLI usage, and error diagnosis right in your terminal. Guidance is drawn from per-domain quick-reference skills (text, multimodal, speech, retrieval, fine-tuning, agent, cli) built on the SDK's public interfaces — parameters, outputs, and error codes — so you can ask instead of reading the docs. Type `/help` inside the assistant to view available commands.
8
+
9
+ ## Installation
10
+ To install the DashScope Python SDK, simply run:
11
+ ```shell
12
+ pip install dashscope
13
+ ```
14
+
15
+ If you clone the code from github, you can install from source by running:
16
+ ```shell
17
+ pip install -e .
18
+ ```
19
+
20
+ To use tokenizer in local mode without downloading any files, run:
21
+ ```shell
22
+ pip install dashscope[tokenizer]
23
+ ```
24
+
25
+
26
+ ## Quick Start
27
+
28
+ ```python
29
+ from http import HTTPStatus
30
+ from dashscope import Generation
31
+
32
+ responses = Generation.call(
33
+ model="qwen-plus",
34
+ messages=[
35
+ {"role": "system", "content": "You are a helpful assistant."},
36
+ {"role": "user", "content": "Who are you?"},
37
+ ],
38
+ result_format="message",
39
+ )
40
+
41
+ if responses.status_code == HTTPStatus.OK:
42
+ print(responses.output.choices[0].message.content)
43
+ else:
44
+ print(f"Error: {responses.code} - {responses.message}")
45
+ ```
46
+
47
+ ## API Key Authentication
48
+
49
+ The SDK uses API key for authentication. Please refer to [official documentation for alibabacloud china](https://www.alibabacloud.com/help/en/model-studio/) and [official documentation for alibabacloud international](https://www.alibabacloud.com/help/en/model-studio/) regarding how to obtain your api-key.
50
+
51
+ ### Using the API Key
52
+
53
+ 1. Set the API key via code
54
+ ```python
55
+ import dashscope
56
+
57
+ dashscope.api_key = 'YOUR-DASHSCOPE-API-KEY'
58
+ # Or specify the API key file path via code
59
+ # dashscope.api_key_file_path='~/.dashscope/api_key'
60
+
61
+ ```
62
+
63
+ 2. Set the API key via environment variables
64
+
65
+ a. Set the API key directly using the environment variable below
66
+
67
+ ```shell
68
+ export DASHSCOPE_API_KEY='YOUR-DASHSCOPE-API-KEY'
69
+ ```
70
+
71
+ b. Specify the API key file path via an environment variable
72
+
73
+ ```shell
74
+ export DASHSCOPE_API_KEY_FILE_PATH='~/.dashscope/api_key'
75
+ ```
76
+
77
+ 3. Save the API key to a file
78
+ ```python
79
+ from dashscope import save_api_key
80
+
81
+ save_api_key(api_key='YOUR-DASHSCOPE-API-KEY',
82
+ api_key_file_path='api_key_file_location or (None, will save to default location "~/.dashscope/api_key"')
83
+
84
+ ```
85
+
86
+ ## AI Assistant: DashScope SDK Expert
87
+
88
+ The SDK ships with an interactive AI assistant, **DashScope SDK Expert**, built on the bundled Agentic CLI (`dashscope/acli`) framework. For DashScope SDK/CLI users it is the recommended way to get development consultation and AI coding help — answering SDK/API questions, generating runnable examples, showing CLI usage, and diagnosing errors, right in your terminal.
89
+
90
+ - Run `dashscope` with no arguments to start the assistant. On first run it offers to install the SDK Expert knowledge pack (per-domain quick-reference skills: text, multimodal, speech, retrieval, fine-tuning, agent, cli), so guidance comes from the SDK's public interfaces — parameters, outputs, error codes — without reading the source
91
+ - Ask it instead of reading docs — e.g. `dashscope "how do I stream Generation output"` or `dashscope "CLI command to cancel a fine-tuning job"`. Type `/help` inside the assistant to list available commands (`/setup`, `/skill`, `/stats`, ...); classic SDK subcommands still work, and unrecognized commands are routed to the assistant
92
+
93
+ ## Supported Models
94
+
95
+ | Category | Recommended Models | SDK Class |
96
+ |----------|-------------------|-----------|
97
+ | Text Generation | qwen3.8-max, qwen3.7-max, qwen3.7-plus, qwen3.6-flash | `Generation` |
98
+ | Multi-Modal Understanding | qwen3.5-omni-plus, qwen3.7-plus (vision) | `MultiModalConversation` |
99
+ | Text Embedding | text-embedding-v4, text-embedding-v3 | `TextEmbedding` |
100
+ | Multi-Modal Embedding | tongyi-embedding-vision-plus, qwen3-vl-embedding | `MultiModalEmbedding` |
101
+ | Text ReRank | qwen3-rerank, gte-rerank-v2 | `TextReRank` |
102
+ | Image Generation | wan2.7-image-pro, qwen-image-2.0-pro | `ImageSynthesis` |
103
+ | Video Generation | wan2.7-t2v, wan2.7-i2v, happyhorse-1.0-t2v/i2v | `VideoSynthesis` |
104
+ | Speech Synthesis (TTS) | cosyvoice-v3.5-plus, cosyvoice-v1 | `SpeechSynthesizer`, `HttpSpeechSynthesizer` |
105
+ | Speech Recognition (ASR) | fun-asr-realtime, fun-asr, paraformer-v1 | `Transcription` |
106
+ | Omni (Real-time) | qwen3.5-omni-plus-realtime | `MultiModalConversation` |
107
+
108
+ For the latest model list, visit [Bailian Model Plaza](https://bailian.console.aliyun.com/).
109
+
110
+ ## Shell Completion
111
+
112
+ Run the appropriate command once, then restart your shell (or re-source your config file):
113
+
114
+ | Shell | Install command |
115
+ |-------|-----------------|
116
+ | **bash** | `dashscope --install-completion bash` |
117
+ | **zsh** | `dashscope --install-completion zsh` |
118
+ | **fish** | `dashscope --install-completion fish` |
119
+
120
+ To preview the completion script without installing:
121
+ ```shell
122
+ dashscope --show-completion bash
123
+ ```
124
+
125
+ ## Logging
126
+ To output Dashscope logs, you need to configure the logger.
127
+ ```shell
128
+ export DASHSCOPE_LOGGING_LEVEL='info'
129
+
130
+ ```
131
+
132
+ ## Output
133
+ The output contains the following fields:
134
+ ```
135
+ request_id (str): The request id.
136
+ status_code (int): HTTP status code, 200 indicates that the
137
+ request was successful, others indicate an error.
138
+ code (str): Error code if error occurs, otherwise empty str.
139
+ message (str): Set to error message on error.
140
+ output (Any): The request output.
141
+ usage (Any): The request usage information.
142
+ ```
143
+
144
+ ## License
145
+ This project is licensed under the Apache License (Version 2.0).
@@ -14,6 +14,7 @@ warnings.filterwarnings(
14
14
  category=Warning,
15
15
  )
16
16
 
17
+ from dashscope.version import __version__
17
18
  from dashscope.aigc.code_generation import CodeGeneration
18
19
  from dashscope.aigc.conversation import Conversation, History, HistoryItem
19
20
  from dashscope.aigc.generation import AioGeneration, Generation
@@ -80,6 +81,7 @@ from dashscope.tokenizers import (
80
81
  )
81
82
 
82
83
  __all__ = [
84
+ "__version__",
83
85
  "base_compatible_api_url",
84
86
  "base_http_api_url",
85
87
  "base_websocket_api_url",
@@ -0,0 +1,18 @@
1
+ # -*- coding: utf-8 -*-
2
+ from __future__ import annotations
3
+
4
+ __version__ = "0.6.2"
5
+
6
+ # Expose the lightweight programmatic SDK at the package root.
7
+ try:
8
+ from dashscope.acli.sdk import (
9
+ create_agent,
10
+ run_interactive,
11
+ run_once,
12
+ run_once_sync,
13
+ )
14
+ except Exception: # pragma: no cover - sdk imports optional deps may fail
15
+ create_agent = None # type: ignore
16
+ run_interactive = None # type: ignore
17
+ run_once = None # type: ignore
18
+ run_once_sync = None # type: ignore
@@ -0,0 +1,7 @@
1
+ # -*- coding: utf-8 -*-
2
+ from __future__ import annotations
3
+
4
+ from dashscope.acli.cli import main
5
+
6
+ if __name__ == "__main__":
7
+ main()