返回 Skill 列表
extension
分类: 数据与分析需要 API Key

百炼联网搜索

需提供自己的apikey

person作者: user_1bd0d5b7hubcommunity

Bailian Web Search

Use scripts/search.py to run a query through the Bailian Responses API. Default to the Beijing endpoint and qwen3.7-max from the supplied workflow.

Workflow

  1. Capture the user's query and any requested date, region, language, source, or output constraints.
  2. Check whether BAILIAN_API_KEY or DASHSCOPE_API_KEY exists without printing its value.
  3. If neither variable exists, ask the user to provide a Bailian API key. Prefer asking them to set BAILIAN_API_KEY in the execution environment. Never repeat the key, put it in a command argument, write it to a file, or commit it.
  4. Confirm the workspace endpoint when the user supplies a different Bailian region or workspace. Use BAILIAN_BASE_URL or --base-url to override the default.
  5. Run the script with the user's query. Preserve the three tools unless the user asks to limit them.
  6. Return the answer and tool-call counts. Include trace output only when the user explicitly requests the intermediate process.

Run Queries

Run a normal search:

python scripts/search.py "杭州天气"

Override model or endpoint:

python scripts/search.py "杭州天气" --model qwen3.7-max --base-url "https://llm-WORKSPACE_ID.cn-beijing.maas.aliyuncs.com/compatible-mode/v1"

Request machine-readable output or intermediate trace:

python scripts/search.py "杭州天气" --json
python scripts/search.py "杭州天气" --show-trace

Limit tools or disable thinking only when requested:

python scripts/search.py "提取指定网页的正文" --tools web_extractor
python scripts/search.py "杭州天气" --no-thinking

Resolve scripts/search.py relative to this Skill directory, not the user's current directory.

Credential Rules

  • Accept credentials only from BAILIAN_API_KEY, then DASHSCOPE_API_KEY, or from the script's hidden interactive prompt.
  • Do not add an API key command-line option.
  • Do not display environment variables or dump process configuration while checking credentials.
  • If authentication fails, ask the user for a valid Bailian key without echoing the rejected value.

Dependencies

Require Python 3.9+ and the openai Python package. If the package is missing, install it in the active Python environment, then rerun the command:

python -m pip install --upgrade openai

Do not make a network call during dependency or credential checks.