生成百炼(百炼 DashScope)子代理,处理大 token 量或计算密集型任务。当主代理需委托数据处理、批量操作时使用。
Delegate heavy tasks to a cheaper bailian model to save Claude tokens.
ModelUse casebailian/qwen3.5-plusGeneral tasks, data processing, writingbailian/qwen3-coder-plusCode generation, debugging, scriptsbailian/kimi-k2.5Long context, document analysisbailian/glm-5Alternative general model
Default recommendation: bailian/qwen3.5-plus for most tasks.
text
sessions_spawn(
task="<detailed instructions>",
model="bailian/qwen3.5-plus",
runtime="subagent",
mode="run",
runTimeoutSeconds=600
)
Good candidates:
Keep with Claude (main agent):
Include all required context in the task string — subagent starts fresh with no memory:
When delegating MC/DW SQL tasks, provide this pattern in the task:
python
from alibabacloud_dataworks_public20240518.client import Client
from alibabacloud_dataworks_public20240518 import models as dw_models
from alibabacloud_tea_openapi.models import Config
import uuid, time
config = Config(
access_key_id='${ALICLOUD_ACCESS_KEY_ID}',
access_key_secret='${ALICLOUD_ACCESS_KEY_SECRET}',
endpoint='dataworks.cn-hangzhou.aliyuncs.com',
region_id='cn-hangzhou'
)
client = Client(config)
# ... run_sql() helper pattern
Key params: project_id=579810, owner=1206989323863181, resource_group_id=Serverless_res_group_421503158374466_777119112505568, datasource=samuelhsin
Sleep 15s between SQL calls to avoid throttling.