Explorar o código

fix: format lint (#316)

cachho %!s(int64=2) %!d(string=hai) anos
pai
achega
d16eafae05

+ 2 - 1
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)

+ 2 - 2
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
 

+ 1 - 1
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

+ 2 - 1
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:

+ 0 - 2
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()
 

+ 2 - 1
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"
 

+ 2 - 3
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)