bailian-web-search
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseBailian web search routing (bailian-web-search
)
bailian-web-searchBailian web search routing (bailian-web-search
)
bailian-web-searchCRITICAL — Before executing, MUST read the shared protocol in : 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 ; do not guess auth/consent.
../bailian-protocol/SKILL.mdbl skill initScope: model-aware routing for web search inside Agent-drivenworkflows — this skill owns the routing decision only. Command flags / usage / examples: Read skillblreference if installed; elsebailian-cli/bl search web --help— do not guess flags.bl text chat --helpInstall (supported):bl skill init
Token Plan keys do not authorize Bailian MCP search — never route them to .
bl search web重要提示 — 执行前必须阅读中的共享协议:包括服务商选择与授权同意、版本与更新(预检清单)、设置与鉴权,以及CLI错误上报流程。若该协议文件缺失,请停止操作并执行;请勿自行猜测鉴权/授权方式。
../bailian-protocol/SKILL.mdbl skill init适用范围: 由Agent驱动的工作流中,针对联网搜索的模型感知路由 — 本技能仅负责路由决策。 命令参数/用法/示例:若已安装,请查看bl技能参考文档;否则执行bailian-cli/bl search web --help— 请勿自行猜测参数。bl text chat --help安装(支持方式):bl skill init
Token Plan密钥无法授权Bailian MCP搜索 — 切勿将其路由至。
bl search webRouting workflow
路由工作流
Step 1 — Identify the active model identity
步骤1 — 识别当前模型身份
Run (no auth needed):
bash
bl config show --output jsonTreat the connection as Token Plan when either condition holds — this mirrors the CLI's own endpoint detection (), so routing stays consistent with command behavior:
usesTokenPlanEndpoint- (active profile name) is
config, ortoken-plan - the hostname of matches
base_url(e.g.token-plan.<region>.maas.aliyuncs.com).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.
执行以下命令(无需鉴权):
bash
bl config show --output json当满足以下任一条件时,判定当前连接为Token Plan身份 — 这与CLI自身的端点检测逻辑()保持一致,确保路由与命令行为一致:
usesTokenPlanEndpoint- (当前激活的配置文件名称)为
config,或token-plan - 的主机名匹配
base_url(例如token-plan.<region>.maas.aliyuncs.com)。https://token-plan.cn-beijing.maas.aliyuncs.com
请勿仅依赖配置文件名称:用户可能在自定义名称下创建额外的Token Plan配置文件,只有Base URL主机检查才能识别此类情况。其他所有情况→默认身份。
Step 2 — Route by identity
步骤2 — 根据身份路由
| Condition | Route | Notes |
|---|---|---|
| Token Plan model identity | Model-native path | Preferred — the only path Token Plan keys authorize |
| Any other model / default | MCP path | Default for regular DashScope API keys |
| MCP path (eligible fail) | Model-native path, exactly once | Fallback — 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 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).
bl search web| 条件 | 路由路径 | 说明 |
|---|---|---|
| Token Plan模型身份 | 模型原生路径 | 优先选择 — 这是Token Plan密钥唯一授权的路径 |
| 其他任何模型/默认身份 | MCP路径 | 常规DashScope API密钥的默认路径 |
| MCP路径(符合失败条件) | 模型原生路径,仅执行一次 | 兜底方案 — 仅适用于以下指定的失败类型 |
用户覆盖规则: 若用户指定了具体路径或命令,需遵循用户要求但Token Plan身份除外:即使用户要求使用MCP,也不得调用 — 需向用户说明Token Plan密钥无法授权Bailian MCP搜索,然后使用模型原生路径(或询问用户是否切换配置文件/密钥)。
bl search webModel-native path (Token Plan preferred / fallback target)
模型原生路径(Token Plan优先选择/兜底目标)
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 : omit it so the CLI uses
--model/ built-in default; only passdefault_text_modelwhen the user named one.--model - Write in the user's language; the reply language follows the prompt (see
--message→ Respond in the user's language).bailian-protocol - Flags / usage: Read skill if installed, else
bailian-cli.bl text chat --help
bash
bl text chat --api responses --tool '{"type":"web_search"}' --message "搜索近期的阿里云新闻"- Responses API通过工具定义实现原生联网搜索。
{"type":"web_search"} - 需要支持原生联网搜索的模型(Qwen3.7+)。请勿硬编码参数: 省略该参数,让CLI使用
--model/内置默认模型;仅当用户指定模型时才传递default_text_model。--model - 需使用用户的语言编写;回复语言将遵循提示语言(请参考
--message→使用用户的语言回复)。bailian-protocol - 参数/用法:若已安装,请查看技能文档;否则执行
bailian-cli。bl text chat --help
MCP path (default)
MCP路径(默认)
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 if installed, else
bailian-cli.bl search web --help
bash
bl search web --query "阿里云百炼最新功能"- 当前密钥需已激活WebSearch MCP;若出现未激活错误,CLI会附加包含市场URL的激活提示 — 需将该提示转发给用户。
- 参数/用法:若已安装,请查看技能文档;否则执行
bailian-cli。bl search web --help
Fallback (MCP → model-native, exactly once)
兜底方案(MCP→模型原生,仅执行一次)
Do not fall back on every non-zero exit. Fall back only when fails for one of these classes (match stderr / message):
bl search web- auth / permission — key not valid for the MCP service (e.g. Token Plan key misrouted by identity detection),
- MCP not activated — with
MCP request failed: 404/未开通/MCP不存在(CLI may append an activation hint),MCP_IS_INVALID - MCP transport — 405 / Streamable-HTTP unsupported, or clear network / timeout / DNS failures reaching the MCP endpoint.
Do not fall back for: missing / 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.
--queryFallback discipline:
- Re-issue the same query via the model-native path (omit unless the user named one).
--model - 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.
- If the fallback also fails, stop and report both errors verbatim; follow the issue-reporting flow in (ask once). Never loop retries.
bailian-protocol
请勿在所有非零退出码时都触发兜底。仅当因以下类型失败时(匹配标准错误输出/消息),才触发兜底:
bl search web- 鉴权/权限问题 — 密钥对MCP服务无效(例如身份检测错误导致Token Plan密钥被错误路由),
- MCP未激活 — 且包含
MCP request failed: 404/未开通/MCP不存在(CLI可能附加激活提示),MCP_IS_INVALID - MCP传输问题 — 405错误/不支持Streamable-HTTP,或连接MCP端点时出现明确的网络/超时/DNS故障。
请勿触发兜底的情况:缺失参数/用法错误、速率限制、MCP会话成功但返回内容策略/业务错误,或返回空结果但会话成功。需直接上报这些错误并停止操作(或询问用户);请勿消耗Responses调用次数。
--query兜底执行规范:
- 通过模型原生路径重新发起相同查询(除非用户指定模型,否则省略参数)。
--model - 若兜底成功,需告知用户MCP路径失败,且当出现未激活提示时,说明激活WebSearch MCP可恢复默认路径。
- 若兜底也失败,需停止操作并如实上报两个错误;遵循中的错误上报流程(询问用户一次)。切勿循环重试。
bailian-protocol
Quick examples
快速示例
bash
undefinedbash
undefinedStep 1: identify the active model identity
步骤1:识别当前模型身份
bl config show --output json
bl config show --output json
Token Plan identity → model-native web search (no --model unless user named one)
Token Plan身份 → 模型原生联网搜索(除非用户指定模型,否则不添加--model)
bl text chat --api responses --tool '{"type":"web_search"}' --message "搜索近期的阿里云新闻"
bl text chat --api responses --tool '{"type":"web_search"}' --message "搜索近期的阿里云新闻"
Default identity → Bailian MCP search
默认身份 → Bailian MCP搜索
bl search web --query "阿里云百炼最新功能"
bl search web --query "阿里云百炼最新功能"
Eligible MCP failure → fall back once (same rule: no hardcoded --model)
符合条件的MCP失败 → 兜底一次(规则相同:不硬编码--model)
bl text chat --api responses --tool '{"type":"web_search"}' --message "阿里云百炼最新功能"
undefinedbl text chat --api responses --tool '{"type":"web_search"}' --message "阿里云百炼最新功能"
undefinedRouting reminders
路由注意事项
- Generic web research the host can do, ordinary Q&A, coding, writing → host-first; do not invoke (class 1 in
bl). Route only when the user names Bailian / DashScope /bailian-protocolor continues an existingblworkflow (class 4).bl - Knowledge-base / RAG over Bailian corpora → hub skill (
bailian-cli), not this skill.bl knowledge - 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 in that language (do not hardcode 简体中文).
--system - Other Bailian workflows (apps / usage / config) → hub skill ; media generation →
bailian-cli; fine-tuning →bailian-gen; agents.yaml →bailian-finetune. Soft hand-off by skill name: Read if installed, elsebailian-managed-agentor promptbl … --help.bl skill init
- 宿主可完成的通用网络调研、普通问答、编程、写作→优先由宿主处理;请勿调用(
bl中的第1类情况)。仅当用户提及Bailian/DashScope/bailian-protocol或延续现有bl工作流时,才进行路由(第4类情况)。bl - 基于Bailian语料库的知识库/RAG→使用核心技能(
bailian-cli),而非本技能。bl knowledge - 使用用户的语言总结搜索结果;在模型原生路径下,CLI不会注入默认语言 — 若需要固定语言,需传递参数并指定该语言(请勿硬编码简体中文)。
--system - 其他Bailian工作流(应用/使用/配置)→使用核心技能;媒体生成→使用
bailian-cli;模型精调→使用bailian-gen;agents.yaml→使用bailian-finetune。通过技能名称进行软切换:若已安装则查看文档,否则执行bailian-managed-agent或提示用户执行bl … --help。bl skill init
references
参考文档
- bailian-protocol — shared protocol (install via )
bl skill init - skill — hub command reference for
bailian-cli/bl search web(soft hand-off; fallback:bl text chat)--help
- bailian-protocol — 共享协议(通过安装)
bl skill init - 技能—
bailian-cli/bl search web的核心命令参考文档(软切换;兜底方案:执行bl text chat)--help