From 8bdb2ff86960746d675ef29b24d96ba9d6eb0a79 Mon Sep 17 00:00:00 2001 From: mraniki <8766259+mraniki@users.noreply.github.com> Date: Fri, 18 Aug 2023 14:05:50 +0200 Subject: [PATCH 01/45] =?UTF-8?q?=F0=9F=9A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LICENSE | 1 + 1 file changed, 1 insertion(+) diff --git a/LICENSE b/LICENSE index 789ea516c..bf3942c5f 100644 --- a/LICENSE +++ b/LICENSE @@ -19,3 +19,4 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + From 894b35a1b20cb40e8aa2508e26bea84354688d89 Mon Sep 17 00:00:00 2001 From: mraniki <8766259+mraniki@users.noreply.github.com> Date: Fri, 18 Aug 2023 15:01:00 +0200 Subject: [PATCH 02/45] =?UTF-8?q?=F0=9F=94=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tt/talky_settings.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tt/talky_settings.toml b/tt/talky_settings.toml index b0212f9b9..e3aaae9da 100644 --- a/tt/talky_settings.toml +++ b/tt/talky_settings.toml @@ -345,11 +345,11 @@ llm_serpapi-key = "" llm_default_prompt = "write a tiny story" # help message listing the commands # available -llm_commands = "🦾 /qq\n" +llm_commands = "🦾 /qq\n/ai" # command for questions bot_command_question = "qq" -# command for topic/conversation -bot_command_topic = "tq" +# command for conversation +bot_command_topic = "ai" ######################################## ### TALKYTREND SETTINGS ### From b4bf8f2262b25e71f193bb29fab69963faba765e Mon Sep 17 00:00:00 2001 From: mraniki <8766259+mraniki@users.noreply.github.com> Date: Fri, 18 Aug 2023 17:54:16 +0200 Subject: [PATCH 03/45] =?UTF-8?q?=E2=9A=97=EF=B8=8F=20updating=20llm=20plu?= =?UTF-8?q?gin=20for=20continous=20mode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 4 ++-- tt/plugins/default_plugins/llm_plugin.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 9aedc5e6c..8f1ca1d12 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,7 +40,7 @@ classifiers = [ [tool.poetry.dependencies] python = "^3.10" dynaconf = "^3.1.12" -loguru = "^0.6.0" +loguru = "0.6.0" asyncz = "^0.3.1" apprise= "^1.4.0" httpx = "^0.24.1" @@ -52,7 +52,7 @@ dxsp = "^4.2.25" findmyorder = "^1.7.16" iamlistening = "^3.3.5" talkytrend = "^1.13.2" -myllm = "^1.2.15" +myllm = "^1.2.18" [tool.poetry.group.dev.dependencies] diff --git a/tt/plugins/default_plugins/llm_plugin.py b/tt/plugins/default_plugins/llm_plugin.py index 97cb1d6e3..533a239dd 100644 --- a/tt/plugins/default_plugins/llm_plugin.py +++ b/tt/plugins/default_plugins/llm_plugin.py @@ -18,12 +18,9 @@ def __init__(self): super().__init__() self.enabled = settings.llm_enabled if self.enabled: - self.version = "MyLLM" self.help_message = settings.llm_commands self.llm= MyLLM() - - async def start(self): """Starts the plugin""" @@ -39,6 +36,8 @@ async def handle_message(self, msg): """Handles incoming messages""" if not self.should_handle(msg): return + if self.llm.continous_mode: + await self.llm.continous_mode(msg) if msg.startswith(settings.bot_prefix): command, *args = msg.split(" ") command = command[1:] @@ -46,6 +45,7 @@ async def handle_message(self, msg): command_mapping = { settings.bot_command_help: self.get_llm_help, settings.bot_command_info: self.get_llm_info, + settings.bot_command_info: self.llm.clear_chat_history, settings.bot_command_question: lambda: self.llm.talk(args), settings.bot_command_topic: lambda: self.llm.chat(args), } @@ -59,6 +59,6 @@ async def get_llm_help(self): async def get_llm_info(self): """info Message""" - return self.version + return self.llm.get_myllm_info() From d0ba48bcfa00b57051e356fbacdbfcea9e3519af Mon Sep 17 00:00:00 2001 From: mraniki Date: Fri, 18 Aug 2023 16:03:47 +0000 Subject: [PATCH 04/45] Update Requirements --- .requirements/requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.requirements/requirements.txt b/.requirements/requirements.txt index cb74c93f0..f44ad15f9 100644 --- a/.requirements/requirements.txt +++ b/.requirements/requirements.txt @@ -72,7 +72,7 @@ mastodon-py==1.8.1 ; python_version >= "3.10" and python_version < "4.0" matrix-nio==0.20.2 ; python_version >= "3.10" and python_version < "4.0" multidict==6.0.4 ; python_version >= "3.10" and python_version < "4.0" multitasking==0.0.11 ; python_version >= "3.10" and python_version < "4.0" -myllm==1.2.15 ; python_version >= "3.10" and python_version < "4.0" +myllm==1.2.19 ; python_version >= "3.10" and python_version < "4.0" numpy==1.25.2 ; python_version >= "3.10" and python_version < "4.0" oauthlib==3.2.2 ; python_version >= "3.10" and python_version < "4.0" packaging==23.1 ; python_version >= "3.10" and python_version < "4.0" @@ -115,7 +115,7 @@ rlp==3.0.0 ; python_version >= "3.10" and python_version < "4" rocketchat-api==1.30.0 ; python_version >= "3.10" and python_version < "4.0" rpds-py==0.9.2 ; python_version >= "3.10" and python_version < "4.0" rsa==4.9 ; python_version >= "3.10" and python_version < "4" -setuptools==68.1.0 ; python_version >= "3.10" and python_version < "4.0" +setuptools==68.1.2 ; python_version >= "3.10" and python_version < "4.0" simplematrixbotlib==2.10.0 ; python_version >= "3.10" and python_version < "4.0" six==1.16.0 ; python_version >= "3.10" and python_version < "4.0" sniffio==1.3.0 ; python_version >= "3.10" and python_version < "4.0" From 34833b27a0dded33f5fe0db56e18223f5650bb03 Mon Sep 17 00:00:00 2001 From: mraniki Date: Fri, 18 Aug 2023 20:11:38 +0200 Subject: [PATCH 05/45] :white_check_mark: unit test --- tests/test_llm_plugin.py | 6 +++--- tt/plugins/default_plugins/llm_plugin.py | 7 +------ 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/tests/test_llm_plugin.py b/tests/test_llm_plugin.py index 7b931d014..13eefc743 100644 --- a/tests/test_llm_plugin.py +++ b/tests/test_llm_plugin.py @@ -50,12 +50,12 @@ async def test_parsing_help(plugin): @pytest.mark.asyncio async def test_parsing_info(plugin): """Test info """ - plugin.get_llm_info = AsyncMock() + plugin.llm.get_myllm_info = AsyncMock() await plugin.handle_message( f"{settings.bot_prefix}{settings.bot_command_info}") - plugin.get_llm_info.assert_awaited_once() - + plugin.llm.get_llm_info.assert_awaited_once() + @pytest.mark.asyncio async def test_parsing_llm(plugin): """Test scr """ diff --git a/tt/plugins/default_plugins/llm_plugin.py b/tt/plugins/default_plugins/llm_plugin.py index 533a239dd..cc53bafb5 100644 --- a/tt/plugins/default_plugins/llm_plugin.py +++ b/tt/plugins/default_plugins/llm_plugin.py @@ -44,7 +44,7 @@ async def handle_message(self, msg): command_mapping = { settings.bot_command_help: self.get_llm_help, - settings.bot_command_info: self.get_llm_info, + settings.bot_command_info: self.llm.get_myllm_info, settings.bot_command_info: self.llm.clear_chat_history, settings.bot_command_question: lambda: self.llm.talk(args), settings.bot_command_topic: lambda: self.llm.chat(args), @@ -57,8 +57,3 @@ async def get_llm_help(self): """Help Message""" return f"{self.help_message}" - async def get_llm_info(self): - """info Message""" - return self.llm.get_myllm_info() - - From 634505b1dbb036cbefd13924f3c0ccd44c1225dc Mon Sep 17 00:00:00 2001 From: mraniki Date: Fri, 18 Aug 2023 18:14:03 +0000 Subject: [PATCH 06/45] Update Requirements --- .requirements/requirements.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.requirements/requirements.txt b/.requirements/requirements.txt index f44ad15f9..9e608bcb5 100644 --- a/.requirements/requirements.txt +++ b/.requirements/requirements.txt @@ -45,6 +45,7 @@ frozendict==2.3.8 ; python_version >= "3.10" and python_version < "4.0" frozenlist==1.4.0 ; python_version >= "3.10" and python_version < "4.0" future==0.18.3 ; python_version >= "3.10" and python_version < "4.0" g4f==0.0.1.7 ; python_version >= "3.10" and python_version < "4.0" +google-search-results==2.4.2 ; python_version >= "3.10" and python_version < "4.0" grpcio==1.57.0 ; python_version >= "3.10" and python_version < "4.0" guilded-py==1.10.0 ; python_version >= "3.10" and python_version < "4.0" h11==0.14.0 ; python_version >= "3.10" and python_version < "4.0" @@ -72,7 +73,7 @@ mastodon-py==1.8.1 ; python_version >= "3.10" and python_version < "4.0" matrix-nio==0.20.2 ; python_version >= "3.10" and python_version < "4.0" multidict==6.0.4 ; python_version >= "3.10" and python_version < "4.0" multitasking==0.0.11 ; python_version >= "3.10" and python_version < "4.0" -myllm==1.2.19 ; python_version >= "3.10" and python_version < "4.0" +myllm==1.2.20 ; python_version >= "3.10" and python_version < "4.0" numpy==1.25.2 ; python_version >= "3.10" and python_version < "4.0" oauthlib==3.2.2 ; python_version >= "3.10" and python_version < "4.0" packaging==23.1 ; python_version >= "3.10" and python_version < "4.0" @@ -121,8 +122,8 @@ six==1.16.0 ; python_version >= "3.10" and python_version < "4.0" sniffio==1.3.0 ; python_version >= "3.10" and python_version < "4.0" soupsieve==2.4.1 ; python_version >= "3.10" and python_version < "4.0" starlette==0.27.0 ; python_version >= "3.10" and python_version < "4.0" -talkytrend==1.13.4 ; python_version >= "3.10" and python_version < "4.0" -telethon==1.29.2 ; python_version >= "3.10" and python_version < "4.0" +talkytrend==1.14.0 ; python_version >= "3.10" and python_version < "4.0" +telethon==1.29.3 ; python_version >= "3.10" and python_version < "4.0" tinode-grpc==0.22.3 ; python_version >= "3.10" and python_version < "4.0" toml==0.10.2 ; python_version >= "3.10" and python_version < "4.0" toolz==0.12.0 ; python_version >= "3.10" and python_version < "4" and (implementation_name == "pypy" or implementation_name == "cpython") From 7f0f4ba2a5bc33c1b327df20df0b650b60ad91b6 Mon Sep 17 00:00:00 2001 From: mraniki <8766259+mraniki@users.noreply.github.com> Date: Fri, 18 Aug 2023 21:32:56 +0200 Subject: [PATCH 07/45] =?UTF-8?q?=E2=AC=86=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 8f1ca1d12..b960a17d4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -52,7 +52,7 @@ dxsp = "^4.2.25" findmyorder = "^1.7.16" iamlistening = "^3.3.5" talkytrend = "^1.13.2" -myllm = "^1.2.18" +myllm = "^1.2.20" [tool.poetry.group.dev.dependencies] From fb16032754e9cf8ef4cdff0e90bd3c8b8efcfeb8 Mon Sep 17 00:00:00 2001 From: mraniki <8766259+mraniki@users.noreply.github.com> Date: Sat, 19 Aug 2023 20:36:41 +0200 Subject: [PATCH 08/45] Update conf.py --- docs/conf.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index e3a547885..59dee311a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -58,6 +58,7 @@ "myllm": ("https://myllm.readthedocs.io/en/latest", None), "community": ("https://tt-plugins.readthedocs.io/en/latest", None), "cefi": ("https://cex.readthedocs.io/en/latest", None), + "headlinehunt": ("https://headlinehunt.readthedocs.io/en/latest", None), } intersphinx_disabled_reftypes = ["*"] @@ -76,7 +77,8 @@ 'iamlistening', 'talkytrend', 'myllm', - 'community' + 'community', + 'headlinehunt' ] From 5914b28c1a7860b96358bc0087ad69b8182bf375 Mon Sep 17 00:00:00 2001 From: mraniki Date: Sat, 19 Aug 2023 18:38:55 +0000 Subject: [PATCH 09/45] Update Requirements --- .requirements/requirements.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.requirements/requirements.txt b/.requirements/requirements.txt index 9e608bcb5..3737a2016 100644 --- a/.requirements/requirements.txt +++ b/.requirements/requirements.txt @@ -15,7 +15,7 @@ beautifulsoup4==4.12.2 ; python_version >= "3.10" and python_version < "4.0" bitarray==2.8.1 ; python_version >= "3.10" and python_version < "4" blurhash==1.1.4 ; python_version >= "3.10" and python_version < "4.0" browser-cookie3==0.19.1 ; python_version >= "3.10" and python_version < "4.0" -ccxt==4.0.67 ; python_version >= "3.10" and python_version < "4.0" +ccxt==4.0.68 ; python_version >= "3.10" and python_version < "4.0" cefi==1.1.16 ; python_version >= "3.10" and python_version < "4.0" certifi==2023.7.22 ; python_version >= "3.10" and python_version < "4.0" cffi==1.15.1 ; python_version >= "3.10" and python_version < "4.0" @@ -82,7 +82,7 @@ parsimonious==0.9.0 ; python_version >= "3.10" and python_version < "4" pillow==9.5.0 ; python_version >= "3.10" and python_version < "4.0" ping3==4.0.4 ; python_version >= "3.10" and python_version < "4.0" prettytable==3.8.0 ; python_version >= "3.10" and python_version < "4.0" -protobuf==4.24.0 ; python_version >= "3.10" and python_version < "4.0" +protobuf==4.24.1 ; python_version >= "3.10" and python_version < "4.0" py-cord==2.4.1 ; python_version >= "3.10" and python_version < "4.0" pyaes==1.6.1 ; python_version >= "3.10" and python_version < "4.0" pyasn1==0.5.0 ; python_version >= "3.10" and python_version < "4" From cb484aecfa1aada912f05588615ec93d990fd74c Mon Sep 17 00:00:00 2001 From: mraniki <8766259+mraniki@users.noreply.github.com> Date: Sat, 19 Aug 2023 20:39:48 +0200 Subject: [PATCH 10/45] Update navbar.html --- docs/_templates/navbar.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/_templates/navbar.html b/docs/_templates/navbar.html index 38d68f3d6..4e5844a97 100644 --- a/docs/_templates/navbar.html +++ b/docs/_templates/navbar.html @@ -43,9 +43,13 @@
  • πŸ’± CEX
  • - πŸ’ Helper + πŸ›Ÿ Helper
  • πŸ“° Talkytrend +
  • + 🦾 MyLLM +
  • + πŸ•΅οΈ HeadlineHunt