Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions .github/release-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
## ${TAG_NAME} Release Notes

<!--
Maintainer guide (please read before publishing; this HTML comment is
invisible in the rendered Release page):

1. This file is the skeleton for the draft Release body. It is rendered
by the `release` job in .github/workflows/release.yml using Python's
string.Template.safe_substitute.
2. Placeholders that get substituted automatically at render time:
TAG_NAME current tag, e.g. vX.Y.Z
VERSION version without the leading `v`, e.g. X.Y.Z
FULL_CHANGELOG_URL compare URL against the previous tag
Note: these three names must appear as `$` followed by braces in the
template body to be substituted; this comment intentionally spells
them without that syntax so it does not substitute itself.
3. HTML comments under each section are classification hints. Delete or
keep them before publishing (kept comments stay invisible to readers
and save effort on the next release).
4. If a section has no content for this release, delete it entirely or
write "None".
5. Classification follows conventional-commit PR title prefixes:
feat(scope): -> ✨ Features
fix(scope): -> 🐛 Bug Fixes
refactor(scope): -> ♻️ Refactoring
docs(scope): -> 📚 Documentation
chore/ci/build/test: -> 🔧 CI & Chore
6. Highlights is the "elevator pitch" — pick 1-3 changes users should
care about most (new capabilities, breaking changes, or fixes with
wide impact).
7. For pre-release versions (tag contains a/b/rc/post), tick
"Set as a pre-release" on the draft page so this release does not
occupy the /releases/latest endpoint.
-->

### 🚀 Highlights

-

### ✨ Features

-

### ♻️ Refactoring

-

### 🐛 Bug Fixes

-

### 📚 Documentation

-

### 🔧 CI & Chore

-

### ⚠️ Breaking Changes

None

---

### 📦 Installation

```bash
pip install --upgrade dashscope==${VERSION}
```

### 👥 Contributors

Thanks to all the contributors who made this release possible:

<!-- List @handles here. On the draft page, the "Generate release notes"
button in the top-right can auto-populate New Contributors. -->

-

### 📝 Full Changelog

${FULL_CHANGELOG_URL}
128 changes: 128 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
name: Build and Release

on:
push:
tags:
- 'v*'

permissions:
contents: read

jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Verify tag commit is on main
run: |
git fetch origin main
if ! git merge-base --is-ancestor "$GITHUB_SHA" origin/main; then
echo "::error::Tag $GITHUB_REF_NAME does not point to a commit on main."
exit 1
fi

- name: Verify version matches tag
run: |
tag_version="${GITHUB_REF_NAME#v}"
pkg_version=$(python -c "exec(open('dashscope/version.py').read()); print(__version__)")
if [ "$tag_version" != "$pkg_version" ]; then
echo "::error::Tag $GITHUB_REF_NAME (=$tag_version) != dashscope/version.py (=$pkg_version)"
exit 1
fi

package:
needs: [validate]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.13'
- run: python -m pip install build twine
- run: python -m build
- run: twine check dist/*
- uses: actions/upload-artifact@v4
with:
name: python-distribution
path: |
dist/*.whl
dist/*.tar.gz

pypi:
needs: [package]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/dashscope
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
name: python-distribution
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

release:
needs: [package]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/download-artifact@v4
with:
name: python-distribution
path: dist/

- name: Render release notes
env:
TAG_NAME: ${{ github.ref_name }}
run: |
git fetch --tags --force
prev_tag=$(git tag --sort=-v:refname | grep -v "^${TAG_NAME}$" | head -1)
if [ -n "$prev_tag" ]; then
changelog_url="https://github.com/${{ github.repository }}/compare/${prev_tag}...${TAG_NAME}"
else
changelog_url="https://github.com/${{ github.repository }}/commits/${TAG_NAME}"
fi
python - "$TAG_NAME" "$changelog_url" <<'PYEOF'
import sys
from string import Template
from pathlib import Path

tag = sys.argv[1]
changelog = sys.argv[2]
version = tag.lstrip("v")
tpl = Template(Path(".github/release-template.md").read_text())
body = tpl.safe_substitute(
TAG_NAME=tag, VERSION=version, FULL_CHANGELOG_URL=changelog,
)
Path("release-body.md").write_text(body)
PYEOF

- name: Detect pre-release
id: prerelease
env:
TAG_NAME: ${{ github.ref_name }}
run: |
if echo "$TAG_NAME" | grep -qE '(a|b|rc|post|dev)[0-9]'; then
echo "flag=true" >> "$GITHUB_OUTPUT"
else
echo "flag=false" >> "$GITHUB_OUTPUT"
fi

- name: Create draft GitHub Release
uses: softprops/action-gh-release@v2
with:
body_path: release-body.md
files: dist/*
draft: true
prerelease: ${{ steps.prerelease.outputs.flag }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ cython_debug/
# PyPI configuration file
.pypirc

/.acli/
/.agenticx/

.qoder/

Expand Down
1 change: 0 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ include dashscope/py.typed
include dashscope/__init__.pyi
include NOTICE
include LICENSE.certifi
recursive-include dashscope/acli/examples *.md *.toml *.py
recursive-include examples *.md *.py
include requirements.txt
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ The DashScope Python SDK is the official client for [Alibaba Cloud Model Studio
pip install -U dashscope
```

The base install covers SDK API calls, the `dashscope` CLI command, Agentic RL fine-tuning and the local tokenizer. Python 3.9+ is required. Optional feature groups all belong to the bundled AI assistant:
The base install covers SDK API calls, the `dashscope` CLI command, Agentic RL fine-tuning and the local tokenizer. Python 3.9+ is required. Optional feature groups configure the AI assistant provided by `dashscope-agenticx`; the assistant requires Python 3.10+:

| Extra | Provides | Install |
|-------|----------|---------|
Expand Down Expand Up @@ -511,11 +511,11 @@ For the latest model list, visit the [Model Studio model plaza](https://bailian.

## AI Assistant: DashScope SDK Expert

The SDK ships with an interactive AI assistant, **DashScope SDK Expert**, built on the bundled Agentic CLI (`dashscope/acli`). It answers SDK/API questions, generates runnable examples, shows CLI usage, and diagnoses errors right in your terminal.
The SDK integrates an interactive AI assistant, **DashScope SDK Expert**, powered by the optional `dashscope-agenticx` dependency. It answers SDK/API questions, generates runnable examples, shows CLI usage, and diagnoses errors right in your terminal.

- Run `dashscope` with no arguments to start the assistant. On first run it offers to install the 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.
- Run `dashscope` with no arguments to start the assistant. On first run it offers to download the Expert profile and per-domain skills into `./.agenticx/`; the same profile can be installed later with `agenticx expert download dashscope-sdk-expert`.
- Ask it instead of reading docs — e.g. `dashscope expert "how do I stream chat output"` (asks once and exits). Type `/help` inside the assistant for available commands; `dashscope expert --help` shows all forms.
- Install with the `acli` extra: `pip install "dashscope[acli]"`. Add `acli-voice` / `acli-camera` for voice and camera input, or `acli-all` for everything — see the [extras table](#installation).
- With Python 3.10+, install the `acli` extra: `pip install "dashscope[acli]"`. Add `acli-voice` / `acli-camera` for voice and camera input, or `acli-all` for everything — see the [extras table](#installation).
- Full walkthrough: [DashScope SDK Expert guide](https://help.aliyun.com/en/model-studio/dashscope-sdk-expert).

## Command line
Expand Down
8 changes: 4 additions & 4 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ DashScope Python SDK 是[阿里云百炼(Model Studio)](https://help.aliyun.
pip install -U dashscope
```

基础安装包含 SDK API 调用、`dashscope` CLI 命令、Agentic RL 微调和本地 tokenizer,要求 Python 3.9+。可选功能组都属于内置的 AI 助手:
基础安装包含 SDK API 调用、`dashscope` CLI 命令、Agentic RL 微调和本地 tokenizer,要求 Python 3.9+。可选功能组用于配置由 `dashscope-agenticx` 提供的 AI 助手;助手要求 Python 3.10+:

| Extra | 提供的能力 | 安装命令 |
|-------|----------|---------|
Expand Down Expand Up @@ -511,11 +511,11 @@ connection.close()

## AI 助手:DashScope SDK Expert

SDK 内置了交互式 AI 助手 **DashScope SDK Expert**,基于随包提供的 Agentic CLI(`dashscope/acli`)框架构建。它能直接在终端中解答 SDK/API 问题、生成可运行示例、展示 CLI 用法、诊断错误。
SDK 集成了交互式 AI 助手 **DashScope SDK Expert**,由可选依赖 `dashscope-agenticx` 提供。它能直接在终端中解答 SDK/API 问题、生成可运行示例、展示 CLI 用法、诊断错误。

- 直接运行 `dashscope`(不带参数)即可启动助手。首次运行时会提示安装知识包(按领域划分的速查技能:文本、多模态、语音、检索、微调、Agent、CLI),使助手的指导来自 SDK 的公开接口 —— 参数、输出、错误码 —— 而无需阅读源码。
- 直接运行 `dashscope`(不带参数)即可启动助手。首次运行时会提示将 Expert 配置和按领域划分的 Skills 下载到 `./.agenticx/`;之后也可以运行 `agenticx expert download dashscope-sdk-expert` 安装。
- 直接提问代替翻文档 —— 如 `dashscope expert "如何流式输出对话结果"`(一次性提问后退出)。在助手内输入 `/help` 查看可用命令;`dashscope expert --help` 查看全部形式。
- 通过 `acli` extra 安装:`pip install "dashscope[acli]"`。需要语音/摄像头输入可加装 `acli-voice` / `acli-camera`,或直接用 `acli-all` 装齐 —— 详见[安装](#安装)一节的 extra 表格。
- 使用 Python 3.10+ 时,通过 `acli` extra 安装:`pip install "dashscope[acli]"`。需要语音/摄像头输入可加装 `acli-voice` / `acli-camera`,或直接用 `acli-all` 装齐 —— 详见[安装](#安装)一节的 extra 表格。
- 完整使用指南:[DashScope SDK Expert 文档](https://help.aliyun.com/zh/model-studio/dashscope-sdk-expert)。

## 命令行
Expand Down
24 changes: 0 additions & 24 deletions dashscope/acli/__init__.py

This file was deleted.

7 changes: 0 additions & 7 deletions dashscope/acli/__main__.py

This file was deleted.

Loading
Loading