# 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 .bytes_generation_request import BytesGenerationRequest
    from .cancellation_request import CancellationRequest
    from .chunk import Chunk
    from .contextful_chunk import ContextfulChunk
    from .contextful_generation_request import ContextfulGenerationRequest
    from .done import Done
    from .generation_request import GenerationRequest
    from .output_format import OutputFormat
    from .response import Response, Response_Chunk, Response_Done, Response_Error
    from .server_sent_event import ServerSentEvent, ServerSentEvent_Chunk, ServerSentEvent_Error
    from .streaming_encoding import StreamingEncoding
    from .streaming_error import StreamingError
    from .streaming_generation_request import StreamingGenerationRequest
    from .streaming_output_format import StreamingOutputFormat
    from .voice import Voice
_dynamic_imports: typing.Dict[str, str] = {
    "BytesGenerationRequest": ".bytes_generation_request",
    "CancellationRequest": ".cancellation_request",
    "Chunk": ".chunk",
    "ContextfulChunk": ".contextful_chunk",
    "ContextfulGenerationRequest": ".contextful_generation_request",
    "Done": ".done",
    "GenerationRequest": ".generation_request",
    "OutputFormat": ".output_format",
    "Response": ".response",
    "Response_Chunk": ".response",
    "Response_Done": ".response",
    "Response_Error": ".response",
    "ServerSentEvent": ".server_sent_event",
    "ServerSentEvent_Chunk": ".server_sent_event",
    "ServerSentEvent_Error": ".server_sent_event",
    "StreamingEncoding": ".streaming_encoding",
    "StreamingError": ".streaming_error",
    "StreamingGenerationRequest": ".streaming_generation_request",
    "StreamingOutputFormat": ".streaming_output_format",
    "Voice": ".voice",
}


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",
    "CancellationRequest",
    "Chunk",
    "ContextfulChunk",
    "ContextfulGenerationRequest",
    "Done",
    "GenerationRequest",
    "OutputFormat",
    "Response",
    "Response_Chunk",
    "Response_Done",
    "Response_Error",
    "ServerSentEvent",
    "ServerSentEvent_Chunk",
    "ServerSentEvent_Error",
    "StreamingEncoding",
    "StreamingError",
    "StreamingGenerationRequest",
    "StreamingOutputFormat",
    "Voice",
]
