dashscope 1.26.0__tar.gz → 1.26.3__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 (214) hide show
  1. dashscope-1.26.3/LICENSE.certifi +20 -0
  2. dashscope-1.26.3/MANIFEST.in +3 -0
  3. dashscope-1.26.3/NOTICE +3 -0
  4. {dashscope-1.26.0/dashscope.egg-info → dashscope-1.26.3}/PKG-INFO +7 -24
  5. dashscope-1.26.3/dashscope/agentstudio/__init__.py +118 -0
  6. dashscope-1.26.3/dashscope/agentstudio/client.py +208 -0
  7. dashscope-1.26.3/dashscope/agentstudio/constants.py +95 -0
  8. dashscope-1.26.3/dashscope/agentstudio/exceptions.py +244 -0
  9. dashscope-1.26.3/dashscope/agentstudio/pagination.py +139 -0
  10. dashscope-1.26.3/dashscope/agentstudio/resources/__init__.py +65 -0
  11. dashscope-1.26.3/dashscope/agentstudio/resources/_helpers.py +79 -0
  12. dashscope-1.26.3/dashscope/agentstudio/resources/agents.py +338 -0
  13. dashscope-1.26.3/dashscope/agentstudio/resources/environments.py +242 -0
  14. dashscope-1.26.3/dashscope/agentstudio/resources/files.py +303 -0
  15. dashscope-1.26.3/dashscope/agentstudio/resources/session_events.py +332 -0
  16. dashscope-1.26.3/dashscope/agentstudio/resources/sessions.py +276 -0
  17. dashscope-1.26.3/dashscope/agentstudio/resources/skills.py +376 -0
  18. dashscope-1.26.3/dashscope/agentstudio/resources/vaults.py +476 -0
  19. dashscope-1.26.3/dashscope/agentstudio/streaming.py +226 -0
  20. dashscope-1.26.3/dashscope/agentstudio/transport.py +696 -0
  21. dashscope-1.26.3/dashscope/agentstudio/types/__init__.py +97 -0
  22. dashscope-1.26.3/dashscope/agentstudio/types/models.py +870 -0
  23. dashscope-1.26.3/dashscope/agentstudio/types/params.py +551 -0
  24. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/aigc/code_generation.py +1 -0
  25. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/aigc/generation.py +70 -0
  26. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/aigc/image_synthesis.py +284 -27
  27. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/aigc/multimodal_conversation.py +41 -2
  28. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/aigc/video_synthesis.py +46 -15
  29. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/api_entities/aio_session.py +36 -0
  30. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/api_entities/aiohttp_request.py +6 -3
  31. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/api_entities/api_request_data.py +8 -2
  32. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/api_entities/http_request.py +10 -4
  33. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/api_entities/websocket_request.py +2 -2
  34. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/audio/http_tts/http_speech_synthesizer.py +49 -1
  35. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/audio/qwen_omni/omni_realtime.py +10 -3
  36. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/audio/qwen_tts_realtime/qwen_tts_realtime.py +22 -6
  37. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/audio/tts_v2/speech_synthesizer.py +10 -3
  38. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/cli/__init__.py +0 -6
  39. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/cli/agentic_rl.py +14 -1
  40. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/cli/code_generation.py +3 -2
  41. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/cli/common.py +42 -5
  42. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/cli/deployments.py +82 -21
  43. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/cli/files.py +12 -1
  44. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/cli/fine_tunes.py +75 -19
  45. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/cli/image_synthesis.py +2 -1
  46. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/cli/speech_synthesis.py +19 -1
  47. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/cli/transcription.py +3 -1
  48. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/cli/understanding.py +3 -2
  49. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/cli/video_synthesis.py +3 -1
  50. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/client/base_api.py +18 -6
  51. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/common/utils.py +17 -11
  52. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/reinforcement/component/data/base_data_model.py +1 -0
  53. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/nlp/understanding.py +1 -0
  54. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/version.py +1 -1
  55. {dashscope-1.26.0 → dashscope-1.26.3/dashscope.egg-info}/PKG-INFO +7 -24
  56. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope.egg-info/SOURCES.txt +21 -1
  57. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope.egg-info/entry_points.txt +1 -0
  58. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope.egg-info/requires.txt +2 -0
  59. dashscope-1.26.0/MANIFEST.in +0 -4
  60. dashscope-1.26.0/requirements.txt +0 -7
  61. {dashscope-1.26.0 → dashscope-1.26.3}/LICENSE +0 -0
  62. {dashscope-1.26.0 → dashscope-1.26.3}/README.md +0 -0
  63. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/__init__.py +0 -0
  64. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/aigc/__init__.py +0 -0
  65. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/aigc/chat_completion.py +0 -0
  66. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/aigc/conversation.py +0 -0
  67. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/aigc/image_generation.py +0 -0
  68. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/api_entities/__init__.py +0 -0
  69. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/api_entities/api_request_factory.py +0 -0
  70. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/api_entities/base_request.py +0 -0
  71. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/api_entities/chat_completion_types.py +0 -0
  72. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/api_entities/dashscope_response.py +0 -0
  73. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/api_entities/encryption.py +0 -0
  74. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/app/__init__.py +0 -0
  75. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/app/application.py +0 -0
  76. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/app/application_response.py +0 -0
  77. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/assistants/__init__.py +0 -0
  78. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/assistants/assistant_types.py +0 -0
  79. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/assistants/assistants.py +0 -0
  80. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/assistants/files.py +0 -0
  81. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/audio/__init__.py +0 -0
  82. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/audio/asr/__init__.py +0 -0
  83. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/audio/asr/asr_phrase_manager.py +0 -0
  84. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/audio/asr/recognition.py +0 -0
  85. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/audio/asr/transcription.py +0 -0
  86. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/audio/asr/translation_recognizer.py +0 -0
  87. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/audio/asr/vocabulary.py +0 -0
  88. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/audio/http_tts/__init__.py +0 -0
  89. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/audio/qwen_asr/__init__.py +0 -0
  90. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/audio/qwen_asr/qwen_transcription.py +0 -0
  91. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/audio/qwen_omni/__init__.py +0 -0
  92. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/audio/qwen_tts/__init__.py +0 -0
  93. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/audio/qwen_tts/speech_synthesizer.py +0 -0
  94. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/audio/qwen_tts_realtime/__init__.py +0 -0
  95. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/audio/tts/__init__.py +0 -0
  96. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/audio/tts/speech_synthesizer.py +0 -0
  97. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/audio/tts_v2/__init__.py +0 -0
  98. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/audio/tts_v2/enrollment.py +0 -0
  99. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/cli/__main__.py +0 -0
  100. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/cli/application.py +0 -0
  101. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/cli/embeddings.py +0 -0
  102. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/cli/generation.py +0 -0
  103. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/cli/image_generation.py +0 -0
  104. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/cli/models.py +0 -0
  105. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/cli/multimodal_conversation.py +0 -0
  106. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/cli/multimodal_embedding.py +0 -0
  107. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/cli/oss.py +0 -0
  108. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/cli/rerank.py +0 -0
  109. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/cli/tokenization.py +0 -0
  110. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/client/__init__.py +0 -0
  111. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/common/__init__.py +0 -0
  112. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/common/api_key.py +0 -0
  113. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/common/base_type.py +0 -0
  114. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/common/constants.py +0 -0
  115. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/common/env.py +0 -0
  116. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/common/error.py +0 -0
  117. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/common/logging.py +0 -0
  118. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/common/message_manager.py +0 -0
  119. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/embeddings/__init__.py +0 -0
  120. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/embeddings/batch_text_embedding.py +0 -0
  121. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/embeddings/batch_text_embedding_response.py +0 -0
  122. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/embeddings/multimodal_embedding.py +0 -0
  123. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/embeddings/text_embedding.py +0 -0
  124. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/files.py +0 -0
  125. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/__init__.py +0 -0
  126. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/agentic_rl.py +0 -0
  127. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/customize_types.py +0 -0
  128. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/deployments.py +0 -0
  129. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/finetunes.py +0 -0
  130. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/reinforcement/__init__.py +0 -0
  131. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/reinforcement/common/__init__.py +0 -0
  132. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/reinforcement/common/constants.py +0 -0
  133. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/reinforcement/common/errors.py +0 -0
  134. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/reinforcement/common/log.py +0 -0
  135. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/reinforcement/common/model.py +0 -0
  136. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/reinforcement/common/model_types.py +0 -0
  137. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/reinforcement/common/utils.py +0 -0
  138. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/reinforcement/component/__init__.py +0 -0
  139. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/reinforcement/component/data/__init__.py +0 -0
  140. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/reinforcement/component/data/group_reward_input.py +0 -0
  141. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/reinforcement/component/data/group_reward_output.py +0 -0
  142. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/reinforcement/component/data/reward_input.py +0 -0
  143. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/reinforcement/component/data/reward_output.py +0 -0
  144. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/reinforcement/component/data/rollout_input.py +0 -0
  145. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/reinforcement/component/data/rollout_output.py +0 -0
  146. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/reinforcement/component/demo/__init__.py +0 -0
  147. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/reinforcement/component/demo/group_reward_processor_demo.py +0 -0
  148. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/reinforcement/component/demo/reward_processor_demo.py +0 -0
  149. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/reinforcement/component/demo/rollout_processor_demo.py +0 -0
  150. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/reinforcement/component/func_decorator.py +0 -0
  151. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/reinforcement/component/func_manager.py +0 -0
  152. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/reinforcement/component/observability/__init__.py +0 -0
  153. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/reinforcement/component/observability/genai/__init__.py +0 -0
  154. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/reinforcement/component/observability/genai/_core.py +0 -0
  155. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/reinforcement/component/observability/genai/llm_dashscope.py +0 -0
  156. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/reinforcement/component/observability/genai/llm_openai.py +0 -0
  157. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/reinforcement/component/observability/genai/llm_span.py +0 -0
  158. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/reinforcement/component/observability/genai/messages.py +0 -0
  159. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/reinforcement/component/observability/genai/tools.py +0 -0
  160. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/reinforcement/component/observability/processor_span.py +0 -0
  161. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/reinforcement/component/observability/tracing.py +0 -0
  162. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/reinforcement/component/parser/__init__.py +0 -0
  163. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/reinforcement/component/parser/base_parser.py +0 -0
  164. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/reinforcement/component/parser/group_reward_parser.py +0 -0
  165. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/reinforcement/component/parser/reward_parser.py +0 -0
  166. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/reinforcement/component/parser/rollout_parser.py +0 -0
  167. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/reinforcement/component/processor/__init__.py +0 -0
  168. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/reinforcement/component/processor/abstract_group_reward_processor.py +0 -0
  169. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/reinforcement/component/processor/abstract_processor.py +0 -0
  170. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/reinforcement/component/processor/abstract_reward_processor.py +0 -0
  171. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/reinforcement/component/processor/abstract_rollout_processor.py +0 -0
  172. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/reinforcement/component/server/__init__.py +0 -0
  173. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/finetune/reinforcement/component/server/server.py +0 -0
  174. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/io/__init__.py +0 -0
  175. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/io/input_output.py +0 -0
  176. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/model.py +0 -0
  177. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/models.py +0 -0
  178. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/multimodal/__init__.py +0 -0
  179. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/multimodal/dialog_state.py +0 -0
  180. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/multimodal/multimodal_constants.py +0 -0
  181. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/multimodal/multimodal_dialog.py +0 -0
  182. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/multimodal/multimodal_request_params.py +0 -0
  183. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/multimodal/tingwu/__init__.py +0 -0
  184. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/multimodal/tingwu/tingwu.py +0 -0
  185. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/multimodal/tingwu/tingwu_realtime.py +0 -0
  186. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/nlp/__init__.py +0 -0
  187. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/protocol/__init__.py +0 -0
  188. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/protocol/websocket.py +0 -0
  189. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/rerank/__init__.py +0 -0
  190. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/rerank/text_rerank.py +0 -0
  191. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/resources/qwen.tiktoken +0 -0
  192. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/threads/__init__.py +0 -0
  193. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/threads/messages/__init__.py +0 -0
  194. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/threads/messages/files.py +0 -0
  195. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/threads/messages/messages.py +0 -0
  196. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/threads/runs/__init__.py +0 -0
  197. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/threads/runs/runs.py +0 -0
  198. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/threads/runs/steps.py +0 -0
  199. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/threads/thread_types.py +0 -0
  200. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/threads/threads.py +0 -0
  201. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/tokenizers/__init__.py +0 -0
  202. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/tokenizers/qwen_tokenizer.py +0 -0
  203. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/tokenizers/tokenization.py +0 -0
  204. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/tokenizers/tokenizer.py +0 -0
  205. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/tokenizers/tokenizer_base.py +0 -0
  206. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/utils/__init__.py +0 -0
  207. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/utils/message_utils.py +0 -0
  208. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/utils/oss_utils.py +0 -0
  209. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope/utils/param_utils.py +0 -0
  210. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope.egg-info/dependency_links.txt +0 -0
  211. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope.egg-info/not-zip-safe +0 -0
  212. {dashscope-1.26.0 → dashscope-1.26.3}/dashscope.egg-info/top_level.txt +0 -0
  213. {dashscope-1.26.0 → dashscope-1.26.3}/setup.cfg +0 -0
  214. {dashscope-1.26.0 → dashscope-1.26.3}/setup.py +0 -0
@@ -0,0 +1,20 @@
1
+ This package contains a modified version of ca-bundle.crt:
2
+
3
+ ca-bundle.crt -- Bundle of CA Root Certificates
4
+
5
+ This is a bundle of X.509 certificates of public Certificate Authorities
6
+ (CA). These were automatically extracted from Mozilla's root certificates
7
+ file (certdata.txt). This file can be found in the mozilla source tree:
8
+ https://hg.mozilla.org/mozilla-central/file/tip/security/nss/lib/ckfw/builtins/certdata.txt
9
+ It contains the certificates in PEM format and therefore
10
+ can be directly used with curl / libcurl / php_curl, or with
11
+ an Apache+mod_ssl webserver for SSL client authentication.
12
+ Just configure this file as the SSLCACertificateFile.#
13
+
14
+ ***** BEGIN LICENSE BLOCK *****
15
+ This Source Code Form is subject to the terms of the Mozilla Public License,
16
+ v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain
17
+ one at http://mozilla.org/MPL/2.0/.
18
+
19
+ ***** END LICENSE BLOCK *****
20
+ @(#) $RCSfile: certdata.txt,v $ $Revision: 1.80 $ $Date: 2011/11/03 15:11:58 $
@@ -0,0 +1,3 @@
1
+ include dashscope/resources/qwen.tiktoken
2
+ include NOTICE
3
+ include LICENSE.certifi
@@ -0,0 +1,3 @@
1
+ This product depends on certifi (https://github.com/certifi/python-certifi),
2
+ which is provided under the Mozilla Public License 2.0.
3
+ See bundled LICENSE.certifi for details.
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.1
2
2
  Name: dashscope
3
- Version: 1.26.0
3
+ Version: 1.26.3
4
4
  Summary: dashscope client sdk library
5
5
  Home-page: https://dashscope.aliyun.com/
6
6
  Author: Alibaba Cloud
@@ -18,29 +18,10 @@ Classifier: Programming Language :: Python :: 3.10
18
18
  Classifier: Programming Language :: Python :: 3.11
19
19
  Requires-Python: >=3.8.0
20
20
  Description-Content-Type: text/markdown
21
- License-File: LICENSE
22
- Requires-Dist: aiohttp
23
- Requires-Dist: requests
24
- Requires-Dist: websocket-client
25
- Requires-Dist: cryptography
26
- Requires-Dist: certifi
27
- Requires-Dist: typer>=0.9.0
28
- Requires-Dist: rich>=13.0.0
29
21
  Provides-Extra: tokenizer
30
- Requires-Dist: tiktoken; extra == "tokenizer"
31
- Dynamic: author
32
- Dynamic: author-email
33
- Dynamic: classifier
34
- Dynamic: description
35
- Dynamic: description-content-type
36
- Dynamic: home-page
37
- Dynamic: license
38
- Dynamic: license-file
39
- Dynamic: platform
40
- Dynamic: provides-extra
41
- Dynamic: requires-dist
42
- Dynamic: requires-python
43
- Dynamic: summary
22
+ License-File: LICENSE
23
+ License-File: LICENSE.certifi
24
+ License-File: NOTICE
44
25
 
45
26
  # DashScope Python SDK
46
27
 
@@ -562,3 +543,5 @@ Coming soon.
562
543
 
563
544
  ## License
564
545
  This project is licensed under the Apache License (Version 2.0).
546
+
547
+
@@ -0,0 +1,118 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright (c) Alibaba, Inc. and its affiliates.
3
+ """AgentStudio sub-SDK for the dashscope Python client.
4
+
5
+ The ``agentstudio`` package wraps the AgentStudio managed-agent HTTP
6
+ API. All resource classes are accessed through a client instance::
7
+
8
+ from dashscope.agentstudio import Client
9
+ from dashscope.agentstudio.types import (
10
+ user_message, user_tool_result,
11
+ )
12
+
13
+ Example
14
+ -------
15
+ >>> from dashscope.agentstudio import Client
16
+ >>> from dashscope.agentstudio.types import user_message
17
+ >>> client = Client(api_key="sk-xxx")
18
+ >>> agent = client.agents.create(name="demo", model="qwen-plus")
19
+ >>> session = client.sessions.create(agent=agent.id)
20
+ >>> client.sessions.events.send(session.id, [user_message("Hello!")])
21
+ >>> with client.sessions.events.stream(session.id) as stream:
22
+ ... for event in stream:
23
+ ... print(event.type, event.to_dict())
24
+ ... if event.type == "session_status":
25
+ ... break
26
+ """
27
+
28
+ # yapf: disable
29
+
30
+ from .client import Client, AsyncClient
31
+ from .transport import APIResponse, RequestOptions
32
+ from . import types
33
+ from .exceptions import (
34
+ AgentStudioError,
35
+ APIConnectionError,
36
+ APIStatusError,
37
+ APITimeoutError,
38
+ AuthenticationError,
39
+ ConflictError,
40
+ InternalServerError,
41
+ InvalidRequestError,
42
+ NotFoundError,
43
+ OverloadedError,
44
+ PermissionDeniedError,
45
+ RateLimitError,
46
+ StreamClosedError,
47
+ StreamError,
48
+ )
49
+ from .pagination import (
50
+ AsyncCursorPage,
51
+ CursorPage,
52
+ )
53
+ from .types import (
54
+ Message,
55
+ ServerEvent,
56
+ user_define_outcome,
57
+ user_interrupt,
58
+ user_message,
59
+ user_tool_confirmation,
60
+ user_custom_tool_result,
61
+ user_tool_result,
62
+ )
63
+ from .types.params import (
64
+ AgentCreateParams,
65
+ AgentUpdateParams,
66
+ SessionCreateParams,
67
+ SessionUpdateParams,
68
+ EnvironmentCreateParams,
69
+ EnvironmentUpdateParams,
70
+ SessionEventSendParams,
71
+ )
72
+
73
+ __all__ = [
74
+ # client
75
+ "Client",
76
+ "AsyncClient",
77
+ # base types
78
+ "RequestOptions",
79
+ "APIResponse",
80
+ # exceptions
81
+ "AgentStudioError",
82
+ "APIConnectionError",
83
+ "APIStatusError",
84
+ "APITimeoutError",
85
+ "AuthenticationError",
86
+ "ConflictError",
87
+ "InternalServerError",
88
+ "InvalidRequestError",
89
+ "NotFoundError",
90
+ "OverloadedError",
91
+ "PermissionDeniedError",
92
+ "RateLimitError",
93
+ "StreamError",
94
+ "StreamClosedError",
95
+ # pagination
96
+ "CursorPage",
97
+ "AsyncCursorPage",
98
+ # unified message type
99
+ "Message",
100
+ "ServerEvent",
101
+ # client event helpers (re-exported for convenience)
102
+ "user_message",
103
+ "user_interrupt",
104
+ "user_tool_confirmation",
105
+ "user_custom_tool_result",
106
+ "user_tool_result",
107
+ "user_define_outcome",
108
+ # typing module
109
+ "types",
110
+ # params (commonly used request-body types)
111
+ "AgentCreateParams",
112
+ "AgentUpdateParams",
113
+ "SessionCreateParams",
114
+ "SessionUpdateParams",
115
+ "EnvironmentCreateParams",
116
+ "EnvironmentUpdateParams",
117
+ "SessionEventSendParams",
118
+ ]
@@ -0,0 +1,208 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright (c) Alibaba, Inc. and its affiliates.
3
+ """AgentStudio client classes."""
4
+
5
+ from __future__ import annotations
6
+
7
+ import os
8
+ from typing import Any, Optional, Tuple, Union
9
+
10
+ import httpx
11
+
12
+ from dashscope.agentstudio.resources.agents import Agents, AsyncAgents
13
+ from dashscope.agentstudio.resources.environments import (
14
+ Environments,
15
+ AsyncEnvironments,
16
+ )
17
+ from dashscope.agentstudio.resources.files import Files, AsyncFiles
18
+ from dashscope.agentstudio.resources.sessions import Sessions, AsyncSessions
19
+ from dashscope.agentstudio.resources.skills import Skills, AsyncSkills
20
+ from dashscope.agentstudio.resources.vaults import Vaults, AsyncVaults
21
+ from dashscope.agentstudio.constants import (
22
+ AGENTSTUDIO_BASE_URL_TEMPLATE,
23
+ AGENTSTUDIO_DEFAULT_REGION,
24
+ AGENTSTUDIO_DEFAULT_TIMEOUT,
25
+ AGENTSTUDIO_MAX_RETRIES,
26
+ )
27
+ from dashscope.agentstudio.transport import SyncTransport, AsyncTransport
28
+ from dashscope.common.api_key import get_default_api_key
29
+
30
+
31
+ def _resolve_base_url(
32
+ explicit_url: Optional[str],
33
+ workspace: Optional[str],
34
+ region: Optional[str] = None,
35
+ ) -> str:
36
+ """Resolve the base URL.
37
+
38
+ Priority:
39
+ 1. explicit base_url parameter (full URL)
40
+ 2. DASHSCOPE_AGENTSTUDIO_URL / AGENTSTUDIO_URL env
41
+ 3. Build from workspace + region template
42
+ """
43
+ if explicit_url:
44
+ return explicit_url
45
+ env_url = os.environ.get("DASHSCOPE_AGENTSTUDIO_URL") or os.environ.get(
46
+ "AGENTSTUDIO_URL",
47
+ )
48
+ if env_url:
49
+ return env_url
50
+ # Build from workspace + region
51
+ ws = workspace or os.environ.get("DASHSCOPE_WORKSPACE")
52
+ if not ws:
53
+ raise ValueError(
54
+ "workspace is required when base_url is not provided "
55
+ "(pass workspace='ws_xxx' or set DASHSCOPE_WORKSPACE env var "
56
+ "or use base_url=... to override)",
57
+ )
58
+ rgn = region or AGENTSTUDIO_DEFAULT_REGION
59
+ return AGENTSTUDIO_BASE_URL_TEMPLATE.format(
60
+ workspace=ws,
61
+ region=rgn,
62
+ )
63
+
64
+
65
+ def _user_agent(base_url: str) -> str:
66
+ try:
67
+ from dashscope.version import __version__
68
+ except Exception:
69
+ __version__ = "0.0.0"
70
+ return f"dashscope-agentstudio-python/{__version__} (+{base_url})"
71
+
72
+
73
+ class Client:
74
+ """Synchronous AgentStudio client.
75
+
76
+ Usage::
77
+
78
+ from dashscope.agentstudio import Client
79
+
80
+ client = Client(api_key="sk-xxx", workspace="my-ws")
81
+ agent = client.agents.create(name="demo", model="qwen-max")
82
+ session = client.sessions.create(agent=agent.id)
83
+ with client.sessions.events.stream(session.id) as stream:
84
+ for event in stream:
85
+ print(event.type)
86
+ """
87
+
88
+ def __init__(
89
+ self,
90
+ *,
91
+ api_key: Optional[str] = None,
92
+ workspace: Optional[str] = None,
93
+ region: Optional[str] = None,
94
+ base_url: Optional[str] = None,
95
+ uid: Optional[str] = None,
96
+ timeout: Optional[
97
+ Union[float, httpx.Timeout, Tuple[float, float]]
98
+ ] = None,
99
+ max_retries: int = AGENTSTUDIO_MAX_RETRIES,
100
+ http_client: Optional[httpx.Client] = None,
101
+ ) -> None:
102
+ resolved_workspace = workspace or os.environ.get("DASHSCOPE_WORKSPACE")
103
+ resolved_base = _resolve_base_url(
104
+ base_url,
105
+ resolved_workspace,
106
+ region,
107
+ )
108
+ self.transport = SyncTransport(
109
+ base_url=resolved_base,
110
+ api_key=api_key or get_default_api_key(),
111
+ workspace=resolved_workspace,
112
+ uid=uid or os.environ.get("DASHSCOPE_UID"),
113
+ user_agent=_user_agent(resolved_base),
114
+ timeout=timeout or AGENTSTUDIO_DEFAULT_TIMEOUT,
115
+ max_retries=max_retries,
116
+ http_client=http_client,
117
+ )
118
+ self.agents = Agents(self)
119
+ self.sessions = Sessions(self)
120
+ self.environments = Environments(self)
121
+ self.files = Files(self)
122
+ self.skills = Skills(self)
123
+ self.vaults = Vaults(self)
124
+
125
+ def close(self) -> None:
126
+ self.transport.close()
127
+
128
+ def __enter__(self) -> "Client":
129
+ return self
130
+
131
+ def __exit__(self, *exc: Any) -> None:
132
+ self.close()
133
+
134
+ def __del__(self) -> None:
135
+ try:
136
+ self.close()
137
+ except Exception:
138
+ pass
139
+
140
+
141
+ class AsyncClient:
142
+ """Asynchronous AgentStudio client.
143
+
144
+ Usage::
145
+
146
+ from dashscope.agentstudio import AsyncClient
147
+
148
+ client = AsyncClient(api_key="sk-xxx", workspace="my-ws")
149
+ agent = await client.agents.create(
150
+ name="demo", model="qwen-max",
151
+ )
152
+ session = await client.sessions.create(agent=agent.id)
153
+ async with client.sessions.events.stream(session.id) as stream:
154
+ async for event in stream:
155
+ print(event.type)
156
+ """
157
+
158
+ def __init__(
159
+ self,
160
+ *,
161
+ api_key: Optional[str] = None,
162
+ workspace: Optional[str] = None,
163
+ region: Optional[str] = None,
164
+ base_url: Optional[str] = None,
165
+ uid: Optional[str] = None,
166
+ timeout: Optional[
167
+ Union[float, httpx.Timeout, Tuple[float, float]]
168
+ ] = None,
169
+ max_retries: int = AGENTSTUDIO_MAX_RETRIES,
170
+ http_client: Optional[httpx.AsyncClient] = None,
171
+ ) -> None:
172
+ resolved_workspace = workspace or os.environ.get("DASHSCOPE_WORKSPACE")
173
+ resolved_base = _resolve_base_url(
174
+ base_url,
175
+ resolved_workspace,
176
+ region,
177
+ )
178
+ self.transport = AsyncTransport(
179
+ base_url=resolved_base,
180
+ api_key=api_key or get_default_api_key(),
181
+ workspace=resolved_workspace,
182
+ uid=uid or os.environ.get("DASHSCOPE_UID"),
183
+ user_agent=_user_agent(resolved_base),
184
+ timeout=timeout or AGENTSTUDIO_DEFAULT_TIMEOUT,
185
+ max_retries=max_retries,
186
+ http_client=http_client,
187
+ )
188
+ self.agents = AsyncAgents(self)
189
+ self.sessions = AsyncSessions(self)
190
+ self.environments = AsyncEnvironments(self)
191
+ self.files = AsyncFiles(self)
192
+ self.skills = AsyncSkills(self)
193
+ self.vaults = AsyncVaults(self)
194
+
195
+ async def aclose(self) -> None:
196
+ await self.transport.aclose()
197
+
198
+ async def __aenter__(self) -> "AsyncClient":
199
+ return self
200
+
201
+ async def __aexit__(self, *exc: Any) -> None:
202
+ await self.aclose()
203
+
204
+ def __del__(self) -> None:
205
+ try:
206
+ self.transport.close()
207
+ except Exception:
208
+ pass
@@ -0,0 +1,95 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright (c) Alibaba, Inc. and its affiliates.
3
+ """AgentStudio wire-protocol and configuration constants."""
4
+
5
+ import enum
6
+ import sys
7
+
8
+ import httpx
9
+
10
+ if sys.version_info >= (3, 11):
11
+ from enum import StrEnum
12
+ else:
13
+
14
+ class StrEnum(str, enum.Enum): # type: ignore[no-redef]
15
+ """Minimal StrEnum shim for Python < 3.11."""
16
+
17
+
18
+ # ---------------------------------------------------------------------------
19
+ # Configuration
20
+ # ---------------------------------------------------------------------------
21
+
22
+ _HOST = "https://{workspace}.{region}.maas.aliyuncs.com"
23
+ AGENTSTUDIO_BASE_URL_TEMPLATE = _HOST + "/api/v1/agentstudio"
24
+ AGENTSTUDIO_DEFAULT_REGION = "cn-beijing"
25
+ AGENTSTUDIO_DEFAULT_TIMEOUT = httpx.Timeout(600.0, connect=10.0)
26
+ AGENTSTUDIO_MAX_RETRIES = 2
27
+
28
+
29
+ # ---------------------------------------------------------------------------
30
+ # Wire-protocol enums
31
+ # ---------------------------------------------------------------------------
32
+
33
+
34
+ class SSEEventType(StrEnum):
35
+ """Server-sent event types (the value of ``event.type`` in SSE payloads).
36
+
37
+ Client-sendable: MESSAGE, INTERRUPT, TOOL_CONFIRMATION,
38
+ FUNCTION_CALL_OUTPUT, TOOL_CALL_OUTPUT, DEFINE_OUTCOME.
39
+ Server-emitted: all types.
40
+ """
41
+
42
+ # Client-sendable
43
+ MESSAGE = "message"
44
+ INTERRUPT = "interrupt"
45
+ TOOL_CONFIRMATION = "tool_confirmation"
46
+ FUNCTION_CALL_OUTPUT = "function_call_output"
47
+ TOOL_CALL_OUTPUT = "tool_call_output"
48
+ DEFINE_OUTCOME = "define_outcome"
49
+
50
+ # Server-emitted
51
+ FUNCTION_CALL = "function_call"
52
+ TOOL_CALL = "tool_call"
53
+ REASONING = "reasoning"
54
+ MCP_CALL = "mcp_call"
55
+ MCP_CALL_OUTPUT = "mcp_call_output"
56
+ THREAD_MESSAGE_SENT = "thread_message_sent"
57
+ THREAD_MESSAGE_RECEIVED = "thread_message_received"
58
+ THREAD_CONTEXT_COMPACTED = "thread_context_compacted"
59
+ SESSION_STATUS = "session_status"
60
+ ERROR = "error"
61
+ SESSION_UPDATED = "session_updated"
62
+ THREAD_CREATED = "thread_created"
63
+ THREAD_STATUS = "thread_status"
64
+ MODEL_REQUEST_START = "model_request_start"
65
+ MODEL_REQUEST_END = "model_request_end"
66
+ OUTCOME_EVALUATION = "outcome_evaluation"
67
+
68
+
69
+ class MessageRole(StrEnum):
70
+ """Roles used in message/event payloads."""
71
+
72
+ USER = "user"
73
+ ASSISTANT = "assistant"
74
+ TOOL = "tool"
75
+
76
+
77
+ class BlockType(StrEnum):
78
+ """Content block types (``block.type`` values)."""
79
+
80
+ TEXT = "text"
81
+ IMAGE = "image"
82
+ AUDIO = "audio"
83
+ DATA = "data"
84
+ FILE = "file"
85
+ REFUSAL = "refusal"
86
+ ERROR = "error"
87
+
88
+
89
+ class SessionStatus(StrEnum):
90
+ """Session run-status values (``session_status``)."""
91
+
92
+ IDLE = "idle"
93
+ RUNNING = "running"
94
+ RESCHEDULING = "rescheduling"
95
+ TERMINATED = "terminated"