Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lint and formatting fixes #554

Merged
merged 11 commits into from
Sep 5, 2023
3 changes: 1 addition & 2 deletions embedchain/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@
from embedchain.apps.CustomApp import CustomApp # noqa: F401
from embedchain.apps.Llama2App import Llama2App # noqa: F401
from embedchain.apps.OpenSourceApp import OpenSourceApp # noqa: F401
from embedchain.apps.PersonApp import (PersonApp, # noqa: F401
PersonOpenSourceApp)
from embedchain.apps.PersonApp import PersonApp, PersonOpenSourceApp # noqa: F401
7 changes: 3 additions & 4 deletions embedchain/bots/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from embedchain.bots.poe import PoeBot
from embedchain.bots.whatsapp import WhatsAppBot
# TODO: fix discord import
# from embedchain.bots.discord import DiscordBot
from embedchain.bots.poe import PoeBot # noqa: F401
from embedchain.bots.whatsapp import WhatsAppBot # noqa: F401
from embedchain.bots.discord import DiscordBot # noqa: F401
Dev-Khant marked this conversation as resolved.
Show resolved Hide resolved
3 changes: 1 addition & 2 deletions embedchain/bots/base.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from embedchain import CustomApp
from embedchain.config import AddConfig, CustomAppConfig, QueryConfig
from embedchain.helper_classes.json_serializable import (
JSONSerializable, register_deserializable)
from embedchain.helper_classes.json_serializable import JSONSerializable, register_deserializable
from embedchain.models import EmbeddingFunctions, Providers


Expand Down
5 changes: 3 additions & 2 deletions embedchain/bots/whatsapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
import signal
import sys

from flask import Flask, request
Dev-Khant marked this conversation as resolved.
Show resolved Hide resolved
from twilio.twiml.messaging_response import MessagingResponse

from embedchain.helper_classes.json_serializable import register_deserializable

from .base import BaseBot
Expand All @@ -11,8 +14,6 @@
@register_deserializable
class WhatsAppBot(BaseBot):
def __init__(self):
from flask import Flask, request
from twilio.twiml.messaging_response import MessagingResponse
super().__init__()

def handle_message(self, message):
Expand Down
3 changes: 1 addition & 2 deletions embedchain/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@
from .BaseConfig import BaseConfig # noqa: F401
from .ChatConfig import ChatConfig # noqa: F401
from .QueryConfig import QueryConfig # noqa: F401
from .vectordbs.ElasticsearchDBConfig import \
ElasticsearchDBConfig # noqa: F401
from .vectordbs.ElasticsearchDBConfig import ElasticsearchDBConfig # noqa: F401
3 changes: 1 addition & 2 deletions embedchain/config/apps/CustomAppConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@

from embedchain.config.vectordbs import ElasticsearchDBConfig
from embedchain.helper_classes.json_serializable import register_deserializable
from embedchain.models import (EmbeddingFunctions, Providers, VectorDatabases,
VectorDimensions)
from embedchain.models import EmbeddingFunctions, Providers, VectorDatabases, VectorDimensions

from .BaseAppConfig import BaseAppConfig

Expand Down
3 changes: 1 addition & 2 deletions embedchain/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,7 @@ def detect_datatype(source: Any) -> DataType:
formatted_source = format_source(str(source), 30)

if url:
from langchain.document_loaders.youtube import \
ALLOWED_NETLOCK as YOUTUBE_ALLOWED_NETLOCS
from langchain.document_loaders.youtube import ALLOWED_NETLOCK as YOUTUBE_ALLOWED_NETLOCS

if url.netloc in YOUTUBE_ALLOWED_NETLOCS:
logging.debug(f"Source of `{formatted_source}` detected as `youtube_video`.")
Expand Down