"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from typing import TYPE_CHECKING
from importlib import import_module
import builtins
import sys

if TYPE_CHECKING:
    from .chatcontent import ChatContent, ChatContentTypedDict, Type
    from .chatrequest import ChatRequest, ChatRequestAction, ChatRequestTypedDict
    from .chatresponse import ChatResponse, ChatResponseTypedDict, Role
    from .chatsource import ChatSource, ChatSourceTypedDict
    from .chatsources import ChatSources, ChatSourcesTypedDict
    from .connection import (
        Connection,
        ConnectionMetadata,
        ConnectionMetadataTypedDict,
        ConnectionTypedDict,
    )
    from .connectionlist import ConnectionList, ConnectionListTypedDict
    from .connectionmetadatarequest import (
        ConnectionMetadataRequest,
        ConnectionMetadataRequestMetadata,
        ConnectionMetadataRequestMetadataTypedDict,
        ConnectionMetadataRequestTypedDict,
    )
    from .connectionmetadataresponse import (
        ConnectionMetadataResponse,
        ConnectionMetadataResponseMetadata,
        ConnectionMetadataResponseMetadataTypedDict,
        ConnectionMetadataResponseTypedDict,
    )
    from .connectsessionrequest import (
        ConnectSessionRequest,
        ConnectSessionRequestMetadata,
        ConnectSessionRequestMetadataTypedDict,
        ConnectSessionRequestTypedDict,
    )
    from .connectsessionresponse import (
        ConnectSessionResponse,
        ConnectSessionResponseTypedDict,
    )
    from .databasemetadatarequest import (
        DatabaseMetadataRequest,
        DatabaseMetadataRequestDatabaseType,
        DatabaseMetadataRequestTypedDict,
    )
    from .databasemetadataresponse import (
        Database,
        DatabaseMetadataResponse,
        DatabaseMetadataResponseMetadata,
        DatabaseMetadataResponseMetadataTypedDict,
        DatabaseMetadataResponseTypedDict,
        DatabaseTypedDict,
    )
    from .deleteconnectionop import (
        DeleteConnectionRequest,
        DeleteConnectionRequestTypedDict,
        DeleteConnectionResponse,
        DeleteConnectionResponseTypedDict,
    )
    from .documentuploadresponse import (
        Document,
        DocumentTypedDict,
        DocumentUploadResponse,
        DocumentUploadResponseTypedDict,
    )
    from .getconnectionmetadataop import (
        GetConnectionMetadataRequest,
        GetConnectionMetadataRequestTypedDict,
    )
    from .getconnectionop import GetConnectionRequest, GetConnectionRequestTypedDict
    from .getsessioninfoop import GetSessionInfoRequest, GetSessionInfoRequestTypedDict
    from .listconnectionsop import (
        ListConnectionsRequest,
        ListConnectionsRequestTypedDict,
        ProviderConfigKey,
    )
    from .listsessionsop import ListSessionsRequest, ListSessionsRequestTypedDict
    from .performvisualizationop import (
        PerformVisualizationResponse,
        PerformVisualizationResponseTypedDict,
    )
    from .security import Security, SecurityTypedDict
    from .sessionactionrequest import (
        SessionActionRequest,
        SessionActionRequestAction,
        SessionActionRequestTypedDict,
    )
    from .sessionactionresponse import (
        SessionActionResponse,
        SessionActionResponseTypedDict,
    )
    from .sessioninfo import SessionInfo, SessionInfoTypedDict
    from .sessionlistresponse import SessionListResponse, SessionListResponseTypedDict
    from .sessionsummary import SessionSummary, SessionSummaryTypedDict
    from .syncenqueuerequest import SyncEnqueueRequest, SyncEnqueueRequestTypedDict
    from .syncenqueueresponse import SyncEnqueueResponse, SyncEnqueueResponseTypedDict
    from .testconnectionrequest import (
        TestConnectionRequest,
        TestConnectionRequestConnection,
        TestConnectionRequestConnectionTypedDict,
        TestConnectionRequestDatabaseType,
        TestConnectionRequestTypedDict,
    )
    from .testconnectionresponse import (
        TestConnectionResponse,
        TestConnectionResponseTypedDict,
    )
    from .uploaddocumentsop import (
        File,
        FileTypedDict,
        UploadDocumentsRequest,
        UploadDocumentsRequestTypedDict,
    )
    from .visualizationrequest import (
        ConfidenceThreshold,
        ResponseFormat,
        VisualizationRequest,
        VisualizationRequestAction,
        VisualizationRequestTypedDict,
    )
    from .visualizationresponsejson import (
        NodeProperties,
        NodePropertiesTypedDict,
        RelationshipDirection,
        RelationshipDirectionTypedDict,
        Statistics,
        StatisticsTypedDict,
        VisualizationResponseJSON,
        VisualizationResponseJSONMetadata,
        VisualizationResponseJSONMetadataTypedDict,
        VisualizationResponseJSONTypedDict,
    )

__all__ = [
    "ChatContent",
    "ChatContentTypedDict",
    "ChatRequest",
    "ChatRequestAction",
    "ChatRequestTypedDict",
    "ChatResponse",
    "ChatResponseTypedDict",
    "ChatSource",
    "ChatSourceTypedDict",
    "ChatSources",
    "ChatSourcesTypedDict",
    "ConfidenceThreshold",
    "ConnectSessionRequest",
    "ConnectSessionRequestMetadata",
    "ConnectSessionRequestMetadataTypedDict",
    "ConnectSessionRequestTypedDict",
    "ConnectSessionResponse",
    "ConnectSessionResponseTypedDict",
    "Connection",
    "ConnectionList",
    "ConnectionListTypedDict",
    "ConnectionMetadata",
    "ConnectionMetadataRequest",
    "ConnectionMetadataRequestMetadata",
    "ConnectionMetadataRequestMetadataTypedDict",
    "ConnectionMetadataRequestTypedDict",
    "ConnectionMetadataResponse",
    "ConnectionMetadataResponseMetadata",
    "ConnectionMetadataResponseMetadataTypedDict",
    "ConnectionMetadataResponseTypedDict",
    "ConnectionMetadataTypedDict",
    "ConnectionTypedDict",
    "Database",
    "DatabaseMetadataRequest",
    "DatabaseMetadataRequestDatabaseType",
    "DatabaseMetadataRequestTypedDict",
    "DatabaseMetadataResponse",
    "DatabaseMetadataResponseMetadata",
    "DatabaseMetadataResponseMetadataTypedDict",
    "DatabaseMetadataResponseTypedDict",
    "DatabaseTypedDict",
    "DeleteConnectionRequest",
    "DeleteConnectionRequestTypedDict",
    "DeleteConnectionResponse",
    "DeleteConnectionResponseTypedDict",
    "Document",
    "DocumentTypedDict",
    "DocumentUploadResponse",
    "DocumentUploadResponseTypedDict",
    "File",
    "FileTypedDict",
    "GetConnectionMetadataRequest",
    "GetConnectionMetadataRequestTypedDict",
    "GetConnectionRequest",
    "GetConnectionRequestTypedDict",
    "GetSessionInfoRequest",
    "GetSessionInfoRequestTypedDict",
    "ListConnectionsRequest",
    "ListConnectionsRequestTypedDict",
    "ListSessionsRequest",
    "ListSessionsRequestTypedDict",
    "NodeProperties",
    "NodePropertiesTypedDict",
    "PerformVisualizationResponse",
    "PerformVisualizationResponseTypedDict",
    "ProviderConfigKey",
    "RelationshipDirection",
    "RelationshipDirectionTypedDict",
    "ResponseFormat",
    "Role",
    "Security",
    "SecurityTypedDict",
    "SessionActionRequest",
    "SessionActionRequestAction",
    "SessionActionRequestTypedDict",
    "SessionActionResponse",
    "SessionActionResponseTypedDict",
    "SessionInfo",
    "SessionInfoTypedDict",
    "SessionListResponse",
    "SessionListResponseTypedDict",
    "SessionSummary",
    "SessionSummaryTypedDict",
    "Statistics",
    "StatisticsTypedDict",
    "SyncEnqueueRequest",
    "SyncEnqueueRequestTypedDict",
    "SyncEnqueueResponse",
    "SyncEnqueueResponseTypedDict",
    "TestConnectionRequest",
    "TestConnectionRequestConnection",
    "TestConnectionRequestConnectionTypedDict",
    "TestConnectionRequestDatabaseType",
    "TestConnectionRequestTypedDict",
    "TestConnectionResponse",
    "TestConnectionResponseTypedDict",
    "Type",
    "UploadDocumentsRequest",
    "UploadDocumentsRequestTypedDict",
    "VisualizationRequest",
    "VisualizationRequestAction",
    "VisualizationRequestTypedDict",
    "VisualizationResponseJSON",
    "VisualizationResponseJSONMetadata",
    "VisualizationResponseJSONMetadataTypedDict",
    "VisualizationResponseJSONTypedDict",
]

_dynamic_imports: dict[str, str] = {
    "ChatContent": ".chatcontent",
    "ChatContentTypedDict": ".chatcontent",
    "Type": ".chatcontent",
    "ChatRequest": ".chatrequest",
    "ChatRequestAction": ".chatrequest",
    "ChatRequestTypedDict": ".chatrequest",
    "ChatResponse": ".chatresponse",
    "ChatResponseTypedDict": ".chatresponse",
    "Role": ".chatresponse",
    "ChatSource": ".chatsource",
    "ChatSourceTypedDict": ".chatsource",
    "ChatSources": ".chatsources",
    "ChatSourcesTypedDict": ".chatsources",
    "Connection": ".connection",
    "ConnectionMetadata": ".connection",
    "ConnectionMetadataTypedDict": ".connection",
    "ConnectionTypedDict": ".connection",
    "ConnectionList": ".connectionlist",
    "ConnectionListTypedDict": ".connectionlist",
    "ConnectionMetadataRequest": ".connectionmetadatarequest",
    "ConnectionMetadataRequestMetadata": ".connectionmetadatarequest",
    "ConnectionMetadataRequestMetadataTypedDict": ".connectionmetadatarequest",
    "ConnectionMetadataRequestTypedDict": ".connectionmetadatarequest",
    "ConnectionMetadataResponse": ".connectionmetadataresponse",
    "ConnectionMetadataResponseMetadata": ".connectionmetadataresponse",
    "ConnectionMetadataResponseMetadataTypedDict": ".connectionmetadataresponse",
    "ConnectionMetadataResponseTypedDict": ".connectionmetadataresponse",
    "ConnectSessionRequest": ".connectsessionrequest",
    "ConnectSessionRequestMetadata": ".connectsessionrequest",
    "ConnectSessionRequestMetadataTypedDict": ".connectsessionrequest",
    "ConnectSessionRequestTypedDict": ".connectsessionrequest",
    "ConnectSessionResponse": ".connectsessionresponse",
    "ConnectSessionResponseTypedDict": ".connectsessionresponse",
    "DatabaseMetadataRequest": ".databasemetadatarequest",
    "DatabaseMetadataRequestDatabaseType": ".databasemetadatarequest",
    "DatabaseMetadataRequestTypedDict": ".databasemetadatarequest",
    "Database": ".databasemetadataresponse",
    "DatabaseMetadataResponse": ".databasemetadataresponse",
    "DatabaseMetadataResponseMetadata": ".databasemetadataresponse",
    "DatabaseMetadataResponseMetadataTypedDict": ".databasemetadataresponse",
    "DatabaseMetadataResponseTypedDict": ".databasemetadataresponse",
    "DatabaseTypedDict": ".databasemetadataresponse",
    "DeleteConnectionRequest": ".deleteconnectionop",
    "DeleteConnectionRequestTypedDict": ".deleteconnectionop",
    "DeleteConnectionResponse": ".deleteconnectionop",
    "DeleteConnectionResponseTypedDict": ".deleteconnectionop",
    "Document": ".documentuploadresponse",
    "DocumentTypedDict": ".documentuploadresponse",
    "DocumentUploadResponse": ".documentuploadresponse",
    "DocumentUploadResponseTypedDict": ".documentuploadresponse",
    "GetConnectionMetadataRequest": ".getconnectionmetadataop",
    "GetConnectionMetadataRequestTypedDict": ".getconnectionmetadataop",
    "GetConnectionRequest": ".getconnectionop",
    "GetConnectionRequestTypedDict": ".getconnectionop",
    "GetSessionInfoRequest": ".getsessioninfoop",
    "GetSessionInfoRequestTypedDict": ".getsessioninfoop",
    "ListConnectionsRequest": ".listconnectionsop",
    "ListConnectionsRequestTypedDict": ".listconnectionsop",
    "ProviderConfigKey": ".listconnectionsop",
    "ListSessionsRequest": ".listsessionsop",
    "ListSessionsRequestTypedDict": ".listsessionsop",
    "PerformVisualizationResponse": ".performvisualizationop",
    "PerformVisualizationResponseTypedDict": ".performvisualizationop",
    "Security": ".security",
    "SecurityTypedDict": ".security",
    "SessionActionRequest": ".sessionactionrequest",
    "SessionActionRequestAction": ".sessionactionrequest",
    "SessionActionRequestTypedDict": ".sessionactionrequest",
    "SessionActionResponse": ".sessionactionresponse",
    "SessionActionResponseTypedDict": ".sessionactionresponse",
    "SessionInfo": ".sessioninfo",
    "SessionInfoTypedDict": ".sessioninfo",
    "SessionListResponse": ".sessionlistresponse",
    "SessionListResponseTypedDict": ".sessionlistresponse",
    "SessionSummary": ".sessionsummary",
    "SessionSummaryTypedDict": ".sessionsummary",
    "SyncEnqueueRequest": ".syncenqueuerequest",
    "SyncEnqueueRequestTypedDict": ".syncenqueuerequest",
    "SyncEnqueueResponse": ".syncenqueueresponse",
    "SyncEnqueueResponseTypedDict": ".syncenqueueresponse",
    "TestConnectionRequest": ".testconnectionrequest",
    "TestConnectionRequestConnection": ".testconnectionrequest",
    "TestConnectionRequestConnectionTypedDict": ".testconnectionrequest",
    "TestConnectionRequestDatabaseType": ".testconnectionrequest",
    "TestConnectionRequestTypedDict": ".testconnectionrequest",
    "TestConnectionResponse": ".testconnectionresponse",
    "TestConnectionResponseTypedDict": ".testconnectionresponse",
    "File": ".uploaddocumentsop",
    "FileTypedDict": ".uploaddocumentsop",
    "UploadDocumentsRequest": ".uploaddocumentsop",
    "UploadDocumentsRequestTypedDict": ".uploaddocumentsop",
    "ConfidenceThreshold": ".visualizationrequest",
    "ResponseFormat": ".visualizationrequest",
    "VisualizationRequest": ".visualizationrequest",
    "VisualizationRequestAction": ".visualizationrequest",
    "VisualizationRequestTypedDict": ".visualizationrequest",
    "NodeProperties": ".visualizationresponsejson",
    "NodePropertiesTypedDict": ".visualizationresponsejson",
    "RelationshipDirection": ".visualizationresponsejson",
    "RelationshipDirectionTypedDict": ".visualizationresponsejson",
    "Statistics": ".visualizationresponsejson",
    "StatisticsTypedDict": ".visualizationresponsejson",
    "VisualizationResponseJSON": ".visualizationresponsejson",
    "VisualizationResponseJSONMetadata": ".visualizationresponsejson",
    "VisualizationResponseJSONMetadataTypedDict": ".visualizationresponsejson",
    "VisualizationResponseJSONTypedDict": ".visualizationresponsejson",
}


def dynamic_import(modname, retries=3):
    for attempt in range(retries):
        try:
            return import_module(modname, __package__)
        except KeyError:
            # Clear any half-initialized module and retry
            sys.modules.pop(modname, None)
            if attempt == retries - 1:
                break
    raise KeyError(f"Failed to import module '{modname}' after {retries} attempts")


def __getattr__(attr_name: str) -> object:
    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 = dynamic_import(module_name)
        result = getattr(module, attr_name)
        return result
    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 = builtins.list(_dynamic_imports.keys())
    return builtins.sorted(lazy_attrs)
