# 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 . import common, copilots, document_catalog, document_collections, search, users
    from .client import AsyncCredalApi, CredalApi
    from .common import (
        Collaborator,
        CustomMetadataValue,
        ExternalResourceId,
        Operator,
        ResourceIdentifier,
        ResourceIdentifier_ExternalResourceId,
        ResourceIdentifier_Url,
        ResourceType,
        Role,
        Url,
    )
    from .copilots import (
        AiEndpointConfiguration,
        BlockedChunk,
        BooleanFieldSchema,
        CollectionFilteredData,
        Configuration,
        CreateConversationResponse,
        CreateCopilotResponse,
        DataChunk,
        DataFilter,
        DatetimeFieldSchema,
        DeleteCopilotResponse,
        EndOfMessageChunk,
        ErrorChunk,
        ErrorChunkData,
        ExportCopilotsResponse,
        ExportedCopilot,
        FeedbackEnum,
        Filter,
        Filter_Boolean,
        Filter_Datetime,
        Filter_Number,
        Filter_String,
        FinalChunk,
        InitialChunk,
        InputVariable,
        InsertedAuditLog,
        MessageBlocked,
        MessageFeedback,
        MessageReply,
        NumberFieldSchema,
        ReferencedSource,
        ResponseChunk,
        SendAgentMessageResponse,
        SendMessageResponse,
        SendMessageResponse_AiResponseResult,
        SendMessageResponse_BlockedResult,
        StreamingChunk,
        StreamingChunk_Blocked,
        StreamingChunk_DataChunk,
        StreamingChunk_EndOfMessage,
        StreamingChunk_ErrorChunk,
        StreamingChunk_FinalChunk,
        StreamingChunk_Initial,
        StringFieldSchema,
        WebSearchResult,
    )
    from .document_catalog import (
        DocumentMetadataPatch,
        DocumentMetadataPatchRequest,
        SyncSourceByUrlRequest,
        SyncSourceByUrlResponse,
        UploadDocumentResponse,
    )
    from .document_collections import (
        CreateCollectionResponse,
        DeleteCollectionResponse,
        ListDocumentsInCollectionResponse,
        MongoCollectionSyncConfig,
        MongoCollectionSyncResponse,
        MongoSourceFieldsConfig,
    )
    from .environment import CredalApiEnvironment
    from .search import (
        DocumentCollectionSearchOptions,
        DocumentCollectionSearchResult,
        SearchDocumentCollectionResponse,
        SearchResultChunk,
        SingleFieldFilter,
    )
    from .users import UserMetadataPatch
    from .version import __version__
_dynamic_imports: typing.Dict[str, str] = {
    "AiEndpointConfiguration": ".copilots",
    "AsyncCredalApi": ".client",
    "BlockedChunk": ".copilots",
    "BooleanFieldSchema": ".copilots",
    "Collaborator": ".common",
    "CollectionFilteredData": ".copilots",
    "Configuration": ".copilots",
    "CreateCollectionResponse": ".document_collections",
    "CreateConversationResponse": ".copilots",
    "CreateCopilotResponse": ".copilots",
    "CredalApi": ".client",
    "CredalApiEnvironment": ".environment",
    "CustomMetadataValue": ".common",
    "DataChunk": ".copilots",
    "DataFilter": ".copilots",
    "DatetimeFieldSchema": ".copilots",
    "DeleteCollectionResponse": ".document_collections",
    "DeleteCopilotResponse": ".copilots",
    "DocumentCollectionSearchOptions": ".search",
    "DocumentCollectionSearchResult": ".search",
    "DocumentMetadataPatch": ".document_catalog",
    "DocumentMetadataPatchRequest": ".document_catalog",
    "EndOfMessageChunk": ".copilots",
    "ErrorChunk": ".copilots",
    "ErrorChunkData": ".copilots",
    "ExportCopilotsResponse": ".copilots",
    "ExportedCopilot": ".copilots",
    "ExternalResourceId": ".common",
    "FeedbackEnum": ".copilots",
    "Filter": ".copilots",
    "Filter_Boolean": ".copilots",
    "Filter_Datetime": ".copilots",
    "Filter_Number": ".copilots",
    "Filter_String": ".copilots",
    "FinalChunk": ".copilots",
    "InitialChunk": ".copilots",
    "InputVariable": ".copilots",
    "InsertedAuditLog": ".copilots",
    "ListDocumentsInCollectionResponse": ".document_collections",
    "MessageBlocked": ".copilots",
    "MessageFeedback": ".copilots",
    "MessageReply": ".copilots",
    "MongoCollectionSyncConfig": ".document_collections",
    "MongoCollectionSyncResponse": ".document_collections",
    "MongoSourceFieldsConfig": ".document_collections",
    "NumberFieldSchema": ".copilots",
    "Operator": ".common",
    "ReferencedSource": ".copilots",
    "ResourceIdentifier": ".common",
    "ResourceIdentifier_ExternalResourceId": ".common",
    "ResourceIdentifier_Url": ".common",
    "ResourceType": ".common",
    "ResponseChunk": ".copilots",
    "Role": ".common",
    "SearchDocumentCollectionResponse": ".search",
    "SearchResultChunk": ".search",
    "SendAgentMessageResponse": ".copilots",
    "SendMessageResponse": ".copilots",
    "SendMessageResponse_AiResponseResult": ".copilots",
    "SendMessageResponse_BlockedResult": ".copilots",
    "SingleFieldFilter": ".search",
    "StreamingChunk": ".copilots",
    "StreamingChunk_Blocked": ".copilots",
    "StreamingChunk_DataChunk": ".copilots",
    "StreamingChunk_EndOfMessage": ".copilots",
    "StreamingChunk_ErrorChunk": ".copilots",
    "StreamingChunk_FinalChunk": ".copilots",
    "StreamingChunk_Initial": ".copilots",
    "StringFieldSchema": ".copilots",
    "SyncSourceByUrlRequest": ".document_catalog",
    "SyncSourceByUrlResponse": ".document_catalog",
    "UploadDocumentResponse": ".document_catalog",
    "Url": ".common",
    "UserMetadataPatch": ".users",
    "WebSearchResult": ".copilots",
    "__version__": ".version",
    "common": ".common",
    "copilots": ".copilots",
    "document_catalog": ".document_catalog",
    "document_collections": ".document_collections",
    "search": ".search",
    "users": ".users",
}


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__ = [
    "AiEndpointConfiguration",
    "AsyncCredalApi",
    "BlockedChunk",
    "BooleanFieldSchema",
    "Collaborator",
    "CollectionFilteredData",
    "Configuration",
    "CreateCollectionResponse",
    "CreateConversationResponse",
    "CreateCopilotResponse",
    "CredalApi",
    "CredalApiEnvironment",
    "CustomMetadataValue",
    "DataChunk",
    "DataFilter",
    "DatetimeFieldSchema",
    "DeleteCollectionResponse",
    "DeleteCopilotResponse",
    "DocumentCollectionSearchOptions",
    "DocumentCollectionSearchResult",
    "DocumentMetadataPatch",
    "DocumentMetadataPatchRequest",
    "EndOfMessageChunk",
    "ErrorChunk",
    "ErrorChunkData",
    "ExportCopilotsResponse",
    "ExportedCopilot",
    "ExternalResourceId",
    "FeedbackEnum",
    "Filter",
    "Filter_Boolean",
    "Filter_Datetime",
    "Filter_Number",
    "Filter_String",
    "FinalChunk",
    "InitialChunk",
    "InputVariable",
    "InsertedAuditLog",
    "ListDocumentsInCollectionResponse",
    "MessageBlocked",
    "MessageFeedback",
    "MessageReply",
    "MongoCollectionSyncConfig",
    "MongoCollectionSyncResponse",
    "MongoSourceFieldsConfig",
    "NumberFieldSchema",
    "Operator",
    "ReferencedSource",
    "ResourceIdentifier",
    "ResourceIdentifier_ExternalResourceId",
    "ResourceIdentifier_Url",
    "ResourceType",
    "ResponseChunk",
    "Role",
    "SearchDocumentCollectionResponse",
    "SearchResultChunk",
    "SendAgentMessageResponse",
    "SendMessageResponse",
    "SendMessageResponse_AiResponseResult",
    "SendMessageResponse_BlockedResult",
    "SingleFieldFilter",
    "StreamingChunk",
    "StreamingChunk_Blocked",
    "StreamingChunk_DataChunk",
    "StreamingChunk_EndOfMessage",
    "StreamingChunk_ErrorChunk",
    "StreamingChunk_FinalChunk",
    "StreamingChunk_Initial",
    "StringFieldSchema",
    "SyncSourceByUrlRequest",
    "SyncSourceByUrlResponse",
    "UploadDocumentResponse",
    "Url",
    "UserMetadataPatch",
    "WebSearchResult",
    "__version__",
    "common",
    "copilots",
    "document_catalog",
    "document_collections",
    "search",
    "users",
]
