# 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 (
        BytesGenerationRequest,
        CancellationRequest,
        Chunk,
        ContextfulChunk,
        ContextfulGenerationRequest,
        Done,
        GenerationRequest,
        OutputFormat,
        Response,
        Response_Chunk,
        Response_Done,
        Response_Error,
        ServerSentEvent,
        ServerSentEvent_Chunk,
        ServerSentEvent_Error,
        StreamingEncoding,
        StreamingError,
        StreamingGenerationRequest,
        StreamingOutputFormat,
        Voice,
    )
    from .requests import (
        BytesGenerationRequestParams,
        CancellationRequestParams,
        ChunkParams,
        ContextfulChunkParams,
        ContextfulGenerationRequestParams,
        DoneParams,
        GenerationRequestParams,
        OutputFormatParams,
        ResponseParams,
        Response_ChunkParams,
        Response_DoneParams,
        Response_ErrorParams,
        ServerSentEventParams,
        ServerSentEvent_ChunkParams,
        ServerSentEvent_ErrorParams,
        StreamingErrorParams,
        StreamingGenerationRequestParams,
        StreamingOutputFormatParams,
        VoiceParams,
    )
_dynamic_imports: typing.Dict[str, str] = {
    "BytesGenerationRequest": ".types",
    "BytesGenerationRequestParams": ".requests",
    "CancellationRequest": ".types",
    "CancellationRequestParams": ".requests",
    "Chunk": ".types",
    "ChunkParams": ".requests",
    "ContextfulChunk": ".types",
    "ContextfulChunkParams": ".requests",
    "ContextfulGenerationRequest": ".types",
    "ContextfulGenerationRequestParams": ".requests",
    "Done": ".types",
    "DoneParams": ".requests",
    "GenerationRequest": ".types",
    "GenerationRequestParams": ".requests",
    "OutputFormat": ".types",
    "OutputFormatParams": ".requests",
    "Response": ".types",
    "ResponseParams": ".requests",
    "Response_Chunk": ".types",
    "Response_ChunkParams": ".requests",
    "Response_Done": ".types",
    "Response_DoneParams": ".requests",
    "Response_Error": ".types",
    "Response_ErrorParams": ".requests",
    "ServerSentEvent": ".types",
    "ServerSentEventParams": ".requests",
    "ServerSentEvent_Chunk": ".types",
    "ServerSentEvent_ChunkParams": ".requests",
    "ServerSentEvent_Error": ".types",
    "ServerSentEvent_ErrorParams": ".requests",
    "StreamingEncoding": ".types",
    "StreamingError": ".types",
    "StreamingErrorParams": ".requests",
    "StreamingGenerationRequest": ".types",
    "StreamingGenerationRequestParams": ".requests",
    "StreamingOutputFormat": ".types",
    "StreamingOutputFormatParams": ".requests",
    "Voice": ".types",
    "VoiceParams": ".requests",
}


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__ = [
    "BytesGenerationRequest",
    "BytesGenerationRequestParams",
    "CancellationRequest",
    "CancellationRequestParams",
    "Chunk",
    "ChunkParams",
    "ContextfulChunk",
    "ContextfulChunkParams",
    "ContextfulGenerationRequest",
    "ContextfulGenerationRequestParams",
    "Done",
    "DoneParams",
    "GenerationRequest",
    "GenerationRequestParams",
    "OutputFormat",
    "OutputFormatParams",
    "Response",
    "ResponseParams",
    "Response_Chunk",
    "Response_ChunkParams",
    "Response_Done",
    "Response_DoneParams",
    "Response_Error",
    "Response_ErrorParams",
    "ServerSentEvent",
    "ServerSentEventParams",
    "ServerSentEvent_Chunk",
    "ServerSentEvent_ChunkParams",
    "ServerSentEvent_Error",
    "ServerSentEvent_ErrorParams",
    "StreamingEncoding",
    "StreamingError",
    "StreamingErrorParams",
    "StreamingGenerationRequest",
    "StreamingGenerationRequestParams",
    "StreamingOutputFormat",
    "StreamingOutputFormatParams",
    "Voice",
    "VoiceParams",
]
