Skills Agentes

Bailian Web Search

Enrutamiento de búsqueda web de Aliyun Bailian: identifica el plan activo y elige entre búsqueda nativa del modelo o el MCP de Bailian (`bl search web`), con fallback automático una vez.

Estrellas
315

en todo el repo

Actividad
62

0–100, la ruta de este skill

Actualizado
anteayer

último commit aquí

Commits
2

últimos 90 días

Contexto
1.9k tok

235 tok en reposo

Paquete
1 archivo

7 KB

Instalar

Funciona con cualquier agente que lea SKILL.md

npx -y skills add modelstudioai/cli --skill bailian-web-search --agent claude-code

Se instala solo en este repositorio.

Qué hace

  • Enruta las solicitudes de búsqueda web dentro de flujos `bl` según la identidad del modelo activo (Token Plan vs. resto)
  • Con identidad Token Plan, usa búsqueda nativa del modelo (`bl text chat --api responses --tool web_search`)
  • Con identidad por defecto, usa el marketplace MCP de Bailian (`bl search web`)
  • Hace fallback una sola vez a la ruta nativa del modelo si el MCP falla por auth, no activación o transporte

Úsalo cuando

  • El usuario pide buscar en la web o consultar noticias recientes dentro de un flujo de Bailian
  • Hay que depurar un fallo de búsqueda web con Token Plan o una confusión de autenticación entre ambas rutas

No lo uses cuando

  • Investigación web genérica que el host ya puede resolver, sin nombrar Bailian
  • Búsqueda o preguntas y respuestas sobre una base de conocimiento propia (va a bailian-cli / `bl knowledge`)

Qué lo activa

Di cualquiera de estas frases y el agente debería cargar este skill.

  • Busca en la web las últimas noticias de Aliyun
  • ¿Por qué falla la búsqueda web con mi Token Plan?

SKILL.md

En inglés

Bailian web search routing (bailian-web-search)

CRITICAL — Before executing, MUST read the shared protocol in ../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):

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

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 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)

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)

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 activatedMCP 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

# 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)

Reproducido de modelstudioai/cli bajo licencia Apache-2.0. Leer esta página en markdown.

Archivos

1 archivo en el paquete. Solo se lee SKILL.md al activarse — las referencias se cargan si el skill decide que las necesita.

Antes de instalar

Necesita el binario `bl` y, según la ruta, una API key de Token Plan o el marketplace MCP de WebSearch activado.

Detalles

Licencia
Apache-2.0
Recursos incluidos
Solo SKILL.md
Código fuente
Ver SKILL.md

Etiquetas

Más de modelstudioai/cli

Este repo incluye 8 skills. Si instalas uno, normalmente ya tienes los demás.

Centro de gestión de recursos de Aliyun Bailian/DashScope con el CLI `bl`: apps, memoria, conocimiento, catálogo de modelos, uso/cuota, workspaces, marketplace MCP, pipelines y gestión de skills.

Costo de contexto al activarse
2.9k tok
Tamaño del paquete
3 archivos
Última actualización
anteayer
herramientas desarrollo

Referencia autogenerada de los comandos `bl skill add/init/list/remove/update`: flags, autenticación y ejemplos, generada desde el código fuente del CLI.

Costo de contexto al activarse
1.4k tok
Tamaño del paquete
22 archivos
Última actualización
hace 3 días
herramientas desarrollo

Generación y comprensión multimedia de Bailian: imagen y vídeo, edición de vídeo, TTS/ASR, y comprensión de imagen, vídeo y audio con `bl image`/`video`/`speech`/`vision`/`omni`.

Costo de contexto al activarse
1.8k tok
Tamaño del paquete
8 archivos
Última actualización
anteayer
herramientas desarrollo

Pipeline de fine-tuning de modelos de Bailian (SFT, LoRA, DPO, CPT en texto, voz e imagen): valida y sube datasets, crea jobs, sigue progreso, exporta y despliega con `bl dataset`/`finetune`/`deploy`.

Costo de contexto al activarse
1.3k tok
Tamaño del paquete
5 archivos
Última actualización
anteayer
herramientas desarrollo

Infraestructura declarativa para agentes gestionados de Aliyun Bailian: agents.yaml como fuente de verdad, con init, validate, plan, apply y destroy vía `bl managed-agent`.

Costo de contexto al activarse
1.3k tok
Tamaño del paquete
3 archivos
Última actualización
anteayer
devops infraestructura

Protocolo de ejecución compartido de la familia `bl` de Aliyun Bailian: consentimiento, verificación de versión, autenticación/instalación y reporte de errores para las skills bailian-*.

Costo de contexto al activarse
2.9k tok
Tamaño del paquete
6 archivos
Última actualización
anteayer
herramientas desarrollo

Skills relacionados

Centro de gestión de recursos de Aliyun Bailian/DashScope con el CLI `bl`: apps, memoria, conocimiento, catálogo de modelos, uso/cuota, workspaces, marketplace MCP, pipelines y gestión de skills.

Costo de contexto al activarse
2.9k tok
Tamaño del paquete
3 archivos
Última actualización
anteayer
herramientas desarrollo

Pipeline de fine-tuning de modelos de Bailian (SFT, LoRA, DPO, CPT en texto, voz e imagen): valida y sube datasets, crea jobs, sigue progreso, exporta y despliega con `bl dataset`/`finetune`/`deploy`.

Costo de contexto al activarse
1.3k tok
Tamaño del paquete
5 archivos
Última actualización
anteayer
herramientas desarrollo

Generación y comprensión multimedia de Bailian: imagen y vídeo, edición de vídeo, TTS/ASR, y comprensión de imagen, vídeo y audio con `bl image`/`video`/`speech`/`vision`/`omni`.

Costo de contexto al activarse
1.8k tok
Tamaño del paquete
8 archivos
Última actualización
anteayer
herramientas desarrollo