From 94ba82f2a24fe21d497bfba1a19a676e207ae036 Mon Sep 17 00:00:00 2001 From: Sandra Serrano <69241131+sandrasgg@users.noreply.github.com> Date: Fri, 5 Jan 2024 09:21:49 +0100 Subject: [PATCH] #710 | Remove unused and deprecated app.count method (#1116) --- embedchain/embedchain.py | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/embedchain/embedchain.py b/embedchain/embedchain.py index eec35cb5..bc74d569 100644 --- a/embedchain/embedchain.py +++ b/embedchain/embedchain.py @@ -7,9 +7,7 @@ from typing import Any, Dict, List, Optional, Tuple, Union from dotenv import load_dotenv from langchain.docstore.document import Document -from embedchain.cache import (adapt, get_gptcache_session, - gptcache_data_convert, - gptcache_update_cache_callback) +from embedchain.cache import adapt, get_gptcache_session, gptcache_data_convert, gptcache_update_cache_callback from embedchain.chunkers.base_chunker import BaseChunker from embedchain.config import AddConfig, BaseLlmConfig, ChunkerConfig from embedchain.config.base_app_config import BaseAppConfig @@ -19,8 +17,7 @@ from embedchain.embedder.base import BaseEmbedder from embedchain.helpers.json_serializable import JSONSerializable from embedchain.llm.base import BaseLlm from embedchain.loaders.base_loader import BaseLoader -from embedchain.models.data_type import (DataType, DirectDataType, - IndirectDataType, SpecialDataType) +from embedchain.models.data_type import DataType, DirectDataType, IndirectDataType, SpecialDataType from embedchain.telemetry.posthog import AnonymousTelemetry from embedchain.utils import detect_datatype, is_valid_json_string from embedchain.vectordb.base import BaseVectorDB @@ -654,18 +651,6 @@ class EmbedChain(JSONSerializable): # TODO: Check whether it is necessary to assign to the `self.collection` attribute, # since the main purpose is the creation. - def count(self) -> int: - """ - Count the number of embeddings. - - DEPRECATED IN FAVOR OF `db.count()` - - :return: The number of embeddings. - :rtype: int - """ - logging.warning("DEPRECATION WARNING: Please use `app.db.count()` instead of `app.count()`.") - return self.db.count() - def reset(self): """ Resets the database. Deletes all embeddings irreversibly.