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.
- {dashscope-1.26.6 → dashscope-1.27.2}/MANIFEST.in +1 -0
- dashscope-1.27.2/PKG-INFO +214 -0
- dashscope-1.27.2/README.md +145 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/__init__.py +2 -0
- dashscope-1.27.2/dashscope/acli/__init__.py +18 -0
- dashscope-1.27.2/dashscope/acli/__main__.py +7 -0
- dashscope-1.27.2/dashscope/acli/agent.py +1163 -0
- dashscope-1.27.2/dashscope/acli/agents/__init__.py +2 -0
- dashscope-1.27.2/dashscope/acli/agents/delegate.py +383 -0
- dashscope-1.27.2/dashscope/acli/agents/subagent.py +317 -0
- dashscope-1.27.2/dashscope/acli/agents/subagents.py +335 -0
- dashscope-1.27.2/dashscope/acli/audit.py +252 -0
- dashscope-1.27.2/dashscope/acli/capabilities/__init__.py +102 -0
- dashscope-1.27.2/dashscope/acli/capabilities/local_memory.py +92 -0
- dashscope-1.27.2/dashscope/acli/cli/__init__.py +226 -0
- dashscope-1.27.2/dashscope/acli/cli/completer.py +316 -0
- dashscope-1.27.2/dashscope/acli/cli/constants.py +319 -0
- dashscope-1.27.2/dashscope/acli/cli/dispatch.py +542 -0
- dashscope-1.27.2/dashscope/acli/cli/examples.py +504 -0
- dashscope-1.27.2/dashscope/acli/cli/handlers_capability.py +306 -0
- dashscope-1.27.2/dashscope/acli/cli/handlers_config.py +850 -0
- dashscope-1.27.2/dashscope/acli/cli/handlers_device.py +432 -0
- dashscope-1.27.2/dashscope/acli/cli/handlers_key.py +279 -0
- dashscope-1.27.2/dashscope/acli/cli/handlers_misc.py +320 -0
- dashscope-1.27.2/dashscope/acli/cli/handlers_profile.py +272 -0
- dashscope-1.27.2/dashscope/acli/cli/handlers_provider.py +282 -0
- dashscope-1.27.2/dashscope/acli/cli/handlers_session.py +213 -0
- dashscope-1.27.2/dashscope/acli/cli/handlers_setup.py +311 -0
- dashscope-1.27.2/dashscope/acli/cli/handlers_skill.py +373 -0
- dashscope-1.27.2/dashscope/acli/cli/mcp.py +179 -0
- dashscope-1.27.2/dashscope/acli/cli/multimodal.py +279 -0
- dashscope-1.27.2/dashscope/acli/cli/repl.py +601 -0
- dashscope-1.27.2/dashscope/acli/cli/runners.py +387 -0
- dashscope-1.27.2/dashscope/acli/cli/startup.py +192 -0
- dashscope-1.27.2/dashscope/acli/cli/streaming.py +351 -0
- dashscope-1.27.2/dashscope/acli/commands.py +232 -0
- dashscope-1.27.2/dashscope/acli/compression.py +313 -0
- dashscope-1.27.2/dashscope/acli/config.py +879 -0
- dashscope-1.27.2/dashscope/acli/debuglog.py +29 -0
- dashscope-1.27.2/dashscope/acli/deliverable.py +171 -0
- dashscope-1.27.2/dashscope/acli/dev.py +1295 -0
- dashscope-1.27.2/dashscope/acli/eval/__init__.py +248 -0
- dashscope-1.27.2/dashscope/acli/examples/basic-chat/.acli/config.toml +4 -0
- dashscope-1.27.2/dashscope/acli/examples/basic-chat/.acli/custom-extensions.toml +234 -0
- dashscope-1.27.2/dashscope/acli/examples/basic-chat/.acli/hooks.toml +101 -0
- dashscope-1.27.2/dashscope/acli/examples/basic-chat/.acli/skills/explain-code.md +17 -0
- dashscope-1.27.2/dashscope/acli/examples/basic-chat/.acli/skills/research-topic.md +19 -0
- dashscope-1.27.2/dashscope/acli/examples/basic-chat/.acli/skills/translate.md +15 -0
- dashscope-1.27.2/dashscope/acli/examples/basic-chat/.acli/skills/write-poem.md +11 -0
- dashscope-1.27.2/dashscope/acli/examples/basic-chat/.acli/system-prompt.md +26 -0
- dashscope-1.27.2/dashscope/acli/examples/basic-chat/README.md +112 -0
- dashscope-1.27.2/dashscope/acli/examples/dashscope-sdk-expert/.acli/config.toml +5 -0
- dashscope-1.27.2/dashscope/acli/examples/dashscope-sdk-expert/.acli/custom-extensions.toml +23 -0
- dashscope-1.27.2/dashscope/acli/examples/dashscope-sdk-expert/.acli/hooks.toml +25 -0
- dashscope-1.27.2/dashscope/acli/examples/dashscope-sdk-expert/.acli/skills/agent.md +97 -0
- dashscope-1.27.2/dashscope/acli/examples/dashscope-sdk-expert/.acli/skills/api-doc.md +14 -0
- dashscope-1.27.2/dashscope/acli/examples/dashscope-sdk-expert/.acli/skills/cli.md +87 -0
- dashscope-1.27.2/dashscope/acli/examples/dashscope-sdk-expert/.acli/skills/diagnose.md +13 -0
- dashscope-1.27.2/dashscope/acli/examples/dashscope-sdk-expert/.acli/skills/error-code.md +11 -0
- dashscope-1.27.2/dashscope/acli/examples/dashscope-sdk-expert/.acli/skills/explain-code.md +9 -0
- dashscope-1.27.2/dashscope/acli/examples/dashscope-sdk-expert/.acli/skills/fine-tuning.md +107 -0
- dashscope-1.27.2/dashscope/acli/examples/dashscope-sdk-expert/.acli/skills/multimodal.md +109 -0
- dashscope-1.27.2/dashscope/acli/examples/dashscope-sdk-expert/.acli/skills/retrieval.md +131 -0
- dashscope-1.27.2/dashscope/acli/examples/dashscope-sdk-expert/.acli/skills/sdk-example.md +13 -0
- dashscope-1.27.2/dashscope/acli/examples/dashscope-sdk-expert/.acli/skills/speech.md +110 -0
- dashscope-1.27.2/dashscope/acli/examples/dashscope-sdk-expert/.acli/skills/text-generation.md +145 -0
- dashscope-1.27.2/dashscope/acli/examples/dashscope-sdk-expert/.acli/skills/translate.md +9 -0
- dashscope-1.27.2/dashscope/acli/examples/dashscope-sdk-expert/.acli/system-prompt.md +84 -0
- dashscope-1.27.2/dashscope/acli/examples/dashscope-sdk-expert/README.md +111 -0
- dashscope-1.27.2/dashscope/acli/executor.py +383 -0
- dashscope-1.27.2/dashscope/acli/extensions.py +1304 -0
- dashscope-1.27.2/dashscope/acli/hooks.py +426 -0
- dashscope-1.27.2/dashscope/acli/mcp_server.py +169 -0
- dashscope-1.27.2/dashscope/acli/mcp_stdio.py +313 -0
- dashscope-1.27.2/dashscope/acli/memory/__init__.py +2 -0
- dashscope-1.27.2/dashscope/acli/memory/directives_learning.py +258 -0
- dashscope-1.27.2/dashscope/acli/memory/experience.py +168 -0
- dashscope-1.27.2/dashscope/acli/memory/manager.py +148 -0
- dashscope-1.27.2/dashscope/acli/memory/plan.py +111 -0
- dashscope-1.27.2/dashscope/acli/memory/reflection.py +69 -0
- dashscope-1.27.2/dashscope/acli/memory/skill_evolution.py +244 -0
- dashscope-1.27.2/dashscope/acli/memory/tool_chains.py +198 -0
- dashscope-1.27.2/dashscope/acli/memory/trace.py +197 -0
- dashscope-1.27.2/dashscope/acli/permission.py +141 -0
- dashscope-1.27.2/dashscope/acli/platforms/__init__.py +74 -0
- dashscope-1.27.2/dashscope/acli/platforms/bailian/__init__.py +15 -0
- dashscope-1.27.2/dashscope/acli/platforms/bailian/cli.py +178 -0
- dashscope-1.27.2/dashscope/acli/platforms/bailian/mcp.py +303 -0
- dashscope-1.27.2/dashscope/acli/platforms/base.py +309 -0
- dashscope-1.27.2/dashscope/acli/platforms/local/__init__.py +6 -0
- dashscope-1.27.2/dashscope/acli/platforms/local/history.py +319 -0
- dashscope-1.27.2/dashscope/acli/platforms/local/memory.py +235 -0
- dashscope-1.27.2/dashscope/acli/prompt.py +202 -0
- dashscope-1.27.2/dashscope/acli/prompt_pipeline.py +303 -0
- dashscope-1.27.2/dashscope/acli/providers/__init__.py +133 -0
- dashscope-1.27.2/dashscope/acli/providers/adapter.py +331 -0
- dashscope-1.27.2/dashscope/acli/providers/anthropic.py +377 -0
- dashscope-1.27.2/dashscope/acli/providers/base.py +49 -0
- dashscope-1.27.2/dashscope/acli/providers/hardening.py +203 -0
- dashscope-1.27.2/dashscope/acli/providers/openai.py +282 -0
- dashscope-1.27.2/dashscope/acli/providers/profile.py +305 -0
- dashscope-1.27.2/dashscope/acli/providers/tongyi.py +443 -0
- dashscope-1.27.2/dashscope/acli/sandbox.py +181 -0
- dashscope-1.27.2/dashscope/acli/scheduler.py +641 -0
- dashscope-1.27.2/dashscope/acli/sdk.py +189 -0
- dashscope-1.27.2/dashscope/acli/session.py +559 -0
- dashscope-1.27.2/dashscope/acli/session_events.py +200 -0
- dashscope-1.27.2/dashscope/acli/skills/__init__.py +33 -0
- dashscope-1.27.2/dashscope/acli/skills/base.py +212 -0
- dashscope-1.27.2/dashscope/acli/skills/manager.py +175 -0
- dashscope-1.27.2/dashscope/acli/skills/package.py +253 -0
- dashscope-1.27.2/dashscope/acli/skills/store.py +589 -0
- dashscope-1.27.2/dashscope/acli/tools/__init__.py +6 -0
- dashscope-1.27.2/dashscope/acli/tools/browser.py +493 -0
- dashscope-1.27.2/dashscope/acli/tools/camera.py +39 -0
- dashscope-1.27.2/dashscope/acli/tools/checkpoint.py +167 -0
- dashscope-1.27.2/dashscope/acli/tools/evolution.py +75 -0
- dashscope-1.27.2/dashscope/acli/tools/filesystem.py +296 -0
- dashscope-1.27.2/dashscope/acli/tools/platform.py +546 -0
- dashscope-1.27.2/dashscope/acli/tools/registry.py +454 -0
- dashscope-1.27.2/dashscope/acli/tools/session.py +414 -0
- dashscope-1.27.2/dashscope/acli/tools/shell.py +608 -0
- dashscope-1.27.2/dashscope/acli/tools/skills.py +77 -0
- dashscope-1.27.2/dashscope/acli/tools/web_search.py +193 -0
- dashscope-1.27.2/dashscope/acli/ui/__init__.py +2 -0
- dashscope-1.27.2/dashscope/acli/ui/camera.py +208 -0
- dashscope-1.27.2/dashscope/acli/ui/embedded.py +135 -0
- dashscope-1.27.2/dashscope/acli/ui/tts.py +662 -0
- dashscope-1.27.2/dashscope/acli/ui/tui.py +3078 -0
- dashscope-1.27.2/dashscope/acli/ui/voice.py +483 -0
- dashscope-1.27.2/dashscope/acli/utils/__init__.py +98 -0
- dashscope-1.27.2/dashscope/acli/utils/clipboard.py +43 -0
- dashscope-1.27.2/dashscope/acli/utils/crypto.py +46 -0
- dashscope-1.27.2/dashscope/acli/utils/exceptions.py +19 -0
- dashscope-1.27.2/dashscope/acli/utils/ids.py +37 -0
- dashscope-1.27.2/dashscope/acli/utils/images.py +31 -0
- dashscope-1.27.2/dashscope/acli/utils/keywords.py +52 -0
- dashscope-1.27.2/dashscope/acli/utils/messages.py +193 -0
- dashscope-1.27.2/dashscope/acli/utils/paths.py +99 -0
- dashscope-1.27.2/dashscope/acli/utils/sanitizer.py +104 -0
- dashscope-1.27.2/dashscope/acli/utils/spinner.py +108 -0
- dashscope-1.27.2/dashscope/acli/utils/template.py +31 -0
- dashscope-1.27.2/dashscope/acli/utils/text.py +105 -0
- dashscope-1.27.2/dashscope/acli/utils/toml.py +111 -0
- dashscope-1.27.2/dashscope/acli/utils/validation.py +116 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/agentstudio/resources/agents.py +8 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/agentstudio/resources/files.py +88 -2
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/agentstudio/resources/sessions.py +4 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/agentstudio/types/__init__.py +2 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/agentstudio/types/models.py +41 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/agentstudio/types/params.py +23 -1
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/api_entities/aio_session.py +24 -1
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/api_entities/aiohttp_request.py +19 -12
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/api_entities/api_request_factory.py +99 -72
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/api_entities/http_request.py +55 -24
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/app/application.py +105 -52
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/audio/asr/recognition.py +88 -3
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/audio/asr/translation_recognizer.py +96 -4
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/audio/http_tts/http_speech_synthesizer.py +9 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/audio/tts_v2/speech_synthesizer.py +100 -30
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/cli/__init__.py +180 -3
- dashscope-1.27.2/dashscope/cli/auth.py +116 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/cli/common.py +54 -3
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/cli/generation.py +48 -18
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/tokenizers/tokenization.py +31 -4
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/version.py +1 -1
- dashscope-1.27.2/dashscope.egg-info/PKG-INFO +214 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope.egg-info/SOURCES.txt +142 -0
- dashscope-1.27.2/dashscope.egg-info/requires.txt +40 -0
- dashscope-1.27.2/requirements.txt +15 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/setup.cfg +1 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/setup.py +11 -0
- dashscope-1.26.6/PKG-INFO +0 -568
- dashscope-1.26.6/README.md +0 -520
- dashscope-1.26.6/dashscope.egg-info/PKG-INFO +0 -568
- dashscope-1.26.6/dashscope.egg-info/requires.txt +0 -12
- dashscope-1.26.6/requirements.txt +0 -9
- {dashscope-1.26.6 → dashscope-1.27.2}/LICENSE +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/LICENSE.certifi +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/NOTICE +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/__init__.pyi +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/agentstudio/__init__.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/agentstudio/client.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/agentstudio/constants.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/agentstudio/exceptions.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/agentstudio/pagination.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/agentstudio/resources/__init__.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/agentstudio/resources/_helpers.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/agentstudio/resources/deployments.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/agentstudio/resources/environments.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/agentstudio/resources/session_events.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/agentstudio/resources/skills.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/agentstudio/resources/vaults.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/agentstudio/streaming.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/agentstudio/transport.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/aigc/__init__.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/aigc/chat_completion.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/aigc/code_generation.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/aigc/conversation.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/aigc/generation.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/aigc/image_generation.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/aigc/image_synthesis.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/aigc/multimodal_conversation.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/aigc/video_synthesis.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/api_entities/__init__.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/api_entities/api_request_data.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/api_entities/base_request.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/api_entities/chat_completion_types.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/api_entities/dashscope_response.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/api_entities/encryption.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/api_entities/websocket_request.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/app/__init__.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/app/application_response.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/assistants/__init__.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/assistants/assistant_types.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/assistants/assistants.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/assistants/files.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/audio/__init__.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/audio/asr/__init__.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/audio/asr/asr_phrase_manager.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/audio/asr/transcription.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/audio/asr/vocabulary.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/audio/http_tts/__init__.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/audio/qwen_asr/__init__.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/audio/qwen_asr/qwen_transcription.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/audio/qwen_omni/__init__.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/audio/qwen_omni/omni_realtime.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/audio/qwen_tts/__init__.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/audio/qwen_tts/speech_synthesizer.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/audio/qwen_tts_realtime/__init__.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/audio/qwen_tts_realtime/qwen_tts_realtime.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/audio/tts/__init__.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/audio/tts/speech_synthesizer.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/audio/tts_v2/__init__.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/audio/tts_v2/enrollment.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/cli/__main__.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/cli/agentic_rl.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/cli/application.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/cli/code_generation.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/cli/deployments.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/cli/embeddings.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/cli/files.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/cli/fine_tunes.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/cli/image_generation.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/cli/image_synthesis.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/cli/models.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/cli/multimodal_conversation.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/cli/multimodal_embedding.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/cli/oss.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/cli/rerank.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/cli/speech_synthesis.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/cli/tokenization.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/cli/transcription.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/cli/understanding.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/cli/video_synthesis.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/client/__init__.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/client/base_api.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/common/__init__.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/common/api_key.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/common/base_type.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/common/constants.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/common/env.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/common/error.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/common/logging.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/common/message_manager.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/common/utils.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/embeddings/__init__.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/embeddings/batch_text_embedding.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/embeddings/batch_text_embedding_response.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/embeddings/multimodal_embedding.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/embeddings/text_embedding.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/files.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/__init__.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/agentic_rl.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/customize_types.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/deployments.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/finetunes.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/__init__.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/common/__init__.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/common/constants.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/common/errors.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/common/log.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/common/model.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/common/model_types.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/common/utils.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/__init__.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/data/__init__.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/data/base_data_model.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/data/group_reward_input.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/data/group_reward_output.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/data/reward_input.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/data/reward_output.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/data/rollout_input.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/data/rollout_output.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/demo/__init__.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/demo/group_reward_processor_demo.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/demo/reward_processor_demo.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/demo/rollout_processor_demo.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/func_decorator.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/func_manager.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/observability/__init__.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/observability/genai/__init__.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/observability/genai/_core.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/observability/genai/llm_dashscope.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/observability/genai/llm_openai.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/observability/genai/llm_span.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/observability/genai/messages.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/observability/genai/tools.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/observability/processor_span.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/observability/tracing.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/parser/__init__.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/parser/base_parser.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/parser/group_reward_parser.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/parser/reward_parser.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/parser/rollout_parser.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/processor/__init__.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/processor/abstract_group_reward_processor.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/processor/abstract_processor.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/processor/abstract_reward_processor.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/processor/abstract_rollout_processor.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/server/__init__.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/finetune/reinforcement/component/server/server.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/io/__init__.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/io/input_output.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/model.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/models.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/multimodal/__init__.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/multimodal/dialog_state.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/multimodal/multimodal_constants.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/multimodal/multimodal_dialog.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/multimodal/multimodal_request_params.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/multimodal/tingwu/__init__.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/multimodal/tingwu/tingwu.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/multimodal/tingwu/tingwu_realtime.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/nlp/__init__.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/nlp/understanding.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/protocol/__init__.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/protocol/websocket.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/py.typed +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/rerank/__init__.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/rerank/text_rerank.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/resources/qwen.tiktoken +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/threads/__init__.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/threads/messages/__init__.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/threads/messages/files.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/threads/messages/messages.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/threads/runs/__init__.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/threads/runs/runs.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/threads/runs/steps.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/threads/thread_types.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/threads/threads.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/tokenizers/__init__.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/tokenizers/qwen_tokenizer.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/tokenizers/tokenizer.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/tokenizers/tokenizer_base.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/utils/__init__.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/utils/message_utils.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/utils/oss_utils.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope/utils/param_utils.py +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope.egg-info/dependency_links.txt +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope.egg-info/entry_points.txt +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope.egg-info/not-zip-safe +0 -0
- {dashscope-1.26.6 → dashscope-1.27.2}/dashscope.egg-info/top_level.txt +0 -0
|
@@ -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
|