"""Configuration components."""

# Export the modular config components
from oboyu.indexer.config.indexer_config import IndexerConfig
from oboyu.indexer.config.model_config import ModelConfig
from oboyu.indexer.config.processing_config import ProcessingConfig
from oboyu.indexer.config.search_config import SearchConfig

# Define constants that other modules depend on
DEFAULT_BATCH_SIZE = 32
DEFAULT_BM25_B = 0.75
DEFAULT_BM25_K1 = 1.2
DEFAULT_BM25_MIN_TOKEN_LENGTH = 2
DEFAULT_CHUNK_OVERLAP = 200
DEFAULT_CHUNK_SIZE = 1000
DEFAULT_DOCUMENT_PREFIX = "文書: "
DEFAULT_EF_CONSTRUCTION = 200
DEFAULT_EF_SEARCH = 100
DEFAULT_EMBEDDING_DEVICE = "cpu"
DEFAULT_EMBEDDING_MODEL = "cl-nagoya/ruri-v3-30m"
DEFAULT_GENERAL_PREFIX = ""
DEFAULT_M = 16
DEFAULT_M0 = 16
DEFAULT_MAX_SEQ_LENGTH = 512
DEFAULT_MAX_WORKERS = 4
DEFAULT_ONNX_OPTIMIZATION_LEVEL = "all"
DEFAULT_ONNX_QUANTIZATION_ENABLED = True
DEFAULT_ONNX_QUANTIZATION_METHOD = "QUInt8"
DEFAULT_ONNX_QUANTIZATION_WEIGHT_TYPE = "uint8"
DEFAULT_QUERY_PREFIX = "質問: "
DEFAULT_RERANKER_BATCH_SIZE = 8
DEFAULT_RERANKER_DEVICE = "cpu"
DEFAULT_RERANKER_MAX_LENGTH = 512
DEFAULT_RERANKER_MODEL = "cl-nagoya/ruri-reranker-small"
DEFAULT_RERANKER_THRESHOLD = 0.5
DEFAULT_RERANKER_TOP_K_MULTIPLIER = 3
DEFAULT_RERANKER_USE_ONNX = True
DEFAULT_TOPIC_PREFIX = "トピック: "
DEFAULT_USE_BM25 = True
DEFAULT_USE_JAPANESE_TOKENIZER = True
DEFAULT_USE_ONNX = True
DEFAULT_USE_RERANKER = False

# Default config dict for compatibility
DEFAULT_CONFIG = {
    "embedding_model": DEFAULT_EMBEDDING_MODEL,
    "embedding_device": DEFAULT_EMBEDDING_DEVICE,
    "use_onnx": DEFAULT_USE_ONNX,
    "batch_size": DEFAULT_BATCH_SIZE,
    "max_seq_length": DEFAULT_MAX_SEQ_LENGTH,
    "chunk_size": DEFAULT_CHUNK_SIZE,
    "chunk_overlap": DEFAULT_CHUNK_OVERLAP,
    "bm25_k1": DEFAULT_BM25_K1,
    "bm25_b": DEFAULT_BM25_B,
    "use_reranker": DEFAULT_USE_RERANKER,
    "reranker_model": DEFAULT_RERANKER_MODEL,
    "reranker_device": DEFAULT_RERANKER_DEVICE,
    "reranker_use_onnx": DEFAULT_RERANKER_USE_ONNX,
}

__all__ = [
    # Constants
    "DEFAULT_BATCH_SIZE",
    "DEFAULT_BM25_B",
    "DEFAULT_BM25_K1",
    "DEFAULT_BM25_MIN_TOKEN_LENGTH",
    "DEFAULT_CHUNK_OVERLAP",
    "DEFAULT_CHUNK_SIZE",
    "DEFAULT_DOCUMENT_PREFIX",
    "DEFAULT_EF_CONSTRUCTION",
    "DEFAULT_EF_SEARCH",
    "DEFAULT_EMBEDDING_DEVICE",
    "DEFAULT_EMBEDDING_MODEL",
    "DEFAULT_GENERAL_PREFIX",
    "DEFAULT_M",
    "DEFAULT_M0",
    "DEFAULT_MAX_SEQ_LENGTH",
    "DEFAULT_MAX_WORKERS",
    "DEFAULT_ONNX_OPTIMIZATION_LEVEL",
    "DEFAULT_ONNX_QUANTIZATION_ENABLED",
    "DEFAULT_ONNX_QUANTIZATION_METHOD",
    "DEFAULT_ONNX_QUANTIZATION_WEIGHT_TYPE",
    "DEFAULT_QUERY_PREFIX",
    "DEFAULT_RERANKER_BATCH_SIZE",
    "DEFAULT_RERANKER_DEVICE",
    "DEFAULT_RERANKER_MAX_LENGTH",
    "DEFAULT_RERANKER_MODEL",
    "DEFAULT_RERANKER_THRESHOLD",
    "DEFAULT_RERANKER_TOP_K_MULTIPLIER",
    "DEFAULT_RERANKER_USE_ONNX",
    "DEFAULT_TOPIC_PREFIX",
    "DEFAULT_USE_BM25",
    "DEFAULT_USE_JAPANESE_TOKENIZER",
    "DEFAULT_USE_ONNX",
    "DEFAULT_USE_RERANKER",
    "DEFAULT_CONFIG",
    # Config classes
    "IndexerConfig",
    "ModelConfig",
    "ProcessingConfig",
    "SearchConfig",
]
