ai-parrot 0.2.1__tar.gz → 0.2.3__tar.gz
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.1 → ai_parrot-0.2.3}/PKG-INFO +1 -1
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/ai_parrot.egg-info/PKG-INFO +1 -1
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/ai_parrot.egg-info/SOURCES.txt +1 -0
- ai_parrot-0.2.3/documents/ex-code-loaders.txt +116 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/chatbots/abstract.py +15 -131
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/chatbots/retrievals/__init__.py +3 -7
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/version.py +1 -1
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/.flake8 +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/.github/dependabot.yml +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/.github/workflows/codeql-analysis.yml +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/.github/workflows/release.yml +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/.gitignore +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/.isort.cfg +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/.pylintrc +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/INSTALL +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/LICENSE +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/Makefile +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/README.md +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/SECURITY.md +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/ai_parrot.egg-info/dependency_links.txt +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/ai_parrot.egg-info/requires.txt +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/ai_parrot.egg-info/top_level.txt +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/app.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/etc/navigator-ssl.ini +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/etc/navigator.ini +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/etc/ssl/domain.ext +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/etc/ssl/navigator.local.crt +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/etc/ssl/navigator.local.csr +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/etc/ssl/navigator.local.key +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/etc/ssl/rootCA.crt +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/etc/ssl/rootCA.key +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/etc/ssl/rootCA.srl +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/examples/test_bot.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/examples/test_question.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/mypy.ini +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/__init__.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/chatbots/__init__.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/chatbots/asktroc.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/chatbots/base.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/chatbots/basic.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/chatbots/bose.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/chatbots/cody.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/chatbots/copilot.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/chatbots/dataframe.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/chatbots/hragents.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/chatbots/odoo.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/chatbots/retrievals/constitutional.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/conf.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/crew/__init__.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/crew/tools/__init__.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/crew/tools/bing.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/crew/tools/config.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/crew/tools/duckgo.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/crew/tools/file.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/crew/tools/google.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/crew/tools/gtrends.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/crew/tools/md2pdf.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/crew/tools/rag.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/crew/tools/search.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/crew/tools/url.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/exceptions.c +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/exceptions.pyx +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/handlers/__init__.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/handlers/bots.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/handlers/chat.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/interfaces/__init__.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/interfaces/database.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/llms/__init__.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/llms/abstract.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/llms/anthropic.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/llms/google.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/llms/groq.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/llms/hf.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/llms/openai.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/llms/pipes.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/llms/vertex.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/loaders/__init__.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/loaders/abstract.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/loaders/basepdf.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/loaders/basevideo.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/loaders/csv.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/loaders/dir.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/loaders/excel.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/loaders/github.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/loaders/handlers/__init__.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/loaders/handlers/data.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/loaders/image.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/loaders/json.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/loaders/pdf.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/loaders/pdfchapters.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/loaders/pdffn.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/loaders/pdfimages.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/loaders/pdfmark.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/loaders/pdftables.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/loaders/ppt.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/loaders/qa.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/loaders/repo.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/loaders/rtd.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/loaders/txt.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/loaders/utils/__init__.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/loaders/utils/models.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/loaders/video.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/loaders/videolocal.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/loaders/vimeo.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/loaders/web.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/loaders/web_base.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/loaders/word.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/loaders/youtube.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/manager.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/models.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/py.typed +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/stores/__init__.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/stores/abstract.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/stores/milvus.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/stores/qdrant.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/tools/__init__.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/tools/abstract.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/tools/asknews.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/tools/bing.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/tools/duck.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/tools/google.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/tools/stack.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/tools/weather.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/tools/wikipedia.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/tools/zipcode.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/utils/__init__.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/utils/parsers/__init__.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/utils/parsers/toml.c +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/utils/parsers/toml.pyx +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/utils/toml.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/utils/types.cpp +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/utils/types.pyx +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/parrot/utils/uv.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/pyproject.toml +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/pytest.ini +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/requirements/requirements-dev.txt +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/resources/__init__.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/resources/quick.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/resources/users/__init__.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/resources/users/handlers.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/resources/users/models.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/run.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/settings/__init__.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/settings/settings.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/setup.cfg +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/setup.py +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/templates/.compiled +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/templates/README.md +0 -0
- {ai_parrot-0.2.1 → ai_parrot-0.2.3}/tox.ini +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
|
|
@@ -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
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
def load_pdf(self, path: Path, source_type: str = 'pdf', **kwargs):
|
|
2
|
+
loader = PDFLoader(path, source_type=source_type, no_summarization=True, **kwargs)
|
|
3
|
+
return loader.load()
|
|
4
|
+
|
|
5
|
+
def load_github(
|
|
6
|
+
self,
|
|
7
|
+
url: str,
|
|
8
|
+
github_token: str,
|
|
9
|
+
lang: str = 'python',
|
|
10
|
+
branch: str = 'master',
|
|
11
|
+
source_type: str = 'code'
|
|
12
|
+
) -> list:
|
|
13
|
+
git = GithubLoader(
|
|
14
|
+
url,
|
|
15
|
+
github_token=github_token,
|
|
16
|
+
lang=lang,
|
|
17
|
+
branch=branch,
|
|
18
|
+
source_type=source_type
|
|
19
|
+
)
|
|
20
|
+
return git.load()
|
|
21
|
+
|
|
22
|
+
def load_repository(
|
|
23
|
+
self,
|
|
24
|
+
path: Path,
|
|
25
|
+
lang: str = 'python',
|
|
26
|
+
source_type: str = 'code',
|
|
27
|
+
**kwargs
|
|
28
|
+
) -> list:
|
|
29
|
+
repo = RepositoryLoader(
|
|
30
|
+
source_type=source_type,
|
|
31
|
+
**kwargs
|
|
32
|
+
)
|
|
33
|
+
return repo.load(path, lang=lang)
|
|
34
|
+
|
|
35
|
+
def process_websites(
|
|
36
|
+
self,
|
|
37
|
+
websites: list,
|
|
38
|
+
source_type: str = 'website',
|
|
39
|
+
**kwargs
|
|
40
|
+
) -> list:
|
|
41
|
+
loader = WebLoader(
|
|
42
|
+
urls=websites,
|
|
43
|
+
source_type=source_type
|
|
44
|
+
)
|
|
45
|
+
return loader.load()
|
|
46
|
+
|
|
47
|
+
def load_youtube_videos(
|
|
48
|
+
self,
|
|
49
|
+
urls: list,
|
|
50
|
+
video_path: Union[str, Path],
|
|
51
|
+
source_type: str = 'youtube',
|
|
52
|
+
priority: int = 'high',
|
|
53
|
+
language: str = 'en',
|
|
54
|
+
**kwargs
|
|
55
|
+
) -> list:
|
|
56
|
+
yt = YoutubeLoader(
|
|
57
|
+
urls=urls,
|
|
58
|
+
video_path=video_path,
|
|
59
|
+
source_type=source_type,
|
|
60
|
+
priority=priority,
|
|
61
|
+
language=language,
|
|
62
|
+
llm=self._llm,
|
|
63
|
+
**kwargs
|
|
64
|
+
)
|
|
65
|
+
return yt.load()
|
|
66
|
+
|
|
67
|
+
def load_vimeo_videos(
|
|
68
|
+
self,
|
|
69
|
+
urls: list,
|
|
70
|
+
video_path: Union[str, Path],
|
|
71
|
+
source_type: str = 'vimeo',
|
|
72
|
+
priority: int = 'high',
|
|
73
|
+
language: str = 'en',
|
|
74
|
+
**kwargs
|
|
75
|
+
) -> list:
|
|
76
|
+
yt = VimeoLoader(
|
|
77
|
+
urls=urls,
|
|
78
|
+
video_path=video_path,
|
|
79
|
+
source_type=source_type,
|
|
80
|
+
priority=priority,
|
|
81
|
+
language=language,
|
|
82
|
+
llm=self._llm,
|
|
83
|
+
**kwargs
|
|
84
|
+
)
|
|
85
|
+
return yt.load()
|
|
86
|
+
|
|
87
|
+
def load_directory(
|
|
88
|
+
self,
|
|
89
|
+
path: Union[str, Path],
|
|
90
|
+
source_type: str = 'documents',
|
|
91
|
+
) -> list:
|
|
92
|
+
return None
|
|
93
|
+
|
|
94
|
+
def load_docx(
|
|
95
|
+
self,
|
|
96
|
+
path: Path,
|
|
97
|
+
source_type: str = 'docx',
|
|
98
|
+
**kwargs
|
|
99
|
+
) -> list:
|
|
100
|
+
return MSWordLoader.from_path(
|
|
101
|
+
path=path,
|
|
102
|
+
source_type=source_type,
|
|
103
|
+
**kwargs
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
def load_pptx(
|
|
107
|
+
self,
|
|
108
|
+
path: Path,
|
|
109
|
+
source_type: str = 'pptx',
|
|
110
|
+
**kwargs
|
|
111
|
+
) -> list:
|
|
112
|
+
return PPTXLoader.from_path(
|
|
113
|
+
path=path,
|
|
114
|
+
source_type=source_type,
|
|
115
|
+
**kwargs
|
|
116
|
+
)
|
|
@@ -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,
|
|
@@ -626,9 +614,6 @@ class AbstractChatbot(ABC, DBInterface):
|
|
|
626
614
|
)
|
|
627
615
|
elif vector_db == 'MilvusStore':
|
|
628
616
|
if MILVUS_ENABLED is True:
|
|
629
|
-
print('EMBEDDINGS > ', self.embeddings)
|
|
630
|
-
print('AQUI MILVUS >> ', embed)
|
|
631
|
-
print('AQUI MILVUS >> ', self.embedding_model_name)
|
|
632
617
|
self._store = MilvusStore(
|
|
633
618
|
embeddings=embed,
|
|
634
619
|
embedding_name=self.embedding_model_name,
|
|
@@ -805,122 +790,21 @@ class AbstractChatbot(ABC, DBInterface):
|
|
|
805
790
|
collection=collection
|
|
806
791
|
)
|
|
807
792
|
|
|
808
|
-
def
|
|
809
|
-
loader = PDFLoader(path, source_type=source_type, no_summarization=True, **kwargs)
|
|
810
|
-
return loader.load()
|
|
811
|
-
|
|
812
|
-
def load_github(
|
|
813
|
-
self,
|
|
814
|
-
url: str,
|
|
815
|
-
github_token: str,
|
|
816
|
-
lang: str = 'python',
|
|
817
|
-
branch: str = 'master',
|
|
818
|
-
source_type: str = 'code'
|
|
819
|
-
) -> list:
|
|
820
|
-
git = GithubLoader(
|
|
821
|
-
url,
|
|
822
|
-
github_token=github_token,
|
|
823
|
-
lang=lang,
|
|
824
|
-
branch=branch,
|
|
825
|
-
source_type=source_type
|
|
826
|
-
)
|
|
827
|
-
return git.load()
|
|
828
|
-
|
|
829
|
-
def load_repository(
|
|
830
|
-
self,
|
|
831
|
-
path: Path,
|
|
832
|
-
lang: str = 'python',
|
|
833
|
-
source_type: str = 'code',
|
|
834
|
-
**kwargs
|
|
835
|
-
) -> list:
|
|
836
|
-
repo = RepositoryLoader(
|
|
837
|
-
source_type=source_type,
|
|
838
|
-
**kwargs
|
|
839
|
-
)
|
|
840
|
-
return repo.load(path, lang=lang)
|
|
841
|
-
|
|
842
|
-
def process_websites(
|
|
843
|
-
self,
|
|
844
|
-
websites: list,
|
|
845
|
-
source_type: str = 'website',
|
|
846
|
-
**kwargs
|
|
847
|
-
) -> list:
|
|
848
|
-
loader = WebLoader(
|
|
849
|
-
urls=websites,
|
|
850
|
-
source_type=source_type
|
|
851
|
-
)
|
|
852
|
-
return loader.load()
|
|
853
|
-
|
|
854
|
-
def load_youtube_videos(
|
|
855
|
-
self,
|
|
856
|
-
urls: list,
|
|
857
|
-
video_path: Union[str, Path],
|
|
858
|
-
source_type: str = 'youtube',
|
|
859
|
-
priority: int = 'high',
|
|
860
|
-
language: str = 'en',
|
|
861
|
-
**kwargs
|
|
862
|
-
) -> list:
|
|
863
|
-
yt = YoutubeLoader(
|
|
864
|
-
urls=urls,
|
|
865
|
-
video_path=video_path,
|
|
866
|
-
source_type=source_type,
|
|
867
|
-
priority=priority,
|
|
868
|
-
language=language,
|
|
869
|
-
llm=self._llm,
|
|
870
|
-
**kwargs
|
|
871
|
-
)
|
|
872
|
-
return yt.load()
|
|
873
|
-
|
|
874
|
-
def load_vimeo_videos(
|
|
875
|
-
self,
|
|
876
|
-
urls: list,
|
|
877
|
-
video_path: Union[str, Path],
|
|
878
|
-
source_type: str = 'vimeo',
|
|
879
|
-
priority: int = 'high',
|
|
880
|
-
language: str = 'en',
|
|
881
|
-
**kwargs
|
|
882
|
-
) -> list:
|
|
883
|
-
yt = VimeoLoader(
|
|
884
|
-
urls=urls,
|
|
885
|
-
video_path=video_path,
|
|
886
|
-
source_type=source_type,
|
|
887
|
-
priority=priority,
|
|
888
|
-
language=language,
|
|
889
|
-
llm=self._llm,
|
|
890
|
-
**kwargs
|
|
891
|
-
)
|
|
892
|
-
return yt.load()
|
|
893
|
-
|
|
894
|
-
def load_directory(
|
|
895
|
-
self,
|
|
896
|
-
path: Union[str, Path],
|
|
897
|
-
source_type: str = 'documents',
|
|
898
|
-
) -> list:
|
|
899
|
-
return None
|
|
900
|
-
|
|
901
|
-
def load_docx(
|
|
793
|
+
def clean_history(
|
|
902
794
|
self,
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
source_type: str = 'pptx',
|
|
917
|
-
**kwargs
|
|
918
|
-
) -> list:
|
|
919
|
-
return PPTXLoader.from_path(
|
|
920
|
-
path=path,
|
|
921
|
-
source_type=source_type,
|
|
922
|
-
**kwargs
|
|
923
|
-
)
|
|
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
|
+
)
|
|
924
808
|
|
|
925
809
|
def get_memory(
|
|
926
810
|
self,
|
|
@@ -928,7 +812,7 @@ class AbstractChatbot(ABC, DBInterface):
|
|
|
928
812
|
key: str = 'chat_history',
|
|
929
813
|
input_key: str = 'question',
|
|
930
814
|
output_key: str = 'answer',
|
|
931
|
-
size: int =
|
|
815
|
+
size: int = 5,
|
|
932
816
|
ttl: int = 86400
|
|
933
817
|
):
|
|
934
818
|
args = {
|
|
@@ -124,7 +124,7 @@ class RetrievalManager:
|
|
|
124
124
|
question: str = None,
|
|
125
125
|
chain_type: str = 'stuff',
|
|
126
126
|
search_type: str = 'similarity',
|
|
127
|
-
search_kwargs: dict = {"k":
|
|
127
|
+
search_kwargs: dict = {"k": 4, "fetch_k": 10, "lambda_mult": 0.89},
|
|
128
128
|
return_docs: bool = True,
|
|
129
129
|
metric_type: str = None,
|
|
130
130
|
memory: Any = None,
|
|
@@ -220,7 +220,7 @@ class RetrievalManager:
|
|
|
220
220
|
question: str = None,
|
|
221
221
|
chain_type: str = 'stuff',
|
|
222
222
|
search_type: str = 'mmr',
|
|
223
|
-
search_kwargs: dict = {"k":
|
|
223
|
+
search_kwargs: dict = {"k": 4, "fetch_k": 10, "lambda_mult": 0.89},
|
|
224
224
|
return_docs: bool = True,
|
|
225
225
|
metric_type: str = None,
|
|
226
226
|
use_llm: str = None
|
|
@@ -452,19 +452,15 @@ class RetrievalManager:
|
|
|
452
452
|
question: str = None,
|
|
453
453
|
chain_type: str = 'stuff',
|
|
454
454
|
search_type: str = 'similarity',
|
|
455
|
-
search_kwargs: dict = {"k":
|
|
455
|
+
search_kwargs: dict = {"k": 4, "fetch_k": 10, "lambda_mult": 0.89},
|
|
456
456
|
return_docs: bool = True,
|
|
457
457
|
metric_type: str = None,
|
|
458
458
|
memory: Any = None,
|
|
459
459
|
**kwargs
|
|
460
460
|
):
|
|
461
461
|
# Generating Vector:
|
|
462
|
-
# print('COLLECTION > ', self.store.collection, self.store.embedding_name)
|
|
463
|
-
# print('DB > ', self.store.database)
|
|
464
462
|
async with self.store as store: #pylint: disable=E1101
|
|
465
463
|
vector = store.get_vector(metric_type=metric_type)
|
|
466
|
-
# docs = vector.similarity_search(question, k=1)
|
|
467
|
-
# print('DOCS > ', docs)
|
|
468
464
|
retriever = VectorStoreRetriever(
|
|
469
465
|
vectorstore=vector,
|
|
470
466
|
search_type=search_type,
|
|
@@ -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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|