ai-parrot 0.2.2__cp311-cp311-manylinux_2_28_x86_64.whl → 0.2.3__cp311-cp311-manylinux_2_28_x86_64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of ai-parrot might be problematic. Click here for more details.
- {ai_parrot-0.2.2.dist-info → ai_parrot-0.2.3.dist-info}/METADATA +1 -1
- {ai_parrot-0.2.2.dist-info → ai_parrot-0.2.3.dist-info}/RECORD +7 -7
- parrot/chatbots/abstract.py +15 -128
- parrot/version.py +1 -1
- {ai_parrot-0.2.2.dist-info → ai_parrot-0.2.3.dist-info}/LICENSE +0 -0
- {ai_parrot-0.2.2.dist-info → ai_parrot-0.2.3.dist-info}/WHEEL +0 -0
- {ai_parrot-0.2.2.dist-info → ai_parrot-0.2.3.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ai-parrot
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.3
|
|
4
4
|
Summary: Live Chatbots based on Langchain chatbots and Agents Integrated into Navigator Framework or used into aiohttp applications.
|
|
5
5
|
Home-page: https://github.com/phenobarbital/ai-parrot
|
|
6
6
|
Author: Jesus Lara
|
|
@@ -4,9 +4,9 @@ parrot/exceptions.cpython-311-x86_64-linux-gnu.so,sha256=p2epCb17B2DCUg3-CZizDQI
|
|
|
4
4
|
parrot/manager.py,sha256=UShLbqfNyPvnGYHzprzQYwu_oj1L-Mhhk2qMRRnsfwo,5187
|
|
5
5
|
parrot/models.py,sha256=GlyWMe2OCgM9dySm2BzK60yKOMHqFth7TYHidTWnioY,12513
|
|
6
6
|
parrot/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
-
parrot/version.py,sha256
|
|
7
|
+
parrot/version.py,sha256=jffo_3m_M-XJTuobuxGR6dQJrAoGVYBA7Ul7Ldc1jKU,373
|
|
8
8
|
parrot/chatbots/__init__.py,sha256=ypskCnME0xUv6psBEGCEyXCrD0J0ULHSllpVmSxqb4A,200
|
|
9
|
-
parrot/chatbots/abstract.py,sha256=
|
|
9
|
+
parrot/chatbots/abstract.py,sha256=sYEgs-SCHuax6f_QiTVNYxqyuGYdsGYLPSFbLhgJnaU,30520
|
|
10
10
|
parrot/chatbots/asktroc.py,sha256=gyWzyvpAnmXwXd-3DEKoIJtAxt6NnP5mUZdZbkFky8s,604
|
|
11
11
|
parrot/chatbots/base.py,sha256=fXqCzxeA2dU2wYlOV7jCMF4S9_8ohqGMdUfm2VQTfQQ,8054
|
|
12
12
|
parrot/chatbots/basic.py,sha256=DIMTPoGc90BRSlokeOdnjlEXAAfZlIFqxXWaMyAX9uk,232
|
|
@@ -102,8 +102,8 @@ resources/users/handlers.py,sha256=BGzqBvPY_OaIF_nONWX4b_B5OyyBrdGuSihIsdlFwjk,2
|
|
|
102
102
|
resources/users/models.py,sha256=glk7Emv7QCi6i32xRFDrGc8UwK23_LPg0XUOJoHnwRU,6799
|
|
103
103
|
settings/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
104
104
|
settings/settings.py,sha256=9ueEvyLNurUX-AaIeRPV8GKX1c4YjDLbksUAeqEq6Ck,1854
|
|
105
|
-
ai_parrot-0.2.
|
|
106
|
-
ai_parrot-0.2.
|
|
107
|
-
ai_parrot-0.2.
|
|
108
|
-
ai_parrot-0.2.
|
|
109
|
-
ai_parrot-0.2.
|
|
105
|
+
ai_parrot-0.2.3.dist-info/LICENSE,sha256=vRKOoa7onTsLNvSzJtGtMaNhWWh8B3YAT733Tlu6M4o,1070
|
|
106
|
+
ai_parrot-0.2.3.dist-info/METADATA,sha256=pODrWxcJrK5wB-ZCkJel6S8kht_mSNp7aEySw_ivigY,9336
|
|
107
|
+
ai_parrot-0.2.3.dist-info/WHEEL,sha256=czZm5XKxt3lM6KcAi6fwGhndrA0uZKYAkkvqX1vZAww,113
|
|
108
|
+
ai_parrot-0.2.3.dist-info/top_level.txt,sha256=qHoO4BhYDfeTkyKnciZSQtn5FSLN3Q-P5xCTkyvbuxg,26
|
|
109
|
+
ai_parrot-0.2.3.dist-info/RECORD,,
|
parrot/chatbots/abstract.py
CHANGED
|
@@ -107,20 +107,8 @@ try:
|
|
|
107
107
|
except (ModuleNotFoundError, ImportError):
|
|
108
108
|
GROQ_ENABLED = False
|
|
109
109
|
|
|
110
|
-
from ..loaders import (
|
|
111
|
-
PDFLoader,
|
|
112
|
-
PDFTablesLoader,
|
|
113
|
-
GithubLoader,
|
|
114
|
-
RepositoryLoader,
|
|
115
|
-
WebLoader,
|
|
116
|
-
VimeoLoader,
|
|
117
|
-
YoutubeLoader,
|
|
118
|
-
PPTXLoader,
|
|
119
|
-
MSWordLoader
|
|
120
|
-
)
|
|
121
110
|
from .retrievals import RetrievalManager
|
|
122
111
|
from ..conf import (
|
|
123
|
-
DEFAULT_LLM_MODEL_NAME,
|
|
124
112
|
EMBEDDING_DEVICE,
|
|
125
113
|
MAX_VRAM_AVAILABLE,
|
|
126
114
|
RAM_AVAILABLE,
|
|
@@ -802,122 +790,21 @@ class AbstractChatbot(ABC, DBInterface):
|
|
|
802
790
|
collection=collection
|
|
803
791
|
)
|
|
804
792
|
|
|
805
|
-
def
|
|
806
|
-
loader = PDFLoader(path, source_type=source_type, no_summarization=True, **kwargs)
|
|
807
|
-
return loader.load()
|
|
808
|
-
|
|
809
|
-
def load_github(
|
|
810
|
-
self,
|
|
811
|
-
url: str,
|
|
812
|
-
github_token: str,
|
|
813
|
-
lang: str = 'python',
|
|
814
|
-
branch: str = 'master',
|
|
815
|
-
source_type: str = 'code'
|
|
816
|
-
) -> list:
|
|
817
|
-
git = GithubLoader(
|
|
818
|
-
url,
|
|
819
|
-
github_token=github_token,
|
|
820
|
-
lang=lang,
|
|
821
|
-
branch=branch,
|
|
822
|
-
source_type=source_type
|
|
823
|
-
)
|
|
824
|
-
return git.load()
|
|
825
|
-
|
|
826
|
-
def load_repository(
|
|
827
|
-
self,
|
|
828
|
-
path: Path,
|
|
829
|
-
lang: str = 'python',
|
|
830
|
-
source_type: str = 'code',
|
|
831
|
-
**kwargs
|
|
832
|
-
) -> list:
|
|
833
|
-
repo = RepositoryLoader(
|
|
834
|
-
source_type=source_type,
|
|
835
|
-
**kwargs
|
|
836
|
-
)
|
|
837
|
-
return repo.load(path, lang=lang)
|
|
838
|
-
|
|
839
|
-
def process_websites(
|
|
840
|
-
self,
|
|
841
|
-
websites: list,
|
|
842
|
-
source_type: str = 'website',
|
|
843
|
-
**kwargs
|
|
844
|
-
) -> list:
|
|
845
|
-
loader = WebLoader(
|
|
846
|
-
urls=websites,
|
|
847
|
-
source_type=source_type
|
|
848
|
-
)
|
|
849
|
-
return loader.load()
|
|
850
|
-
|
|
851
|
-
def load_youtube_videos(
|
|
852
|
-
self,
|
|
853
|
-
urls: list,
|
|
854
|
-
video_path: Union[str, Path],
|
|
855
|
-
source_type: str = 'youtube',
|
|
856
|
-
priority: int = 'high',
|
|
857
|
-
language: str = 'en',
|
|
858
|
-
**kwargs
|
|
859
|
-
) -> list:
|
|
860
|
-
yt = YoutubeLoader(
|
|
861
|
-
urls=urls,
|
|
862
|
-
video_path=video_path,
|
|
863
|
-
source_type=source_type,
|
|
864
|
-
priority=priority,
|
|
865
|
-
language=language,
|
|
866
|
-
llm=self._llm,
|
|
867
|
-
**kwargs
|
|
868
|
-
)
|
|
869
|
-
return yt.load()
|
|
870
|
-
|
|
871
|
-
def load_vimeo_videos(
|
|
872
|
-
self,
|
|
873
|
-
urls: list,
|
|
874
|
-
video_path: Union[str, Path],
|
|
875
|
-
source_type: str = 'vimeo',
|
|
876
|
-
priority: int = 'high',
|
|
877
|
-
language: str = 'en',
|
|
878
|
-
**kwargs
|
|
879
|
-
) -> list:
|
|
880
|
-
yt = VimeoLoader(
|
|
881
|
-
urls=urls,
|
|
882
|
-
video_path=video_path,
|
|
883
|
-
source_type=source_type,
|
|
884
|
-
priority=priority,
|
|
885
|
-
language=language,
|
|
886
|
-
llm=self._llm,
|
|
887
|
-
**kwargs
|
|
888
|
-
)
|
|
889
|
-
return yt.load()
|
|
890
|
-
|
|
891
|
-
def load_directory(
|
|
892
|
-
self,
|
|
893
|
-
path: Union[str, Path],
|
|
894
|
-
source_type: str = 'documents',
|
|
895
|
-
) -> list:
|
|
896
|
-
return None
|
|
897
|
-
|
|
898
|
-
def load_docx(
|
|
793
|
+
def clean_history(
|
|
899
794
|
self,
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
source_type: str = 'pptx',
|
|
914
|
-
**kwargs
|
|
915
|
-
) -> list:
|
|
916
|
-
return PPTXLoader.from_path(
|
|
917
|
-
path=path,
|
|
918
|
-
source_type=source_type,
|
|
919
|
-
**kwargs
|
|
920
|
-
)
|
|
795
|
+
session_id: str = None
|
|
796
|
+
):
|
|
797
|
+
try:
|
|
798
|
+
redis_client = RedisChatMessageHistory(
|
|
799
|
+
url=REDIS_HISTORY_URL,
|
|
800
|
+
session_id=session_id,
|
|
801
|
+
ttl=60
|
|
802
|
+
)
|
|
803
|
+
redis_client.clear()
|
|
804
|
+
except Exception as e:
|
|
805
|
+
self.logger.error(
|
|
806
|
+
f"Error clearing chat history: {e}"
|
|
807
|
+
)
|
|
921
808
|
|
|
922
809
|
def get_memory(
|
|
923
810
|
self,
|
|
@@ -925,7 +812,7 @@ class AbstractChatbot(ABC, DBInterface):
|
|
|
925
812
|
key: str = 'chat_history',
|
|
926
813
|
input_key: str = 'question',
|
|
927
814
|
output_key: str = 'answer',
|
|
928
|
-
size: int =
|
|
815
|
+
size: int = 5,
|
|
929
816
|
ttl: int = 86400
|
|
930
817
|
):
|
|
931
818
|
args = {
|
parrot/version.py
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
__title__ = "ai-parrot"
|
|
4
4
|
__description__ = "Live Chatbots based on Langchain chatbots and Agents \
|
|
5
5
|
Integrated into Navigator Framework or used into aiohttp applications."
|
|
6
|
-
__version__ = "0.2.
|
|
6
|
+
__version__ = "0.2.3"
|
|
7
7
|
__author__ = "Jesus Lara"
|
|
8
8
|
__author_email__ = "jesuslarag@gmail.com"
|
|
9
9
|
__license__ = "MIT"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|