Skip to content

Wrapper Functions

Convenience functions that build the matching content class and call raise_interrupt for you — you don't need to know content class names or constructors to raise a HITL. Each accepts the same feature kwargs as raise_interrupt (see Client & Decorators), plus fallback.

Function Content class
raise_approval BinaryApprovalContent
raise_approval_with_edits ModifyApprovalContent
raise_pick_one_option SingleDecisionContent
raise_pick_multiple_options MultiDecisionContent
raise_ranking_options RankDecisionContent
raise_req_for_context FreetextContextContent
raise_form_fill FormContextContent
raise_confirm_context ConfirmContextContent
raise_draft ContentEditContent
raise_tool_args_edit ToolArgsEditContent

raise_approval

raise_approval(hitl_key: str, prompt: str, *, choices: Optional[list[Choice]] = None, fallback: Optional[dict] = None, channels: ChannelsInput = None, users: UsersInput = None, secondary_channels: ChannelsInput = None, secondary_users: UsersInput = None, ttl_seconds: TtlSecondsInput = None, on_expiry: OnExpiryInput = None, default_response: DefaultResponseInput = None, features: Optional[RunFeatures] = None) -> BinaryApprovalResponse

Raise a binary approve/reject HITL.

choices defaults to a standard Approve/Reject pair when omitted, e.g. choices=[Choice("approve", "Approve"), Choice("reject", "Reject")].

raise_approval_with_edits

raise_approval_with_edits(hitl_key: str, prompt: str, *, choices: list[Choice], modifiable: list[ModifiableField], fallback: Optional[dict] = None, channels: ChannelsInput = None, users: UsersInput = None, secondary_channels: ChannelsInput = None, secondary_users: UsersInput = None, ttl_seconds: TtlSecondsInput = None, on_expiry: OnExpiryInput = None, default_response: DefaultResponseInput = None, features: Optional[RunFeatures] = None) -> ModifyApprovalResponse

Raise an approve/reject HITL with operator-editable fields.

E.g. choices=[Choice("approve", "Approve")], modifiable=[ModifiableField("amount", "Amount", 50.00, FieldType.NUMBER)].

raise_pick_one_option

raise_pick_one_option(hitl_key: str, prompt: str, *, options: list[Choice], fallback: Optional[dict] = None, channels: ChannelsInput = None, users: UsersInput = None, secondary_channels: ChannelsInput = None, secondary_users: UsersInput = None, ttl_seconds: TtlSecondsInput = None, on_expiry: OnExpiryInput = None, default_response: DefaultResponseInput = None, features: Optional[RunFeatures] = None) -> SingleDecisionResponse

Raise a HITL asking the operator to pick exactly one option.

E.g. options=[Choice("staging", "Staging"), Choice("prod", "Production")].

raise_pick_multiple_options

raise_pick_multiple_options(hitl_key: str, prompt: str, *, options: list[Choice], min_select: int = 1, max_select: Optional[int] = None, fallback: Optional[dict] = None, channels: ChannelsInput = None, users: UsersInput = None, secondary_channels: ChannelsInput = None, secondary_users: UsersInput = None, ttl_seconds: TtlSecondsInput = None, on_expiry: OnExpiryInput = None, default_response: DefaultResponseInput = None, features: Optional[RunFeatures] = None) -> MultiDecisionResponse

Raise a HITL asking the operator to pick one or more options.

max_select=None means no upper bound. E.g. options=[Choice("infra", "Infrastructure"), Choice("backend", "Backend")].

raise_ranking_options

raise_ranking_options(hitl_key: str, prompt: str, *, options: list[Choice], fallback: Optional[dict] = None, channels: ChannelsInput = None, users: UsersInput = None, secondary_channels: ChannelsInput = None, secondary_users: UsersInput = None, ttl_seconds: TtlSecondsInput = None, on_expiry: OnExpiryInput = None, default_response: DefaultResponseInput = None, features: Optional[RunFeatures] = None) -> RankDecisionResponse

Raise a HITL asking the operator to order all options by preference.

E.g. options=[Choice("email", "Email"), Choice("sms", "SMS")].

raise_req_for_context

raise_req_for_context(hitl_key: str, prompt: str, *, input: FreetextInput, fallback: Optional[dict] = None, channels: ChannelsInput = None, users: UsersInput = None, secondary_channels: ChannelsInput = None, secondary_users: UsersInput = None, ttl_seconds: TtlSecondsInput = None, on_expiry: OnExpiryInput = None, default_response: DefaultResponseInput = None, features: Optional[RunFeatures] = None) -> FreetextContextResponse

Raise a HITL collecting a free-form text answer from the operator.

E.g. input=FreetextInput(label="Customer preference").

raise_form_fill

raise_form_fill(hitl_key: str, prompt: str, *, fields: list[FormField], fallback: Optional[dict] = None, channels: ChannelsInput = None, users: UsersInput = None, secondary_channels: ChannelsInput = None, secondary_users: UsersInput = None, ttl_seconds: TtlSecondsInput = None, on_expiry: OnExpiryInput = None, default_response: DefaultResponseInput = None, features: Optional[RunFeatures] = None) -> FormContextResponse

Raise a HITL collecting structured data via a multi-field form.

E.g. fields=[FormField("ticket_id", "Ticket ID", FieldType.STRING, required=True)].

raise_confirm_context

raise_confirm_context(hitl_key: str, prompt: str, *, statement: str = '', fallback: Optional[dict] = None, channels: ChannelsInput = None, users: UsersInput = None, secondary_channels: ChannelsInput = None, secondary_users: UsersInput = None, ttl_seconds: TtlSecondsInput = None, on_expiry: OnExpiryInput = None, default_response: DefaultResponseInput = None, features: Optional[RunFeatures] = None) -> ConfirmContextResponse

Raise a HITL asking the operator to read and acknowledge a statement.

raise_draft

raise_draft(hitl_key: str, prompt: str, *, draft: str = '', fallback: Optional[dict] = None, channels: ChannelsInput = None, users: UsersInput = None, secondary_channels: ChannelsInput = None, secondary_users: UsersInput = None, ttl_seconds: TtlSecondsInput = None, on_expiry: OnExpiryInput = None, default_response: DefaultResponseInput = None, features: Optional[RunFeatures] = None) -> ContentEditResponse

Raise a HITL letting the operator review and rewrite a text draft.

raise_tool_args_edit

raise_tool_args_edit(hitl_key: str, prompt: str, *, tool_name: str, args: list[ToolArg], fallback: Optional[dict] = None, channels: ChannelsInput = None, users: UsersInput = None, secondary_channels: ChannelsInput = None, secondary_users: UsersInput = None, ttl_seconds: TtlSecondsInput = None, on_expiry: OnExpiryInput = None, default_response: DefaultResponseInput = None, features: Optional[RunFeatures] = None) -> ToolArgsEditResponse

Raise a HITL letting the operator review and edit pending tool call arguments.

E.g. args=[ToolArg("limit", "Row Limit", 1000, FieldType.NUMBER, editable=True)].