AutoGPT icon indicating copy to clipboard operation
AutoGPT copied to clipboard

Telegram Bot integration & Voice Prompt

Open Wladastic opened this issue 1 year ago • 24 comments

Background

Adding 2 new prompt options:

  • Telegram bot (have to fix it, threading is wrong, it succeeds to send a message but the webhook won't work)
  • voice prompt (just realized it can work on WIndows and Linux too lol)

Changes

Documentation

You have to create a telegram bot with botfather and get the chat_id after chatting with your bot the first time.

Once you set the bot up run:

To start run from AutoGPT folder :"python ./autogpt/start_bot.py --gpt3only" or "python3 ./autogpt/start_bot.py --gpt3only"

it passes all the arguments into autogpt.

It will tell you through telegram to send "/start" to start it. You can always use "/stop" to stop it and "/start" to start again.

I made the bot be able to restart your autogpt by this ;-)

Test Plan

PR Quality Checklist

  • [x] My pull request is atomic and focuses on a single change.
  • [x] I have thoroughly tested my changes with multiple different prompts.
  • [x] I have considered potential risks and mitigations for my changes.
  • [x] I have documented my changes clearly and comprehensively.
  • [x] I have not snuck in any "extra" small tweaks changes

Wladastic avatar Apr 13 '23 15:04 Wladastic

@Wladastic There are conflicts.

nponeccop avatar Apr 13 '23 19:04 nponeccop

@Wladastic There are conflicts.

It also doesn't work yet... I have issues starting it, because telegram expects you to run your server from within the telegram bot, as it's run_polling method waits for input and freezes the thread lol

Wladastic avatar Apr 13 '23 20:04 Wladastic

If it doesn't work yet GitHub lets you to convert a PR to a draft PR

nponeccop avatar Apr 13 '23 20:04 nponeccop

@nponeccop Feel free to test. It's kindda flacky still but I probably need some help fixing the thread blocking by waiting for the users's response. It works, but sometimes just gets stuck at the responce_received.wait()

Wladastic avatar Apr 15 '23 02:04 Wladastic

image

Wladastic avatar Apr 15 '23 02:04 Wladastic

@Wladastic There are conflicts and red CI now

nponeccop avatar Apr 15 '23 13:04 nponeccop

@Wladastic The CI is still red (just in case you didn't notice)

nponeccop avatar Apr 15 '23 16:04 nponeccop

I know, only updated.I found a better was to implement it with the new structure of the project but have to fix some stuff, as it still get’s stuch at response.wait() and doesn’t let the application poll do an update, I didn’t do much python before hahaAny ideas?Am 15.04.2023 um 18:29 schrieb nponeccop @.***>: @Wladastic The CI is still red (just in case you didn't notice)

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

Wladastic avatar Apr 15 '23 16:04 Wladastic

@Wladastic The CI is still red (just in case you didn't notice)

It now works! Waiting for the pipelines to finish so that I can see what whitespaces I missed, then it's ready to be merged! :)

Wladastic avatar Apr 16 '23 11:04 Wladastic

image

Wladastic avatar Apr 16 '23 12:04 Wladastic

@richbeales if this is marked plugin, will it be skipped or what does it mean?

Wladastic avatar Apr 16 '23 12:04 Wladastic

@nponeccop will need your approve again, there have been many changes on master and I had to test and fix some stuff. Also I rebuilt the /start /stop handlers, you can now just /stop the bot and /start again without having to touch the console ever :D

Wladastic avatar Apr 16 '23 20:04 Wladastic

@nponeccop sorry mate, had to fix the conflicts due to some merges.

Wladastic avatar Apr 16 '23 23:04 Wladastic

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

github-actions[bot] avatar Apr 17 '23 19:04 github-actions[bot]

Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly.

github-actions[bot] avatar Apr 17 '23 19:04 github-actions[bot]

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

github-actions[bot] avatar Apr 17 '23 22:04 github-actions[bot]

Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly.

github-actions[bot] avatar Apr 18 '23 07:04 github-actions[bot]

No idea what black does?!

Wladastic avatar Apr 18 '23 08:04 Wladastic

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

github-actions[bot] avatar Apr 18 '23 14:04 github-actions[bot]

Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly.

github-actions[bot] avatar Apr 18 '23 20:04 github-actions[bot]

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

github-actions[bot] avatar Apr 18 '23 20:04 github-actions[bot]

Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly.

github-actions[bot] avatar Apr 19 '23 16:04 github-actions[bot]

This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request.

github-actions[bot] avatar Apr 19 '23 23:04 github-actions[bot]

Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly.

github-actions[bot] avatar Apr 20 '23 12:04 github-actions[bot]

Like #2593, this is functionality that fits better in a plugin than in the core. If you need help converting it to a plugin, [at]BillSchumacher is happy to help. :)

Pwuts avatar Apr 20 '23 19:04 Pwuts

Yup we already talk. only issue is wrapping autogpt with the bot as I added a possibility to restart autogpt by telegram

Wladastic avatar Apr 20 '23 19:04 Wladastic

I started making a plugin here: https://github.com/Wladastic/Auto-GPT-Telegram-Plugin If anyone likes to assist, I would be glad :)

Wladastic avatar Apr 21 '23 08:04 Wladastic