Run prediction
run_predictionRun a single ad-hoc prediction against a trained model version, returning the predicted label, value, or class probabilities. Optionally return at once and poll for results.
Instructions
Run a single ad-hoc prediction against a trained model version.
Each call is a new prediction and spends a prediction credit; get_prediction
follows one still running, by its prediction_id.
project_id and target_feature are auto-resolved from the model version
record when omitted. By default waits and returns the predicted label or value
in output. For a classifier the result also has probabilities, one
{"probability_<class>": p} object per entry of output, named like
run_batch_prediction's CSV columns, and classLabels, the label each
<class> stands for: {"0": "B", "1": "M"} for a text target,
{"0": 0, "1": 1} for a 0/1 target. output follows the model's default
rule, so a threshold you chose applies to the probability, not to output.
Regressors return neither. Set wait_for_result=false to return immediately
with prediction_id. A wait lasts
max_wait_seconds (45 s by default, at most 60 s); if the prediction is still
running then, the result has timed_out: true and next_steps: poll
get_prediction to keep waiting.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input_data | Yes | ||
| project_id | No | ||
| target_feature | No | ||
| wait_for_result | No | ||
| max_wait_seconds | No | With wait_for_result=true, how long to wait, in seconds (default 45, at most 60; larger values are clamped). Hosts end long tool calls at different times, some at 60 s, so the default returns well before that; poll get_prediction to keep waiting. | |
| model_version_id | Yes | ||
| poll_interval_seconds | No | Seconds between status checks while waiting (default 2.0). Values below 2 are raised to 2. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||