Skip to content

Commit

Permalink
Merge pull request #24 from bukosabino/develop-isort
Browse files Browse the repository at this point in the history
sorting imports
  • Loading branch information
bukosabino authored Sep 29, 2023
2 parents 40f34a7 + c46fe40 commit f8b5607
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 33 deletions.
6 changes: 5 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,8 @@ pinecone-client==2.2.2
sentence_transformers==2.2.2
openai==0.27.8

sendgrid==6.10.0
sendgrid==6.10.0

# Clean code tools
black==23.9.1
isort==5.12.0
3 changes: 1 addition & 2 deletions src/email/send_email.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
import os

from sendgrid import SendGridAPIClient
from sendgrid.helpers.mail import Email, To, Content, Mail
from sendgrid.helpers.mail import Content, Email, Mail, To

from src.initialize import initialize_logging


initialize_logging()


Expand Down
7 changes: 3 additions & 4 deletions src/etls/etl_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@
import os
import typing as tp

from langchain.text_splitter import CharacterTextSplitter
from langchain.schema import Document
import pinecone
from langchain.schema import Document
from langchain.text_splitter import CharacterTextSplitter
from retry import retry

from src.etls.utils import BOETextLoader, BOEMetadataDocument
from src.etls.utils import BOEMetadataDocument, BOETextLoader
from src.initialize import initialize_logging


initialize_logging()


Expand Down
3 changes: 1 addition & 2 deletions src/etls/etl_daily.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
from datetime import date

from src.email.send_email import send_email
from src.etls.etl_common import ETL
from src.etls.scrapper.boe import BOEScrapper
from src.initialize import initialize_app
from src.email.send_email import send_email


if __name__ == '__main__':
INIT_OBJECTS = initialize_app()
Expand Down
5 changes: 2 additions & 3 deletions src/etls/etl_initial.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
from datetime import datetime

from src.email.send_email import send_email
from src.etls.etl_common import ETL
from src.initialize import initialize_app
from src.etls.scrapper.boe import BOEScrapper
from src.email.send_email import send_email

from src.initialize import initialize_app

if __name__ == '__main__':
INIT_OBJECTS = initialize_app()
Expand Down
2 changes: 1 addition & 1 deletion src/etls/scrapper/base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from abc import ABC, abstractmethod
import typing as tp
from abc import ABC, abstractmethod
from datetime import date

from src.etls.utils import BOEMetadataDocument
Expand Down
10 changes: 5 additions & 5 deletions src/etls/scrapper/boe.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import copy
import logging as lg
import typing as tp
import tempfile
import typing as tp
import unicodedata
from datetime import datetime, date, timedelta
from datetime import date, datetime, timedelta

from bs4 import BeautifulSoup
import requests
from bs4 import BeautifulSoup
from requests.exceptions import HTTPError

from src.etls.scrapper.base import BaseScrapper
from src.etls.utils import BOEMetadataDocument, BOEMetadataReferencia, BOEMetadataDocument2
from src.etls.utils import (BOEMetadataDocument, BOEMetadataDocument2,
BOEMetadataReferencia)
from src.initialize import initialize_logging


initialize_logging()


Expand Down
6 changes: 3 additions & 3 deletions src/etls/utils.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from dataclasses import dataclass
from datetime import datetime, date
import typing as tp
from dataclasses import dataclass
from datetime import date, datetime

from pydantic import BaseModel, validator
from langchain.docstore.document import Document
from langchain.document_loaders.base import BaseLoader
from pydantic import BaseModel, validator


@dataclass
Expand Down
15 changes: 8 additions & 7 deletions src/initialize.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
import collections
import logging as lg
import os
import yaml

import pinecone
from supabase.client import Client, create_client
from langchain.prompts import ChatPromptTemplate, HumanMessagePromptTemplate, SystemMessagePromptTemplate
from langchain.vectorstores.pinecone import Pinecone
from langchain.embeddings import HuggingFaceEmbeddings
import yaml
from langchain.chains import RetrievalQA
from langchain.chat_models import ChatOpenAI
from qdrant_client.models import Distance, VectorParams
from qdrant_client import QdrantClient
from langchain.embeddings import HuggingFaceEmbeddings
from langchain.prompts import (ChatPromptTemplate, HumanMessagePromptTemplate,
SystemMessagePromptTemplate)
from langchain.vectorstores.pinecone import Pinecone
from langchain.vectorstores.qdrant import Qdrant
from qdrant_client import QdrantClient
from qdrant_client.models import Distance, VectorParams
from supabase.client import Client, create_client

from src.utils import StandardSupabaseVectorStore

Expand Down
3 changes: 1 addition & 2 deletions src/service/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@

from fastapi import FastAPI

from src.utils import QAResponsePayloadModel, timeit
from src.initialize import initialize_app, initialize_logging

from src.utils import QAResponsePayloadModel, timeit

initialize_logging()

Expand Down
6 changes: 3 additions & 3 deletions src/utils.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import typing as tp
from functools import wraps
import logging as lg
import time
import typing as tp
from functools import wraps

from langchain.schema import Document
from langchain.vectorstores import SupabaseVectorStore
from pydantic import BaseModel
from langchain.schema import Document


class StandardSupabaseVectorStore(SupabaseVectorStore):
Expand Down

0 comments on commit f8b5607

Please sign in to comment.