# This file was auto-generated by Fern from our API Definition.

# isort: skip_file

import typing
from importlib import import_module

if typing.TYPE_CHECKING:
    from .types import (
        AssistantEnd,
        AssistantInput,
        AssistantMessage,
        AssistantProsody,
        AudioConfiguration,
        AudioInput,
        AudioOutput,
        BuiltInTool,
        BuiltinToolConfig,
        ChatMessage,
        ChatMessageToolResult,
        ChatMetadata,
        ConnectSessionSettings,
        ConnectSessionSettingsAudio,
        ConnectSessionSettingsContext,
        ConnectSessionSettingsVariablesValue,
        Context,
        ContextType,
        ControlPlanePublishEvent,
        EmotionScores,
        Encoding,
        ErrorLevel,
        ErrorResponse,
        HttpValidationError,
        Inference,
        JsonMessage,
        LanguageModelType,
        MillisecondInterval,
        ModelProviderEnum,
        PauseAssistantMessage,
        PostedBuiltinTool,
        PostedBuiltinToolName,
        PostedConfigPromptSpec,
        PostedEllmModel,
        PostedEventMessageSpec,
        PostedEventMessageSpecs,
        PostedLanguageModel,
        PostedNudgeSpec,
        PostedTimeoutSpec,
        PostedTimeoutSpecs,
        PostedTimeoutSpecsInactivity,
        PostedTimeoutSpecsMaxDuration,
        PostedUserDefinedToolSpec,
        PostedWebhookEventType,
        PostedWebhookSpec,
        ProsodyInference,
        ResumeAssistantMessage,
        ReturnBuiltinTool,
        ReturnBuiltinToolToolType,
        ReturnChat,
        ReturnChatAudioReconstruction,
        ReturnChatAudioReconstructionStatus,
        ReturnChatEvent,
        ReturnChatEventRole,
        ReturnChatEventType,
        ReturnChatGroup,
        ReturnChatGroupPagedAudioReconstructions,
        ReturnChatGroupPagedAudioReconstructionsPaginationDirection,
        ReturnChatGroupPagedChats,
        ReturnChatGroupPagedChatsPaginationDirection,
        ReturnChatGroupPagedEvents,
        ReturnChatGroupPagedEventsPaginationDirection,
        ReturnChatPagedEvents,
        ReturnChatPagedEventsPaginationDirection,
        ReturnChatPagedEventsStatus,
        ReturnChatStatus,
        ReturnConfig,
        ReturnConfigSpec,
        ReturnEllmModel,
        ReturnEventMessageSpec,
        ReturnEventMessageSpecs,
        ReturnLanguageModel,
        ReturnNudgeSpec,
        ReturnPagedChatGroups,
        ReturnPagedChatGroupsPaginationDirection,
        ReturnPagedChats,
        ReturnPagedChatsPaginationDirection,
        ReturnPagedConfigs,
        ReturnPagedPrompts,
        ReturnPagedUserDefinedTools,
        ReturnPrompt,
        ReturnPromptVersionType,
        ReturnTimeoutSpec,
        ReturnTimeoutSpecs,
        ReturnUserDefinedTool,
        ReturnUserDefinedToolToolType,
        ReturnUserDefinedToolVersionType,
        ReturnVoice,
        ReturnWebhookEventType,
        ReturnWebhookSpec,
        Role,
        SessionSettings,
        SessionSettingsVariablesValue,
        SubscribeEvent,
        Tool,
        ToolCallMessage,
        ToolErrorMessage,
        ToolResponseMessage,
        ToolType,
        UserInput,
        UserInterruption,
        UserMessage,
        ValidationError,
        ValidationErrorLocItem,
        VoiceId,
        VoiceName,
        VoiceProvider,
        VoiceRef,
        WebSocketError,
        WebhookEvent,
        WebhookEventBase,
        WebhookEventChatEnded,
        WebhookEventChatStartType,
        WebhookEventChatStarted,
        WebhookEventChatStatus,
        WebhookEventToolCall,
    )
    from .errors import BadRequestError, UnprocessableEntityError
    from . import chat, chat_groups, chats, configs, control_plane, prompts, tools
    from .chat import PublishEvent
_dynamic_imports: typing.Dict[str, str] = {
    "AssistantEnd": ".types",
    "AssistantInput": ".types",
    "AssistantMessage": ".types",
    "AssistantProsody": ".types",
    "AudioConfiguration": ".types",
    "AudioInput": ".types",
    "AudioOutput": ".types",
    "BadRequestError": ".errors",
    "BuiltInTool": ".types",
    "BuiltinToolConfig": ".types",
    "ChatMessage": ".types",
    "ChatMessageToolResult": ".types",
    "ChatMetadata": ".types",
    "ConnectSessionSettings": ".types",
    "ConnectSessionSettingsAudio": ".types",
    "ConnectSessionSettingsContext": ".types",
    "ConnectSessionSettingsVariablesValue": ".types",
    "Context": ".types",
    "ContextType": ".types",
    "ControlPlanePublishEvent": ".types",
    "EmotionScores": ".types",
    "Encoding": ".types",
    "ErrorLevel": ".types",
    "ErrorResponse": ".types",
    "HttpValidationError": ".types",
    "Inference": ".types",
    "JsonMessage": ".types",
    "LanguageModelType": ".types",
    "MillisecondInterval": ".types",
    "ModelProviderEnum": ".types",
    "PauseAssistantMessage": ".types",
    "PostedBuiltinTool": ".types",
    "PostedBuiltinToolName": ".types",
    "PostedConfigPromptSpec": ".types",
    "PostedEllmModel": ".types",
    "PostedEventMessageSpec": ".types",
    "PostedEventMessageSpecs": ".types",
    "PostedLanguageModel": ".types",
    "PostedNudgeSpec": ".types",
    "PostedTimeoutSpec": ".types",
    "PostedTimeoutSpecs": ".types",
    "PostedTimeoutSpecsInactivity": ".types",
    "PostedTimeoutSpecsMaxDuration": ".types",
    "PostedUserDefinedToolSpec": ".types",
    "PostedWebhookEventType": ".types",
    "PostedWebhookSpec": ".types",
    "ProsodyInference": ".types",
    "PublishEvent": ".chat",
    "ResumeAssistantMessage": ".types",
    "ReturnBuiltinTool": ".types",
    "ReturnBuiltinToolToolType": ".types",
    "ReturnChat": ".types",
    "ReturnChatAudioReconstruction": ".types",
    "ReturnChatAudioReconstructionStatus": ".types",
    "ReturnChatEvent": ".types",
    "ReturnChatEventRole": ".types",
    "ReturnChatEventType": ".types",
    "ReturnChatGroup": ".types",
    "ReturnChatGroupPagedAudioReconstructions": ".types",
    "ReturnChatGroupPagedAudioReconstructionsPaginationDirection": ".types",
    "ReturnChatGroupPagedChats": ".types",
    "ReturnChatGroupPagedChatsPaginationDirection": ".types",
    "ReturnChatGroupPagedEvents": ".types",
    "ReturnChatGroupPagedEventsPaginationDirection": ".types",
    "ReturnChatPagedEvents": ".types",
    "ReturnChatPagedEventsPaginationDirection": ".types",
    "ReturnChatPagedEventsStatus": ".types",
    "ReturnChatStatus": ".types",
    "ReturnConfig": ".types",
    "ReturnConfigSpec": ".types",
    "ReturnEllmModel": ".types",
    "ReturnEventMessageSpec": ".types",
    "ReturnEventMessageSpecs": ".types",
    "ReturnLanguageModel": ".types",
    "ReturnNudgeSpec": ".types",
    "ReturnPagedChatGroups": ".types",
    "ReturnPagedChatGroupsPaginationDirection": ".types",
    "ReturnPagedChats": ".types",
    "ReturnPagedChatsPaginationDirection": ".types",
    "ReturnPagedConfigs": ".types",
    "ReturnPagedPrompts": ".types",
    "ReturnPagedUserDefinedTools": ".types",
    "ReturnPrompt": ".types",
    "ReturnPromptVersionType": ".types",
    "ReturnTimeoutSpec": ".types",
    "ReturnTimeoutSpecs": ".types",
    "ReturnUserDefinedTool": ".types",
    "ReturnUserDefinedToolToolType": ".types",
    "ReturnUserDefinedToolVersionType": ".types",
    "ReturnVoice": ".types",
    "ReturnWebhookEventType": ".types",
    "ReturnWebhookSpec": ".types",
    "Role": ".types",
    "SessionSettings": ".types",
    "SessionSettingsVariablesValue": ".types",
    "SubscribeEvent": ".types",
    "Tool": ".types",
    "ToolCallMessage": ".types",
    "ToolErrorMessage": ".types",
    "ToolResponseMessage": ".types",
    "ToolType": ".types",
    "UnprocessableEntityError": ".errors",
    "UserInput": ".types",
    "UserInterruption": ".types",
    "UserMessage": ".types",
    "ValidationError": ".types",
    "ValidationErrorLocItem": ".types",
    "VoiceId": ".types",
    "VoiceName": ".types",
    "VoiceProvider": ".types",
    "VoiceRef": ".types",
    "WebSocketError": ".types",
    "WebhookEvent": ".types",
    "WebhookEventBase": ".types",
    "WebhookEventChatEnded": ".types",
    "WebhookEventChatStartType": ".types",
    "WebhookEventChatStarted": ".types",
    "WebhookEventChatStatus": ".types",
    "WebhookEventToolCall": ".types",
    "chat": ".chat",
    "chat_groups": ".chat_groups",
    "chats": ".chats",
    "configs": ".configs",
    "control_plane": ".control_plane",
    "prompts": ".prompts",
    "tools": ".tools",
}


def __getattr__(attr_name: str) -> typing.Any:
    module_name = _dynamic_imports.get(attr_name)
    if module_name is None:
        raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
    try:
        module = import_module(module_name, __package__)
        if module_name == f".{attr_name}":
            return module
        else:
            return getattr(module, attr_name)
    except ImportError as e:
        raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
    except AttributeError as e:
        raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e


def __dir__():
    lazy_attrs = list(_dynamic_imports.keys())
    return sorted(lazy_attrs)


__all__ = [
    "AssistantEnd",
    "AssistantInput",
    "AssistantMessage",
    "AssistantProsody",
    "AudioConfiguration",
    "AudioInput",
    "AudioOutput",
    "BadRequestError",
    "BuiltInTool",
    "BuiltinToolConfig",
    "ChatMessage",
    "ChatMessageToolResult",
    "ChatMetadata",
    "ConnectSessionSettings",
    "ConnectSessionSettingsAudio",
    "ConnectSessionSettingsContext",
    "ConnectSessionSettingsVariablesValue",
    "Context",
    "ContextType",
    "ControlPlanePublishEvent",
    "EmotionScores",
    "Encoding",
    "ErrorLevel",
    "ErrorResponse",
    "HttpValidationError",
    "Inference",
    "JsonMessage",
    "LanguageModelType",
    "MillisecondInterval",
    "ModelProviderEnum",
    "PauseAssistantMessage",
    "PostedBuiltinTool",
    "PostedBuiltinToolName",
    "PostedConfigPromptSpec",
    "PostedEllmModel",
    "PostedEventMessageSpec",
    "PostedEventMessageSpecs",
    "PostedLanguageModel",
    "PostedNudgeSpec",
    "PostedTimeoutSpec",
    "PostedTimeoutSpecs",
    "PostedTimeoutSpecsInactivity",
    "PostedTimeoutSpecsMaxDuration",
    "PostedUserDefinedToolSpec",
    "PostedWebhookEventType",
    "PostedWebhookSpec",
    "ProsodyInference",
    "PublishEvent",
    "ResumeAssistantMessage",
    "ReturnBuiltinTool",
    "ReturnBuiltinToolToolType",
    "ReturnChat",
    "ReturnChatAudioReconstruction",
    "ReturnChatAudioReconstructionStatus",
    "ReturnChatEvent",
    "ReturnChatEventRole",
    "ReturnChatEventType",
    "ReturnChatGroup",
    "ReturnChatGroupPagedAudioReconstructions",
    "ReturnChatGroupPagedAudioReconstructionsPaginationDirection",
    "ReturnChatGroupPagedChats",
    "ReturnChatGroupPagedChatsPaginationDirection",
    "ReturnChatGroupPagedEvents",
    "ReturnChatGroupPagedEventsPaginationDirection",
    "ReturnChatPagedEvents",
    "ReturnChatPagedEventsPaginationDirection",
    "ReturnChatPagedEventsStatus",
    "ReturnChatStatus",
    "ReturnConfig",
    "ReturnConfigSpec",
    "ReturnEllmModel",
    "ReturnEventMessageSpec",
    "ReturnEventMessageSpecs",
    "ReturnLanguageModel",
    "ReturnNudgeSpec",
    "ReturnPagedChatGroups",
    "ReturnPagedChatGroupsPaginationDirection",
    "ReturnPagedChats",
    "ReturnPagedChatsPaginationDirection",
    "ReturnPagedConfigs",
    "ReturnPagedPrompts",
    "ReturnPagedUserDefinedTools",
    "ReturnPrompt",
    "ReturnPromptVersionType",
    "ReturnTimeoutSpec",
    "ReturnTimeoutSpecs",
    "ReturnUserDefinedTool",
    "ReturnUserDefinedToolToolType",
    "ReturnUserDefinedToolVersionType",
    "ReturnVoice",
    "ReturnWebhookEventType",
    "ReturnWebhookSpec",
    "Role",
    "SessionSettings",
    "SessionSettingsVariablesValue",
    "SubscribeEvent",
    "Tool",
    "ToolCallMessage",
    "ToolErrorMessage",
    "ToolResponseMessage",
    "ToolType",
    "UnprocessableEntityError",
    "UserInput",
    "UserInterruption",
    "UserMessage",
    "ValidationError",
    "ValidationErrorLocItem",
    "VoiceId",
    "VoiceName",
    "VoiceProvider",
    "VoiceRef",
    "WebSocketError",
    "WebhookEvent",
    "WebhookEventBase",
    "WebhookEventChatEnded",
    "WebhookEventChatStartType",
    "WebhookEventChatStarted",
    "WebhookEventChatStatus",
    "WebhookEventToolCall",
    "chat",
    "chat_groups",
    "chats",
    "configs",
    "control_plane",
    "prompts",
    "tools",
]
