modelstudioai/cli

bailian-web-search

阿里云百炼联网搜索(web search)入口:为联网搜索 / 网页搜索 / 查最新资讯做路径分发。 先识别当前连接身份:Token Plan(profile token-plan 或 baseurl host 为 token-plan.

View source

How to use

  1. Copy the installation command and review the source package before installing it in your own agent environment.
  2. Check the source document for required tools, credentials and supported hosts.
  3. Describe your input and desired deliverable; review the output against the source material.
npx skills add https://github.com/modelstudioai/cli --skill bailian-web-search

Before you start

  • Installation does not include a model subscription, API allowance or permission to access your files.
  • Repository stars and installation counts describe activity, not an independent quality or security test.
Original skill document

Rendered from the source repository. Headings, examples, code, tables, links, and referenced images are preserved.

Bailian web search routing (bailian-web-search)

CRITICAL — Before executing, MUST read the shared protocol in [`../bailian-protocol/SKILL.md`](../bailian-protocol/SKILL.md): Provider selection and consent, Version & updates (pre-flight checklist), Setup & auth, and CLI errors: report an issue. If that protocol file is missing, stop and run `bl skill init`; do not guess auth/consent.

Scope: model-aware routing for web search inside Agent-driven bl workflows — this skill owns the routing decision only. Command flags / usage / examples: Read skill bailian-cli reference if installed; else bl search web --help / bl text chat --help — do not guess flags. Install (supported): bl skill init

Token Plan keys do not authorize Bailian MCP search — never route them to bl search web.

Routing workflow

Step 1 — Identify the active model identity

Run (no auth needed):

bash
bl config show --output json

Treat the connection as Token Plan when either condition holds — this mirrors the CLI's own endpoint detection (usesTokenPlanEndpoint), so routing stays consistent with command behavior:

  • config (active profile name) is token-plan, or
  • the hostname of base_url matches token-plan.<region>.maas.aliyuncs.com (e.g. https://token-plan.cn-beijing.maas.aliyuncs.com).

Do not rely on the profile name alone: users can create additional Token Plan profiles under custom names, and only the Base URL host check catches those. Anything else → default identity.

Step 2 — Route by identity

ConditionRouteNotes
Token Plan model identityModel-native pathPreferred — the only path Token Plan keys authorize
Any other model / defaultMCP pathDefault for regular DashScope API keys
MCP path (eligible fail)Model-native path, exactly onceFallback — only for the failure classes below

User override: if the user names a specific path or command, follow it except under Token Plan identity: do not call bl search web even if the user asks for MCP — explain that Token Plan keys cannot authorize Bailian MCP search, then use the model-native path (or ask once whether to switch profile / key).

Model-native path (Token Plan preferred / fallback target)

bash
bl text chat --api responses --tool '{"type":"web_search"}' --message "搜索近期的阿里云新闻"
  • The Responses API enables native web search via the tool definition {"type":"web_search"}.
  • Requires a model with native web search support (Qwen3.7+). Do not hardcode `--model`: omit it so the CLI uses default_text_model / built-in default; only pass --model when the user named one.
  • Write --message in the user's language; the reply language follows the prompt (see bailian-protocol → Respond in the user's language).
  • Flags / usage: Read skill bailian-cli if installed, else bl text chat --help.

MCP path (default)

bash
bl search web --query "阿里云百炼最新功能"
  • Requires the WebSearch MCP to be activated for the current key; on the not-activated error the CLI appends an activation hint with the marketplace URL — relay it to the user.
  • Flags / usage: Read skill bailian-cli if installed, else bl search web --help.

Fallback (MCP → model-native, exactly once)

Do not fall back on every non-zero exit. Fall back only when bl search web fails for one of these classes (match stderr / message):

  • auth / permission — key not valid for the MCP service (e.g. Token Plan key misrouted by identity detection),
  • MCP not activated — MCP request failed: 404 with 未开通 / MCP不存在 / MCP_IS_INVALID (CLI may append an activation hint),
  • MCP transport — 405 / Streamable-HTTP unsupported, or clear network / timeout / DNS failures reaching the MCP endpoint.

Do not fall back for: missing --query / USAGE errors, rate limits, content-policy / business errors from a successful MCP session, or empty-but-successful result sets. Report those verbatim and stop (or ask the user); do not burn a Responses call.

Fallback discipline:

  1. Re-issue the same query via the model-native path (omit --model unless the user named one).
  2. If the fallback succeeds, tell the user the MCP path failed and — when the not-activated hint appeared — that activating the WebSearch MCP restores the default path.
  3. If the fallback also fails, stop and report both errors verbatim; follow the issue-reporting flow in bailian-protocol (ask once). Never loop retries.

Quick examples

bash
# Step 1: identify the active model identity
bl config show --output json

# Token Plan identity → model-native web search (no --model unless user named one)
bl text chat --api responses --tool '{"type":"web_search"}' --message "搜索近期的阿里云新闻"

# Default identity → Bailian MCP search
bl search web --query "阿里云百炼最新功能"

# Eligible MCP failure → fall back once (same rule: no hardcoded --model)
bl text chat --api responses --tool '{"type":"web_search"}' --message "阿里云百炼最新功能"

Routing reminders

  • Generic web research the host can do, ordinary Q&A, coding, writing → host-first; do not invoke bl (class 1 in bailian-protocol). Route only when the user names Bailian / DashScope / bl or continues an existing bl workflow (class 4).
  • Knowledge-base / RAG over Bailian corpora → hub skill bailian-cli (bl knowledge), not this skill.
  • Summarize search results in the user's language; on the model-native path the CLI injects no default language — if a fixed language is required, pass --system in that language (do not hardcode 简体中文).
  • Other Bailian workflows (apps / usage / config) → hub skill bailian-cli; media generation → bailian-gen; fine-tuning → bailian-finetune; agents.yaml → bailian-managed-agent. Soft hand-off by skill name: Read if installed, else bl … --help or prompt bl skill init.

references

  • bailian-protocol — shared protocol (install via bl skill init)
  • skill bailian-cli — hub command reference for bl search web / bl text chat (soft hand-off; fallback: --help)

Related by task

from this repository

More skills

All skills
modelstudioai
Community

bailian-cli

阿里云百炼 / Aliyun Bailian / DashScope 资源管理与 bl CLI hub: 应用调用(bl app)、决策模型推理(bl decision)、知识库检索、模型目录/模型列表、用量/额度/配额、免费额度、 工作空间、MCP 市场、pipeline、文件上传、console API、登录鉴权与配置、 Agent skill 安装/列表/更新/卸载(bl skill add|list|update|remove,百炼 skill registry)。 用户点名百炼 / DashScope / bl,或继续既有 bl 工作流时直接使用。 共享协议(consent / 版本预检 / 鉴权 / 错误上报)在 bailian-protocol;官方安装 bl skill init。 家族路由:生图/生视频/配音/语音合成/转写 → bailian-gen;精调/微调/训练/数据集 → bailian-finetune; agents.yaml 托管 Agent → bailian-managed-agent;Sandbox 实例与模版 → bailian-sandbox

installs
1
GitHub stars
472
Updated
Oct 20
modelstudioai
Community

bailian-gen

阿里云百炼图片/视频/语音生成与理解入口:用户要生图、画图、生成照片、生成图片、AI 绘画、海报、头像、插画、 文生图(text-to-image)、图生图、改图、修图、多图合成、生成视频、文生视频、图生视频、参考生视频、视频编辑、风格转换、 配音、语音合成(TTS)、朗读、转写、语音识别(ASR),或图片理解、看图问答、视频理解、读视频、多模态理解时使用 bl image / bl video / bl speech / bl vision describe / bl omni。 默认行为:用户未指定服务商时,生成/编辑默认走本技能;视频理解与宿主放不了的音视频理解也走本技能。 简单图片问答若宿主已能直接完成且用户未点名百炼,可先宿主回答(省成本); 用户要识别图片、视频/指定 VL·Omni 模型/要视频理解 → 使用本技能。 图片和语音同步返回并落地本地文件,视频是异步任务、用 --download 或轮询取回;本地文件直接传路径,CLI 自动上传。 反触发:普通问答、编程、写作、翻译不走本技能;百炼应用/知识库/用量/额度走 bailian-cli; 精调训练走 bailian

installs
1
GitHub stars
472
Updated
Oct 20
modelstudioai
Community

bailian-managed-agent

阿里云百炼托管 Agent 声明式基础设施与 API 命令入口:用户要创建agent、初始化 agents.yaml、校验或预览配置变更、 创建/更新/销毁托管 Agent 或 Deployment、在 Workbench 编辑和调试目录项目、管理本地快照版本,或查询 Agent/Environment/Skill/Vault/Deployment/Memory Store、管理 Session/Event/File/Webhook/记忆正文及版本、运行/暂停 Deployment 时使用 bl managed-agent。Agent/Environment/Skill/Vault/Deployment/Memory Store 仍以 agents.yaml 为唯一事实源做 IaC;Webhook 使用无需项目文件的工作空间 API;公开 API 能力按资源透出 list/get/search/versions/download、数据面和运行时动作命令。apply / destroy 与破坏性 API 命令受统一高风险确认闸门保护; 务必先展示预览再让用户确认,禁止自动添加 --yes

installs
1
GitHub stars
472
Updated
Oct 20
modelstudioai
Community

bailian-memory

个人长期记忆与首次启用引导。当个人背景、偏好或历史会影响答案时使用,包括饮食/出行推荐、 个人计划、按用户习惯写邮件、延续之前的任务;不要求用户说“记得”或点名百炼。 用户提供长期事实、纠正偏好(“以后自然一点”)、确认长期决定(“就选第二种,以后都这样”), 或要求记住、回忆、查看、忘记、暂停、恢复时也应读取本 Skill;结合前文识别,不能只看最后一句。 先检查本地状态;未配置引导启用,授权后检索和抽取生活/工作记忆。宿主内置记忆不排除此 Skill。 也处理明确的 bl memory 资源操作。纯计算、通用知识、无个性化需要的翻译/写作不触发;授权前不上传。

installs
1
GitHub stars
472
Updated
Oct 20