-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from Sayvai-io/version
Version
- Loading branch information
Showing
32 changed files
with
3,594 additions
and
534 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,4 +23,5 @@ tests/__pycache__ | |
.pytest_cache/* | ||
client_secrets.json | ||
credentials (1).json | ||
.env | ||
.env | ||
docs.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,7 @@ build: | |
|
||
install: | ||
pip install . | ||
|
||
format: | ||
black src/ | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,37 @@ | ||
[tool.poetry] | ||
name = "sayvai-tools" | ||
version = "0.0.2" | ||
version = "0.0.3" | ||
description = "A python framwork for customising langchain assiatants." | ||
authors = ["sayvai <[email protected]>"] | ||
license = "MIT" | ||
readme = "README.md" | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.11" | ||
pyaudio = "0.2.11" | ||
openai = "0.28.0" | ||
rich = "13.7.0" | ||
pinecone-client = "2.2.4" | ||
langchain = "0.0.292" | ||
llama-index = "0.8.22" | ||
transformers = "^4.36.2" | ||
sqlalchemy = "2.0.20" | ||
elevenlabs = "0.2.24" | ||
google-auth-oauthlib = "^1.2.0" | ||
google-auth-httplib2 = "^0.2.0" | ||
numpy = "^1.26.3" | ||
google = "^3.0.0" | ||
google-cloud-speech = "^2.23.0" | ||
cloud-sql-python-connector = "^1.5.0" | ||
pg8000 = "^1.30.4" | ||
pgvector = "^0.2.4" | ||
pandas = "^2.1.4" | ||
openpyxl = "^3.1.2" | ||
gspread = "5.11.3" | ||
pydub = "^0.25.1" | ||
oauth2client = "^4.1.3" | ||
pytest = "^7.4.4" | ||
python-dotenv = "^1.0.0" | ||
|
||
|
||
[build-system] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
__version__ = "0.0.2" | ||
__version__ = "0.0.3" | ||
__author__ = "sayvai-io" | ||
__author_email__ = "[email protected]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,53 @@ | ||
"""Conversational Human """ | ||
import os | ||
from typing import Callable, Optional | ||
# """Conversational Human """ | ||
# import os | ||
# from typing import Callable, Optional | ||
|
||
from elevenlabs import play | ||
from langchain.callbacks.manager import CallbackManagerForToolRun | ||
from langchain.pydantic_v1 import Field | ||
# from elevenlabs import play | ||
# from langchain.callbacks.manager import CallbackManagerForToolRun | ||
# from langchain.pydantic_v1 import Field | ||
|
||
from sayvai_tools.utils.voice.stt import STT | ||
from sayvai_tools.utils.voice.tts import ElevenlabsAudioStreaming | ||
# from sayvai_tools.utils.voice.stt import STT | ||
# from sayvai_tools.utils.voice.tts import ElevenlabsAudioStreaming | ||
|
||
|
||
class ConversationalHuman: | ||
"""Tool that asks user for input.""" | ||
|
||
name: str = "human" | ||
description: str = ( | ||
"You can ask a human for guidance when you think you " | ||
"got stuck or you are not sure what to do next. " | ||
"The input should be a question for the human." | ||
) | ||
# prompt_func: Callable[[str], None] = Field(default_factory=lambda: _print_func) | ||
# input_func: Callable = Field(default_factory=lambda: input) | ||
|
||
def __init__(self, api_key: str, g_api_key: str, phrase_set_path: str) -> None: | ||
self.stt = STT(audio_format="mp3", speech_context_path=phrase_set_path) | ||
self.tts = ElevenlabsAudioStreaming(api_key=api_key) | ||
self.g_api_key = g_api_key | ||
|
||
def _run( | ||
self, | ||
query: str, | ||
run_manager: Optional[CallbackManagerForToolRun] = None, | ||
) -> str: | ||
"""Use the Human input tool.""" | ||
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = self.g_api_key | ||
inputbytes = self.tts.audio_streaming( | ||
query, | ||
model="eleven_multilingual_v1", | ||
voice="Adam", | ||
audio_streaming=True, | ||
stability=0.5, | ||
similarity=0.5, | ||
# api_key= self.api_key | ||
) | ||
play(inputbytes) | ||
|
||
# self.prompt_func(query) | ||
# return self.input_func() | ||
return self.stt.generate_text() | ||
raise "NotImplementedError" | ||
|
||
|
||
# """Tool that asks user for input.""" | ||
|
||
# name: str = "human" | ||
# description: str = ( | ||
# "You can ask a human for guidance when you think you " | ||
# "got stuck or you are not sure what to do next. " | ||
# "The input should be a question for the human." | ||
# ) | ||
# # prompt_func: Callable[[str], None] = Field(default_factory=lambda: _print_func) | ||
# # input_func: Callable = Field(default_factory=lambda: input) | ||
|
||
# def __init__(self, api_key: str, g_api_key: str, phrase_set_path: str) -> None: | ||
# self.stt = STT(audio_format="mp3", speech_context_path=phrase_set_path) | ||
# self.tts = ElevenlabsAudioStreaming(api_key=api_key) | ||
# self.g_api_key = g_api_key | ||
|
||
# def _run( | ||
# self, | ||
# query: str, | ||
# run_manager: Optional[CallbackManagerForToolRun] = None, | ||
# ) -> str: | ||
# """Use the Human input tool.""" | ||
# os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = self.g_api_key | ||
# inputbytes = self.tts.audio_streaming( | ||
# query, | ||
# model="eleven_multilingual_v1", | ||
# voice="Adam", | ||
# audio_streaming=True, | ||
# stability=0.5, | ||
# similarity=0.5, | ||
# # api_key= self.api_key | ||
# ) | ||
# play(inputbytes) | ||
|
||
# # self.prompt_func(query) | ||
# # return self.input_func() | ||
# return self.stt.generate_text() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
"""init file for forms""" | ||
"""init file for forms""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
from sayvai_tools.tools.retrive_details.retrive_email.tool import RetrieveEmail | ||
from sayvai_tools.tools.retrive_details.retrive_phone.tool import RetrievePhone | ||
|
||
__all__ = ["RetrieveEmail", | ||
"RetrievePhone"] | ||
__all__ = ["RetrieveEmail", "RetrievePhone"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
## init file for send mail | ||
## init file for send mail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
|
||
|
||
class Sheets: | ||
|
||
name = "sheets" | ||
description = ( | ||
"Useful for creating and updating sheets." | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
# init file for google | ||
# init file for google |
Oops, something went wrong.