clemsau / telegram-gpt Goto Github PK
View Code? Open in Web Editor NEWYour self-hosted telegram bot for chatting with ChatGPT
License: MIT License
Your self-hosted telegram bot for chatting with ChatGPT
License: MIT License
Stream the answer as it is being generated
Add a general error handler
Maybe an explicit error of the potential workarounds for #2
My key has never been used. Verified it via portal.
Any ideas?
root@Javis-1:~/telegram-gpt/src# python3 bot.py
No error handlers are registered, logging exception.
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/telegram/ext/_application.py", line 1104, in process_update
await coroutine
File "/usr/local/lib/python3.10/dist-packages/telegram/ext/_handler.py", line 141, in handle_update
return await self.callback(update, context)
File "/root/telegram-gpt/src/handlers.py", line 28, in message_handler
answer: str = await openai_instance.complete(message)
File "/root/telegram-gpt/src/openai_utils.py", line 22, in complete
response = await openai.ChatCompletion.acreate(
File "/usr/local/lib/python3.10/dist-packages/openai/api_resources/chat_completion.py", line 45, in acreate
return await super().acreate(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/openai/api_resources/abstract/engine_api_resource.py", line 217, in acreate
response, _, api_key = await requestor.arequest(
File "/usr/local/lib/python3.10/dist-packages/openai/api_requestor.py", line 310, in arequest
resp, got_stream = await self._interpret_async_response(result, stream)
File "/usr/local/lib/python3.10/dist-packages/openai/api_requestor.py", line 645, in _interpret_async_response
self._interpret_response_line(
File "/usr/local/lib/python3.10/dist-packages/openai/api_requestor.py", line 682, in _interpret_response_line
raise self.handle_error_response(
openai.error.RateLimitError: You exceeded your current quota, please check your plan and billing details.
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.