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
- Capture the user's query and any requested date, region, language, source, or output constraints.
- Check whether
BAILIAN_API_KEYorDASHSCOPE_API_KEYexists without printing its value. - If neither variable exists, ask the user to provide a Bailian API key. Prefer asking them to set
BAILIAN_API_KEYin the execution environment. Never repeat the key, put it in a command argument, write it to a file, or commit it. - Confirm the workspace endpoint when the user supplies a different Bailian region or workspace. Use
BAILIAN_BASE_URLor--base-urlto override the default. - Run the script with the user's query. Preserve the three tools unless the user asks to limit them.
- 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, thenDASHSCOPE_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.
微信扫一扫