// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../core/resource'; import { APIPromise } from '../../core/api-promise'; import { buildHeaders } from '../../internal/headers'; import { RequestOptions } from '../../internal/request-options'; export class Hitl extends APIResource { /** * Submit a Human-in-the-Loop (HITL) decision for an agent approval request. */ submitDecision( params: HitlSubmitDecisionParams, options?: RequestOptions, ): APIPromise { const { 'Accept-Language': acceptLanguage, 'X-Error-Format': xErrorFormat, ...body } = params; return this._client.patch('/agents/hitl/decision', { body, ...options, headers: buildHeaders([ { ...(acceptLanguage != null ? { 'Accept-Language': acceptLanguage } : undefined), ...(xErrorFormat != null ? { 'X-Error-Format': xErrorFormat } : undefined), }, options?.headers, ]), }); } } /** * Response model for Hitl agent info. * * Attributes: id (str): The ID of the agent. name (str): The name of the agent. */ export interface AgentInfo { id: string; name: string; } /** * Response model for Hitl tool info. * * Attributes: id (str): The ID of the tool. name (str): The name of the tool. * arguments (dict[str, Any] | None): The arguments for the tool. */ export interface ToolInfo { id: string; name: string; arguments?: { [key: string]: unknown } | null; } /** * Response model for HITL decision submission. * * Attributes: status (str): The status of the decision submission. message (str): * A descriptive message about the result. */ export interface HitlSubmitDecisionResponse { /** * A descriptive message about the result */ message: string; /** * The status of the decision submission */ status: string; } export interface HitlSubmitDecisionParams { /** * Body param: The decision made by the user - one of 'approved', 'rejected', or * 'skipped' */ decision: 'approved' | 'rejected' | 'skipped'; /** * Body param: The UUID observed in the stream */ request_id: string; /** * Body param: Free-form comment for audit/UIs. Defaults to empty string if * omitted. */ operator_input?: string; /** * Body param: Pass through if you track session identifiers on the client side. */ run_id?: string | null; /** * Header param */ 'Accept-Language'?: string; /** * Header param: Set to `structured` to receive errors in the structured envelope. * Omit it to keep the legacy error body. */ 'X-Error-Format'?: string; } export declare namespace Hitl { export { type AgentInfo as AgentInfo, type ToolInfo as ToolInfo, type HitlSubmitDecisionResponse as HitlSubmitDecisionResponse, type HitlSubmitDecisionParams as HitlSubmitDecisionParams, }; }