Skip to content

Commit

Permalink
Merge pull request #53 from Sayvai-io/tools-langchain-0.1
Browse files Browse the repository at this point in the history
Tools langchain 0.1
  • Loading branch information
Arunprakaash authored Feb 4, 2024
2 parents 1c2035a + 21b1b20 commit 9829147
Show file tree
Hide file tree
Showing 10 changed files with 76 additions and 65 deletions.
100 changes: 52 additions & 48 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ google = "^3.0.0"
google-cloud-speech = "^2.23.0"
cloud-sql-python-connector = "^1.5.0"
pg8000 = "^1.30.4"
pandas = "^2.1.4"
pandas = "^2.2.0"
openpyxl = "^3.1.2"
gspread = "5.11.3"
pydub = "^0.25.1"
Expand Down
8 changes: 4 additions & 4 deletions src/sayvai_tools/tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
from sayvai_tools.tools.date import GetDate
from sayvai_tools.tools.display_events import DisplayEvents
from sayvai_tools.tools.forms import FormTool
from sayvai_tools.tools.pdfreader import (ReadPagesTool, ReadPageTool,
ReadPdfTool)
from sayvai_tools.tools.pdfreader import ReadPagesTool, ReadPageTool, ReadPDFTool
from sayvai_tools.tools.retrive_details import RetrieveEmail, RetrievePhone
from sayvai_tools.tools.send_mail import SendMail
from sayvai_tools.tools.spreadsheets import Sheets, SQLSheet
Expand Down Expand Up @@ -37,7 +36,7 @@
"PGVectorDB",
"PineconeDB",
"ReadPagesTool",
"ReadPdfTool",
"ReadPDFTool",
"ReadPageTool",
]

Expand All @@ -51,6 +50,7 @@ def get_tool(tool_name: str) -> str:
return tool_name
else:
return "Tool not found"



def get_langchain_tools() -> List[str]:
return langchain_tools
5 changes: 2 additions & 3 deletions src/sayvai_tools/tools/pdfreader/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# init file from pdf reader tool
from sayvai_tools.tools.pdfreader.tool import (ReadPagesTool, ReadPageTool,
ReadPdfTool)
from sayvai_tools.tools.pdfreader.tool import ReadPagesTool, ReadPageTool, ReadPDFTool

__all__ = ["ReadPagesTool", "ReadPdfTool", "ReadPageTool"]
__all__ = ["ReadPagesTool", "ReadPDFTool", "ReadPageTool"]
1 change: 1 addition & 0 deletions src/sayvai_tools/utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from sayvai_tools.utils.google.mail import EmailSender
from sayvai_tools.utils.google.sheets import GSheets
from sayvai_tools.utils.microsoft.excel import Excel

# from sayvai_tools.utils.voice.stt import STT
from sayvai_tools.utils.voice.tts import ElevenlabsAudioStreaming

Expand Down
5 changes: 2 additions & 3 deletions src/sayvai_tools/utils/database/dbchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@
from langchain.callbacks.manager import CallbackManagerForChainRun
from langchain.chains.base import Chain
from langchain.chains.llm import LLMChain
from langchain.chains.sql_database.prompt import (DECIDER_PROMPT, PROMPT,
SQL_PROMPTS)
from langchain.chains.sql_database.prompt import DECIDER_PROMPT, PROMPT, SQL_PROMPTS
from langchain.prompts.prompt import PromptTemplate
from langchain.schema import BasePromptTemplate
from langchain.schema.language_model import BaseLanguageModel
from langchain.tools.sql_database.prompt import QUERY_CHECKER
from langchain_experimental.pydantic_v1 import Extra, Field, root_validator
from langchain.pydantic_v1 import Extra, Field, root_validator

from sayvai_tools.utils.database.dbbase import SQLDatabase

Expand Down
5 changes: 2 additions & 3 deletions src/sayvai_tools/utils/database/sheetschain.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@
from langchain.callbacks.manager import CallbackManagerForChainRun
from langchain.chains.base import Chain
from langchain.chains.llm import LLMChain
from langchain.chains.sql_database.prompt import (DECIDER_PROMPT, PROMPT,
SQL_PROMPTS)
from langchain.chains.sql_database.prompt import DECIDER_PROMPT, PROMPT, SQL_PROMPTS
from langchain.prompts.prompt import PromptTemplate
from langchain.schema import BasePromptTemplate
from langchain.schema.language_model import BaseLanguageModel
from langchain.tools.sql_database.prompt import QUERY_CHECKER
from langchain_experimental.pydantic_v1 import Extra, Field, root_validator
from langchain.pydantic_v1 import Extra, Field, root_validator

from sayvai_tools.utils.database.dbsheetsbase import SQLDatabaseSheetsBase

Expand Down
8 changes: 8 additions & 0 deletions src/sayvai_tools/utils/exception.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,11 @@ class SayvaiToolsWarning(Warning):
def __init__(self, message: str):
self.message = message
super().__init__(self.message)


class SayvaiToolsDeprecatedWarning(SayvaiToolsWarning):
"""Base class for deprecated warnings in this module."""

def __init__(self, message: str):
self.message = message
super().__init__(self.message)
3 changes: 1 addition & 2 deletions src/sayvai_tools/utils/pdfreader/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# init file
from sayvai_tools.utils.pdfreader.readpdf import (read_page, read_pages,
read_pdf)
from sayvai_tools.utils.pdfreader.readpdf import read_page, read_pages, read_pdf

__all__ = ["read_page", "read_pdf", "read_pages"]
4 changes: 3 additions & 1 deletion src/sayvai_tools/utils/system/properties/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""init file for properties utils"""

from sayvai_tools.utils.system.properties.properties import (
SystemProperties, get_all_properties)
SystemProperties,
get_all_properties,
)

__properties__ = properties

0 comments on commit 9829147

Please sign in to comment.