decide.v1
Status: v1. A published shape is frozen by spec.md section 20.1.
Capability key: decide
Route: POST /decide
Parts in
One row for each part kind that this capability accepts. A kind that is not in
this table is invalid_part.
| kind | role | required | meaning |
|---|---|---|---|
| text | question | yes, exactly one | the question that the model must answer. |
| json | options | yes, exactly one | {"options": [{"id": "...", "label": "...", "description": "..."}]}. |
| image | any | no | optional visual context for the question. |
Parameters
This capability has no parameters. A value in params is ignored (R26). The
options part carries the whole choice set.
Channels out
One row for each channel that this capability can emit.
| channel | mime | payload |
|---|---|---|
| decision | application/json | {"chosen": "<id>", "options": [{"id": "...", "probability": 0.0}]} |
Terminal metadata
done.meta is vocabulary-defined. The core stores it and never reads it.
done without meta means {}.
| key | type | meaning |
|---|---|---|
model | string | the served name that ran the job |
model is present when outcome is completed. It is absent when the outcome
is cancelled or expired.
Request
POST /decide
{
"model": "<served-name>",
"input": [
{"kind": "text", "role": "question", "text": "Which queue should this job enter?"},
{"kind": "json", "role": "options", "json": {"options": [
{"id": "fast", "label": "Fast lane", "description": "Small jobs with a short deadline."},
{"id": "bulk", "label": "Bulk lane", "description": "Large jobs with no deadline."}
]}}
],
"params": {},
"stream": false
}
Response, no stream
{"job": "019...", "outcome": "completed",
"decision": {"mime": "application/json", "inline": {"chosen": "fast", "options": [
{"id": "fast", "probability": 0.82}, {"id": "bulk", "probability": 0.18}]}},
"usage": {"tokens_in": 24, "tokens_out": 3},
"meta": {"model": "<served-name>"}}
Stream
decide emits one decision event, then the done frame. No other event
appears.
event ch=decision application/json {"chosen":"fast","options":[{"id":"fast","probability":0.82},{"id":"bulk","probability":0.18}]}
done outcome=completed meta={"model": "<served-name>"}
Rules
- Exactly one
textpart with rolequestionis required. A request without it isinvalid_part. - Exactly one
jsonpart with roleoptionsis required. A request without it isinvalid_part. - An
audio,video, ortokenspart isinvalid_part. An image is optional visual context; a model that does not declare image support refuses it. - Every entry of the
optionsarray namesid,label, anddescription. A missing key gives a refusal that namesoptions. - The
optionsarray holds at least two entries. Fewer than two gives a refusal that namesoptions. - Every
idin theoptionsarray is unique. A repeatedidgives a refusal that namesoptions. chosenis oneidfrom the request. A value outside that set is a protocol error.- The payload
optionsarray lists every requestedid, once each. Its length equals the length of the request array. - Each
probabilityis a float. It is never negative and never above one. - The payload probabilities add to one for one job.
chosennames the entry with the highestprobability. A tie keeps the request order.- The payload carries no
labeland nodescription. Those strings never appear in the output. - The plugin emits one
decisionevent and nothing else for this job. A seconddecisionevent is a protocol error. - A value in
paramsdoes not change the emitted decision. usage.tokens_incounts the question and the options.usage.tokens_outcounts the emitted answer tokens. Both are present whenoutcomeiscompleted.- No event follows a
cancel. The terminal frame isdonewithoutcome = cancelled, and it carries no metadata keys.