ai-parrot 0.2.2__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.

Files changed (149) hide show
  1. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/PKG-INFO +1 -1
  2. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/ai_parrot.egg-info/PKG-INFO +1 -1
  3. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/ai_parrot.egg-info/SOURCES.txt +1 -0
  4. ai_parrot-0.2.3/documents/ex-code-loaders.txt +116 -0
  5. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/chatbots/abstract.py +15 -128
  6. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/version.py +1 -1
  7. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/.flake8 +0 -0
  8. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/.github/dependabot.yml +0 -0
  9. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/.github/workflows/codeql-analysis.yml +0 -0
  10. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/.github/workflows/release.yml +0 -0
  11. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/.gitignore +0 -0
  12. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/.isort.cfg +0 -0
  13. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/.pylintrc +0 -0
  14. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/INSTALL +0 -0
  15. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/LICENSE +0 -0
  16. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/Makefile +0 -0
  17. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/README.md +0 -0
  18. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/SECURITY.md +0 -0
  19. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/ai_parrot.egg-info/dependency_links.txt +0 -0
  20. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/ai_parrot.egg-info/requires.txt +0 -0
  21. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/ai_parrot.egg-info/top_level.txt +0 -0
  22. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/app.py +0 -0
  23. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/etc/navigator-ssl.ini +0 -0
  24. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/etc/navigator.ini +0 -0
  25. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/etc/ssl/domain.ext +0 -0
  26. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/etc/ssl/navigator.local.crt +0 -0
  27. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/etc/ssl/navigator.local.csr +0 -0
  28. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/etc/ssl/navigator.local.key +0 -0
  29. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/etc/ssl/rootCA.crt +0 -0
  30. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/etc/ssl/rootCA.key +0 -0
  31. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/etc/ssl/rootCA.srl +0 -0
  32. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/examples/test_bot.py +0 -0
  33. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/examples/test_question.py +0 -0
  34. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/mypy.ini +0 -0
  35. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/__init__.py +0 -0
  36. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/chatbots/__init__.py +0 -0
  37. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/chatbots/asktroc.py +0 -0
  38. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/chatbots/base.py +0 -0
  39. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/chatbots/basic.py +0 -0
  40. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/chatbots/bose.py +0 -0
  41. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/chatbots/cody.py +0 -0
  42. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/chatbots/copilot.py +0 -0
  43. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/chatbots/dataframe.py +0 -0
  44. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/chatbots/hragents.py +0 -0
  45. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/chatbots/odoo.py +0 -0
  46. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/chatbots/retrievals/__init__.py +0 -0
  47. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/chatbots/retrievals/constitutional.py +0 -0
  48. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/conf.py +0 -0
  49. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/crew/__init__.py +0 -0
  50. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/crew/tools/__init__.py +0 -0
  51. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/crew/tools/bing.py +0 -0
  52. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/crew/tools/config.py +0 -0
  53. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/crew/tools/duckgo.py +0 -0
  54. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/crew/tools/file.py +0 -0
  55. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/crew/tools/google.py +0 -0
  56. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/crew/tools/gtrends.py +0 -0
  57. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/crew/tools/md2pdf.py +0 -0
  58. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/crew/tools/rag.py +0 -0
  59. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/crew/tools/search.py +0 -0
  60. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/crew/tools/url.py +0 -0
  61. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/exceptions.c +0 -0
  62. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/exceptions.pyx +0 -0
  63. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/handlers/__init__.py +0 -0
  64. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/handlers/bots.py +0 -0
  65. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/handlers/chat.py +0 -0
  66. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/interfaces/__init__.py +0 -0
  67. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/interfaces/database.py +0 -0
  68. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/llms/__init__.py +0 -0
  69. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/llms/abstract.py +0 -0
  70. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/llms/anthropic.py +0 -0
  71. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/llms/google.py +0 -0
  72. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/llms/groq.py +0 -0
  73. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/llms/hf.py +0 -0
  74. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/llms/openai.py +0 -0
  75. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/llms/pipes.py +0 -0
  76. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/llms/vertex.py +0 -0
  77. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/loaders/__init__.py +0 -0
  78. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/loaders/abstract.py +0 -0
  79. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/loaders/basepdf.py +0 -0
  80. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/loaders/basevideo.py +0 -0
  81. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/loaders/csv.py +0 -0
  82. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/loaders/dir.py +0 -0
  83. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/loaders/excel.py +0 -0
  84. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/loaders/github.py +0 -0
  85. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/loaders/handlers/__init__.py +0 -0
  86. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/loaders/handlers/data.py +0 -0
  87. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/loaders/image.py +0 -0
  88. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/loaders/json.py +0 -0
  89. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/loaders/pdf.py +0 -0
  90. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/loaders/pdfchapters.py +0 -0
  91. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/loaders/pdffn.py +0 -0
  92. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/loaders/pdfimages.py +0 -0
  93. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/loaders/pdfmark.py +0 -0
  94. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/loaders/pdftables.py +0 -0
  95. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/loaders/ppt.py +0 -0
  96. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/loaders/qa.py +0 -0
  97. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/loaders/repo.py +0 -0
  98. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/loaders/rtd.py +0 -0
  99. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/loaders/txt.py +0 -0
  100. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/loaders/utils/__init__.py +0 -0
  101. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/loaders/utils/models.py +0 -0
  102. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/loaders/video.py +0 -0
  103. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/loaders/videolocal.py +0 -0
  104. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/loaders/vimeo.py +0 -0
  105. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/loaders/web.py +0 -0
  106. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/loaders/web_base.py +0 -0
  107. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/loaders/word.py +0 -0
  108. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/loaders/youtube.py +0 -0
  109. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/manager.py +0 -0
  110. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/models.py +0 -0
  111. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/py.typed +0 -0
  112. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/stores/__init__.py +0 -0
  113. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/stores/abstract.py +0 -0
  114. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/stores/milvus.py +0 -0
  115. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/stores/qdrant.py +0 -0
  116. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/tools/__init__.py +0 -0
  117. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/tools/abstract.py +0 -0
  118. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/tools/asknews.py +0 -0
  119. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/tools/bing.py +0 -0
  120. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/tools/duck.py +0 -0
  121. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/tools/google.py +0 -0
  122. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/tools/stack.py +0 -0
  123. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/tools/weather.py +0 -0
  124. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/tools/wikipedia.py +0 -0
  125. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/tools/zipcode.py +0 -0
  126. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/utils/__init__.py +0 -0
  127. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/utils/parsers/__init__.py +0 -0
  128. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/utils/parsers/toml.c +0 -0
  129. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/utils/parsers/toml.pyx +0 -0
  130. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/utils/toml.py +0 -0
  131. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/utils/types.cpp +0 -0
  132. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/utils/types.pyx +0 -0
  133. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/parrot/utils/uv.py +0 -0
  134. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/pyproject.toml +0 -0
  135. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/pytest.ini +0 -0
  136. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/requirements/requirements-dev.txt +0 -0
  137. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/resources/__init__.py +0 -0
  138. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/resources/quick.py +0 -0
  139. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/resources/users/__init__.py +0 -0
  140. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/resources/users/handlers.py +0 -0
  141. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/resources/users/models.py +0 -0
  142. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/run.py +0 -0
  143. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/settings/__init__.py +0 -0
  144. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/settings/settings.py +0 -0
  145. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/setup.cfg +0 -0
  146. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/setup.py +0 -0
  147. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/templates/.compiled +0 -0
  148. {ai_parrot-0.2.2 → ai_parrot-0.2.3}/templates/README.md +0 -0
  149. {ai_parrot-0.2.2 → 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.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.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
@@ -22,6 +22,7 @@ ai_parrot.egg-info/SOURCES.txt
22
22
  ai_parrot.egg-info/dependency_links.txt
23
23
  ai_parrot.egg-info/requires.txt
24
24
  ai_parrot.egg-info/top_level.txt
25
+ documents/ex-code-loaders.txt
25
26
  etc/navigator-ssl.ini
26
27
  etc/navigator.ini
27
28
  etc/ssl/domain.ext
@@ -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,
@@ -802,122 +790,21 @@ class AbstractChatbot(ABC, DBInterface):
802
790
  collection=collection
803
791
  )
804
792
 
805
- def load_pdf(self, path: Path, source_type: str = 'pdf', **kwargs):
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
- path: Path,
901
- source_type: str = 'docx',
902
- **kwargs
903
- ) -> list:
904
- return MSWordLoader.from_path(
905
- path=path,
906
- source_type=source_type,
907
- **kwargs
908
- )
909
-
910
- def load_pptx(
911
- self,
912
- path: Path,
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 = 30,
815
+ size: int = 5,
929
816
  ttl: int = 86400
930
817
  ):
931
818
  args = {
@@ -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.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