flynnoct / chatgpt-telegram-bot Goto Github PK
View Code? Open in Web Editor NEWTelegram bot implemented by OFFICIAL OpenAI ChatGPT API (gpt-3.5-turbo, released on 2023-03-01)
License: MIT License
Telegram bot implemented by OFFICIAL OpenAI ChatGPT API (gpt-3.5-turbo, released on 2023-03-01)
License: MIT License
Would be very useful to have a prompt system that allows you to set the tone of the assistant.
Something that allows us to kick conversations off with some of the settings we prefer. For example I would have:
'prompt': 'You are a helpful assistant. You always convert imperial to metric measurements and localise spelling to the United Kingdom'
This branch is a mess😫.
I implemented several features in one branch and this branch will include:
logging
lib, do it on my own!I followed your procedures on an ARM based Oracle VPS but received the following error.
$ python3 telegram_message_parser.py
Traceback (most recent call last):
File "telegram_message_parser.py", line 15, in
from telegram import Update
ImportError: cannot import name 'Update' from 'telegram' (/home/ubuntu/.local/lib/python3.8/site-packages/telegram/init.py)
I am using 3.8.10 python
$ py --version
Python 3.8.10
I fixed it by force removing ~/.local/lib/python3.8/site-packages/telegram and force reinstalling
$ pip install python-telegram-bot --force-reinstall
and it fixed the issue
One of my use cases is basically running another instance for my friends to use as a telegram bot. It would be helpful to have a way to ‘whitelist’ all telegram IDs so as long as they know the link to message it, they can talk to the bot.
Related to this too, not sure how feasible it is, would be separate conversational context for each person that messages the bot, but I’m also not sure if this is even possible with the API.
"Would like to see output settings, for example, to display code in monospace font so that it can be easily copied by click. Also, it would be useful to have a feature to output text as an image."
Example:
/settings
Add config options for logging
Add a system role customizing feature which makes user able to modify the characteristic of the bot.
2023-03-16 01:11:04 Bot has been started successfully 2023-03-16 01:11:06 Bot has been started successfully 2023-03-16 01:11:07 Bot has been started successfully
Always restart...
`C:\Users\Asus\Python\chatgpt-telegram-bot>docker compose up -d
[+] Running 0/1
C:\Users\Asus\Python\chatgpt-telegram-bot>`
I use the latest version 1.2.2
What I did wrong?
How can I fix it?
PS: Thank you for your work!
Fact error in Readme.
Whisper is OpenAI's speech-to-text engine, not Microsoft's.
Ref: https://openai.com/research/whisper
Fix this plz, thanks.
I followed the prompts in the instructions for installation, and at the end it showed that the bot has started successfully. However, I'm not receiving any replies from the bot when I send messages to it. I don't know why.
I can't write code, but I would like to add the function of changing the role by the command directly in the code, because if you specify the role in the chat, he does not really want to match it
Access manager has been derived from Telegram APIs in new branch accessmanager-dev. Please help me test it. Thx. @flynnoct
In case of granting users different authority between text, voice and file, the <chat_type> field is currently reserved for future use.
How i can use voice?
I modified line 31 and 41 in openai_parser.py
, replaced gpt-3.5-turbo-0301
with gpt-3.5-turbo
, and restart the bot, I found it on OpenAI daily usage breakdown page the bot still using model gpt-3.5-turbo-0301
. How can I change the model? Thanks.
I deployed this bot and installed the Azure TTS SDK. But the bot still does not respond with an audio message, only text. How to run it with an audio message?
Inline mode is a helpful feature of telegram bot. I'm working on adding support for this feature.
See u soon.
After updating from version 1.2.2 to 1.3.0, the bot stopped responding. I discovered that new parameters were added to the config.json file. The bot did not work until I added the following new parameters:
Perhaps default values for these parameters should be used if they do not exist.
I have installed and configured the config.json with my api key and bot key. I run the bot on terminal and it says the bot has started, but when I try to interact with the bot in telegram it does nothing.
When i'm trying nothing happen
gpt-3.5-turbo
according to #33update docs.
It would be great if we could change the key value of ChatGPT through command line, such as typing (or selecting) [change key value] in the terminal, and then inputting the new key to update the key value in the configuration file, which would be more convenient than editing the config file manually.😄
First of all, fantastic work. This thing is by far the best I've used. Not sure how you were able to push specific tasks to the background and still communicate with it, but I love it!
I did want to ask about the models. I noticed you were using gpt-3.5-turbo-0301. I'm not familiar with it. Can you explain why that one and not the normal 3.5 turbo?
Also, I tried swapping to text-davinci-003 and 002, but I got a URL error. I assume it just means the wrong syntax is being used to call the API. Is there any way to set it up to utilize older models? I've found that 002 works much better with coding than the newer ones.
I have used command pip install ffmpeg-python
to get ffmpeg installed, and have set enable_voice
to true
, after I restarted the bot, the audio interaction still does not work, anything wrong I did?
It’s been working fine for the past few days but suddenly I’m not getting any responses from the bot, even after restart_bot.sh and a server reboot. Are there any further steps I can take for troubleshooting?
Thank you.
This model's maximum context length is 4096 tokens. However, your messages resulted in 4119 tokens. Please reduce the length of the messages. Sorry, I am not feeling well. Please try again.
After exceeding the limit of tokens, we can only execute /clear to clear conversation context to restore function.
This seems to be the only option, so is it possible that sending the message again after reaching the limit will automatically execute the /clear command?
Add a command, such as /system <system message>
to allow user to customize the system role of a new conversation
Hello author, I have a question to ask. Why do we need to copy a config.json file through command during installation? Why not directly provide it in the program code? If it is provided directly, the user would have one less step during installation. I am not a programmer, just curious.Thank you for providing such an interesting project.😄
A config loader, for loading config once in all classes
I tried main and dev and they both have the same problem.
When using start_bot.sh, although it says bot started successfully, it cannot get a response after sending a message through Telegram Bot.
When starting telegram_message_parser.py with the python command, the following error is encountered.
Traceback (most recent call last): File "/home/src/telegram_message_parser.py", line 15, in <module> from telegram.ext import ApplicationBuilder, CommandHandler, MessageHandler, InlineQueryHandler, ChosenInlineResultHandler, ContextTypes, filters ModuleNotFoundError: No module named 'telegram'
Any possible to add text-to-speech feature to the bot? For example, with Amazon Polly, we could get 5 million characters free per month for 12 months with the AWS Free Tier. https://aws.amazon.com/polly/
This feature could allow the bot to reply voice messages to users. This could make the bot more powerful, for example for language learning, etc.
ok its not my first time working with ai bots, iv followed all the instructions and ran it and nothing happens it wont responed or anything.
Please help me to integrate to telegram, bot started, but telegram bot doesnt working:(
It's Flynn here, I'm glad to show you what I plan to do now.
@your_bot_name <your messages>
in a group chat to make the bot reply. And the Privacy Mode needs to be disabled to make the bot have ability to get ALL messages from a group. We reviewed that requirement and we think it could be a privacy concern for some users (but I promise we didn't, and won't save your chat history for any other use). Therefore, in next version, the way to chat with the bot in a group chat is to use a specific command /chat
. Privacy is basic rights, we hope you like this changes.Good night. See you soon.
The Image Generation Counter starts with 0, should be 1.
Temporarily fixed by @flynnoct. However, please take care of it.
Thanks.
wget command didn't work for me, so I used git clone to pull the source code, and I got all dependencies installed, sure, replaced the api key and bot token and got it running on my Azure WM, but I still got no response from my bot.
Add config options for logging
gpt-3.5-turbo
.Add a new troubleshooting documentation for users unfamiliar with the config.json
file.
There are many users there, and it can be loved by more people.
For example, on Synology devices, it only supports the use of HubDocker for installation.
If you can synchronize to HubDocker, it's really great.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.