Repository: SuperDuperDB/superduperdb
File: superduper/base/config.py (Python)

Code before:
    """Describes the configuration for change data capture.

    :param uri: The URI for the CDC service
    :param strategy: The strategy to use for CDC
    """

    uri: t.Optional[str] = None  # None implies local mode
    strategy: t.Union[PollingStrategy, LogBasedStrategy] = dc.field(
        default_factory=PollingStrategy
    )


@dc.dataclass
class QdrantConfig(BaseConfig):
    """Describes the configuration for Qdrant.

    :param location: The location for the Qdrant service.
    :param prefer_grpc: Whether to prefer gRPC for the Qdrant service.
    :param https: Whether to use HTTPS for the Qdrant service.
    :param api_key: The API key for the Qdrant service.
    :param prefix: The prefix for the Qdrant service.
    :param timeout: The timeout for the Qdrant service.
    :param vector_name: The name of the vector in the collection.
    """

    location: t.Optional[str] = ":memory:"
    prefer_grpc: bool = False
    https: t.Optional[bool] = None
    api_key: t.Optional[str] = None
    prefix: t.Optional[str] = None
    timeout: t.Optional[int] = None
    vector_name: t.Optional[str] = None


@dc.dataclass
class VectorSearch(BaseConfig):
    """Describes the configuration for vector search.

    :param uri: The URI for the vector search service
    :param type: The type of vector search service
    :param backfill_batch_size: The size of the backfill batch
    """

    uri: t.Optional[str] = None  # None implies local mode
    type: str = "in_memory"  # in_memory|lance|qdrant
    backfill_batch_size: int = 100

    qdrant_config: QdrantConfig = dc.field(default_factory=QdrantConfig)


@dc.dataclass

Review comment (suggestion):
This is fine, but since we might support many vector-search implementations, it would probably be good to include a more generic way to add parameters to the vector-search backend. 

For example, you could add `CFG.vector_search_kwargs` and then pass these on to the vector-search class.



Code after:
    """Describes the configuration for change data capture.

    :param uri: The URI for the CDC service
    :param strategy: The strategy to use for CDC
    """

    uri: t.Optional[str] = None  # None implies local mode
    strategy: t.Union[PollingStrategy, LogBasedStrategy] = dc.field(
        default_factory=PollingStrategy
    )


@dc.dataclass
class VectorSearch(BaseConfig):
    """Describes the configuration for vector search.

    :param uri: The URI for the vector search service
    :param type: The type of vector search service
    :param backfill_batch_size: The size of the backfill batch
    """

    uri: t.Optional[str] = None  # None implies local mode
    type: str = "in_memory"  # in_memory|lance|qdrant
    backfill_batch_size: int = 100


@dc.dataclass
class Rest(BaseConfig):
    """Describes the configuration for the REST service.

    :param uri: The URI for the REST service
    :param config: The path to the config yaml file
        for the REST service
    """

    uri: t.Optional[str] = None
    config: t.Optional[str] = None


@dc.dataclass
class CronTab(BaseConfig):
    """Describes the configuration for the crontab service.

    :param uri: The URI for the crontab service
    """

    uri: t.Optional[str] = None


@dc.dataclass
class SchedulerConfig(BaseConfig):