diff --git a/embedchain/__init__.py b/embedchain/__init__.py index 4279b16e..371713f1 100644 --- a/embedchain/__init__.py +++ b/embedchain/__init__.py @@ -5,4 +5,5 @@ __version__ = importlib.metadata.version(__package__ or __name__) from embedchain.apps.App import App # noqa: F401 from embedchain.apps.CustomApp import CustomApp # noqa: F401 from embedchain.apps.OpenSourceApp import OpenSourceApp # noqa: F401 -from embedchain.apps.PersonApp import PersonApp, PersonOpenSourceApp # noqa: F401 +from embedchain.apps.PersonApp import (PersonApp, # noqa: F401 + PersonOpenSourceApp) diff --git a/embedchain/apps/CustomApp.py b/embedchain/apps/CustomApp.py index 517c85aa..69062c15 100644 --- a/embedchain/apps/CustomApp.py +++ b/embedchain/apps/CustomApp.py @@ -1,9 +1,9 @@ import logging -from typing import Iterable, List, Union +from typing import List from langchain.schema import BaseMessage -from embedchain.config import ChatConfig, CustomAppConfig, OpenSourceAppConfig +from embedchain.config import ChatConfig, CustomAppConfig from embedchain.embedchain import EmbedChain from embedchain.models import Providers diff --git a/embedchain/apps/OpenSourceApp.py b/embedchain/apps/OpenSourceApp.py index 2ab6e0aa..803cf133 100644 --- a/embedchain/apps/OpenSourceApp.py +++ b/embedchain/apps/OpenSourceApp.py @@ -1,5 +1,5 @@ import logging -from typing import Iterable, List, Union +from typing import Iterable, Union from embedchain.config import ChatConfig, OpenSourceAppConfig from embedchain.embedchain import EmbedChain diff --git a/embedchain/apps/PersonApp.py b/embedchain/apps/PersonApp.py index 4bac1c10..2472f691 100644 --- a/embedchain/apps/PersonApp.py +++ b/embedchain/apps/PersonApp.py @@ -4,7 +4,8 @@ from embedchain.apps.App import App from embedchain.apps.OpenSourceApp import OpenSourceApp from embedchain.config import ChatConfig, QueryConfig from embedchain.config.apps.BaseAppConfig import BaseAppConfig -from embedchain.config.QueryConfig import DEFAULT_PROMPT, DEFAULT_PROMPT_WITH_HISTORY +from embedchain.config.QueryConfig import (DEFAULT_PROMPT, + DEFAULT_PROMPT_WITH_HISTORY) class EmbedChainPersonApp: diff --git a/embedchain/config/apps/CustomAppConfig.py b/embedchain/config/apps/CustomAppConfig.py index f2728218..5649721e 100644 --- a/embedchain/config/apps/CustomAppConfig.py +++ b/embedchain/config/apps/CustomAppConfig.py @@ -1,4 +1,3 @@ -import logging from typing import Any from chromadb.api.types import Documents, Embeddings @@ -7,7 +6,6 @@ from dotenv import load_dotenv from embedchain.models import EmbeddingFunctions, Providers from .BaseAppConfig import BaseAppConfig -from embedchain.models import Providers load_dotenv() diff --git a/embedchain/config/apps/OpenSourceAppConfig.py b/embedchain/config/apps/OpenSourceAppConfig.py index 954c2ec2..82b4cdcc 100644 --- a/embedchain/config/apps/OpenSourceAppConfig.py +++ b/embedchain/config/apps/OpenSourceAppConfig.py @@ -15,7 +15,8 @@ class OpenSourceAppConfig(BaseAppConfig): :param id: Optional. ID of the app. Document metadata will have this id. :param host: Optional. Hostname for the database server. :param port: Optional. Port for the database server. - :param model: Optional. GPT4ALL uses the model to instantiate the class. So unlike `App`, it has to be provided before querying. + :param model: Optional. GPT4ALL uses the model to instantiate the class. + So unlike `App`, it has to be provided before querying. """ self.model = model or "orca-mini-3b.ggmlv3.q4_0.bin" diff --git a/embedchain/embedchain.py b/embedchain/embedchain.py index e645e8ec..c98e852b 100644 --- a/embedchain/embedchain.py +++ b/embedchain/embedchain.py @@ -1,6 +1,7 @@ import logging import os +from chromadb.errors import InvalidDimensionException from dotenv import load_dotenv from langchain.docstore.document import Document from langchain.memory import ConversationBufferMemory @@ -10,8 +11,6 @@ from embedchain.config.apps.BaseAppConfig import BaseAppConfig from embedchain.config.QueryConfig import DOCS_SITE_PROMPT_TEMPLATE from embedchain.data_formatter import DataFormatter -from chromadb.errors import InvalidDimensionException - load_dotenv() ABS_PATH = os.getcwd() @@ -164,7 +163,7 @@ class EmbedChain: except InvalidDimensionException as e: raise InvalidDimensionException( e.message() - + ". This is commonly a side-effect when an embedding function, different from the one used to add the embeddings, is used to retrieve an embedding from the database." + + ". This is commonly a side-effect when an embedding function, different from the one used to add the embeddings, is used to retrieve an embedding from the database." # noqa E501 ) from None results_formatted = self._format_result(result)