if self._embedding_dimension is None:
            self._embedding_dimension = len(
                self.embedding.embed_query("This is a sample sentence.")
            )
        return self._embedding_dimension
    def _drop_collection(self) -> None:
        """
        Drop the collection from storage.
        This is meant as an internal-usage method, no members
        are set other than actual deletion on the backend.
        """
        _ = self.astra_db.delete_collection(
            collection_name=self.collection_name,
        )
        return None
    def _provision_collection(self) -> None:
        """
        Run the API invocation to create the collection on the backend.
        Internal-usage method, no object members are set,
        other than working on the underlying actual storage.
        """
        _ = self.astra_db.create_collection(
            dimension=self._get_embedding_dimension(),
            collection_name=self.collection_name,
            metric=self.metric,
        )
        return None
    @property
    def embeddings(self) -> Embeddings:
        return self.embedding
    @staticmethod
    def _dont_flip_the_cos_score(similarity0to1: float) -> float:
        """Keep similarity from client unchanged ad it's in [0:1] already."""
        return similarity0to1
    def _select_relevance_score_fn(self) -> Callable[[float], float]:
        """
        The underlying API calls already returns a "score proper",
        i.e. one in [0, 1] where higher means more *similar*,
        so here the final score transformation is not reversing the interval:
        """
        return self._dont_flip_the_cos_score
[docs]    def clear(self) -> None:
        """Empty the collection of all its stored entries."""
        self._drop_collection()