Wladastic / Auto-GPT-Telegram-Plugin

MIT License
56 stars 8 forks source link

How to actually get it to run? #6

Closed Snowstar38 closed 1 year ago

Snowstar38 commented 1 year ago

Sorry if this is the wrong place to post this; I don't know a lot about this stuff.

I've got the plugin's .zip in the proper plugins folder. I added the Telegram bot's API key and the Chat ID (which was hard to find for a private chat vs a group, but I found one that works with other curl commands like sendmessage so I assume it's the right one) to the env file as well as the ALLOWLISTED_PLUGINS and CHAT_MESSAGES_ENABLED lines. I've installed all the things in requirements.txt.

So... What do I do now? When I run AutoGPT I do not get any messages through the Telegram bot. What am I doing wrong?

crushingCodes commented 1 year ago

@Snowstar38 I was having the same problem, if you follow the instructions here: https://github.com/Significant-Gravitas/Auto-GPT-Plugins and change the first download step to the following it should work: curl -L -o ./plugins/Auto-GPT-Telegram.zip https://github.com/Wladastic/Auto-GPT-Telegram-Plugin/archive/refs/heads/master.zip

ForceConstant commented 1 year ago

@crushingCodes So opposed to the Readme, we need to use the repo zip, and not just clone directory? Then you need to run autogpt --install-plugin-deps? Ok then after that, you just run autogpt And it will keep running in the background, and allow you to talk to it using telegram?

Wladastic commented 1 year ago

yes

ForceConstant commented 1 year ago

Except now I see that '--install-plugins-deps' was removed in stable.

crushingCodes commented 1 year ago

@ForceConstant i haven't run with that version, but ill let you know if i manage to get it working either way, worst comes to worst you can copy any missing deps into the main requirements.txt, although this is not ideal as a permanent solution

Wladastic commented 1 year ago

That command just haven’t been added to stable yet, as stable is 2 weeks old. you can try adding the requirements but stable does not work with plugins yet

ForceConstant commented 1 year ago

Stable 0.3.0 just came out with support for plugins. Will see how it goes there.

GameWorldsLLC commented 1 year ago

I was able to get it to work but it won't show me the messages from my terminal. Any suggestions? It will show me just the response prompts . image

proitservices commented 1 year ago

Hi Wladastic,

Trying your plugin and getting an odd issue. I can curl my bot for messages (API and bot ID is fine), I traced the path to the .env file and that is correct. Getting Waiting for response on Telegram chat... Sending message to Telegram.. Traceback (most recent call last):

File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/lib/python3.9/runpy.py", line 87, in _run_code exec(code, run_globals) File "/home/bot/Auto-GPT/autogpt/main.py", line 5, in autogpt.cli.main() File "/home/bot/Auto-GPT/autogpt_venv/lib/python3.9/site-packages/click/core.py", line 1130, in call return self.main(args, kwargs) File "/home/bot/Auto-GPT/autogpt_venv/lib/python3.9/site-packages/click/core.py", line 1055, in main rv = self.invoke(ctx) File "/home/bot/Auto-GPT/autogpt_venv/lib/python3.9/site-packages/click/core.py", line 1635, in invoke rv = super().invoke(ctx) File "/home/bot/Auto-GPT/autogpt_venv/lib/python3.9/site-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, ctx.params) File "/home/bot/Auto-GPT/autogpt_venv/lib/python3.9/site-packages/click/core.py", line 760, in invoke return __callback(args, kwargs) File "/home/bot/Auto-GPT/autogpt_venv/lib/python3.9/site-packages/click/decorators.py", line 26, in new_func return f(get_current_context(), *args, *kwargs) File "/home/bot/Auto-GPT/autogpt/cli.py", line 90, in main run_auto_gpt( File "/home/bot/Auto-GPT/autogpt/main.py", line 135, in run_auto_gpt ai_config = construct_main_ai_config() File "/home/bot/Auto-GPT/autogpt/prompts/prompt.py", line 105, in construct_main_ai_config should_continue = clean_input( File "/home/bot/Auto-GPT/autogpt/utils.py", line 29, in clean_input plugin_response = plugin.user_input(user_input=prompt) File "plugins/Auto-GPT-Telegram.zip/Auto-GPT-Telegram-Plugin-master/src/telegram_plugin/init.py", line 260, in user_input File "plugins/Auto-GPT-Telegram.zip/Auto-GPT-Telegram-Plugin-master/src/telegram_plugin/telegram_chat.py", line 192, in ask_user File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete return future.result() File "plugins/Auto-GPT-Telegram.zip/Auto-GPT-Telegram-Plugin-master/src/telegram_plugin/telegram_chat.py", line 116, in ask_user_async File "plugins/Auto-GPT-Telegram.zip/Auto-GPT-Telegram-Plugin-master/src/telegram_plugin/telegram_chat.py", line 159, in _poll_updates File "plugins/Auto-GPT-Telegram.zip/Auto-GPT-Telegram-Plugin-master/src/telegram_plugin/telegram_chat.py", line 58, in get_bot File "/home/bot/Auto-GPT/autogpt_venv/lib/python3.9/site-packages/telegram/_bot.py", line 368, in decorator result = await func(args, kwargs) # skipcq: PYL-E1102 File "/home/bot/Auto-GPT/autogpt_venv/lib/python3.9/site-packages/telegram/_bot.py", line 6983, in get_my_commands result = await self._post( File "/home/bot/Auto-GPT/autogpt_venv/lib/python3.9/site-packages/telegram/_bot.py", line 456, in _post return await self._do_post( File "/home/bot/Auto-GPT/autogpt_venv/lib/python3.9/site-packages/telegram/_bot.py", line 487, in _do_post return await request.post( File "/home/bot/Auto-GPT/autogpt_venv/lib/python3.9/site-packages/telegram/request/_baserequest.py", line 165, in post result = await self._request_wrapper( File "/home/bot/Auto-GPT/autogpt_venv/lib/python3.9/site-packages/telegram/request/_baserequest.py", line 326, in _request_wrapper raise InvalidToken(message) telegram.error.InvalidToken: Not Found


/home/bot/Auto-GPT/.env: CHAT_MESSAGES_ENABLED=True TELEGRAM_ENABLED=True #(from Telegram embedded fork) TELEGRAM_API_KEY= TELEGRAM_CHAT_ID=

Any guidance what am I missing here? (Pulled the latest stable of Auto-GPT and latest of the Telegram plugin)

Cheers, Peter

Wladastic commented 1 year ago

please uninstall the telegram dependency and use --install-plugin-deps when launching autogpt

proitservices commented 1 year ago

I did that and we are missing asyncio in the requirements.txt also now I'm getting

File "/home/bot/Auto-GPT/autogpt_venv/lib/python3.9/site-packages/telegram/_bot.py", line 6983, in get_my_commands result = await self._post( File "/home/bot/Auto-GPT/autogpt_venv/lib/python3.9/site-packages/telegram/_bot.py", line 456, in _post return await self._do_post( File "/home/bot/Auto-GPT/autogpt_venv/lib/python3.9/site-packages/telegram/_bot.py", line 487, in _do_post return await request.post( File "/home/bot/Auto-GPT/autogpt_venv/lib/python3.9/site-packages/telegram/request/_baserequest.py", line 165, in post result = await self._request_wrapper( File "/home/bot/Auto-GPT/autogpt_venv/lib/python3.9/site-packages/telegram/request/_baserequest.py", line 326, in _request_wrapper raise InvalidToken(message) telegram.error.InvalidToken: Not Found

I think its around bot. initialize() where the issue is

Cheers, P

Wladastic commented 1 year ago

Did you add the api key and chat id?

proitservices commented 1 year ago

Yes,

Of course, tested them with curl both ways, tested the path to env is correct, tested are the variables populated around the add_bot and they do pull in as expected.

Cheers, Peter

On Thu, 4 May 2023, 22:05 WladBlank, @.***> wrote:

Did you add the api key and chat id?

— Reply to this email directly, view it on GitHub https://github.com/Wladastic/Auto-GPT-Telegram-Plugin/issues/6#issuecomment-1535410842, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJN3AHN5MRZ5H56VY5IWUZTXEQKYXANCNFSM6AAAAAAXPXJG6M . You are receiving this because you commented.Message ID: @.***>