Bailian CLI command reference for typed decision-model inference with probability outputs.
bl decision calls the decision model to classify a business state and return a choice, noul, or score result with probabilities. Use it for ticket classification, intent detection, risk scoring, and other scenarios that need stable structured output.
The decision model uses a workspace-specific endpoint and requires
--workspace-id, which can also come from BAILIAN_WORKSPACE_ID or the workspace_id config field. It supports the cn-beijing (default) and ap-southeast-1 regions; the API key must match the target region.Quick start
Command
bl decision
Run the decision model. Requires API Key authentication.
Usage
| Parameter | Type | Required | Description |
|---|---|---|---|
--model <model> | string | no | Decision model ID (default: decision-model-preview) |
--state <text> | string | no | Business state to decide on, sent as a string |
--state-file <path> | string | no | Read state from a file; .json is parsed as an object or array, other files as text; - reads stdin |
--questions <json> | string | no | Question table JSON keyed by question ID |
--questions-file <path> | string | no | Read the question table from a JSON file; supports {...} or {"questions":{...}} |
--request-file <path> | string | no | Full request JSON {state, questions}; label and target are stripped automatically |
--workspace-id <id> | string | no | Workspace ID for the endpoint host (or set BAILIAN_WORKSPACE_ID) |
--region <cn-beijing|ap-southeast-1> | string | no | Endpoint region: cn-beijing (default) or ap-southeast-1 |
--api-key <key> | string | no | API key |
--base-url <url> | string | no | API base URL |
- A configured base URL takes precedence over
--region;--regiononly participates in endpoint construction when no base URL is available. --stateis always sent as a string. Use--state-fileor--request-fileto pass an object or array.--request-filestripslabelandtarget, so training samples can be reused without editing them first.- Keep each request to 16 questions or fewer; latency grows as the number of questions increases.
Question types
choice
Pick one option. Use it for intent classification and ticket-type decisions.
choice, confidence, and probabilities.
noul
Decide whether a condition holds and return a 0-1 value. criteria is optional and can describe the true and false cases.
noul score; text output shows it as P(yes).
score
Score against ordered levels. criteria must be an array ordered from low to high.
score, legend, probabilities, and confidence. Three to seven levels are recommended.
Output
The default output is the full JSON response. With --output text, each question produces one summary line:
usage.input_tokensis the number of input tokens for the request.latency_msis the end-to-end latency in milliseconds.- The decision API does not support sampling parameters such as
temperatureormax_tokens.