wait_for_analysis
Block until an analysis reaches a completed, failed, or canceled state. Polls the analysis endpoint and returns the result or timeout guidance for retrying.
Instructions
Block until an analysis reaches a terminal state (completed | failed | canceled), polling GET /v1/analyses/{id}. Returns { analysis, retry }: retry is null when the analysis reached a terminal state, or carries timeout guidance when the wait expired (call again). Default timeout 120s (test-mode analyses complete in seconds). On completion, see get_analysis for the full result field semantics (detected_count, indeterminate_reason, nullable video_duration_s, usage snapshot).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| timeout_s | No | Max seconds to wait (default 120). | |
| analysis_id | Yes | The analysis id (an_…). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| retry | Yes | Null when the analysis reached a terminal state. Set when the wait timed out — call wait_for_analysis or get_analysis again. | |
| analysis | Yes |