import {z} from 'zod' export type SingleTestRunRequestModel = {test_id: string, workflow_node_id?: (string | null) | undefined, root_folder_id?: (string | null) | undefined, root_folder_name?: (string | null) | undefined}; export type ASRQuality = 'high'; export type ASRProvider = 'elevenlabs' | 'scribe_realtime' | 'scribe_v2_turbo'; export type ASRInputFormat = 'pcm_8000' | 'pcm_16000' | 'pcm_22050' | 'pcm_24000' | 'pcm_44100' | 'pcm_48000' | 'ulaw_8000'; export type ASRConversationalConfig = {quality?: ASRQuality | undefined, provider?: ASRProvider | undefined, user_input_audio_format?: ASRInputFormat | undefined, keywords?: Array | undefined}; export type TurnMode = 'silence' | 'turn'; export type TurnEagerness = 'patient' | 'normal' | 'eager'; export type SpellingPatience = 'auto' | 'off'; export type TurnModel = 'turn_v2' | 'turn_v3'; export type SoftTimeoutConfig = {timeout_seconds?: number | undefined, message?: string | undefined, additional_soft_timeout_messages?: Array | undefined, use_llm_generated_message?: boolean | undefined, randomize_fillers?: boolean | undefined, max_soft_timeouts_per_generation?: number | undefined, llm_generated_message_prompt_override?: (string | null) | undefined, disable_until_first_user_message?: boolean | undefined}; export type TurnConfig = {turn_timeout?: number | undefined, initial_wait_time?: (number | null) | undefined, silence_end_call_timeout?: number | undefined, mode?: TurnMode | undefined, turn_eagerness?: TurnEagerness | undefined, spelling_patience?: SpellingPatience | undefined, speculative_turn?: boolean | undefined, retranscribe_on_turn_timeout?: boolean | undefined, turn_model?: TurnModel | undefined, interruption_ignore_terms?: Array | undefined, interruption_ignore_term_languages?: Array | undefined, merge_with_default_ignore_terms?: boolean | undefined, transcribe_on_disabled_interruptions?: boolean | undefined, soft_timeout_config?: SoftTimeoutConfig | undefined, noisy_environment_detection?: boolean | undefined, noisy_environment_message?: string | undefined}; export type TTSConversationalModel = 'eleven_turbo_v2' | 'eleven_turbo_v2_5' | 'eleven_flash_v2' | 'eleven_flash_v2_5' | 'eleven_multilingual_v2' | 'eleven_v3_conversational' | 'eleven_v4' | 'eleven_v4_turbo'; export type TTSModelFamily = 'turbo' | 'flash' | 'multilingual' | 'v3_conversational' | 'v4' | 'v4_turbo'; export type TTSOptimizeStreamingLatency = 0 | 1 | 2 | 3 | 4; export type SupportedVoice = {label: string, voice_id: string, description?: (string | null) | undefined, language?: (string | null) | undefined, model_family?: (TTSModelFamily | null) | undefined, optimize_streaming_latency?: (TTSOptimizeStreamingLatency | null) | undefined, stability?: (number | null) | undefined, speed?: (number | null) | undefined, similarity_boost?: (number | null) | undefined, clone_strength?: (number | null) | undefined}; export type SuggestedAudioTag = {tag: string, description?: (string | null) | undefined}; export type TTSOutputFormat = 'pcm_8000' | 'pcm_16000' | 'pcm_22050' | 'pcm_24000' | 'pcm_44100' | 'pcm_48000' | 'ulaw_8000'; export type TextNormalisationType = 'system_prompt' | 'elevenlabs'; export type PydanticPronunciationDictionaryVersionLocator = {pronunciation_dictionary_id: string, version_id: string | null}; export type EffectsSpecInput = {filter_preset_id?: (string | null) | undefined, distance?: number | undefined, environment_id?: (string | null) | undefined, background_noise_id?: (string | null) | undefined, send_level?: number | undefined, pan?: number | undefined}; export type TTSConversationalConfigInput = {model_id?: TTSConversationalModel | undefined, voice_id?: string | undefined, supported_voices?: Array | undefined, expressive_mode?: boolean | undefined, suggested_audio_tags?: Array | undefined, agent_output_audio_format?: TTSOutputFormat | undefined, optimize_streaming_latency?: TTSOptimizeStreamingLatency | undefined, stability?: number | undefined, speed?: number | undefined, similarity_boost?: number | undefined, clone_strength?: number | undefined, text_normalisation_type?: TextNormalisationType | undefined, pronunciation_dictionary_locators?: Array | undefined, enable_phoneme_tags?: boolean | undefined, audio_effects?: (EffectsSpecInput | null) | undefined}; export type ClientEvent = 'conversation_initiation_metadata' | 'asr_initiation_metadata' | 'ping' | 'audio' | 'interruption' | 'user_transcript' | 'tentative_user_transcript' | 'agent_response' | 'agent_response_correction' | 'client_tool_call' | 'mcp_tool_call' | 'mcp_connection_status' | 'agent_tool_request' | 'agent_tool_response' | 'agent_tool_response_full_payload' | 'agent_response_metadata' | 'vad_score' | 'agent_chat_response_part' | 'client_error' | 'guardrail_triggered' | 'dtmf_request' | 'agent_response_complete' | 'context_usage' | 'internal_turn_probability' | 'internal_tentative_agent_response'; export type FileInputConfig = {enabled?: boolean | undefined, max_files_in_memory?: number | undefined, max_files_per_conversation?: number | undefined}; export type DTMFInputConfig = {dtmf_input_timeout?: number | undefined, hash_terminator?: boolean | undefined, redact_input?: boolean | undefined}; export type BackgroundSoundSourceType = 'preset'; export type BackgroundSoundPresetId = 'office2' | 'office1' | 'restaurant' | 'city' | 'typing' | 'elevator1' | 'elevator2' | 'elevator3' | 'elevator4'; export type BackgroundSoundConfig = {source_type?: (BackgroundSoundSourceType | null) | undefined, source_id?: (BackgroundSoundPresetId | null) | undefined, volume?: number | undefined, crossfade_loop?: boolean | undefined}; export type ConversationConfigInput = {text_only?: boolean | undefined, max_duration_seconds?: number | undefined, client_events?: Array | undefined, file_input?: FileInputConfig | undefined, monitoring_enabled?: boolean | undefined, monitoring_events?: Array | undefined, dtmf_input_settings?: (DTMFInputConfig | null) | undefined, background_sound?: BackgroundSoundConfig | undefined, source_attribution?: boolean | undefined}; export type ASRConversationalConfigOverride = {keywords?: (Array | null) | undefined}; export type SoftTimeoutConfigOverride = {message?: (string | null) | undefined, additional_soft_timeout_messages?: (Array | null) | undefined}; export type TurnConfigOverride = {soft_timeout_config?: (SoftTimeoutConfigOverride | null) | undefined, noisy_environment_message?: (string | null) | undefined}; export type TTSConversationalConfigOverride = {model_id?: ('eleven_turbo_v2' | 'eleven_turbo_v2_5' | 'eleven_flash_v2' | 'eleven_flash_v2_5' | 'eleven_multilingual_v2' | 'eleven_v3_conversational' | 'eleven_v4' | 'eleven_v4_turbo' | null) | undefined, voice_id?: (string | null) | undefined, supported_voices?: (Array | null) | undefined, stability?: (number | null) | undefined, speed?: (number | null) | undefined, similarity_boost?: (number | null) | undefined, clone_strength?: (number | null) | undefined, pronunciation_dictionary_locators?: (Array | null) | undefined}; export type ConversationConfigOverride = {text_only?: (boolean | null) | undefined, max_duration_seconds?: (number | null) | undefined}; export type KnowledgeBaseDocumentType = 'file' | 'url' | 'text' | 'folder'; export type DocumentUsageModeEnum = 'prompt' | 'auto'; export type KnowledgeBaseLocator = {type: KnowledgeBaseDocumentType, name: string, id: string, usage_mode?: DocumentUsageModeEnum | undefined}; export type PromptAgentAPIModelOverrideInput = {prompt?: (string | null) | undefined, llm?: ('gpt-4o-mini' | 'gpt-4o' | 'gpt-4' | 'gpt-4-turbo' | 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-4.1-nano' | 'gpt-5' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.2-chat-latest' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-sol' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6-luna' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-3.5-turbo' | 'gemini-1.5-pro' | 'gemini-1.5-flash' | 'gemini-2.0-flash' | 'gemini-2.0-flash-lite' | 'gemini-2.5-flash-lite' | 'gemini-2.5-flash' | 'gemini-3-pro-preview' | 'gemini-3-flash-preview' | 'gemini-3.1-pro-preview' | 'gemini-3.1-flash-lite-preview' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-argon' | 'claude-sonnet-4-5' | 'claude-opus-4-6' | 'claude-opus-4-7' | 'claude-opus-4-8' | 'claude-opus-5' | 'claude-opus-5-5' | 'claude-sonnet-4-6' | 'claude-sonnet-5' | 'claude-sonnet-5-5' | 'claude-sonnet-4' | 'claude-haiku-4-5' | 'claude-haiku-5-5' | 'claude-3-7-sonnet' | 'claude-3-5-sonnet' | 'claude-3-5-sonnet-v1' | 'claude-3-haiku' | 'grok-beta' | 'custom-llm' | 'qwen3-4b' | 'qwen3-30b-a3b' | 'qwen36-35b-a3b' | 'qwen35-397b-a17b' | 'gpt-oss-20b' | 'gpt-oss-120b' | 'glm-45-air-fp8' | 'glm-52' | 'deepseek-v41-flash' | 'nemotron-35-super-vl-nvfp4' | 'gemini-2.5-flash-preview-09-2025' | 'gemini-2.5-flash-lite-preview-09-2025' | 'gemini-2.5-flash-preview-05-20' | 'gemini-2.5-flash-preview-04-17' | 'gemini-2.5-flash-lite-preview-06-17' | 'gemini-2.0-flash-lite-001' | 'gemini-2.0-flash-001' | 'gemini-1.5-flash-002' | 'gemini-1.5-flash-001' | 'gemini-1.5-pro-002' | 'gemini-1.5-pro-001' | 'claude-sonnet-4@20250514' | 'claude-sonnet-4-5@20250929' | 'claude-haiku-4-5@20251001' | 'claude-3-7-sonnet@20250219' | 'claude-3-5-sonnet@20240620' | 'claude-3-5-sonnet-v2@20241022' | 'claude-3-haiku@20240307' | 'gpt-5-2025-08-07' | 'gpt-5.1-2025-11-13' | 'gpt-5.2-2025-12-11' | 'gpt-5.4-2026-03-05' | 'gpt-5.4-mini-2026-03-17' | 'gpt-5.4-nano-2026-03-17' | 'gpt-5.5-2026-04-23' | 'gpt-5-mini-2025-08-07' | 'gpt-5-nano-2025-08-07' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4o-mini-2024-07-18' | 'gpt-4o-2024-11-20' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-05-13' | 'gpt-4-0613' | 'gpt-4-0314' | 'gpt-4-turbo-2024-04-09' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo-1106' | 'watt-tool-8b' | 'watt-tool-70b' | null) | undefined, reasoning_effort?: ('none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | null) | undefined, tool_ids?: (Array | null) | undefined, tool_ids_strict?: (boolean | null) | undefined, native_mcp_server_ids?: (Array | null) | undefined, knowledge_base?: (Array | null) | undefined}; export type AgentConfigOverrideInput = {first_message?: (string | null) | undefined, language?: (string | null) | undefined, max_conversation_duration_message?: (string | null) | undefined, prompt?: (PromptAgentAPIModelOverrideInput | null) | undefined}; export type ConversationConfigClientOverrideInput = {asr?: (ASRConversationalConfigOverride | null) | undefined, turn?: (TurnConfigOverride | null) | undefined, tts?: (TTSConversationalConfigOverride | null) | undefined, conversation?: (ConversationConfigOverride | null) | undefined, agent?: (AgentConfigOverrideInput | null) | undefined}; export type LanguagePresetTranslation = {source_hash: string, text: string}; export type LanguagePresetInput = {overrides: ConversationConfigClientOverrideInput, first_message_translation?: (LanguagePresetTranslation | null) | undefined, soft_timeout_translation?: (LanguagePresetTranslation | null) | undefined, noisy_environment_message_translation?: (LanguagePresetTranslation | null) | undefined}; export type VADConfig = {background_voice_detection?: boolean | undefined}; export type DynamicVariablesConfig = {dynamic_variable_placeholders?: {[key: string]: unknown} | undefined}; export type Verbosity = 'auto' | 'concise' | 'thorough'; export type OutputFormat = 'plain_text' | 'markdown'; export type InteractionBudget = 'realtime' | '5_minutes' | '10_minutes' | '1_hour'; export type BehaviorOverride = {verbosity?: (Verbosity | null) | undefined, output_format?: (OutputFormat | null) | undefined, interaction_budget?: (InteractionBudget | null) | undefined}; export type AllowedValues = {dynamic_variable: string}; export type LiteralJsonSchemaProperty = {type: 'boolean' | 'string' | 'integer' | 'number' | Array, description?: string | undefined, enum?: (Array | null) | undefined, is_system_provided?: boolean | undefined, dynamic_variable?: string | undefined, allowed_values?: (AllowedValues | null) | undefined, allowed_values_dynamic_variable?: string | undefined, constant_value?: (string | number | number | boolean | null) | undefined, is_omitted?: boolean | undefined}; export type ArrayJsonSchemaPropertyInput = {property_kind?: ('array' | 'object') | undefined, description?: string | undefined, dynamic_variable?: string | undefined, constant_value?: (Array | null) | undefined, is_omitted?: boolean | undefined, type?: 'array' | undefined, items?: (LiteralJsonSchemaProperty | ObjectJsonSchemaPropertyInput | ArrayJsonSchemaPropertyInput) | undefined}; export type RequiredConstraint = {required: Array}; export type RequiredConstraints = {any_of?: Array | undefined, all_of?: Array | undefined}; export type ObjectJsonSchemaPropertyInput = {property_kind?: ('array' | 'object') | undefined, description?: string | undefined, dynamic_variable?: string | undefined, constant_value?: ({[key: string]: unknown} | null) | undefined, is_omitted?: boolean | undefined, type?: 'object' | undefined, required?: Array | undefined, properties?: ({[key: string]: LiteralJsonSchemaProperty | ObjectJsonSchemaPropertyInput | ArrayJsonSchemaPropertyInput}) | undefined, required_constraints?: (RequiredConstraints | null) | undefined}; export type SubAgentInput = {execution_mode?: ('immediate' | 'async') | undefined, timeout_secs?: number | undefined, agent_id: string, branch_id?: (string | null) | undefined, description: string, parameters?: (ObjectJsonSchemaPropertyInput | null) | undefined}; export type SelfSubagent = {execution_mode?: ('immediate' | 'async') | undefined, timeout_secs?: number | undefined, description?: (string | null) | undefined}; export type SubagentConfigInput = {agents?: Array | undefined, self_subagent?: (SelfSubagent | null) | undefined}; export type LLM = 'gpt-4o-mini' | 'gpt-4o' | 'gpt-4' | 'gpt-4-turbo' | 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-4.1-nano' | 'gpt-5' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.2-chat-latest' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-sol' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6-luna' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-3.5-turbo' | 'gemini-1.5-pro' | 'gemini-1.5-flash' | 'gemini-2.0-flash' | 'gemini-2.0-flash-lite' | 'gemini-2.5-flash-lite' | 'gemini-2.5-flash' | 'gemini-3-pro-preview' | 'gemini-3-flash-preview' | 'gemini-3.1-pro-preview' | 'gemini-3.1-flash-lite-preview' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-argon' | 'claude-sonnet-4-5' | 'claude-opus-4-6' | 'claude-opus-4-7' | 'claude-opus-4-8' | 'claude-opus-5' | 'claude-opus-5-5' | 'claude-sonnet-4-6' | 'claude-sonnet-5' | 'claude-sonnet-5-5' | 'claude-sonnet-4' | 'claude-haiku-4-5' | 'claude-haiku-5-5' | 'claude-3-7-sonnet' | 'claude-3-5-sonnet' | 'claude-3-5-sonnet-v1' | 'claude-3-haiku' | 'grok-beta' | 'custom-llm' | 'qwen3-4b' | 'qwen3-30b-a3b' | 'qwen36-35b-a3b' | 'qwen35-397b-a17b' | 'gpt-oss-20b' | 'gpt-oss-120b' | 'glm-45-air-fp8' | 'glm-52' | 'deepseek-v41-flash' | 'nemotron-35-super-vl-nvfp4' | 'gemini-2.5-flash-preview-09-2025' | 'gemini-2.5-flash-lite-preview-09-2025' | 'gemini-2.5-flash-preview-05-20' | 'gemini-2.5-flash-preview-04-17' | 'gemini-2.5-flash-lite-preview-06-17' | 'gemini-2.0-flash-lite-001' | 'gemini-2.0-flash-001' | 'gemini-1.5-flash-002' | 'gemini-1.5-flash-001' | 'gemini-1.5-pro-002' | 'gemini-1.5-pro-001' | 'claude-sonnet-4@20250514' | 'claude-sonnet-4-5@20250929' | 'claude-haiku-4-5@20251001' | 'claude-3-7-sonnet@20250219' | 'claude-3-5-sonnet@20240620' | 'claude-3-5-sonnet-v2@20241022' | 'claude-3-haiku@20240307' | 'gpt-5-2025-08-07' | 'gpt-5.1-2025-11-13' | 'gpt-5.2-2025-12-11' | 'gpt-5.4-2026-03-05' | 'gpt-5.4-mini-2026-03-17' | 'gpt-5.4-nano-2026-03-17' | 'gpt-5.5-2026-04-23' | 'gpt-5-mini-2025-08-07' | 'gpt-5-nano-2025-08-07' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4o-mini-2024-07-18' | 'gpt-4o-2024-11-20' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-05-13' | 'gpt-4-0613' | 'gpt-4-0314' | 'gpt-4-turbo-2024-04-09' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo-1106' | 'watt-tool-8b' | 'watt-tool-70b'; export type LLMServiceTier = 'standard' | 'fast'; export type ToolInterruptionMode = 'allow' | 'disable_during_tool' | 'disable_during_tool_and_turn'; export type PreToolSpeechMode = 'auto' | 'force' | 'off'; export type DynamicVariableAssignment = {source?: 'response' | undefined, dynamic_variable: string, value_path: string, sanitize?: boolean | undefined, preserve_native_type?: boolean | undefined}; export type ToolCallSoundBehavior = 'auto' | 'always'; export type ToolErrorHandlingMode = 'auto' | 'summarized' | 'passthrough' | 'hide'; export type EndCallToolConfig = {system_tool_type?: 'end_call' | undefined}; export type LanguageDetectionToolConfig = {system_tool_type?: 'language_detection' | undefined, only_at_conversation_start?: boolean | undefined}; export type AgentTransferInput = {agent_id?: (string | null) | undefined, branch_id?: (string | null) | undefined, node_id?: (string | null) | undefined, condition: string, delay_ms?: number | undefined, transfer_message?: (string | null) | undefined, enable_transferred_agent_first_message?: boolean | undefined, is_workflow_node_transfer?: boolean | undefined, preserve_client_tts_overrides?: boolean | undefined, preserve_voice_settings?: boolean | undefined}; export type TransferToAgentToolConfigInput = {system_tool_type?: 'transfer_to_agent' | undefined, transfers: Array}; export type CustomSIPHeader = {type?: 'static' | undefined, key: string, value: string}; export type CustomSIPHeaderWithDynamicVariable = {value: string, type: 'dynamic', key: string}; export type PhoneNumberTransferDestination = {type?: 'phone' | undefined, phone_number: string}; export type SIPUriTransferDestination = {type?: 'sip_uri' | undefined, sip_uri: string}; export type PhoneNumberDynamicVariableTransferDestination = {type?: 'phone_dynamic_variable' | undefined, phone_number: string}; export type SIPUriDynamicVariableTransferDestination = {type?: 'sip_uri_dynamic_variable' | undefined, sip_uri: string}; export type TransferTypeEnum = 'blind' | 'conference' | 'sip_refer'; export type UUITransferConfig = {data: string, protocol_discriminator?: (string | null) | undefined, protocol_discriminator_mode?: ('prefix' | 'pd_parameter') | undefined}; export type PostDialDigitsStatic = {type?: 'static' | undefined, value: string}; export type PostDialDigitsDynamicVariable = {value: string, type?: 'dynamic' | undefined}; export type PhoneNumberTransfer = {custom_sip_headers?: (Array) | undefined, transfer_destination: PhoneNumberTransferDestination | SIPUriTransferDestination | PhoneNumberDynamicVariableTransferDestination | SIPUriDynamicVariableTransferDestination, transfer_type?: TransferTypeEnum | undefined, sip_refer_play_dialtone?: boolean | undefined, uui?: (UUITransferConfig | null) | undefined, post_dial_digits?: (PostDialDigitsStatic | PostDialDigitsDynamicVariable | null) | undefined, phone_number?: (string | null) | undefined, condition: string}; export type PhoneDestinationInput = {destination: string, type?: 'phone' | undefined}; export type PhoneDynamicVariableDestinationInput = {destination: string, type?: 'phone_dynamic_variable' | undefined}; export type TwilioWarmConferenceTransferConfigInput = {transfer_destination: PhoneDestinationInput | PhoneDynamicVariableDestinationInput, post_dial_digits?: (PostDialDigitsStatic | PostDialDigitsDynamicVariable | null) | undefined, type?: 'twilio_warm_conference_transfer' | undefined}; export type TwilioColdBlindTransferConfigInput = {transfer_destination: PhoneDestinationInput | PhoneDynamicVariableDestinationInput, post_dial_digits?: (PostDialDigitsStatic | PostDialDigitsDynamicVariable | null) | undefined, type?: 'twilio_cold_blind_transfer' | undefined}; export type TwilioTransferInput = {type?: 'twilio' | undefined, config: TwilioWarmConferenceTransferConfigInput | TwilioColdBlindTransferConfigInput}; export type SIPColdConferenceTransferConfigInput = {transfer_destination: PhoneDestinationInput | PhoneDynamicVariableDestinationInput, type?: 'sip_cold_conference_transfer' | undefined}; export type SipUriDestinationInput = {destination: string, type?: 'sip_uri' | undefined}; export type SipUriDynamicVariableDestinationInput = {destination: string, type?: 'sip_uri_dynamic_variable' | undefined}; export type SIPColdReferTransferConfigInput = {custom_sip_headers?: (Array) | undefined, transfer_destination: PhoneDestinationInput | SipUriDestinationInput | PhoneDynamicVariableDestinationInput | SipUriDynamicVariableDestinationInput, type?: 'sip_cold_refer_transfer' | undefined, uui?: (UUITransferConfig | null) | undefined, play_dialtone?: boolean | undefined}; export type SIPTransferInput = {type?: 'sip_trunk' | undefined, config: SIPColdConferenceTransferConfigInput | SIPColdReferTransferConfigInput}; export type ExotelColdBlindTransferConfigInput = {transfer_destination: PhoneDestinationInput | PhoneDynamicVariableDestinationInput, type?: 'exotel_cold_blind_transfer' | undefined}; export type ExotelWarmTransferConfigInput = {transfer_destination: PhoneDestinationInput | PhoneDynamicVariableDestinationInput, type?: 'exotel_warm_transfer' | undefined}; export type ExotelTransferInput = {type?: 'exotel' | undefined, config: ExotelColdBlindTransferConfigInput | ExotelWarmTransferConfigInput}; export type TransferRuleInput = {provider_configs: Array, condition: string}; export type TransferToNumberToolConfigInput = {system_tool_type?: 'transfer_to_number' | undefined, transfers: Array, transfer_rules?: Array | undefined, enable_client_message?: boolean | undefined}; export type SkipTurnToolConfig = {system_tool_type?: 'skip_turn' | undefined, wait_timeout_secs?: number | undefined}; export type PlayDTMFToolConfig = {system_tool_type?: 'play_keypad_touch_tone' | undefined, use_out_of_band_dtmf?: boolean | undefined, suppress_turn_after_dtmf?: boolean | undefined}; export type VoicemailDetectionToolConfig = {system_tool_type?: 'voicemail_detection' | undefined, voicemail_message?: (string | null) | undefined}; export type KnowledgeBaseRagToolConfig = {system_tool_type?: 'knowledge_base_rag' | undefined}; export type SearchStrategy = 'cat' | 'keyword' | 'semantic' | 'ls'; export type KnowledgeBaseToolConfig = {system_tool_type?: 'knowledge_base' | undefined, enabled_strategies?: Array | undefined}; export type ProcedureVersionRef = {procedure_id: string, version_id: string}; export type ProcedureDraftRef = {procedure_id: string, version_id: unknown}; export type StartProcedureToolConfig = {system_tool_type?: 'start_procedure' | undefined, procedures?: ({[key: string]: ProcedureVersionRef | ProcedureDraftRef}) | undefined}; export type EndProcedureToolConfig = {system_tool_type?: 'end_procedure' | undefined, procedures?: ({[key: string]: ProcedureVersionRef | ProcedureDraftRef}) | undefined}; export type SystemToolConfigInput = {type?: 'system' | undefined, name: string, description?: string | undefined, response_timeout_secs?: number | undefined, disable_interruptions?: boolean | undefined, interruption_mode?: ToolInterruptionMode | undefined, force_pre_tool_speech?: boolean | undefined, pre_tool_speech?: PreToolSpeechMode | undefined, assignments?: Array | undefined, tool_call_sound?: ('typing' | 'elevator1' | 'elevator2' | 'elevator3' | 'elevator4' | null) | undefined, tool_call_sound_behavior?: ToolCallSoundBehavior | undefined, tool_error_handling_mode?: ToolErrorHandlingMode | undefined, params: EndCallToolConfig | LanguageDetectionToolConfig | TransferToAgentToolConfigInput | TransferToNumberToolConfigInput | SkipTurnToolConfig | PlayDTMFToolConfig | VoicemailDetectionToolConfig | KnowledgeBaseRagToolConfig | KnowledgeBaseToolConfig | StartProcedureToolConfig | EndProcedureToolConfig}; export type BuiltInToolsInput = {transfer_to_agent?: (SystemToolConfigInput | null) | undefined, end_call?: (SystemToolConfigInput | null) | undefined, language_detection?: (SystemToolConfigInput | null) | undefined, transfer_to_number?: (SystemToolConfigInput | null) | undefined, skip_turn?: (SystemToolConfigInput | null) | undefined, play_keypad_touch_tone?: (SystemToolConfigInput | null) | undefined, voicemail_detection?: (SystemToolConfigInput | null) | undefined}; export type ConvAISecretLocator = {secret_id: string}; export type ConvAIEnvVarLocator = {env_var_label: string}; export type AuthConnectionLocator = {auth_connection_id: string}; export type EnvironmentAuthConnectionLocator = {env_var_label: string}; export type ConvAIDynamicVariable = {variable_name: string}; export type CustomLLMAPIType = 'chat_completions' | 'responses' | 'websocket'; export type CustomLLM = {url: string, model_id?: (string | null) | undefined, api_key?: (ConvAISecretLocator | ConvAIEnvVarLocator | null) | undefined, auth_connection?: (AuthConnectionLocator | EnvironmentAuthConnectionLocator | null) | undefined, request_headers?: ({[key: string]: string | ConvAISecretLocator | ConvAIDynamicVariable | ConvAIEnvVarLocator}) | undefined, api_version?: (string | null) | undefined, api_type?: CustomLLMAPIType | undefined}; export type EmbeddingModelEnum = 'e5_mistral_7b_instruct' | 'multilingual_e5_large_instruct'; export type KnowledgeBaseToolInfo = {enabled_strategies?: Array | undefined}; export type RagConfigInput = {enabled?: boolean | undefined, embedding_model?: EmbeddingModelEnum | undefined, max_vector_distance?: number | undefined, max_documents_length?: number | undefined, max_retrieved_rag_chunks_count?: number | undefined, num_candidates?: (number | null) | undefined, query_rewrite_prompt_override?: (string | null) | undefined, knowledge_base_tool_info?: (KnowledgeBaseToolInfo | null) | undefined}; export type BackupLLMDefault = {preference?: 'default' | undefined}; export type BackupLLMDisabled = {preference?: 'disabled' | undefined}; export type BackupLLMOverride = {preference?: 'override' | undefined, order: Array}; export type ToolExecutionMode = 'immediate' | 'post_tool_speech' | 'async'; export type QueryParamsJsonSchemaInput = {properties: {[key: string]: LiteralJsonSchemaProperty}, required?: Array | undefined}; export type ResponseFilterMode = 'all' | 'allow' | 'hide_all'; export type ResponseFilter = {mode?: ResponseFilterMode | undefined, filters?: Array | undefined, content_type?: 'application/json' | undefined}; export type WebhookToolApiSchemaConfigInput = {request_headers?: ({[key: string]: string | ConvAISecretLocator | ConvAIDynamicVariable | ConvAIEnvVarLocator}) | undefined, url: string, method?: ('GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE') | undefined, path_params_schema?: {[key: string]: LiteralJsonSchemaProperty} | undefined, query_params_schema?: (QueryParamsJsonSchemaInput | null) | undefined, request_body_schema?: (ObjectJsonSchemaPropertyInput | null) | undefined, response_body_schema?: (ObjectJsonSchemaPropertyInput | null) | undefined, response_filter?: (ResponseFilter | null) | undefined, content_type?: ('application/json' | 'application/x-www-form-urlencoded') | undefined, auth_resolved_params?: Array | undefined, auth_connection?: (AuthConnectionLocator | EnvironmentAuthConnectionLocator | null) | undefined}; export type WebhookToolConfigInput = {type?: 'webhook' | undefined, name: string, description: string, response_timeout_secs?: number | undefined, disable_interruptions?: boolean | undefined, interruption_mode?: ToolInterruptionMode | undefined, force_pre_tool_speech?: boolean | undefined, pre_tool_speech?: PreToolSpeechMode | undefined, assignments?: Array | undefined, tool_call_sound?: ('typing' | 'elevator1' | 'elevator2' | 'elevator3' | 'elevator4' | null) | undefined, tool_call_sound_behavior?: ToolCallSoundBehavior | undefined, tool_error_handling_mode?: ToolErrorHandlingMode | undefined, dynamic_variables?: DynamicVariablesConfig | undefined, execution_mode?: ToolExecutionMode | undefined, api_schema: WebhookToolApiSchemaConfigInput, follow_redirects?: boolean | undefined, follow_redirects_allowed_domains?: Array | undefined}; export type ClientToolConfigInput = {type?: 'client' | undefined, name: string, description: string, response_timeout_secs?: number | undefined, disable_interruptions?: boolean | undefined, interruption_mode?: ToolInterruptionMode | undefined, force_pre_tool_speech?: boolean | undefined, pre_tool_speech?: PreToolSpeechMode | undefined, assignments?: Array | undefined, tool_call_sound?: ('typing' | 'elevator1' | 'elevator2' | 'elevator3' | 'elevator4' | null) | undefined, tool_call_sound_behavior?: ToolCallSoundBehavior | undefined, tool_error_handling_mode?: ToolErrorHandlingMode | undefined, parameters?: (ObjectJsonSchemaPropertyInput | null) | undefined, expects_response?: boolean | undefined, dynamic_variables?: DynamicVariablesConfig | undefined, execution_mode?: ToolExecutionMode | undefined}; export type IntegrationType = 'mcp_server' | 'mcp_integration'; export type MCPApprovalPolicy = 'auto_approve_all' | 'require_approval_all' | 'require_approval_per_tool'; export type ConstantSchemaOverride = {source?: 'constant' | undefined, constant_value: string | number | number | boolean | Array | {[key: string]: unknown} | null}; export type DynamicVariableSchemaOverride = {source?: 'dynamic_variable' | undefined, dynamic_variable: string}; export type LLMSchemaOverride = {source?: 'llm' | undefined, prompt?: (string | null) | undefined}; export type OmitSchemaOverride = {source?: 'omit' | undefined}; export type MCPToolConfigInput = {type?: 'mcp' | undefined, name: string, description: string, response_timeout_secs?: number | undefined, disable_interruptions?: boolean | undefined, interruption_mode?: ToolInterruptionMode | undefined, force_pre_tool_speech?: boolean | undefined, pre_tool_speech?: PreToolSpeechMode | undefined, assignments?: Array | undefined, tool_call_sound?: ('typing' | 'elevator1' | 'elevator2' | 'elevator3' | 'elevator4' | null) | undefined, tool_call_sound_behavior?: ToolCallSoundBehavior | undefined, tool_error_handling_mode?: ToolErrorHandlingMode | undefined, integration_type: IntegrationType, parameters?: (ObjectJsonSchemaPropertyInput | null) | undefined, approval_policy?: MCPApprovalPolicy | undefined, mcp_tool_name: string, mcp_tool_description: string, mcp_server_id: string, mcp_server_name: string, mcp_input_schema?: ({[key: string]: unknown} | null) | undefined, execution_mode?: ToolExecutionMode | undefined, input_overrides?: ({[key: string]: ConstantSchemaOverride | DynamicVariableSchemaOverride | LLMSchemaOverride | OmitSchemaOverride} | null) | undefined}; export type ApiIntegrationWebhookOverrides = {schema_overrides?: ({[key: string]: ConstantSchemaOverride | DynamicVariableSchemaOverride | LLMSchemaOverride | OmitSchemaOverride} | null) | undefined, response_filter_mode?: (ResponseFilterMode | null) | undefined, response_filters?: (Array | null) | undefined, request_headers?: ({[key: string]: string | ConvAIDynamicVariable} | null) | undefined}; export type ApiIntegrationWebhookToolConfigInput = {type?: 'api_integration_webhook' | undefined, name: string, description: string, response_timeout_secs?: number | undefined, disable_interruptions?: boolean | undefined, interruption_mode?: ToolInterruptionMode | undefined, force_pre_tool_speech?: boolean | undefined, pre_tool_speech?: PreToolSpeechMode | undefined, assignments?: Array | undefined, tool_call_sound?: ('typing' | 'elevator1' | 'elevator2' | 'elevator3' | 'elevator4' | null) | undefined, tool_call_sound_behavior?: ToolCallSoundBehavior | undefined, tool_error_handling_mode?: ToolErrorHandlingMode | undefined, dynamic_variables?: DynamicVariablesConfig | undefined, execution_mode?: ToolExecutionMode | undefined, tool_version?: string | undefined, api_integration_id: string, api_integration_connection_id: string, api_schema_overrides?: (ApiIntegrationWebhookOverrides | null) | undefined}; export type SearchClientsParams = {smb_tool_type?: 'search_clients' | undefined}; export type SendCustomEmailParams = {smb_tool_type?: 'send_custom_email' | undefined}; export type ListClientsParams = {smb_tool_type?: 'list_clients' | undefined}; export type GetClientByPhoneParams = {smb_tool_type?: 'get_client_by_phone' | undefined}; export type CreateClientParams = {smb_tool_type?: 'create_client' | undefined}; export type UpdateClientParams = {smb_tool_type?: 'update_client' | undefined}; export type DeleteClientParams = {smb_tool_type?: 'delete_client' | undefined}; export type ListStaffParams = {list_kwargs?: {[key: string]: unknown} | undefined, smb_tool_type?: 'list_staff' | undefined}; export type CreateStaffParams = {smb_tool_type?: 'create_staff' | undefined, per_resource_timezones?: boolean | undefined}; export type UpdateStaffParams = {smb_tool_type?: 'update_staff' | undefined, per_resource_timezones?: boolean | undefined}; export type DeleteStaffParams = {smb_tool_type?: 'delete_staff' | undefined}; export type ListAssetsParams = {list_kwargs?: {[key: string]: unknown} | undefined, smb_tool_type?: 'list_assets' | undefined}; export type CreateAssetParams = {smb_tool_type?: 'create_asset' | undefined, per_resource_timezones?: boolean | undefined}; export type UpdateAssetParams = {smb_tool_type?: 'update_asset' | undefined, per_resource_timezones?: boolean | undefined}; export type DeleteAssetParams = {smb_tool_type?: 'delete_asset' | undefined}; export type ListServicesParams = {list_kwargs?: {[key: string]: unknown} | undefined, smb_tool_type?: 'list_services' | undefined}; export type CreateServiceParams = {smb_tool_type?: 'create_service' | undefined}; export type UpdateServiceParams = {smb_tool_type?: 'update_service' | undefined}; export type DeleteServiceParams = {smb_tool_type?: 'delete_service' | undefined}; export type ListProductsParams = {list_kwargs?: {[key: string]: unknown} | undefined, smb_tool_type?: 'list_products' | undefined}; export type CreateProductParams = {smb_tool_type?: 'create_product' | undefined}; export type UpdateProductParams = {smb_tool_type?: 'update_product' | undefined}; export type DeleteProductParams = {smb_tool_type?: 'delete_product' | undefined}; export type CheckServiceAvailabilityParams = {smb_tool_type?: 'check_service_availability' | undefined}; export type CreateClientAppointmentParams = {smb_tool_type?: 'create_client_appointment' | undefined}; export type GetClientAppointmentsParams = {include_cancelled?: boolean | undefined, smb_tool_type?: 'get_client_appointments' | undefined}; export type GetAppointmentByConfirmationNumberParams = {smb_tool_type?: 'get_appointment_by_confirmation_number' | undefined}; export type CreateOrderParams = {smb_tool_type?: 'create_order' | undefined}; export type GetOrderByConfirmationNumberParams = {smb_tool_type?: 'get_order_by_confirmation_number' | undefined}; export type GetClientOrdersParams = {smb_tool_type?: 'get_client_orders' | undefined, include_cancelled?: boolean | undefined}; export type UpdateOrderParams = {smb_tool_type?: 'update_order' | undefined}; export type CancelOrderParams = {smb_tool_type?: 'cancel_order' | undefined}; export type ListGroupSessionsParams = {smb_tool_type?: 'list_group_sessions' | undefined}; export type ScheduleGroupSessionParams = {smb_tool_type?: 'schedule_group_session' | undefined}; export type RegisterForGroupSessionParams = {smb_tool_type?: 'register_for_group_session' | undefined}; export type CancelGroupSessionRegistrationParams = {smb_tool_type?: 'cancel_group_session_registration' | undefined}; export type UpdateGroupSessionSeatsParams = {smb_tool_type?: 'update_group_session_seats' | undefined}; export type CancelGroupSessionForAllParams = {smb_tool_type?: 'cancel_group_session_for_all' | undefined}; export type DeleteGroupSessionParams = {smb_tool_type?: 'delete_group_session' | undefined}; export type ListCalendarEventsParams = {smb_tool_type?: 'list_calendar_events' | undefined, include_cancelled?: boolean | undefined}; export type UpdateCalendarEventParams = {smb_tool_type?: 'update_calendar_event' | undefined}; export type CancelCalendarEventParams = {smb_tool_type?: 'cancel_calendar_event' | undefined}; export type RestoreCalendarEventParams = {smb_tool_type?: 'restore_calendar_event' | undefined}; export type DeleteCalendarEventParams = {smb_tool_type?: 'delete_calendar_event' | undefined}; export type ListCustomerFacingAgentsParams = {smb_tool_type?: 'list_customer_facing_agents' | undefined}; export type GetAgentConfigParams = {smb_tool_type?: 'get_agent_config' | undefined}; export type ListAgentRulesParams = {smb_tool_type?: 'list_agent_rules' | undefined}; export type CreateAgentRuleParams = {smb_tool_type?: 'create_agent_rule' | undefined}; export type UpdateAgentRuleParams = {smb_tool_type?: 'update_agent_rule' | undefined}; export type DeleteAgentRuleParams = {smb_tool_type?: 'delete_agent_rule' | undefined}; export type ListTransferRulesParams = {smb_tool_type?: 'list_transfer_rules' | undefined}; export type CreateTransferRuleParams = {smb_tool_type?: 'create_transfer_rule' | undefined, post_dial_digits_enabled?: boolean | undefined}; export type UpdateTransferRuleParams = {smb_tool_type?: 'update_transfer_rule' | undefined, post_dial_digits_enabled?: boolean | undefined}; export type DeleteTransferRuleParams = {smb_tool_type?: 'delete_transfer_rule' | undefined}; export type ListAgentProceduresParams = {smb_tool_type?: 'list_agent_procedures' | undefined}; export type ListAgentReferencesParams = {smb_tool_type?: 'list_agent_references' | undefined}; export type CreateAgentProcedureParams = {smb_tool_type?: 'create_agent_procedure' | undefined}; export type UpdateAgentProcedureParams = {smb_tool_type?: 'update_agent_procedure' | undefined}; export type DeleteAgentProcedureParams = {smb_tool_type?: 'delete_agent_procedure' | undefined}; export type ListHolidaysParams = {smb_tool_type?: 'list_holidays' | undefined}; export type CreateHolidayParams = {smb_tool_type?: 'create_holiday' | undefined}; export type UpdateHolidayParams = {smb_tool_type?: 'update_holiday' | undefined}; export type DeleteHolidayParams = {smb_tool_type?: 'delete_holiday' | undefined}; export type GetScheduleParams = {smb_tool_type?: 'get_schedule' | undefined, include_location_filter?: boolean | undefined}; export type SubmitBusinessInfoParams = {smb_tool_type?: 'submit_business_info' | undefined}; export type UpdateBusinessInfoParams = {smb_tool_type?: 'update_business_info' | undefined}; export type UpdateAgentConfigParams = {smb_tool_type?: 'update_agent_config' | undefined}; export type GetAnalyticsSummaryParams = {smb_tool_type?: 'get_analytics_summary' | undefined}; export type GetWorkspacePlanParams = {smb_tool_type?: 'get_workspace_plan' | undefined}; export type GetBookingPageSettingsParams = {smb_tool_type?: 'get_booking_page_settings' | undefined}; export type UpdateBookingPageSettingsParams = {smb_tool_type?: 'update_booking_page_settings' | undefined}; export type UpdateBookingPageAppearanceParams = {smb_tool_type?: 'update_booking_page_appearance' | undefined}; export type GetBookingSlugStatusParams = {smb_tool_type?: 'get_booking_slug_status' | undefined}; export type SetBookingSlugParams = {smb_tool_type?: 'set_booking_slug' | undefined}; export type ListClientInteractionsParams = {smb_tool_type?: 'list_client_interactions' | undefined}; export type CreateClientInteractionParams = {smb_tool_type?: 'create_client_interaction' | undefined}; export type DeleteClientInteractionParams = {smb_tool_type?: 'delete_client_interaction' | undefined}; export type ListLocationsParams = {smb_tool_type?: 'list_locations' | undefined}; export type CreateLocationParams = {smb_tool_type?: 'create_location' | undefined}; export type UpdateLocationParams = {smb_tool_type?: 'update_location' | undefined}; export type DeleteLocationParams = {smb_tool_type?: 'delete_location' | undefined}; export type LeaveMessageParams = {smb_tool_type?: 'leave_message' | undefined}; export type CreateServiceQuoteRequestParams = {smb_tool_type?: 'create_service_quote_request' | undefined}; export type CreateProductQuoteRequestParams = {smb_tool_type?: 'create_product_quote_request' | undefined}; export type ReportKnowledgeGapParams = {smb_tool_type?: 'report_knowledge_gap' | undefined}; export type OptInSmsReminderParams = {smb_tool_type?: 'opt_in_sms_reminder' | undefined}; export type OptOutSmsReminderParams = {smb_tool_type?: 'opt_out_sms_reminder' | undefined}; export type TriggerUserVerificationParams = {smb_tool_type?: 'trigger_user_verification' | undefined}; export type ValidateUserVerificationCodeParams = {smb_tool_type?: 'validate_user_verification_code' | undefined}; export type OwnerListStaffParams = {list_kwargs?: {[key: string]: unknown} | undefined, smb_tool_type?: 'owner_list_staff' | undefined}; export type OwnerListAssetsParams = {list_kwargs?: {[key: string]: unknown} | undefined, smb_tool_type?: 'owner_list_assets' | undefined}; export type OwnerListLocationsParams = {smb_tool_type?: 'owner_list_locations' | undefined}; export type OwnerListServicesParams = {list_kwargs?: {[key: string]: unknown} | undefined, smb_tool_type?: 'owner_list_services' | undefined}; export type OwnerListProductsParams = {list_kwargs?: {[key: string]: unknown} | undefined, smb_tool_type?: 'owner_list_products' | undefined}; export type OwnerGetClientAppointmentsParams = {include_cancelled?: boolean | undefined, smb_tool_type?: 'owner_get_client_appointments' | undefined}; export type SMBToolConfig = {type?: 'smb' | undefined, name: string, description?: string | undefined, response_timeout_secs?: number | undefined, disable_interruptions?: boolean | undefined, interruption_mode?: ToolInterruptionMode | undefined, force_pre_tool_speech?: boolean | undefined, pre_tool_speech?: PreToolSpeechMode | undefined, assignments?: Array | undefined, tool_call_sound?: ('typing' | 'elevator1' | 'elevator2' | 'elevator3' | 'elevator4' | null) | undefined, tool_call_sound_behavior?: ToolCallSoundBehavior | undefined, tool_error_handling_mode?: ToolErrorHandlingMode | undefined, human_description?: string | undefined, enabled?: boolean | undefined, params: SearchClientsParams | SendCustomEmailParams | ListClientsParams | GetClientByPhoneParams | CreateClientParams | UpdateClientParams | DeleteClientParams | ListStaffParams | CreateStaffParams | UpdateStaffParams | DeleteStaffParams | ListAssetsParams | CreateAssetParams | UpdateAssetParams | DeleteAssetParams | ListServicesParams | CreateServiceParams | UpdateServiceParams | DeleteServiceParams | ListProductsParams | CreateProductParams | UpdateProductParams | DeleteProductParams | CheckServiceAvailabilityParams | CreateClientAppointmentParams | GetClientAppointmentsParams | GetAppointmentByConfirmationNumberParams | CreateOrderParams | GetOrderByConfirmationNumberParams | GetClientOrdersParams | UpdateOrderParams | CancelOrderParams | ListGroupSessionsParams | ScheduleGroupSessionParams | RegisterForGroupSessionParams | CancelGroupSessionRegistrationParams | UpdateGroupSessionSeatsParams | CancelGroupSessionForAllParams | DeleteGroupSessionParams | ListCalendarEventsParams | UpdateCalendarEventParams | CancelCalendarEventParams | RestoreCalendarEventParams | DeleteCalendarEventParams | ListCustomerFacingAgentsParams | GetAgentConfigParams | ListAgentRulesParams | CreateAgentRuleParams | UpdateAgentRuleParams | DeleteAgentRuleParams | ListTransferRulesParams | CreateTransferRuleParams | UpdateTransferRuleParams | DeleteTransferRuleParams | ListAgentProceduresParams | ListAgentReferencesParams | CreateAgentProcedureParams | UpdateAgentProcedureParams | DeleteAgentProcedureParams | ListHolidaysParams | CreateHolidayParams | UpdateHolidayParams | DeleteHolidayParams | GetScheduleParams | SubmitBusinessInfoParams | UpdateBusinessInfoParams | UpdateAgentConfigParams | GetAnalyticsSummaryParams | GetWorkspacePlanParams | GetBookingPageSettingsParams | UpdateBookingPageSettingsParams | UpdateBookingPageAppearanceParams | GetBookingSlugStatusParams | SetBookingSlugParams | ListClientInteractionsParams | CreateClientInteractionParams | DeleteClientInteractionParams | ListLocationsParams | CreateLocationParams | UpdateLocationParams | DeleteLocationParams | LeaveMessageParams | CreateServiceQuoteRequestParams | CreateProductQuoteRequestParams | ReportKnowledgeGapParams | OptInSmsReminderParams | OptOutSmsReminderParams | TriggerUserVerificationParams | ValidateUserVerificationCodeParams | OwnerListStaffParams | OwnerListAssetsParams | OwnerListLocationsParams | OwnerListServicesParams | OwnerListProductsParams | OwnerGetClientAppointmentsParams}; export type PromptAgentAPIModelInput = {prompt?: string | undefined, llm?: LLM | undefined, reasoning_effort?: ('none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | null) | undefined, service_tier?: LLMServiceTier | undefined, thinking_budget?: (number | null) | undefined, enable_reasoning_summary?: boolean | undefined, temperature?: (number | null) | undefined, max_tokens?: number | undefined, tool_ids?: Array | undefined, tool_ids_strict?: boolean | undefined, built_in_tools?: BuiltInToolsInput | undefined, enable_parallel_tool_calls?: boolean | undefined, mcp_server_ids?: Array | undefined, native_mcp_server_ids?: Array | undefined, knowledge_base?: Array | undefined, custom_llm?: (CustomLLM | null) | undefined, ignore_default_personality?: (boolean | null) | undefined, rag?: RagConfigInput | undefined, timezone?: (string | null) | undefined, backup_llm_config?: (BackupLLMDefault | BackupLLMDisabled | BackupLLMOverride) | undefined, cascade_timeout_seconds?: number | undefined, tools?: (Array) | undefined}; export type AgentConfigAPIModelInput = {first_message?: string | undefined, language?: string | undefined, hinglish_mode?: boolean | undefined, dynamic_variables?: DynamicVariablesConfig | undefined, disable_first_message_interruptions?: boolean | undefined, max_conversation_duration_message?: string | undefined, text_behavior_overrides?: ({[key: string]: BehaviorOverride} | null) | undefined, subagent_config?: SubagentConfigInput | undefined, prompt?: PromptAgentAPIModelInput | undefined}; export type ConversationalConfigAPIModelInput = {asr?: ASRConversationalConfig | undefined, turn?: TurnConfig | undefined, tts?: TTSConversationalConfigInput | undefined, conversation?: ConversationConfigInput | undefined, language_presets?: {[key: string]: LanguagePresetInput} | undefined, vad?: VADConfig | undefined, agent?: AgentConfigAPIModelInput | undefined}; export type AnalysisScope = 'conversation' | 'agent'; export type CriteriaScoringMode = 'binary' | 'numeric_uniform'; export type PromptEvaluationCriteria = {id: string, name: string, type?: 'prompt' | undefined, conversation_goal_prompt: string, use_knowledge_base?: boolean | undefined, scope?: AnalysisScope | undefined, llm?: (LLM | null) | undefined, scoring_mode?: CriteriaScoringMode | undefined, max_score?: number | undefined, score_instructions?: (string | null) | undefined}; export type EvaluationSettingsInput = {criteria?: Array | undefined}; export type EmbedVariant = 'tiny' | 'compact' | 'full' | 'expandable'; export type WidgetPlacement = 'top-left' | 'top' | 'top-right' | 'bottom-left' | 'bottom' | 'bottom-right'; export type WidgetExpandable = 'never' | 'mobile' | 'desktop' | 'always'; export type OrbAvatar = {type?: 'orb' | undefined, color_1?: string | undefined, color_2?: string | undefined}; export type URLAvatar = {type?: 'url' | undefined, custom_url?: string | undefined}; export type ImageAvatar = {type?: 'image' | undefined, url?: string | undefined}; export type WidgetFeedbackMode = 'none' | 'during' | 'end'; export type WidgetEndFeedbackType = 'rating'; export type WidgetEndFeedbackConfig = {type?: WidgetEndFeedbackType | undefined}; export type AllowlistItem = {hostname: string}; export type WidgetTextContents = {main_label?: (string | null) | undefined, start_call?: (string | null) | undefined, start_chat?: (string | null) | undefined, new_call?: (string | null) | undefined, end_call?: (string | null) | undefined, mute_microphone?: (string | null) | undefined, change_language?: (string | null) | undefined, collapse?: (string | null) | undefined, expand?: (string | null) | undefined, copied?: (string | null) | undefined, accept_terms?: (string | null) | undefined, dismiss_terms?: (string | null) | undefined, listening_status?: (string | null) | undefined, speaking_status?: (string | null) | undefined, connecting_status?: (string | null) | undefined, chatting_status?: (string | null) | undefined, queue_waiting_status?: (string | null) | undefined, queue_waiting_status_short?: (string | null) | undefined, input_label?: (string | null) | undefined, input_placeholder?: (string | null) | undefined, input_placeholder_text_only?: (string | null) | undefined, input_placeholder_new_conversation?: (string | null) | undefined, user_ended_conversation?: (string | null) | undefined, agent_ended_conversation?: (string | null) | undefined, conversation_id?: (string | null) | undefined, error_occurred?: (string | null) | undefined, queue_timed_out?: (string | null) | undefined, copy_id?: (string | null) | undefined, initiate_feedback?: (string | null) | undefined, request_follow_up_feedback?: (string | null) | undefined, thanks_for_feedback?: (string | null) | undefined, thanks_for_feedback_details?: (string | null) | undefined, follow_up_feedback_placeholder?: (string | null) | undefined, submit?: (string | null) | undefined, go_back?: (string | null) | undefined, send_message?: (string | null) | undefined, text_mode?: (string | null) | undefined, voice_mode?: (string | null) | undefined, switched_to_text_mode?: (string | null) | undefined, switched_to_voice_mode?: (string | null) | undefined, copy?: (string | null) | undefined, download?: (string | null) | undefined, wrap?: (string | null) | undefined, agent_working?: (string | null) | undefined, agent_done?: (string | null) | undefined, agent_error?: (string | null) | undefined, attach_file?: (string | null) | undefined, remove_file?: (string | null) | undefined, file_upload_error?: (string | null) | undefined, file_type_unsupported?: (string | null) | undefined, file_too_large?: (string | null) | undefined, file_limit_reached?: (string | null) | undefined, typing_indicator?: (string | null) | undefined, rich_content_unavailable?: (string | null) | undefined}; export type WidgetStyles = {base?: (string | null) | undefined, base_hover?: (string | null) | undefined, base_active?: (string | null) | undefined, base_border?: (string | null) | undefined, base_subtle?: (string | null) | undefined, base_primary?: (string | null) | undefined, base_error?: (string | null) | undefined, accent?: (string | null) | undefined, accent_hover?: (string | null) | undefined, accent_active?: (string | null) | undefined, accent_border?: (string | null) | undefined, accent_subtle?: (string | null) | undefined, accent_primary?: (string | null) | undefined, overlay_padding?: (number | null) | undefined, button_radius?: (number | null) | undefined, input_radius?: (number | null) | undefined, bubble_radius?: (number | null) | undefined, sheet_radius?: (number | null) | undefined, compact_sheet_radius?: (number | null) | undefined, dropdown_sheet_radius?: (number | null) | undefined}; export type WidgetTextContentsTranslation = {source?: {[key: string]: string} | undefined, text?: {[key: string]: string} | undefined}; export type WidgetTermsTranslation = {source_hash: string, text: string}; export type WidgetLanguagePreset = {text_contents?: (WidgetTextContents | null) | undefined, text_contents_translation?: (WidgetTextContentsTranslation | null) | undefined, terms_text?: (string | null) | undefined, terms_html?: (string | null) | undefined, terms_key?: (string | null) | undefined, terms_translation?: (WidgetTermsTranslation | null) | undefined}; export type WidgetConfigInput = {variant?: EmbedVariant | undefined, placement?: WidgetPlacement | undefined, expandable?: WidgetExpandable | undefined, avatar?: (OrbAvatar | URLAvatar | ImageAvatar) | undefined, feedback_mode?: WidgetFeedbackMode | undefined, end_feedback?: (WidgetEndFeedbackConfig | null) | undefined, bg_color?: string | undefined, text_color?: string | undefined, btn_color?: string | undefined, btn_text_color?: string | undefined, border_color?: string | undefined, focus_color?: string | undefined, border_radius?: (number | null) | undefined, btn_radius?: (number | null) | undefined, action_text?: (string | null) | undefined, start_call_text?: (string | null) | undefined, end_call_text?: (string | null) | undefined, expand_text?: (string | null) | undefined, listening_text?: (string | null) | undefined, speaking_text?: (string | null) | undefined, shareable_page_text?: (string | null) | undefined, shareable_page_show_terms?: boolean | undefined, terms_text?: (string | null) | undefined, terms_html?: (string | null) | undefined, terms_key?: (string | null) | undefined, show_avatar_when_collapsed?: (boolean | null) | undefined, disable_banner?: boolean | undefined, override_link?: (string | null) | undefined, markdown_link_allowed_hosts?: Array | undefined, markdown_link_include_www?: boolean | undefined, markdown_link_allow_http?: boolean | undefined, mic_muting_enabled?: boolean | undefined, transcript_enabled?: boolean | undefined, text_input_enabled?: boolean | undefined, conversation_mode_toggle_enabled?: boolean | undefined, default_expanded?: boolean | undefined, always_expanded?: boolean | undefined, dismissible?: boolean | undefined, show_agent_status?: boolean | undefined, show_conversation_id?: boolean | undefined, strip_audio_tags?: boolean | undefined, syntax_highlight_theme?: ('light' | 'dark' | null) | undefined, text_contents?: WidgetTextContents | undefined, styles?: WidgetStyles | undefined, show_resize_button?: boolean | undefined, end_confirmation_enabled?: boolean | undefined, mobile_fullscreen?: boolean | undefined, transcript_speech_sync_enabled?: boolean | undefined, language_selector?: boolean | undefined, supports_text_only?: boolean | undefined, custom_avatar_path?: (string | null) | undefined, language_presets?: {[key: string]: WidgetLanguagePreset} | undefined}; export type AnalysisProperty = {type: 'boolean' | 'string' | 'integer' | 'number', description?: string | undefined, enum?: (Array | null) | undefined, is_system_provided?: boolean | undefined, dynamic_variable?: string | undefined, allowed_values?: (AllowedValues | null) | undefined, allowed_values_dynamic_variable?: string | undefined, constant_value?: (string | number | number | boolean | null) | undefined, is_omitted?: boolean | undefined, name?: (string | null) | undefined, llm?: (LLM | null) | undefined}; export type AttachedUserEvaluationRef = {source: 'user', analysis_item_id: string, version_id?: string | undefined, additional_version_ids?: Array | undefined, scope?: AnalysisScope | undefined, weight?: (number | null) | undefined}; export type SystemEvaluationId = '__system_eval_criteria_sentiment' | '__system_eval_criteria_frustration'; export type AttachedSystemEvaluationRef = {source: 'system', analysis_item_id: SystemEvaluationId, scope?: AnalysisScope | undefined, weight?: (number | null) | undefined}; export type AttachedUserDataCollectionRef = {source: 'user', analysis_item_id: string, version_id?: string | undefined, scope?: AnalysisScope | undefined}; export type SystemDataCollectionId = '__system_data_collection_topic'; export type AttachedSystemDataCollectionRef = {source: 'system', analysis_item_id: SystemDataCollectionId, scope?: AnalysisScope | undefined}; export type AgentAnalysisItemsInput = {evaluation_criteria?: (Array) | undefined, data_collection?: (Array) | undefined}; export type ASRConversationalConfigOverrideConfig = {keywords?: boolean | undefined}; export type SoftTimeoutConfigOverrideConfig = {message?: boolean | undefined, additional_soft_timeout_messages?: boolean | undefined}; export type TurnConfigOverrideConfig = {soft_timeout_config?: SoftTimeoutConfigOverrideConfig | undefined, noisy_environment_message?: boolean | undefined}; export type TTSConversationalConfigOverrideConfig = {model_id?: boolean | undefined, voice_id?: boolean | undefined, supported_voices?: boolean | undefined, stability?: boolean | undefined, speed?: boolean | undefined, similarity_boost?: boolean | undefined, clone_strength?: boolean | undefined, pronunciation_dictionary_locators?: boolean | undefined}; export type ConversationConfigOverrideConfig = {text_only?: boolean | undefined, max_duration_seconds?: boolean | undefined}; export type PromptAgentAPIModelOverrideConfig = {prompt?: boolean | undefined, llm?: boolean | undefined, reasoning_effort?: boolean | undefined, tool_ids?: boolean | undefined, tool_ids_strict?: boolean | undefined, native_mcp_server_ids?: boolean | undefined, knowledge_base?: boolean | undefined}; export type AgentConfigOverrideConfig = {first_message?: boolean | undefined, language?: boolean | undefined, max_conversation_duration_message?: boolean | undefined, prompt?: PromptAgentAPIModelOverrideConfig | undefined}; export type ConversationConfigClientOverrideConfigInput = {asr?: ASRConversationalConfigOverrideConfig | undefined, turn?: TurnConfigOverrideConfig | undefined, tts?: TTSConversationalConfigOverrideConfig | undefined, conversation?: ConversationConfigOverrideConfig | undefined, agent?: AgentConfigOverrideConfig | undefined}; export type ConversationInitiationClientDataConfigInput = {conversation_config_override?: ConversationConfigClientOverrideConfigInput | undefined, custom_llm_extra_body?: boolean | undefined, enable_conversation_initiation_client_data_from_webhook?: boolean | undefined, enable_starting_workflow_node_id_from_client?: boolean | undefined, enable_procedure_ids_from_client?: boolean | undefined}; export type ConversationInitiationClientDataWebhook = {url: string, request_headers: {[key: string]: string | ConvAISecretLocator | ConvAIEnvVarLocator}}; export type WebhookEventType = 'transcript' | 'audio' | 'call_initiation_failure' | 'answering_machine_detection' | 'unredacted_transcript' | 'unredacted_audio'; export type WebhookTranscriptFormat = 'json' | 'opentelemetry'; export type ConvAIWebhooks = {post_call_webhook_id?: (string | null) | undefined, events?: Array | undefined, transcript_format?: WebhookTranscriptFormat | undefined, exclude_transcript?: boolean | undefined, send_audio?: (boolean | null) | undefined}; export type AgentWorkspaceOverridesInput = {conversation_initiation_client_data_webhook?: (ConversationInitiationClientDataWebhook | null) | undefined, webhooks?: ConvAIWebhooks | undefined}; export type AttachedTestModel = {test_id: string, workflow_node_id?: (string | null) | undefined}; export type AgentTestingSettings = {attached_tests?: Array | undefined}; export type FocusGuardrail = {is_enabled?: boolean | undefined}; export type PromptInjectionGuardrail = {is_enabled?: boolean | undefined}; export type GuardrailExecutionMode = 'streaming' | 'blocking'; export type ContentThresholdGuardrail = {is_enabled?: boolean | undefined, threshold?: (number | 'low' | 'medium' | 'high') | undefined}; export type ContentConfig = {sexual?: ContentThresholdGuardrail | undefined, violence?: ContentThresholdGuardrail | undefined, harassment?: ContentThresholdGuardrail | undefined, self_harm?: ContentThresholdGuardrail | undefined, profanity?: ContentThresholdGuardrail | undefined, religion_or_politics?: ContentThresholdGuardrail | undefined, medical_and_legal_information?: ContentThresholdGuardrail | undefined}; export type EndCallTriggerAction = {type?: 'end_call' | undefined}; export type RetryTriggerAction = {type?: 'retry' | undefined, feedback?: string | undefined}; export type ContentGuardrailInput = {execution_mode?: GuardrailExecutionMode | undefined, config?: ContentConfig | undefined, trigger_action?: (EndCallTriggerAction | RetryTriggerAction) | undefined}; export type ThresholdGuardrail = {is_enabled?: boolean | undefined, threshold?: number | undefined}; export type ModerationConfig = {sexual?: ThresholdGuardrail | undefined, violence?: ThresholdGuardrail | undefined, violence_graphic?: ThresholdGuardrail | undefined, harassment?: ThresholdGuardrail | undefined, harassment_threatening?: ThresholdGuardrail | undefined, hate?: ThresholdGuardrail | undefined, hate_threatening?: ThresholdGuardrail | undefined, self_harm_instructions?: ThresholdGuardrail | undefined, self_harm?: ThresholdGuardrail | undefined, self_harm_intent?: ThresholdGuardrail | undefined, sexual_minors?: ThresholdGuardrail | undefined}; export type CustomGuardrailConfig = {is_enabled?: boolean | undefined, name: string, prompt: string, execution_mode?: GuardrailExecutionMode | undefined, model?: ('gemini-2.5-flash-lite' | 'gemini-2.5-flash' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'claude-haiku-4-5' | 'claude-sonnet-4-6' | 'gpt-5.4-nano' | 'gpt-5.4-mini') | undefined, history_message_count?: number | undefined, history_include_tool_calls?: boolean | undefined, trigger_action?: (EndCallTriggerAction | RetryTriggerAction) | undefined, evaluate_full_response_only?: boolean | undefined}; export type CustomGuardrailsConfigInput = {configs?: Array | undefined}; export type CustomGuardrailInput = {config?: CustomGuardrailsConfigInput | undefined}; export type GuardrailsV1Input = {version?: '1' | undefined, focus?: FocusGuardrail | undefined, prompt_injection?: PromptInjectionGuardrail | undefined, content?: ContentGuardrailInput | undefined, moderation?: ({execution_mode?: GuardrailExecutionMode | undefined, config?: ModerationConfig | undefined} | null) | undefined, custom?: CustomGuardrailInput | undefined}; export type AuthSettings = {enable_auth?: boolean | undefined, allowlist?: Array | undefined, require_origin_header?: boolean | undefined, shareable_token?: (string | null) | undefined}; export type AgentCallLimits = {agent_concurrency_limit?: number | undefined, daily_limit?: number | undefined, bursting_enabled?: boolean | undefined}; export type AgentHoldAudioConfig = {audio_path: string, audio_url: string, original_filename: string, duration_secs: number, size_bytes: number}; export type AgentQueueingConfig = {enabled?: boolean | undefined, wait_timeout_seconds?: number | undefined, hold_audio?: (AgentHoldAudioConfig | null) | undefined}; export type ConfigEntityType = 'name' | 'name.name_given' | 'name.name_family' | 'name.name_other' | 'email_address' | 'contact_number' | 'dob' | 'age' | 'religious_belief' | 'political_opinion' | 'sexual_orientation' | 'ethnicity_race' | 'marital_status' | 'occupation' | 'physical_attribute' | 'language' | 'username' | 'password' | 'url' | 'organization' | 'financial_id' | 'financial_id.payment_card' | 'financial_id.payment_card.payment_card_number' | 'financial_id.payment_card.payment_card_expiration_date' | 'financial_id.payment_card.payment_card_cvv' | 'financial_id.bank_account' | 'financial_id.bank_account.bank_account_number' | 'financial_id.bank_account.bank_routing_number' | 'financial_id.bank_account.swift_bic_code' | 'financial_id.financial_id_other' | 'location' | 'location.location_address' | 'location.location_city' | 'location.location_postal_code' | 'location.location_coordinate' | 'location.location_state' | 'location.location_country' | 'location.location_other' | 'date' | 'date_interval' | 'unique_id' | 'unique_id.government_issued_id' | 'unique_id.account_number' | 'unique_id.vehicle_id' | 'unique_id.healthcare_number' | 'unique_id.healthcare_number.medical_record_number' | 'unique_id.healthcare_number.health_plan_beneficiary_number' | 'unique_id.device_id' | 'unique_id.unique_id_other' | 'medical' | 'medical.medical_condition' | 'medical.medication' | 'medical.medical_procedure' | 'medical.medical_measurement' | 'medical.medical_other'; export type ConversationHistoryRedactionConfig = {enabled?: boolean | undefined, entities?: Array | undefined, excluded_data_collection_ids?: Array | undefined}; export type PrivacyConfigInput = {record_voice?: boolean | undefined, retention_days?: number | undefined, delete_transcript_and_pii?: boolean | undefined, delete_audio?: boolean | undefined, apply_to_existing_conversations?: boolean | undefined, zero_retention_mode?: boolean | undefined, conversation_history_redaction?: ConversationHistoryRedactionConfig | undefined}; export type AgentTrustContext = 'unknown' | 'low' | 'high'; export type TopicDiscoverySettings = Record; export type SentimentAnalysisSettings = Record; export type AlertingMonitorConfig = {enabled?: (boolean | null) | undefined, threshold?: (number | null) | undefined, relative_increase_threshold?: (number | null) | undefined, min_failure_count?: (number | null) | undefined, min_history_bucket_count?: (number | null) | undefined, min_sample_count?: (number | null) | undefined, suspect_trigger_threshold?: (number | null) | undefined, auto_resolve_after_inactive_minutes?: (number | null) | undefined}; export type AlertingWebhookNotifier = {type?: 'webhook' | undefined, webhook_id: string}; export type AlertingPagerDutyNotifier = {type?: 'integration' | undefined, integration_type?: 'pagerduty' | undefined, connection_id: string}; export type AlertingSlackNotifier = {type?: 'integration' | undefined, integration_type?: 'slack' | undefined, connection_id: string, channel_id: string}; export type AlertingSettings = {monitor_configs?: {[key: string]: AlertingMonitorConfig} | undefined, auto_resolve_after_inactive_minutes?: (number | null) | undefined, notifiers?: (Array) | undefined}; export type AgentPlatformSettingsRequestModel = {evaluation?: EvaluationSettingsInput | undefined, widget?: WidgetConfigInput | undefined, data_collection?: {[key: string]: AnalysisProperty} | undefined, data_collection_scopes?: {[key: string]: AnalysisScope} | undefined, analysis_items?: (AgentAnalysisItemsInput | null) | undefined, overrides?: ConversationInitiationClientDataConfigInput | undefined, workspace_overrides?: AgentWorkspaceOverridesInput | undefined, testing?: AgentTestingSettings | undefined, archived?: boolean | undefined, guardrails?: GuardrailsV1Input | undefined, summary_language?: (string | null) | undefined, auto_translate_transcript_to_app_language?: (boolean | null) | undefined, auth?: AuthSettings | undefined, call_limits?: AgentCallLimits | undefined, queueing_config?: AgentQueueingConfig | undefined, privacy?: PrivacyConfigInput | undefined, trust_context?: AgentTrustContext | undefined, analysis_llm?: LLM | undefined, topic_discovery?: TopicDiscoverySettings | undefined, sentiment_analysis?: SentimentAnalysisSettings | undefined, alerting?: (AlertingSettings | null) | undefined}; export type WorkflowUnconditionalModelInput = {label?: (string | null) | undefined, type?: 'unconditional' | undefined}; export type WorkflowLLMConditionModelInput = {label?: (string | null) | undefined, type?: 'llm' | undefined, condition: string}; export type WorkflowResultConditionModelInput = {label?: (string | null) | undefined, type?: 'result' | undefined, successful: boolean}; export type ASTStringNodeInput = {type?: 'string_literal' | undefined, value: string}; export type ASTNumberNodeInput = {type?: 'number_literal' | undefined, value: number | number}; export type ASTBooleanNodeInput = {type?: 'boolean_literal' | undefined, value: boolean}; export type ASTNullNodeInput = {type?: 'null_literal' | undefined}; export type LLMLiteralJsonSchemaProperty = {type: 'boolean' | 'string' | 'integer' | 'number' | Array, description: string, enum?: (Array | null) | undefined}; export type ASTLLMNodeInput = {type?: 'llm' | undefined, value_schema: LLMLiteralJsonSchemaProperty} | {type?: 'llm' | undefined, prompt: string}; export type ASTDynamicVariableNodeInput = {type?: 'dynamic_variable' | undefined, name: string}; export type ASTOrOperatorNodeInput = {type?: 'or_operator' | undefined, children: Array}; export type ASTAndOperatorNodeInput = {type?: 'and_operator' | undefined, children: Array}; export type ASTEqualsOperatorNodeInput = {type?: 'eq_operator' | undefined, left: ASTNodeInput, right: ASTNodeInput}; export type ASTNotEqualsOperatorNodeInput = {type?: 'neq_operator' | undefined, left: ASTNodeInput, right: ASTNodeInput}; export type ASTGreaterThanOperatorNodeInput = {type?: 'gt_operator' | undefined, left: ASTNodeInput, right: ASTNodeInput}; export type ASTLessThanOperatorNodeInput = {type?: 'lt_operator' | undefined, left: ASTNodeInput, right: ASTNodeInput}; export type ASTGreaterThanOrEqualsOperatorNodeInput = {type?: 'gte_operator' | undefined, left: ASTNodeInput, right: ASTNodeInput}; export type ASTLessThanOrEqualsOperatorNodeInput = {type?: 'lte_operator' | undefined, left: ASTNodeInput, right: ASTNodeInput}; export type ASTAdditionOperatorNodeInput = {type?: 'add_operator' | undefined, left: ASTNodeInput, right: ASTNodeInput}; export type ASTSubtractionOperatorNodeInput = {type?: 'sub_operator' | undefined, left: ASTNodeInput, right: ASTNodeInput}; export type ASTMultiplicationOperatorNodeInput = {type?: 'mul_operator' | undefined, left: ASTNodeInput, right: ASTNodeInput}; export type ASTDivisionOperatorNodeInput = {type?: 'div_operator' | undefined, left: ASTNodeInput, right: ASTNodeInput}; export type ASTConditionalOperatorNodeInput = {type?: 'conditional_operator' | undefined, condition: ASTNodeInput, trueExpression: ASTNodeInput, falseExpression: ASTNodeInput}; export type ASTNodeInput = ASTStringNodeInput | ASTNumberNodeInput | ASTBooleanNodeInput | ASTNullNodeInput | ASTLLMNodeInput | ASTDynamicVariableNodeInput | ASTOrOperatorNodeInput | ASTAndOperatorNodeInput | ASTEqualsOperatorNodeInput | ASTNotEqualsOperatorNodeInput | ASTGreaterThanOperatorNodeInput | ASTLessThanOperatorNodeInput | ASTGreaterThanOrEqualsOperatorNodeInput | ASTLessThanOrEqualsOperatorNodeInput | ASTAdditionOperatorNodeInput | ASTSubtractionOperatorNodeInput | ASTMultiplicationOperatorNodeInput | ASTDivisionOperatorNodeInput | ASTConditionalOperatorNodeInput; export type WorkflowExpressionConditionModelInput = {label?: (string | null) | undefined, type?: 'expression' | undefined, expression: ASTNodeInput}; export type PositionInput = {x?: number | undefined, y?: number | undefined}; export type WorkflowEdgeModelInput = {source: string, target: string, forward_condition?: (WorkflowUnconditionalModelInput | WorkflowLLMConditionModelInput | WorkflowResultConditionModelInput | WorkflowExpressionConditionModelInput | null) | undefined, backward_condition?: (WorkflowUnconditionalModelInput | WorkflowLLMConditionModelInput | WorkflowResultConditionModelInput | WorkflowExpressionConditionModelInput | null) | undefined, reroutes?: Array | undefined}; export type WorkflowStartNodeModelInput = {type?: 'start' | undefined, position?: PositionInput | undefined, edge_order?: Array | undefined}; export type WorkflowEndNodeOutcome = 'success' | 'failure'; export type WorkflowEndNodeModelInput = {type?: 'end' | undefined, position?: PositionInput | undefined, edge_order?: Array | undefined, outcome?: WorkflowEndNodeOutcome | undefined}; export type WorkflowPhoneNumberNodeModelInput = {custom_sip_headers?: (Array) | undefined, transfer_destination: PhoneNumberTransferDestination | SIPUriTransferDestination | PhoneNumberDynamicVariableTransferDestination | SIPUriDynamicVariableTransferDestination, transfer_type?: TransferTypeEnum | undefined, sip_refer_play_dialtone?: boolean | undefined, uui?: (UUITransferConfig | null) | undefined, post_dial_digits?: (PostDialDigitsStatic | PostDialDigitsDynamicVariable | null) | undefined, type?: 'phone_number' | undefined, position?: PositionInput | undefined, edge_order?: Array | undefined, provider_configs?: (Array) | undefined}; export type ASRConversationalConfigWorkflowOverride = {quality?: (ASRQuality | null) | undefined, provider?: (ASRProvider | null) | undefined, user_input_audio_format?: (ASRInputFormat | null) | undefined, keywords?: (Array | null) | undefined}; export type SoftTimeoutConfigWorkflowOverride = {timeout_seconds?: (number | null) | undefined, message?: (string | null) | undefined, additional_soft_timeout_messages?: (Array | null) | undefined, use_llm_generated_message?: (boolean | null) | undefined, randomize_fillers?: (boolean | null) | undefined, max_soft_timeouts_per_generation?: (number | null) | undefined, llm_generated_message_prompt_override?: (string | null) | undefined, disable_until_first_user_message?: (boolean | null) | undefined}; export type TurnConfigWorkflowOverride = {turn_timeout?: (number | null) | undefined, initial_wait_time?: (number | null) | undefined, silence_end_call_timeout?: (number | null) | undefined, mode?: ('silence' | 'turn' | null) | undefined, turn_eagerness?: (TurnEagerness | null) | undefined, spelling_patience?: (SpellingPatience | null) | undefined, speculative_turn?: (boolean | null) | undefined, retranscribe_on_turn_timeout?: (boolean | null) | undefined, turn_model?: (TurnModel | null) | undefined, interruption_ignore_terms?: (Array | null) | undefined, interruption_ignore_term_languages?: (Array | null) | undefined, merge_with_default_ignore_terms?: (boolean | null) | undefined, transcribe_on_disabled_interruptions?: (boolean | null) | undefined, soft_timeout_config?: (SoftTimeoutConfigWorkflowOverride | null) | undefined, noisy_environment_message?: (string | null) | undefined}; export type TTSConversationalConfigWorkflowOverrideInput = {model_id?: ('eleven_turbo_v2' | 'eleven_turbo_v2_5' | 'eleven_flash_v2' | 'eleven_flash_v2_5' | 'eleven_multilingual_v2' | 'eleven_v3_conversational' | 'eleven_v4' | 'eleven_v4_turbo' | null) | undefined, voice_id?: (string | null) | undefined, supported_voices?: (Array | null) | undefined, expressive_mode?: (boolean | null) | undefined, suggested_audio_tags?: (Array | null) | undefined, agent_output_audio_format?: (TTSOutputFormat | null) | undefined, optimize_streaming_latency?: (TTSOptimizeStreamingLatency | null) | undefined, stability?: (number | null) | undefined, speed?: (number | null) | undefined, similarity_boost?: (number | null) | undefined, clone_strength?: (number | null) | undefined, text_normalisation_type?: (TextNormalisationType | null) | undefined, pronunciation_dictionary_locators?: (Array | null) | undefined, enable_phoneme_tags?: (boolean | null) | undefined, audio_effects?: (EffectsSpecInput | null) | undefined}; export type BackgroundSoundConfigWorkflowOverride = {source_type?: (BackgroundSoundSourceType | null) | undefined, source_id?: (BackgroundSoundPresetId | null) | undefined, volume?: (number | null) | undefined, crossfade_loop?: (boolean | null) | undefined}; export type ConversationConfigWorkflowOverrideInput = {text_only?: (boolean | null) | undefined, max_duration_seconds?: (number | null) | undefined, client_events?: (Array | null) | undefined, file_input?: ({enabled?: (boolean | null) | undefined, max_files_in_memory?: (number | null) | undefined, max_files_per_conversation?: (number | null) | undefined} | null) | undefined, monitoring_enabled?: (boolean | null) | undefined, monitoring_events?: (Array | null) | undefined, dtmf_input_settings?: (DTMFInputConfig | null) | undefined, background_sound?: (BackgroundSoundConfigWorkflowOverride | null) | undefined, source_attribution?: (boolean | null) | undefined}; export type VADConfigWorkflowOverride = {background_voice_detection?: (boolean | null) | undefined}; export type DynamicVariablesConfigWorkflowOverride = {dynamic_variable_placeholders?: ({[key: string]: unknown} | null) | undefined}; export type BuiltInToolsWorkflowOverrideInput = {transfer_to_agent?: (SystemToolConfigInput | null) | undefined, end_call?: (SystemToolConfigInput | null) | undefined, language_detection?: (SystemToolConfigInput | null) | undefined, transfer_to_number?: (SystemToolConfigInput | null) | undefined, skip_turn?: (SystemToolConfigInput | null) | undefined, play_keypad_touch_tone?: (SystemToolConfigInput | null) | undefined, voicemail_detection?: (SystemToolConfigInput | null) | undefined}; export type RagConfigWorkflowOverrideInput = {enabled?: (boolean | null) | undefined, embedding_model?: (EmbeddingModelEnum | null) | undefined, max_vector_distance?: (number | null) | undefined, max_documents_length?: (number | null) | undefined, max_retrieved_rag_chunks_count?: (number | null) | undefined, num_candidates?: (number | null) | undefined, query_rewrite_prompt_override?: (string | null) | undefined, knowledge_base_tool_info?: (KnowledgeBaseToolInfo | null) | undefined}; export type PromptAgentAPIModelWorkflowOverrideInput = {prompt?: (string | null) | undefined, llm?: ('gpt-4o-mini' | 'gpt-4o' | 'gpt-4' | 'gpt-4-turbo' | 'gpt-4.1' | 'gpt-4.1-mini' | 'gpt-4.1-nano' | 'gpt-5' | 'gpt-5.1' | 'gpt-5.2' | 'gpt-5.2-chat-latest' | 'gpt-5.4' | 'gpt-5.4-mini' | 'gpt-5.4-nano' | 'gpt-5.5' | 'gpt-5.6-sol' | 'gpt-5.6-terra' | 'gpt-5.6-luna' | 'gpt-6-astra' | 'gpt-6-sol' | 'gpt-6-luna' | 'gpt-6.1-sol' | 'gpt-6.1-terra' | 'gpt-5-mini' | 'gpt-5-nano' | 'gpt-3.5-turbo' | 'gemini-1.5-pro' | 'gemini-1.5-flash' | 'gemini-2.0-flash' | 'gemini-2.0-flash-lite' | 'gemini-2.5-flash-lite' | 'gemini-2.5-flash' | 'gemini-3-pro-preview' | 'gemini-3-flash-preview' | 'gemini-3.1-pro-preview' | 'gemini-3.1-flash-lite-preview' | 'gemini-3.1-flash-lite' | 'gemini-3.5-flash' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-4-argon' | 'claude-sonnet-4-5' | 'claude-opus-4-6' | 'claude-opus-4-7' | 'claude-opus-4-8' | 'claude-opus-5' | 'claude-opus-5-5' | 'claude-sonnet-4-6' | 'claude-sonnet-5' | 'claude-sonnet-5-5' | 'claude-sonnet-4' | 'claude-haiku-4-5' | 'claude-haiku-5-5' | 'claude-3-7-sonnet' | 'claude-3-5-sonnet' | 'claude-3-5-sonnet-v1' | 'claude-3-haiku' | 'grok-beta' | 'custom-llm' | 'qwen3-4b' | 'qwen3-30b-a3b' | 'qwen36-35b-a3b' | 'qwen35-397b-a17b' | 'gpt-oss-20b' | 'gpt-oss-120b' | 'glm-45-air-fp8' | 'glm-52' | 'deepseek-v41-flash' | 'nemotron-35-super-vl-nvfp4' | 'gemini-2.5-flash-preview-09-2025' | 'gemini-2.5-flash-lite-preview-09-2025' | 'gemini-2.5-flash-preview-05-20' | 'gemini-2.5-flash-preview-04-17' | 'gemini-2.5-flash-lite-preview-06-17' | 'gemini-2.0-flash-lite-001' | 'gemini-2.0-flash-001' | 'gemini-1.5-flash-002' | 'gemini-1.5-flash-001' | 'gemini-1.5-pro-002' | 'gemini-1.5-pro-001' | 'claude-sonnet-4@20250514' | 'claude-sonnet-4-5@20250929' | 'claude-haiku-4-5@20251001' | 'claude-3-7-sonnet@20250219' | 'claude-3-5-sonnet@20240620' | 'claude-3-5-sonnet-v2@20241022' | 'claude-3-haiku@20240307' | 'gpt-5-2025-08-07' | 'gpt-5.1-2025-11-13' | 'gpt-5.2-2025-12-11' | 'gpt-5.4-2026-03-05' | 'gpt-5.4-mini-2026-03-17' | 'gpt-5.4-nano-2026-03-17' | 'gpt-5.5-2026-04-23' | 'gpt-5-mini-2025-08-07' | 'gpt-5-nano-2025-08-07' | 'gpt-4.1-2025-04-14' | 'gpt-4.1-mini-2025-04-14' | 'gpt-4.1-nano-2025-04-14' | 'gpt-4o-mini-2024-07-18' | 'gpt-4o-2024-11-20' | 'gpt-4o-2024-08-06' | 'gpt-4o-2024-05-13' | 'gpt-4-0613' | 'gpt-4-0314' | 'gpt-4-turbo-2024-04-09' | 'gpt-3.5-turbo-0125' | 'gpt-3.5-turbo-1106' | 'watt-tool-8b' | 'watt-tool-70b' | null) | undefined, reasoning_effort?: ('none' | 'minimal' | 'low' | 'medium' | 'high' | 'xhigh' | 'max' | null) | undefined, service_tier?: (LLMServiceTier | null) | undefined, thinking_budget?: (number | null) | undefined, enable_reasoning_summary?: (boolean | null) | undefined, temperature?: (number | null) | undefined, max_tokens?: (number | null) | undefined, tool_ids?: (Array | null) | undefined, tool_ids_strict?: (boolean | null) | undefined, built_in_tools?: (BuiltInToolsWorkflowOverrideInput | null) | undefined, enable_parallel_tool_calls?: (boolean | null) | undefined, mcp_server_ids?: (Array | null) | undefined, native_mcp_server_ids?: (Array | null) | undefined, knowledge_base?: (Array | null) | undefined, custom_llm?: (CustomLLM | null) | undefined, ignore_default_personality?: (boolean | null) | undefined, rag?: (RagConfigWorkflowOverrideInput | null) | undefined, timezone?: (string | null) | undefined, backup_llm_config?: (BackupLLMDefault | BackupLLMDisabled | BackupLLMOverride | null) | undefined, cascade_timeout_seconds?: (number | null) | undefined, tools?: (Array | null) | undefined}; export type AgentConfigAPIModelWorkflowOverrideInput = {first_message?: (string | null) | undefined, language?: (string | null) | undefined, hinglish_mode?: (boolean | null) | undefined, dynamic_variables?: (DynamicVariablesConfigWorkflowOverride | null) | undefined, disable_first_message_interruptions?: (boolean | null) | undefined, max_conversation_duration_message?: (string | null) | undefined, text_behavior_overrides?: ({[key: string]: BehaviorOverride} | null) | undefined, prompt?: (PromptAgentAPIModelWorkflowOverrideInput | null) | undefined}; export type ConversationalConfigAPIModelWorkflowOverrideInput = {asr?: (ASRConversationalConfigWorkflowOverride | null) | undefined, turn?: (TurnConfigWorkflowOverride | null) | undefined, tts?: (TTSConversationalConfigWorkflowOverrideInput | null) | undefined, conversation?: (ConversationConfigWorkflowOverrideInput | null) | undefined, language_presets?: ({[key: string]: LanguagePresetInput} | null) | undefined, vad?: (VADConfigWorkflowOverride | null) | undefined, agent?: (AgentConfigAPIModelWorkflowOverrideInput | null) | undefined}; export type EntryBehavior = 'generate_immediately' | 'wait_for_user' | 'auto'; export type WorkflowOverrideAgentNodeModelInput = {type?: 'override_agent' | undefined, position?: PositionInput | undefined, edge_order?: Array | undefined, conversation_config?: ConversationalConfigAPIModelWorkflowOverrideInput | undefined, additional_prompt?: string | undefined, additional_knowledge_base?: Array | undefined, additional_tool_ids?: Array | undefined, label: string, entry_behavior?: EntryBehavior | undefined}; export type WorkflowStandaloneAgentNodeModelInput = {type?: 'standalone_agent' | undefined, position?: PositionInput | undefined, edge_order?: Array | undefined, agent_id?: (string | null) | undefined, branch_id?: (string | null) | undefined, node_id?: (string | null) | undefined, delay_ms?: number | undefined, transfer_message?: (string | null) | undefined, enable_transferred_agent_first_message?: boolean | undefined, preserve_client_tts_overrides?: boolean | undefined, preserve_voice_settings?: boolean | undefined}; export type WorkflowToolLocator = {tool_id: string, schema_overrides?: ({[key: string]: ConstantSchemaOverride | DynamicVariableSchemaOverride | LLMSchemaOverride | OmitSchemaOverride} | null) | undefined}; export type WorkflowToolNodeModelInput = {type?: 'tool' | undefined, position?: PositionInput | undefined, edge_order?: Array | undefined, tools?: Array | undefined}; export type AgentWorkflowRequestModel = {edges?: {[key: string]: WorkflowEdgeModelInput} | undefined, nodes?: ({[key: string]: WorkflowStartNodeModelInput | WorkflowEndNodeModelInput | WorkflowPhoneNumberNodeModelInput | WorkflowOverrideAgentNodeModelInput | WorkflowStandaloneAgentNodeModelInput | WorkflowToolNodeModelInput}) | undefined, prevent_subagent_loops?: boolean | undefined}; export type AdhocAgentConfigOverrideForTestRequestModel = {conversation_config: ConversationalConfigAPIModelInput, platform_settings: AgentPlatformSettingsRequestModel, workflow?: (AgentWorkflowRequestModel | null) | undefined}; export type RunAgentTestsRequestModel = {name?: (string | null) | undefined, tests: Array, agent_config_override?: (AdhocAgentConfigOverrideForTestRequestModel | null) | undefined, branch_id?: (string | null) | undefined, repeat_count?: number | undefined}; export type CreateApiV1ConvaiAgentsAgentIdRunTestsArgs = {agent_id: string, 'xi-api-key'?: (string | null) | undefined, body: RunAgentTestsRequestModel}; export type CreateApiV1ConvaiAgentsAgentIdRunTestsOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; export const bucketingStatus = z.enum(["pending", "completed", "failed"]); export const testRunStatus = z.enum(["pending", "passed", "failed", "cancelled"]); export const testRunResultBucket = z.object({test_run_ids: z.array(z.string()), title: z.string(), reason: z.string(), status: testRunStatus}); export const testRunResultSummary = z.object({test_id: z.string(), test_name: z.string(), workflow_node_id: z.string().nullable().optional(), buckets: z.array(testRunResultBucket)}); export const agentMetadata = z.object({agent_id: z.string(), branch_id: z.string().nullable().optional(), workflow_node_id: z.string().nullable().optional(), version_id: z.string().nullable().optional()}); export const conversationHistoryMultivoiceMessagePartModel = z.object({text: z.string(), voice_label: z.string().nullable(), time_in_call_secs: z.number().int().nullable()}); export const conversationHistoryMultivoiceMessageModel = z.object({parts: z.array(conversationHistoryMultivoiceMessagePartModel)}); export const toolType = z.enum(["system", "webhook", "client", "mcp", "workflow", "api_integration_webhook", "smb"]); export const conversationHistoryTranscriptToolCallWebhookDetails = z.object({type: z.literal("webhook").optional(), method: z.string(), url: z.string(), headers: z.record(z.string(), z.string()).optional(), path_params: z.record(z.string(), z.string()).optional(), query_params: z.record(z.string(), z.string()).optional(), body: z.string().nullable().optional()}); export const conversationHistoryTranscriptToolCallClientDetails = z.object({type: z.literal("client").optional(), parameters: z.string()}); export const conversationHistoryTranscriptToolCallMCPDetails = z.object({type: z.literal("mcp").optional(), mcp_server_id: z.string(), mcp_server_name: z.string(), integration_type: z.string(), parameters: z.record(z.string(), z.string()).optional(), approval_policy: z.string(), requires_approval: z.boolean().optional(), mcp_tool_name: z.string().optional(), mcp_tool_description: z.string().optional()}); export const conversationHistoryTranscriptToolCallApiIntegrationWebhookDetailsOutput = z.object({type: z.literal("api_integration_webhook"), integration_id: z.string(), credential_id: z.string(), integration_connection_id: z.string(), webhook_details: conversationHistoryTranscriptToolCallWebhookDetails}); export const conversationHistoryTranscriptToolCallCommonModelOutput = z.object({type: toolType.nullable().optional(), request_id: z.string(), tool_name: z.string(), tool_id: z.string().nullable().optional(), params_as_json: z.string(), tool_has_been_called: z.boolean(), tool_details: z.union([conversationHistoryTranscriptToolCallWebhookDetails, conversationHistoryTranscriptToolCallClientDetails, conversationHistoryTranscriptToolCallMCPDetails, conversationHistoryTranscriptToolCallApiIntegrationWebhookDetailsOutput]).nullable().optional()}); export const dynamicVariableUpdateCommonModel = z.object({variable_name: z.string(), old_value: z.string().nullable(), new_value: z.string(), updated_at: z.number(), tool_name: z.string(), tool_request_id: z.string()}); export const conversationHistoryTranscriptOtherToolsResultCommonModel = z.object({request_id: z.string(), tool_name: z.string(), tool_id: z.string().nullable().optional(), result_value: z.string(), is_error: z.boolean(), is_blocked: z.boolean().optional(), tool_has_been_called: z.boolean(), tool_latency_secs: z.number().optional(), error_type: z.string().optional(), raw_error_message: z.string().optional(), dynamic_variable_updates: z.array(dynamicVariableUpdateCommonModel).optional(), type: z.enum(["client", "webhook", "mcp", "code"]).nullable().optional()}); export const endCallToolResultModel = z.object({result_type: z.literal("end_call_success").optional(), status: z.literal("success").optional(), reason: z.string().nullable().optional(), message: z.string().nullable().optional()}); export const languageDetectionToolResultModel = z.object({result_type: z.literal("language_detection_success").optional(), status: z.literal("success").optional(), reason: z.string().nullable().optional(), language: z.string().nullable().optional()}); export const transferBranchInfoConfigured = z.object({branch_reason: z.literal("configured"), branch_id: z.string()}); export const transferBranchInfoTrafficSplit = z.object({branch_reason: z.literal("traffic_split"), branch_id: z.string(), traffic_percentage: z.number()}); export const transferBranchInfoDefaultingToMain = z.object({branch_reason: z.literal("defaulting_to_main"), branch_id: z.string()}); export const transferToAgentToolResultSuccessModelOutput = z.object({result_type: z.literal("transfer_to_agent_success").optional(), status: z.literal("success").optional(), from_agent: z.string(), to_agent: z.string(), to_node: z.string().nullable().optional(), condition: z.string(), delay_ms: z.number().int().optional(), transfer_message: z.string().nullable().optional(), enable_transferred_agent_first_message: z.boolean().optional(), branch_info: z.union([transferBranchInfoConfigured, transferBranchInfoTrafficSplit, transferBranchInfoDefaultingToMain]).nullable().optional(), preserve_client_tts_overrides: z.boolean().optional(), preserve_voice_settings: z.boolean().optional()}); export const transferToAgentToolResultErrorModel = z.object({result_type: z.literal("transfer_to_agent_error").optional(), status: z.literal("error").optional(), from_agent: z.string(), error: z.string()}); export const transferToNumberResultTwilioSuccessModel = z.object({result_type: z.literal("transfer_to_number_twilio_success").optional(), status: z.literal("success").optional(), transfer_number: z.string(), reason: z.string().nullable().optional(), client_message: z.string().nullable().optional(), agent_message: z.string(), conference_name: z.string(), post_dial_digits: z.string().nullable().optional(), note: z.string().nullable().optional()}); export const transferToNumberResultSipSuccessModel = z.object({result_type: z.literal("transfer_to_number_sip_success").optional(), status: z.literal("success").optional(), transfer_number: z.string(), reason: z.string().nullable().optional(), note: z.string().nullable().optional()}); export const transferToNumberResultExotelSuccessModel = z.object({result_type: z.literal("transfer_to_number_exotel_success").optional(), status: z.literal("success").optional(), transfer_number: z.string(), reason: z.string().nullable().optional(), agent_message: z.string().nullable().optional(), note: z.string().nullable().optional()}); export const transferToNumberResultAmazonConnectSuccessModel = z.object({result_type: z.literal("transfer_to_number_amazon_connect_success").optional(), status: z.literal("success").optional(), reason: z.string().nullable().optional(), client_message: z.string().nullable().optional(), note: z.string().nullable().optional()}); export const transferToNumberResultErrorModel = z.object({result_type: z.literal("transfer_to_number_error").optional(), status: z.literal("error").optional(), error: z.string(), details: z.string().nullable().optional()}); export const skipTurnToolResponseModel = z.object({result_type: z.literal("skip_turn_success").optional(), status: z.literal("success").optional(), reason: z.string().nullable().optional()}); export const playDTMFResultSuccessModel = z.object({result_type: z.literal("play_dtmf_success").optional(), status: z.literal("success").optional(), dtmf_tones: z.string(), reason: z.string().nullable().optional()}); export const playDTMFResultErrorModel = z.object({result_type: z.literal("play_dtmf_error").optional(), status: z.literal("error").optional(), error: z.string(), details: z.string().nullable().optional()}); export const voiceMailDetectionResultSuccessModel = z.object({result_type: z.literal("voicemail_detection_success").optional(), status: z.literal("success").optional(), voicemail_message: z.string().nullable().optional(), reason: z.string().nullable().optional()}); export const testToolResultModel = z.object({result_type: z.literal("testing_tool_result").optional(), status: z.literal("success").optional(), reason: z.string().optional(), to_agent: z.string().nullable().optional(), to_node: z.string().nullable().optional()}); export const knowledgeBaseRagToolStatus = z.enum(["success", "no_documents", "no_results"]); export const knowledgeBaseRagChunkModel = z.object({chunk_id: z.string(), document_id: z.string(), content: z.string()}); export const knowledgeBaseRagToolResultModel = z.object({result_type: z.literal("knowledge_base_rag_success").optional(), status: knowledgeBaseRagToolStatus.optional(), chunk_count: z.number().int().optional(), message: z.string().optional(), chunks: z.array(knowledgeBaseRagChunkModel).optional()}); export const knowledgeBaseToolStatus = z.enum(["success", "no_matching_documents", "no_results"]); export const knowledgeBaseToolResultModel = z.object({result_type: z.literal("knowledge_base_success").optional(), status: knowledgeBaseToolStatus.optional(), chunk_count: z.number().int().optional(), message: z.string().optional()}); export const startProcedureToolResultSuccessModel = z.object({result_type: z.literal("start_procedure_success").optional(), status: z.literal("success").optional(), procedure_id: z.string(), procedure_name: z.string(), procedure_entry_workflow_node: z.string().nullable().optional(), procedure_return_workflow_node: z.string().nullable().optional(), message: z.string().optional()}); export const startProcedureToolErrorStatus = z.enum(["not_found", "invalid_name", "already_active"]); export const startProcedureToolResultErrorModel = z.object({result_type: z.literal("start_procedure_error").optional(), status: startProcedureToolErrorStatus, procedure_id: z.string().nullable().optional(), message: z.string()}); export const endProcedureToolResultSuccessModel = z.object({result_type: z.literal("end_procedure_success").optional(), status: z.literal("success").optional(), procedure_id: z.string(), procedure_name: z.string(), message: z.string().optional()}); export const endProcedureToolErrorStatus = z.enum(["not_found", "invalid_id"]); export const endProcedureToolResultErrorModel = z.object({result_type: z.literal("end_procedure_error").optional(), status: endProcedureToolErrorStatus, procedure_id: z.string().nullable().optional(), message: z.string()}); export const dummyToolResultModel = z.object({result_type: z.literal("dummy").optional()}); export const conversationHistoryTranscriptSystemToolResultCommonModelOutput = z.object({request_id: z.string(), tool_name: z.string(), tool_id: z.string().nullable().optional(), result_value: z.string(), is_error: z.boolean(), is_blocked: z.boolean().optional(), tool_has_been_called: z.boolean(), tool_latency_secs: z.number().optional(), error_type: z.string().optional(), raw_error_message: z.string().optional(), dynamic_variable_updates: z.array(dynamicVariableUpdateCommonModel).optional(), type: z.literal("system"), result: z.union([endCallToolResultModel, languageDetectionToolResultModel, transferToAgentToolResultSuccessModelOutput, transferToAgentToolResultErrorModel, transferToNumberResultTwilioSuccessModel, transferToNumberResultSipSuccessModel, transferToNumberResultExotelSuccessModel, transferToNumberResultAmazonConnectSuccessModel, transferToNumberResultErrorModel, skipTurnToolResponseModel, playDTMFResultSuccessModel, playDTMFResultErrorModel, voiceMailDetectionResultSuccessModel, testToolResultModel, knowledgeBaseRagToolResultModel, knowledgeBaseToolResultModel, startProcedureToolResultSuccessModel, startProcedureToolResultErrorModel, endProcedureToolResultSuccessModel, endProcedureToolResultErrorModel, dummyToolResultModel]).nullable().optional()}); export const conversationHistoryTranscriptApiIntegrationWebhookToolsResultCommonModelOutput = z.object({request_id: z.string(), tool_name: z.string(), tool_id: z.string().nullable(), result_value: z.string(), is_error: z.boolean(), is_blocked: z.boolean(), tool_has_been_called: z.boolean(), tool_latency_secs: z.number(), error_type: z.string(), raw_error_message: z.string(), dynamic_variable_updates: z.array(dynamicVariableUpdateCommonModel), type: z.literal("api_integration_webhook"), integration_id: z.string(), credential_id: z.string(), integration_connection_id: z.string()}); export const workflowToolEdgeStepModel = z.object({step_latency_secs: z.number(), type: z.literal("edge").optional(), edge_id: z.string(), target_node_id: z.string()}); export const workflowToolNestedToolsStepModelOutput = z.object({step_latency_secs: z.number(), type: z.literal("nested_tools").optional(), node_id: z.string(), requests: z.array(conversationHistoryTranscriptToolCallCommonModelOutput), results: z.array(z.union([conversationHistoryTranscriptOtherToolsResultCommonModel, conversationHistoryTranscriptSystemToolResultCommonModelOutput, conversationHistoryTranscriptApiIntegrationWebhookToolsResultCommonModelOutput, z.lazy(() => conversationHistoryTranscriptWorkflowToolsResultCommonModelOutput)])), is_successful: z.boolean()}); export const workflowToolMaxIterationsExceededStepModel = z.object({step_latency_secs: z.number(), type: z.literal("max_iterations_exceeded").optional(), max_iterations: z.number().int()}); export const workflowToolResponseModelOutput = z.object({steps: z.array(z.discriminatedUnion("type", [workflowToolEdgeStepModel, workflowToolNestedToolsStepModelOutput, workflowToolMaxIterationsExceededStepModel])).optional()}); export const conversationHistoryTranscriptWorkflowToolsResultCommonModelOutput: z.ZodType = z.object({request_id: z.string(), tool_name: z.string(), tool_id: z.string().nullable().optional(), result_value: z.string(), is_error: z.boolean(), is_blocked: z.boolean().optional(), tool_has_been_called: z.boolean(), tool_latency_secs: z.number().optional(), error_type: z.string().optional(), raw_error_message: z.string().optional(), dynamic_variable_updates: z.array(dynamicVariableUpdateCommonModel).optional(), type: z.literal("workflow"), result: workflowToolResponseModelOutput.nullable().optional()}); export const userFeedbackScore = z.enum(["like", "dislike"]); export const userFeedback = z.object({score: userFeedbackScore, time_in_call_secs: z.number().int()}); export const metricRecord = z.object({elapsed_time: z.number()}); export const conversationTurnMetrics = z.object({metrics: z.record(z.string(), metricRecord).optional(), convai_asr_provider: z.string().nullable().optional(), convai_tts_model: z.string().nullable().optional(), convai_tts_cascade: z.string().nullable().optional(), voice_id: z.string().nullable().optional()}); export const ragChunkMetadata = z.object({document_id: z.string(), chunk_id: z.string(), vector_distance: z.number()}); export const embeddingModelEnum = z.enum(["e5_mistral_7b_instruct", "multilingual_e5_large_instruct"]); export const ragRetrievalInfo = z.object({chunks: z.array(ragChunkMetadata), embedding_model: embeddingModelEnum, retrieval_query: z.string(), rag_latency_secs: z.number(), used_chunk_ids: z.array(z.string()).optional()}); export const lLMTokensCategoryUsage = z.object({tokens: z.number().int().optional(), price: z.number().optional()}); export const lLMInputOutputTokensUsage = z.object({input: lLMTokensCategoryUsage.optional(), input_cache_read: lLMTokensCategoryUsage.optional(), input_cache_write: lLMTokensCategoryUsage.optional(), output_total: lLMTokensCategoryUsage.optional()}); export const lLMUsageOutput = z.object({model_usage: z.record(z.string(), lLMInputOutputTokensUsage).optional()}); export const transcriptPlatformEvent = z.enum(["user_turn_timeout", "skip_turn_wait_elapsed"]); export const conversationReasoningModel = z.object({summary: z.string().nullable().optional(), provider_redact: z.boolean().optional()}); export const chatSourceMedium = z.enum(["audio", "dtmf", "text", "image", "file"]); export const guardrailType = z.enum(["custom", "prompt_injection", "self_harm_intent", "violence_graphic", "sexual", "violence", "harassment", "sexual_minors", "self_harm", "self_harm_instructions", "harassment_threatening", "hate", "hate_threatening", "profanity", "religion_or_politics", "medical_and_legal", "guardrail"]); export const guardrailExecutionMode = z.enum(["streaming", "blocking"]); export const guardrailLLMVerdict = z.object({type: z.literal("llm").optional(), rationale: z.string()}); export const guardrailClassifierVerdict = z.object({type: z.literal("classifier").optional(), score: z.number(), threshold: z.number()}); export const guardrailUnknownVerdict = z.object({type: z.literal("unknown").optional()}); export const triggeredGuardrailCommonModel = z.object({guardrail_type: guardrailType, guardrail_name: z.string().nullable().optional(), execution_mode: guardrailExecutionMode.nullable().optional(), guardrail_details: z.union([guardrailLLMVerdict, guardrailClassifierVerdict, guardrailUnknownVerdict]).nullable().optional()}); export const conversationHistoryTranscriptCommonModelOutput = z.object({role: z.enum(["user", "agent"]), agent_metadata: agentMetadata.nullable().optional(), message: z.string().nullable().optional(), multivoice_message: conversationHistoryMultivoiceMessageModel.nullable().optional(), tool_calls: z.array(conversationHistoryTranscriptToolCallCommonModelOutput).optional(), tool_results: z.array(z.union([conversationHistoryTranscriptOtherToolsResultCommonModel, conversationHistoryTranscriptSystemToolResultCommonModelOutput, conversationHistoryTranscriptApiIntegrationWebhookToolsResultCommonModelOutput, conversationHistoryTranscriptWorkflowToolsResultCommonModelOutput])).optional(), feedback: userFeedback.nullable().optional(), llm_override: z.string().nullable().optional(), producing_llm: z.string().nullable().optional(), time_in_call_secs: z.number().int(), conversation_turn_metrics: conversationTurnMetrics.nullable().optional(), rag_retrieval_info: ragRetrievalInfo.nullable().optional(), llm_usage: lLMUsageOutput.nullable().optional(), interrupted: z.boolean().optional(), ignored_as_backchannel: z.boolean().optional(), platform_event: transcriptPlatformEvent.nullable().optional(), original_message: z.string().nullable().optional(), reasoning: z.array(conversationReasoningModel).optional(), source_medium: chatSourceMedium.nullable().optional(), source_event_id: z.number().int().nullable().optional(), used_static_kb_document_ids: z.array(z.string()).optional(), user_identifier: z.string().nullable().optional(), id: z.string().nullable().optional(), created_at_unix_ms: z.number().int().nullable().optional(), triggered_guardrails: z.array(triggeredGuardrailCommonModel).optional()}); export const testFromConversationMetadataOutput = z.object({conversation_id: z.string(), agent_id: z.string(), branch_id: z.string().nullable().optional(), workflow_node_id: z.string().nullable().optional(), original_agent_reply: z.array(conversationHistoryTranscriptCommonModelOutput).optional()}); export const conversationInitiationSource = z.enum(["unknown", "android_sdk", "node_js_sdk", "react_native_sdk", "react_sdk", "js_sdk", "python_sdk", "widget", "sip_trunk", "twilio", "exotel", "genesys", "avaya", "audiocodes", "swift_sdk", "whatsapp", "twilio_sms", "flutter_sdk", "zendesk_integration", "slack_integration", "telegram_integration", "intercom_integration", "freshdesk_integration", "salesforce_integration", "template_preview", "genesys_bot_connector", "subagent_tool"]); export const agentSuccessfulResponseExample = z.object({response: z.string(), type: z.literal("success")}); export const agentFailureResponseExample = z.object({response: z.string(), type: z.literal("failure")}); export const responseUnitTestModel = z.object({from_conversation_metadata: testFromConversationMetadataOutput.nullable().optional(), dynamic_variables: z.record(z.string(), z.unknown()).optional(), chat_history: z.array(conversationHistoryTranscriptCommonModelOutput).optional(), conversation_initiation_source: conversationInitiationSource.nullable().optional(), environment: z.string().nullable().optional(), type: z.literal("llm").optional(), success_condition: z.string().optional(), success_examples: z.array(agentSuccessfulResponseExample).optional(), failure_examples: z.array(agentFailureResponseExample).optional()}); export const lLMParameterEvaluationStrategy = z.object({type: z.literal("llm"), description: z.string()}); export const regexParameterEvaluationStrategy = z.object({type: z.literal("regex"), pattern: z.string()}); export const exactParameterEvaluationStrategy = z.object({type: z.literal("exact"), expected_value: z.string()}); export const matchAnythingParameterEvaluationStrategy = z.object({type: z.literal("anything")}); export const unitTestToolCallParameter = z.object({eval: z.discriminatedUnion("type", [lLMParameterEvaluationStrategy, regexParameterEvaluationStrategy, exactParameterEvaluationStrategy, matchAnythingParameterEvaluationStrategy]), path: z.string()}); export const referencedToolCommonModel = z.object({id: z.string(), type: z.enum(["system", "webhook", "client", "workflow", "api_integration_webhook", "mcp", "code"])}); export const unitTestWorkflowNodeTransitionEvaluationNodeId = z.object({type: z.literal("node_id").optional(), agent_id: z.string(), target_node_id: z.string()}); export const unitTestGuardrailTriggerEvaluationModel = z.object({type: z.literal("any").optional()}); export const unitTestToolCallEvaluationModelOutput = z.object({parameters: z.array(unitTestToolCallParameter).optional(), referenced_tool: referencedToolCommonModel.nullable().optional(), verify_absence: z.boolean().optional(), workflow_node_transition: unitTestWorkflowNodeTransitionEvaluationNodeId.nullable().optional(), guardrail_trigger: unitTestGuardrailTriggerEvaluationModel.nullable().optional()}); export const toolCallUnitTestModel = z.object({from_conversation_metadata: testFromConversationMetadataOutput.nullable().optional(), dynamic_variables: z.record(z.string(), z.unknown()).optional(), chat_history: z.array(conversationHistoryTranscriptCommonModelOutput).optional(), conversation_initiation_source: conversationInitiationSource.nullable().optional(), environment: z.string().nullable().optional(), type: z.literal("tool").optional(), tool_call_parameters: unitTestToolCallEvaluationModelOutput.nullable().optional(), check_any_tool_matches: z.boolean().nullable().optional()}); export const mockingStrategy = z.enum(["all", "selected", "none"]); export const mockNoMatchBehavior = z.enum(["call_real_tool", "raise_error"]); export const simulationToolMockBehaviorConfig = z.object({mocking_strategy: mockingStrategy.optional(), fallback_strategy: mockNoMatchBehavior.optional(), mocked_tool_ids: z.array(z.string()).optional()}); export const toolResponseMockConfigOutput = z.object({parameter_conditions: z.array(unitTestToolCallParameter).optional(), mock_result: z.string(), is_error: z.boolean().optional()}); export const lLM = z.enum(["gpt-4o-mini", "gpt-4o", "gpt-4", "gpt-4-turbo", "gpt-4.1", "gpt-4.1-mini", "gpt-4.1-nano", "gpt-5", "gpt-5.1", "gpt-5.2", "gpt-5.2-chat-latest", "gpt-5.4", "gpt-5.4-mini", "gpt-5.4-nano", "gpt-5.5", "gpt-5.6-sol", "gpt-5.6-terra", "gpt-5.6-luna", "gpt-6-astra", "gpt-6-sol", "gpt-6-luna", "gpt-6.1-sol", "gpt-6.1-terra", "gpt-5-mini", "gpt-5-nano", "gpt-3.5-turbo", "gemini-1.5-pro", "gemini-1.5-flash", "gemini-2.0-flash", "gemini-2.0-flash-lite", "gemini-2.5-flash-lite", "gemini-2.5-flash", "gemini-3-pro-preview", "gemini-3-flash-preview", "gemini-3.1-pro-preview", "gemini-3.1-flash-lite-preview", "gemini-3.1-flash-lite", "gemini-3.5-flash", "gemini-3.5-flash-lite", "gemini-3.6-flash", "gemini-3.7-flash", "gemini-3.8-flash", "gemini-4-argon", "claude-sonnet-4-5", "claude-opus-4-6", "claude-opus-4-7", "claude-opus-4-8", "claude-opus-5", "claude-opus-5-5", "claude-sonnet-4-6", "claude-sonnet-5", "claude-sonnet-5-5", "claude-sonnet-4", "claude-haiku-4-5", "claude-haiku-5-5", "claude-3-7-sonnet", "claude-3-5-sonnet", "claude-3-5-sonnet-v1", "claude-3-haiku", "grok-beta", "custom-llm", "qwen3-4b", "qwen3-30b-a3b", "qwen36-35b-a3b", "qwen35-397b-a17b", "gpt-oss-20b", "gpt-oss-120b", "glm-45-air-fp8", "glm-52", "deepseek-v41-flash", "nemotron-35-super-vl-nvfp4", "gemini-2.5-flash-preview-09-2025", "gemini-2.5-flash-lite-preview-09-2025", "gemini-2.5-flash-preview-05-20", "gemini-2.5-flash-preview-04-17", "gemini-2.5-flash-lite-preview-06-17", "gemini-2.0-flash-lite-001", "gemini-2.0-flash-001", "gemini-1.5-flash-002", "gemini-1.5-flash-001", "gemini-1.5-pro-002", "gemini-1.5-pro-001", "claude-sonnet-4@20250514", "claude-sonnet-4-5@20250929", "claude-haiku-4-5@20251001", "claude-3-7-sonnet@20250219", "claude-3-5-sonnet@20240620", "claude-3-5-sonnet-v2@20241022", "claude-3-haiku@20240307", "gpt-5-2025-08-07", "gpt-5.1-2025-11-13", "gpt-5.2-2025-12-11", "gpt-5.4-2026-03-05", "gpt-5.4-mini-2026-03-17", "gpt-5.4-nano-2026-03-17", "gpt-5.5-2026-04-23", "gpt-5-mini-2025-08-07", "gpt-5-nano-2025-08-07", "gpt-4.1-2025-04-14", "gpt-4.1-mini-2025-04-14", "gpt-4.1-nano-2025-04-14", "gpt-4o-mini-2024-07-18", "gpt-4o-2024-11-20", "gpt-4o-2024-08-06", "gpt-4o-2024-05-13", "gpt-4-0613", "gpt-4-0314", "gpt-4-turbo-2024-04-09", "gpt-3.5-turbo-0125", "gpt-3.5-turbo-1106", "watt-tool-8b", "watt-tool-70b"]); export const simulationTestModel = z.object({from_conversation_metadata: testFromConversationMetadataOutput.nullable().optional(), dynamic_variables: z.record(z.string(), z.unknown()).optional(), chat_history: z.array(conversationHistoryTranscriptCommonModelOutput).optional(), conversation_initiation_source: conversationInitiationSource.nullable().optional(), environment: z.string().nullable().optional(), type: z.literal("simulation").optional(), success_condition: z.string().nullable().optional(), success_conditions: z.array(z.string()).optional(), simulation_scenario: z.string().optional(), simulation_max_turns: z.number().int().gte(1).lte(50).optional(), simulation_environment: z.string().nullable().optional(), tool_mock_config: simulationToolMockBehaviorConfig.optional(), tool_mock_overrides: z.record(z.string(), z.array(toolResponseMockConfigOutput)).optional(), evaluation_model: lLM.nullable().optional(), simulated_user_model: lLM.nullable().optional()}); export const evaluationSuccessResult = z.enum(["success", "failure", "unknown"]); export const testConditionRationaleCommonModel = z.object({messages: z.array(z.string()).optional(), summary: z.string().optional()}); export const testConditionResultCommonModel = z.object({result: evaluationSuccessResult, rationale: testConditionRationaleCommonModel.nullable().optional()}); export const testRunMetadata = z.object({workspace_id: z.string(), test_name: z.string(), ran_by_user_email: z.string(), test_type: z.enum(["llm", "tool_call", "simulation"]).optional()}); export const lLMCategoryUsage = z.object({irreversible_generation: lLMUsageOutput.optional(), initiated_generation: lLMUsageOutput.optional()}); export const platformCategoryUsage = z.object({credits: z.number().int().optional(), price: z.number().optional(), quantity: z.number().optional()}); export const platformUsage = z.object({category_usage: z.record(z.string(), platformCategoryUsage).optional()}); export const conversationVoiceUsageModel = z.object({voice_id: z.string(), audio_output_seconds: z.number().optional()}); export const conversationTTSUsageModel = z.object({primary_tts_model: z.string().nullable().optional(), total_audio_output_seconds: z.number().optional(), total_characters: z.number().int().optional(), per_voice_usage: z.array(conversationVoiceUsageModel).optional()}); export const conversationASRUsageModel = z.object({asr_model: z.string().nullable().optional(), total_transcription_calls: z.number().int().optional(), total_audio_input_seconds: z.number().optional()}); export const analysisRunningTotal = z.object({price: z.number().optional(), charge: z.number().int().optional(), runs: z.number().int().optional(), price_per_feature: z.record(z.string(), z.number()).optional(), charge_per_feature: z.record(z.string(), z.number().int()).optional()}); export const analysisRunSnapshot = z.object({price: z.number().optional(), charge: z.number().int().optional(), price_per_feature: z.record(z.string(), z.number()).optional(), charge_per_feature: z.record(z.string(), z.number().int()).optional()}); export const analysisCharging = z.object({total: analysisRunningTotal, last_run: analysisRunSnapshot}); export const conversationChargingCommonModel = z.object({dev_discount: z.boolean().optional(), is_burst: z.boolean().optional(), tier: z.string().nullable().optional(), llm_usage: lLMCategoryUsage.optional(), llm_price: z.number().nullable().optional(), llm_charge: z.number().int().nullable().optional(), call_charge: z.number().int().nullable().optional(), platform_charge: z.number().int().nullable().optional(), platform_usage: platformUsage.optional(), platform_price: z.number().nullable().optional(), free_minutes_consumed: z.number().optional(), free_llm_dollars_consumed: z.number().optional(), tts_usage: conversationTTSUsageModel.nullable().optional(), asr_usage: conversationASRUsageModel.nullable().optional(), analysis: analysisCharging.nullable().optional(), voice_surcharge_charge: z.number().int().nullable().optional()}); export const unitTestRunResponseModel = z.object({test_run_id: z.string(), test_info: z.union([responseUnitTestModel, toolCallUnitTestModel, simulationTestModel]).nullable().optional(), test_invocation_id: z.string(), agent_id: z.string(), branch_id: z.string().nullable().optional(), version_id: z.string().nullable().optional(), ran_against_draft: z.boolean().optional(), workflow_node_id: z.string().nullable().optional(), status: testRunStatus, agent_responses: z.array(conversationHistoryTranscriptCommonModelOutput).nullable().optional(), triggered_guardrails: z.array(triggeredGuardrailCommonModel).optional(), test_id: z.string(), test_name: z.string().optional(), condition_result: testConditionResultCommonModel.nullable().optional(), last_updated_at_unix: z.number().int().optional(), metadata: testRunMetadata.nullable().optional(), root_folder_id: z.string().nullable().optional(), root_folder_name: z.string().nullable().optional(), environment: z.string().nullable().optional(), credits_used: z.number().int().nullable().optional(), charging: conversationChargingCommonModel.nullable().optional()}); export const getTestSuiteInvocationResponseModel = z.object({id: z.string(), name: z.string().nullable().optional(), agent_id: z.string().nullable().optional(), branch_id: z.string().nullable().optional(), version_id: z.string().nullable().optional(), ran_against_draft: z.boolean().optional(), created_at: z.number().int().optional(), folder_id: z.string().nullable().optional(), repeat_count: z.number().int().optional(), cancelled: z.boolean().optional(), bucketing_status: bucketingStatus.nullable().optional(), result_groups: z.array(testRunResultSummary).optional(), test_runs: z.array(unitTestRunResponseModel)}); export const validateResponse = async ( schema: { readonly '~standard': { readonly validate: (value: unknown) => ({ readonly value: Output; readonly issues?: undefined } | { readonly issues: ReadonlyArray<{ readonly message: string; readonly path?: ReadonlyArray | undefined }> }) | Promise<{ readonly value: Output; readonly issues?: undefined } | { readonly issues: ReadonlyArray<{ readonly message: string; readonly path?: ReadonlyArray | undefined }> }> } }, value: unknown ): Promise => { const result = await schema['~standard'].validate(value) if (result.issues !== undefined) { const detail = result.issues .map(({ message, path }) => path?.length ? `${path.map((segment) => String(typeof segment === 'object' ? segment.key : segment)).join('.')}: ${message}` : message ) .join('; ') throw new Error(`Response does not match the schema: ${detail}`, { cause: { issues: result.issues } }) } return result.value }; /** * Run Tests On The Agent * * POST /v1/convai/agents/{agent_id}/run-tests */ export const createApiV1ConvaiAgentsAgentIdRunTests = async (args: CreateApiV1ConvaiAgentsAgentIdRunTestsArgs, options: CreateApiV1ConvaiAgentsAgentIdRunTestsOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "application/json") if (args['xi-api-key'] != null) headers.set("xi-api-key", String(args['xi-api-key'])) const url = `${baseUrl.replace(/\/+$/, '')}/v1/convai/agents/${encodeURIComponent(String(args.agent_id))}/run-tests${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return validateResponse(getTestSuiteInvocationResponseModel, await res.json()) };