diff --git a/README.md b/README.md index c4fe6d26..0284d661 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ ChatGPT + Telegram bot. В интернете таких много, мой во 2. Бот на библиотеке telebot, 3. При превышении ожидания перепоключается автоматически - логирует, +- Общение с OpenAI идет асинхронно, но не в стриме, так как телеграм не будет стримить, как я понял. Асинхрон, но надо еще попрактиковать, так как не отскакивает. - Думаю даза SQLite в GitHab будет пустая но с таблицами. Если забуду и будет пустая или вы сами удалите, то можно запусть файл init_db.py - он разметит и внесет все по умолчанию. diff --git a/app/my-test.py b/app/my-test.py index 19baa546..dfc100c6 100644 --- a/app/my-test.py +++ b/app/my-test.py @@ -1,16 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# from keys import api_key + +# from openai import AsyncOpenAI +# import asyncio + + + +# client = AsyncOpenAI( +# api_key=api_key, +# ) + + +# async def main(): +# stream = await client.chat.completions.create( +# model="gpt-4", +# messages=[{"role": "user", "content": "Say this is a test"}], +# stream=True, +# ) +# async for chunk in stream: +# print(chunk.choices[0].delta.content or "", end="") + + +# asyncio.run(main()) + + + + + #from sqlalchemy.ext.declarative import declarative_base #from sqlalchemy import Column, Integer, String, Float, ForeignKey, Boolean, DateTime -from sqlalchemy.orm import relationship, sessionmaker -from models import UsersTelegram, engine +# from sqlalchemy.orm import relationship, sessionmaker +# from models import UsersTelegram, engine -Session = sessionmaker(bind=engine) -session = Session() +# Session = sessionmaker(bind=engine) +# session = Session() -users = session.query(UsersTelegram).all() -for user in users: - print(f'User: {user.user_id}, Email: {user.user_username}, id: {user.id}') +# users = session.query(UsersTelegram).all() +# for user in users: +# print(f'User: {user.user_id}, Email: {user.user_username}, id: {user.id}') diff --git a/app/open_ai.py b/app/open_ai.py index a4df2c8b..4f1bbb22 100644 --- a/app/open_ai.py +++ b/app/open_ai.py @@ -1,7 +1,190 @@ from keys import api_key +from openai import AsyncOpenAI +import asyncio +from typing import Union + + +client = AsyncOpenAI(api_key=api_key) + +all_in = [] + +async def main(question: str) -> Union[str, None]: + + # Добавляю вопросы в кучу для поддержания контекста + all_in.append(f"{question}\n") # Добавляю вопрос + res = ' '.join(all_in) # Пробелы между словами и убираю запятую + print(res) + + + chat_completion = await client.chat.completions.create( + messages=[ + { + "role": "user", + "content": res, #question, + } + ], + model="gpt-3.5-turbo", #"gpt-4", "text-davinci-002", "text-curie-003", or "gpt-3.5-turbo" + ) + + answer = chat_completion.choices[0].message.content # Ответ + model_version = chat_completion.model + completion_tokens = chat_completion.usage.completion_tokens + prompt_tokens = chat_completion.usage.prompt_tokens + total_tokens = chat_completion.usage.total_tokens + total_answer = answer, model_version, completion_tokens, prompt_tokens, total_tokens # В кортеж + #print(f"Ответ {answer}\nВерсия модели {model_version}\nЗавершенные токены {completion_tokens}\nПодсказки_токены {prompt_tokens}\nВсего токенов {total_tokens} ") + # print(total_answer[0]) + all_in.append(f"{answer}\n") # Добавляю вопрос + + + return total_answer or None + +if __name__ == "__main__": # Если код запускается как основной файл (а не импортирован), тогда вызываем asyncio.run(main()) + asyncio.run(main()) + + + + + + +# async def main(question) -> None: +# chat_completion = await client.chat.completions.create( +# messages=[ +# { +# "role": "user", +# "content": question, +# } +# ], +# model="gpt-3.5-turbo", +# ) +# answer = chat_completion.choices[0].message.content # Ответ +# model_version = chat_completion.model +# completion_tokens = chat_completion.usage.completion_tokens +# prompt_tokens = chat_completion.usage.prompt_tokens +# total_tokens = chat_completion.usage.total_tokens +# total_answer = answer, model_version, completion_tokens, prompt_tokens, total_tokens # В кортеж +# print(f"Ответ {answer}\nВерсия модели {model_version}\nЗавершенные токены {completion_tokens}\nПодсказки_токены {prompt_tokens}\nВсего токенов {total_tokens} ") +# # print(total_answer[0]) +# return total_answer + + +# async def run_main(): +# result = await main("Ваш вопрос") # Замените "Ваш вопрос" на реальный вопрос +# print(result[0]) + + +# asyncio.run(run_main()) + +# def open_ai(quest): +# stream = client.chat.completions.create( +# model="gpt-3.5-turbo",#"gpt-4", +# messages=[{"role": "user", "content": quest}], +# stream=True, +# ) +# # print(quest) +# # for gh in stream: +# # print(gh) +# for chunk in stream: +# print(chunk.choices[0].delta.content or "", end="") + + + # Предположим, что у нас есть объект stream, представляющий собой поток данных + # В этом потоке есть набор объектов chunk, которые, вероятно, являются частью какой-то структуры данных + + # Итерируемся по всем chunk в потоке stream + # for chunk in stream: + + # # Получаем первый элемент (choices[0]) из списка choices в объекте chunk + # first_choice = chunk.choices[0] + + # # Проверяем, существует ли свойство delta у объекта first_choice + # if hasattr(first_choice, 'delta'): + # # Если свойство delta существует, получаем объект delta и извлекаем свойство content + # delta_content = first_choice.delta.content + + # # Печатаем значение свойства content, если оно не является пустой строкой + # if delta_content: + # print(delta_content, end="") + # else: + # # Если свойство delta отсутствует, выводим пустую строку + # print("", end="") + +#open_ai(quest) + + + + + + +# from openai import AsyncOpenAI +# import asyncio + +# client = AsyncOpenAI( +# api_key=api_key, +# ) + +# async def main(): +# stream = await client.chat.completions.create( +# model="gpt-3.5-turbo",#"gpt-4", +# messages=[{"role": "user", "content": "Say this is a test"}], +# stream=True, +# ) +# async for chunk in stream: +# print(chunk.choices[0].delta.content or "", end="") +# asyncio.run(main()) + + + + +# def ffg +# # Предположим, у вас есть асинхронная функция, возвращающая поток данных +# async def main(text): +# stream = await client.chat.completions.create( +# model="gpt-3.5-turbo",#"gpt-4", +# messages=[{"role": "user", "content": text}], +# stream=True, +# ) +# # Итерация по потоку данных +# async for chunk in stream: +# content = chunk.choices[0].delta.content or "" # Получение контента из текущего чанка +# print(content, end="") # Печать контента без новой строки в конце + + +# asyncio.run(main(question)) + + + + +# def open_ai(message): +# # bot.send_message(message.chat.id, "hi") +# #logger.info(f" - message_text:'{message.text}' - user_name:{message.from_user.username} - user_id:{message.from_user.id}") +# # bot.reply_to(message, "hi") +# # Собираем запрос Json к API Openai +# question = message.text + " "# +patch +# # print(question) + +# url = 'https://api.openai.com/v1/chat/completions' +# headers = { +# 'Authorization': f'Bearer {api_key}', +# 'Content-Type': 'application/json' +# } +# data = { +# "model": "gpt-3.5-turbo", # model, +# "messages": [{"role": "user", "content": question}], +# "temperature": 0.7, # temp, +# } +# response = requests.post(url, headers=headers, data=json.dumps(data)) + +# response_data = response.json() # Разбираем JSON-ответ + +# first_choice_message = response_data['choices'][0]['message']['content'] +# # print("\n", first_choice_message, "\n", temp) +# return first_choice_message + + + + -def test_openai(): - print(api_key[:5]) diff --git a/app/tele_bot.py b/app/tele_bot.py index 13e655f2..e73d2c25 100644 --- a/app/tele_bot.py +++ b/app/tele_bot.py @@ -1,13 +1,11 @@ import telebot from keys import token from worker_db import read_tele_user, add_tele_user, add_chatgpt_setings - +import asyncio +from open_ai import main bot = telebot.TeleBot(token) # Conection for API Telegram - - - # /start @bot.message_handler(commands=['start']) def start(context): @@ -34,6 +32,41 @@ def start(context): # Вносим id в таблицу настроек gpt, нужное проставиться по default add_chatgpt_setings(added_user_id) +# # /admin - статистика будет, загруженность базы, токены.. +# @bot.message_handler(commands=['admin']) +# def start(context): + + +# Message from OpenAI +@bot.message_handler(func=lambda message: message.text is not None and not message.text.startswith('/')) # Декоратор Telebot принимает все, кроме того, что начинается на / +def handle_message(message): + bot.send_chat_action(message.chat.id, 'typing') # typing bot + async def run_main(): + bot.send_chat_action(message.chat.id, 'typing') # typing bot + result = await main(message.text) + send = f"{result[0]}\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - -\nВерсия модели: {result[1]}\nЗавершенные токены: {result[2]}\nПодсказки токены: {result[3]}\nВсего токенов: {result[4]}" + # send = f"{переменная}\nЖирным - b Курсив - i Код - code
Отдельный блок для копирования - pre
" + bot.reply_to(message, send) # bot.reply_to(message, send, parse_mode='HTML') + loop = asyncio.new_event_loop() + asyncio.set_event_loop(loop) + loop.run_until_complete(run_main()) + + + + +##### +start_bot = bot.polling() # Запуск инициализируется в run_bot.py + + + + + + + + + + + @@ -45,4 +78,3 @@ def start(context): -start_bot = bot.polling() diff --git a/db/sqlite3.db b/db/sqlite3.db index 43cdf1f1..889f7e43 100644 Binary files a/db/sqlite3.db and b/db/sqlite3.db differ diff --git a/log/app.log b/log/app.log index 07b4e3c8..f1c9ef90 100644 --- a/log/app.log +++ b/log/app.log @@ -145,3 +145,2226 @@ Traceback (most recent call last): print(added_user_id.user.id) ^^^^^^^^^^^^^^^^^^ AttributeError: 'tuple' object has no attribute 'user' +2024-01-25 19:52:54,949 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 4, in + from open_ai import first_choice_message, open_ai +ImportError: cannot import name 'first_choice_message' from 'open_ai' (/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py) +2024-01-25 19:54:29,965 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 4, in + from open_ai import first_choice_message, open_ai, first_choice_message +ImportError: cannot import name 'first_choice_message' from 'open_ai' (/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py) +2024-01-25 19:55:03,152 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 4, in + from open_ai import first_choice_message, open_ai +ImportError: cannot import name 'first_choice_message' from 'open_ai' (/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py) +2024-01-25 20:53:48,761 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 4, in + from open_ai import send_message # open_ai, first_choice_message, + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py", line 68, in + assistant_reply = send_message(user_input) + ^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py", line 51, in send_message + response = openai.ChatCompletion.create( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/lib/_old_api.py", line 39, in __call__ + raise APIRemovedInV1(symbol=self._symbol) +openai.lib._old_api.APIRemovedInV1: + +You tried to access openai.ChatCompletion, but this is no longer supported in openai>=1.0.0 - see the README at https://github.com/openai/openai-python for the API. + +You can run `openai migrate` to automatically upgrade your codebase to use the 1.0.0 interface. + +Alternatively, you can pin your installation to the old version, e.g. `pip install openai==0.28` + +A detailed migration guide is available here: https://github.com/openai/openai-python/discussions/742 + +2024-01-25 20:55:50,117 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 4, in + from open_ai import open_ai #first_choice_message, + ^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py", line 40, in + openai.api_key = 'YOUR_API_KEY' + ^^^^^^ +NameError: name 'openai' is not defined +2024-01-25 21:07:38,483 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 4, in + from open_ai import main # open_ai first_choice_message, + ^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py", line 24, in + asyncio.run(main()) + ^^^^^^ +TypeError: main() missing 1 required positional argument: 'message' +2024-01-25 21:08:45,427 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 4, in + from open_ai import maine # open_ai first_choice_message, + ^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py", line 24, in + asyncio.run(main()) + ^^^^ +NameError: name 'main' is not defined +2024-01-25 21:09:30,519 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 4, in + from open_ai import maine # open_ai first_choice_message, + ^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py", line 24, in + asyncio.run(maine()) + ^^^^^^^ +TypeError: maine() missing 1 required positional argument: 'message' +2024-01-25 21:13:44,646 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 62, in + start_bot = bot.polling() + ^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1045, in polling + self.__threaded_polling(non_stop=non_stop, interval=interval, timeout=timeout, long_polling_timeout=long_polling_timeout, + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1120, in __threaded_polling + raise e + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1082, in __threaded_polling + self.worker_pool.raise_exceptions() + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 147, in raise_exceptions + raise self.exception_info + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 90, in run + task(*args, **kwargs) + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 6793, in _run_middlewares_and_handler + result = handler['function'](message) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 48, in handle_message + asyncio.run(saar) + File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run + return runner.run(main) + ^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run + return self._loop.run_until_complete(task) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete + return future.result() + ^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py", line 15, in maine + stream = await client.chat.completions.create( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/resources/chat/completions.py", line 1291, in create + return await self._post( + ^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/_base_client.py", line 1578, in post + return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/_base_client.py", line 1339, in request + return await self._request( + ^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/_base_client.py", line 1359, in _request + request = self._build_request(options) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/_base_client.py", line 467, in _build_request + return self._client.build_request( # pyright: ignore[reportUnknownMemberType] + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/httpx/_client.py", line 358, in build_request + return Request( + ^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/httpx/_models.py", line 338, in __init__ + headers, stream = encode_request( + ^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/httpx/_content.py", line 214, in encode_request + return encode_json(json) + ^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/httpx/_content.py", line 177, in encode_json + body = json_dumps(json).encode("utf-8") + ^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/json/__init__.py", line 231, in dumps + return _default_encoder.encode(obj) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/json/encoder.py", line 200, in encode + chunks = self.iterencode(o, _one_shot=True) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/json/encoder.py", line 258, in iterencode + return _iterencode(o, 0) + ^^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/json/encoder.py", line 180, in default + raise TypeError(f'Object of type {o.__class__.__name__} ' +TypeError: Object of type Message is not JSON serializable +2024-01-25 21:15:32,040 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-25 21:18:08,166 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-25 21:19:21,136 - openai._base_client - INFO - Retrying request to /chat/completions in 0.859743 seconds +2024-01-25 21:21:15,725 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 62, in + start_bot = bot.polling() + ^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1045, in polling + self.__threaded_polling(non_stop=non_stop, interval=interval, timeout=timeout, long_polling_timeout=long_polling_timeout, + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1120, in __threaded_polling + raise e + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1082, in __threaded_polling + self.worker_pool.raise_exceptions() + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 147, in raise_exceptions + raise self.exception_info + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 90, in run + task(*args, **kwargs) + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 6793, in _run_middlewares_and_handler + result = handler['function'](message) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 48, in handle_message + asyncio.run(saar) + File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run + return runner.run(main) + ^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run + return self._loop.run_until_complete(task) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete + return future.result() + ^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py", line 16, in main + stream = await client.chat.completions.create( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/resources/chat/completions.py", line 1291, in create + return await self._post( + ^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/_base_client.py", line 1578, in post + return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/_base_client.py", line 1339, in request + return await self._request( + ^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/_base_client.py", line 1359, in _request + request = self._build_request(options) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/_base_client.py", line 467, in _build_request + return self._client.build_request( # pyright: ignore[reportUnknownMemberType] + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/httpx/_client.py", line 358, in build_request + return Request( + ^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/httpx/_models.py", line 338, in __init__ + headers, stream = encode_request( + ^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/httpx/_content.py", line 214, in encode_request + return encode_json(json) + ^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/httpx/_content.py", line 177, in encode_json + body = json_dumps(json).encode("utf-8") + ^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/json/__init__.py", line 231, in dumps + return _default_encoder.encode(obj) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/json/encoder.py", line 200, in encode + chunks = self.iterencode(o, _one_shot=True) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/json/encoder.py", line 258, in iterencode + return _iterencode(o, 0) + ^^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/json/encoder.py", line 180, in default + raise TypeError(f'Object of type {o.__class__.__name__} ' +TypeError: Object of type set is not JSON serializable +2024-01-25 21:22:56,693 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-25 21:24:59,266 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 61, in + start_bot = bot.polling() + ^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1045, in polling + self.__threaded_polling(non_stop=non_stop, interval=interval, timeout=timeout, long_polling_timeout=long_polling_timeout, + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1120, in __threaded_polling + raise e + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1082, in __threaded_polling + self.worker_pool.raise_exceptions() + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 147, in raise_exceptions + raise self.exception_info + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 90, in run + task(*args, **kwargs) + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 6793, in _run_middlewares_and_handler + result = handler['function'](message) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 47, in handle_message + asyncio.run(main(message_text)) + File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run + return runner.run(main) + ^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run + return self._loop.run_until_complete(task) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete + return future.result() + ^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py", line 16, in main + stream = await client.chat.completions.create( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/resources/chat/completions.py", line 1291, in create + return await self._post( + ^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/_base_client.py", line 1578, in post + return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/_base_client.py", line 1339, in request + return await self._request( + ^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/_base_client.py", line 1359, in _request + request = self._build_request(options) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/_base_client.py", line 467, in _build_request + return self._client.build_request( # pyright: ignore[reportUnknownMemberType] + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/httpx/_client.py", line 358, in build_request + return Request( + ^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/httpx/_models.py", line 338, in __init__ + headers, stream = encode_request( + ^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/httpx/_content.py", line 214, in encode_request + return encode_json(json) + ^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/httpx/_content.py", line 177, in encode_json + body = json_dumps(json).encode("utf-8") + ^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/json/__init__.py", line 231, in dumps + return _default_encoder.encode(obj) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/json/encoder.py", line 200, in encode + chunks = self.iterencode(o, _one_shot=True) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/json/encoder.py", line 258, in iterencode + return _iterencode(o, 0) + ^^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/json/encoder.py", line 180, in default + raise TypeError(f'Object of type {o.__class__.__name__} ' +TypeError: Object of type set is not JSON serializable +2024-01-25 21:27:01,920 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 61, in + start_bot = bot.polling() + ^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1045, in polling + self.__threaded_polling(non_stop=non_stop, interval=interval, timeout=timeout, long_polling_timeout=long_polling_timeout, + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1120, in __threaded_polling + raise e + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1082, in __threaded_polling + self.worker_pool.raise_exceptions() + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 147, in raise_exceptions + raise self.exception_info + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 90, in run + task(*args, **kwargs) + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 6793, in _run_middlewares_and_handler + result = handler['function'](message) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 47, in handle_message + asyncio.run(main(message_text)) + File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run + return runner.run(main) + ^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run + return self._loop.run_until_complete(task) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete + return future.result() + ^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py", line 16, in main + stream = await client.chat.completions.create( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/resources/chat/completions.py", line 1291, in create + return await self._post( + ^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/_base_client.py", line 1578, in post + return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/_base_client.py", line 1339, in request + return await self._request( + ^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/_base_client.py", line 1359, in _request + request = self._build_request(options) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/_base_client.py", line 467, in _build_request + return self._client.build_request( # pyright: ignore[reportUnknownMemberType] + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/httpx/_client.py", line 358, in build_request + return Request( + ^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/httpx/_models.py", line 338, in __init__ + headers, stream = encode_request( + ^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/httpx/_content.py", line 214, in encode_request + return encode_json(json) + ^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/httpx/_content.py", line 177, in encode_json + body = json_dumps(json).encode("utf-8") + ^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/json/__init__.py", line 231, in dumps + return _default_encoder.encode(obj) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/json/encoder.py", line 200, in encode + chunks = self.iterencode(o, _one_shot=True) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/json/encoder.py", line 258, in iterencode + return _iterencode(o, 0) + ^^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/json/encoder.py", line 180, in default + raise TypeError(f'Object of type {o.__class__.__name__} ' +TypeError: Object of type Message is not JSON serializable +2024-01-25 21:28:13,658 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 61, in + start_bot = bot.polling() + ^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1045, in polling + self.__threaded_polling(non_stop=non_stop, interval=interval, timeout=timeout, long_polling_timeout=long_polling_timeout, + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1120, in __threaded_polling + raise e + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1082, in __threaded_polling + self.worker_pool.raise_exceptions() + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 147, in raise_exceptions + raise self.exception_info + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 90, in run + task(*args, **kwargs) + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 6793, in _run_middlewares_and_handler + result = handler['function'](message) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 47, in handle_message + asyncio.run(main(message_text)) + File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run + return runner.run(main) + ^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run + return self._loop.run_until_complete(task) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete + return future.result() + ^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py", line 23, in main + async for chunk in stream: + ^^^^^^ +NameError: name 'stream' is not defined +2024-01-25 21:29:11,059 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 61, in + start_bot = bot.polling() + ^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1045, in polling + self.__threaded_polling(non_stop=non_stop, interval=interval, timeout=timeout, long_polling_timeout=long_polling_timeout, + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1120, in __threaded_polling + raise e + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1082, in __threaded_polling + self.worker_pool.raise_exceptions() + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 147, in raise_exceptions + raise self.exception_info + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 90, in run + task(*args, **kwargs) + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 6793, in _run_middlewares_and_handler + result = handler['function'](message) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 47, in handle_message + asyncio.run(main(message_text)) + File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run + return runner.run(main) + ^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run + return self._loop.run_until_complete(task) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete + return future.result() + ^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py", line 24, in main + async for chunk in stream: + ^^^^^^ +NameError: name 'stream' is not defined +2024-01-25 21:31:23,567 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 61, in + start_bot = bot.polling() + ^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1045, in polling + self.__threaded_polling(non_stop=non_stop, interval=interval, timeout=timeout, long_polling_timeout=long_polling_timeout, + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1120, in __threaded_polling + raise e + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1082, in __threaded_polling + self.worker_pool.raise_exceptions() + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 147, in raise_exceptions + raise self.exception_info + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 90, in run + task(*args, **kwargs) + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 6793, in _run_middlewares_and_handler + result = handler['function'](message) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 47, in handle_message + asyncio.run(main(message_text)) + File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run + return runner.run(main) + ^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run + return self._loop.run_until_complete(task) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete + return future.result() + ^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py", line 15, in main + user_content = [message.text for message in message_text] + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +TypeError: 'Message' object is not iterable +2024-01-25 21:31:56,944 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 61, in + start_bot = bot.polling() + ^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1045, in polling + self.__threaded_polling(non_stop=non_stop, interval=interval, timeout=timeout, long_polling_timeout=long_polling_timeout, + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1120, in __threaded_polling + raise e + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1082, in __threaded_polling + self.worker_pool.raise_exceptions() + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 147, in raise_exceptions + raise self.exception_info + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 90, in run + task(*args, **kwargs) + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 6793, in _run_middlewares_and_handler + result = handler['function'](message) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 47, in handle_message + asyncio.run(main(message_text)) + File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run + return runner.run(main) + ^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run + return self._loop.run_until_complete(task) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete + return future.result() + ^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py", line 15, in main + user_content = [message.text for message in message_text] + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +TypeError: 'Message' object is not iterable +2024-01-25 21:32:39,222 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 61, in + start_bot = bot.polling() + ^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1045, in polling + self.__threaded_polling(non_stop=non_stop, interval=interval, timeout=timeout, long_polling_timeout=long_polling_timeout, + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1120, in __threaded_polling + raise e + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1082, in __threaded_polling + self.worker_pool.raise_exceptions() + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 147, in raise_exceptions + raise self.exception_info + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 90, in run + task(*args, **kwargs) + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 6793, in _run_middlewares_and_handler + result = handler['function'](message) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 47, in handle_message + asyncio.run(main(message_text)) + File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run + return runner.run(main) + ^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run + return self._loop.run_until_complete(task) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete + return future.result() + ^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py", line 15, in main + user_content = [messager.text for messager in message_text] + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +TypeError: 'Message' object is not iterable +2024-01-25 21:37:09,635 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-25 21:38:14,964 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 61, in + start_bot = bot.polling() + ^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1045, in polling + self.__threaded_polling(non_stop=non_stop, interval=interval, timeout=timeout, long_polling_timeout=long_polling_timeout, + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1120, in __threaded_polling + raise e + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1082, in __threaded_polling + self.worker_pool.raise_exceptions() + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 147, in raise_exceptions + raise self.exception_info + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 90, in run + task(*args, **kwargs) + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 6793, in _run_middlewares_and_handler + result = handler['function'](message) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +TypeError: handle_message() takes 0 positional arguments but 1 was given +2024-01-25 21:40:01,545 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 61, in + start_bot = bot.polling() + ^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1045, in polling + self.__threaded_polling(non_stop=non_stop, interval=interval, timeout=timeout, long_polling_timeout=long_polling_timeout, + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1120, in __threaded_polling + raise e + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1082, in __threaded_polling + self.worker_pool.raise_exceptions() + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 147, in raise_exceptions + raise self.exception_info + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 90, in run + task(*args, **kwargs) + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 6793, in _run_middlewares_and_handler + result = handler['function'](message) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +TypeError: handle_message() takes 0 positional arguments but 1 was given +2024-01-25 22:27:36,313 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 4, in + from open_ai import main # open_ai first_choice_message, + ^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py", line 4, in + from tele_bot import text +ImportError: cannot import name 'text' from partially initialized module 'tele_bot' (most likely due to a circular import) (/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py) +2024-01-25 22:32:58,472 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 61, in + start_bot = bot.polling() + ^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1045, in polling + self.__threaded_polling(non_stop=non_stop, interval=interval, timeout=timeout, long_polling_timeout=long_polling_timeout, + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1120, in __threaded_polling + raise e + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1082, in __threaded_polling + self.worker_pool.raise_exceptions() + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 147, in raise_exceptions + raise self.exception_info + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 90, in run + task(*args, **kwargs) + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 6793, in _run_middlewares_and_handler + result = handler['function'](message) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 47, in handle_message + asyncio.run(main(message)) + File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run + return runner.run(main) + ^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run + return self._loop.run_until_complete(task) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete + return future.result() + ^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py", line 17, in main + stream = await client.chat.completions.create( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/resources/chat/completions.py", line 1291, in create + return await self._post( + ^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/_base_client.py", line 1578, in post + return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/_base_client.py", line 1339, in request + return await self._request( + ^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/_base_client.py", line 1359, in _request + request = self._build_request(options) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/_base_client.py", line 467, in _build_request + return self._client.build_request( # pyright: ignore[reportUnknownMemberType] + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/httpx/_client.py", line 358, in build_request + return Request( + ^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/httpx/_models.py", line 338, in __init__ + headers, stream = encode_request( + ^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/httpx/_content.py", line 214, in encode_request + return encode_json(json) + ^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/httpx/_content.py", line 177, in encode_json + body = json_dumps(json).encode("utf-8") + ^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/json/__init__.py", line 231, in dumps + return _default_encoder.encode(obj) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/json/encoder.py", line 200, in encode + chunks = self.iterencode(o, _one_shot=True) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/json/encoder.py", line 258, in iterencode + return _iterencode(o, 0) + ^^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/json/encoder.py", line 180, in default + raise TypeError(f'Object of type {o.__class__.__name__} ' +TypeError: Object of type Message is not JSON serializable +2024-01-25 22:33:38,069 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 61, in + start_bot = bot.polling() + ^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1045, in polling + self.__threaded_polling(non_stop=non_stop, interval=interval, timeout=timeout, long_polling_timeout=long_polling_timeout, + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1120, in __threaded_polling + raise e + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1082, in __threaded_polling + self.worker_pool.raise_exceptions() + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 147, in raise_exceptions + raise self.exception_info + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 90, in run + task(*args, **kwargs) + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 6793, in _run_middlewares_and_handler + result = handler['function'](message) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 47, in handle_message + asyncio.run(main(message)) + File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run + return runner.run(main) + ^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run + return self._loop.run_until_complete(task) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete + return future.result() + ^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py", line 18, in main + stream = await client.chat.completions.create( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/resources/chat/completions.py", line 1291, in create + return await self._post( + ^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/_base_client.py", line 1578, in post + return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/_base_client.py", line 1339, in request + return await self._request( + ^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/_base_client.py", line 1359, in _request + request = self._build_request(options) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/_base_client.py", line 467, in _build_request + return self._client.build_request( # pyright: ignore[reportUnknownMemberType] + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/httpx/_client.py", line 358, in build_request + return Request( + ^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/httpx/_models.py", line 338, in __init__ + headers, stream = encode_request( + ^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/httpx/_content.py", line 214, in encode_request + return encode_json(json) + ^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/httpx/_content.py", line 177, in encode_json + body = json_dumps(json).encode("utf-8") + ^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/json/__init__.py", line 231, in dumps + return _default_encoder.encode(obj) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/json/encoder.py", line 200, in encode + chunks = self.iterencode(o, _one_shot=True) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/json/encoder.py", line 258, in iterencode + return _iterencode(o, 0) + ^^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/json/encoder.py", line 180, in default + raise TypeError(f'Object of type {o.__class__.__name__} ' +TypeError: Object of type Message is not JSON serializable +2024-01-25 22:34:37,203 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 62, in + start_bot = bot.polling() + ^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1045, in polling + self.__threaded_polling(non_stop=non_stop, interval=interval, timeout=timeout, long_polling_timeout=long_polling_timeout, + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1120, in __threaded_polling + raise e + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1082, in __threaded_polling + self.worker_pool.raise_exceptions() + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 147, in raise_exceptions + raise self.exception_info + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 90, in run + task(*args, **kwargs) + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 6793, in _run_middlewares_and_handler + result = handler['function'](message) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 48, in handle_message + asyncio.run(main(message)) + File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run + return runner.run(main) + ^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run + return self._loop.run_until_complete(task) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete + return future.result() + ^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py", line 18, in main + stream = await client.chat.completions.create( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/resources/chat/completions.py", line 1291, in create + return await self._post( + ^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/_base_client.py", line 1578, in post + return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/_base_client.py", line 1339, in request + return await self._request( + ^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/_base_client.py", line 1359, in _request + request = self._build_request(options) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/_base_client.py", line 467, in _build_request + return self._client.build_request( # pyright: ignore[reportUnknownMemberType] + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/httpx/_client.py", line 358, in build_request + return Request( + ^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/httpx/_models.py", line 338, in __init__ + headers, stream = encode_request( + ^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/httpx/_content.py", line 214, in encode_request + return encode_json(json) + ^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/httpx/_content.py", line 177, in encode_json + body = json_dumps(json).encode("utf-8") + ^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/json/__init__.py", line 231, in dumps + return _default_encoder.encode(obj) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/json/encoder.py", line 200, in encode + chunks = self.iterencode(o, _one_shot=True) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/json/encoder.py", line 258, in iterencode + return _iterencode(o, 0) + ^^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/json/encoder.py", line 180, in default + raise TypeError(f'Object of type {o.__class__.__name__} ' +TypeError: Object of type Message is not JSON serializable +2024-01-25 22:37:57,278 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 4, in + from open_ai import main # open_ai first_choice_message, + ^^^^^^^^^^^^^^^^^^^^^^^^ +ImportError: cannot import name 'main' from 'open_ai' (/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py) +2024-01-25 22:38:16,538 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 4, in + from open_ai import main # open_ai first_choice_message, + ^^^^^^^^^^^^^^^^^^^^^^^^ +ImportError: cannot import name 'main' from 'open_ai' (/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py) +2024-01-25 22:40:06,601 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-25 22:41:10,326 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-25 22:43:15,982 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 4, in + from open_ai import main # open_ai first_choice_message, + ^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py", line 26, in + asyncio.run(main()) + ^^^^^^ +TypeError: main() missing 1 required positional argument: 'message' +2024-01-25 22:44:04,419 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-25 22:50:04,131 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 4, in + from open_ai import main # open_ai first_choice_message, + ^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py", line 4, in + from tele_bot import question +ImportError: cannot import name 'question' from partially initialized module 'tele_bot' (most likely due to a circular import) (/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py) +2024-01-25 22:55:37,214 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 4, in + from open_ai import main # open_ai first_choice_message, + ^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py", line 4, in + from tele_bot import question +ImportError: cannot import name 'question' from partially initialized module 'tele_bot' (most likely due to a circular import) (/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py) +2024-01-25 22:59:27,462 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-25 23:04:24,628 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 4, in + from open_ai import ais # open_ai first_choice_message, + ^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py", line 4, in + from tele_bot import question +ImportError: cannot import name 'question' from partially initialized module 'tele_bot' (most likely due to a circular import) (/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py) +2024-01-25 23:07:10,618 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-25 23:07:58,673 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-25 23:08:44,593 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-25 23:12:33,782 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-25 23:12:55,825 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-25 23:15:13,607 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-25 23:16:06,653 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-25 23:16:42,420 - openai._base_client - INFO - Retrying request to /chat/completions in 0.783737 seconds +2024-01-25 23:16:44,693 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-25 23:18:11,223 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 88, in + asyncio.run(main(question)) + ^^^^^^^^ +NameError: name 'question' is not defined +2024-01-25 23:25:02,595 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 84 + fort = (content, end="") + ^^^^^^ +SyntaxError: invalid syntax. Maybe you meant '==' or ':=' instead of '='? +2024-01-25 23:30:15,855 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 83, in + start_bot = bot.polling() + ^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1045, in polling + self.__threaded_polling(non_stop=non_stop, interval=interval, timeout=timeout, long_polling_timeout=long_polling_timeout, + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1120, in __threaded_polling + raise e + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1082, in __threaded_polling + self.worker_pool.raise_exceptions() + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 147, in raise_exceptions + raise self.exception_info + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 90, in run + task(*args, **kwargs) + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 6793, in _run_middlewares_and_handler + result = handler['function'](message) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 73, in handle_message + main(question) + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 63, in main + for chunk in stream: +TypeError: 'coroutine' object is not iterable +2024-01-25 23:31:46,101 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 66, in + asyncio.run(main(question)) + ^^^^^^^^ +NameError: name 'question' is not defined +2024-01-25 23:38:40,199 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 64, in + asyncio.run(main()) + ^^^^^^ +TypeError: main() missing 1 required positional argument: 'question' +2024-01-25 23:40:38,466 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 64, in + asyncio.run(main(message.text)) + ^^^^^^^ +NameError: name 'message' is not defined +2024-01-25 23:42:54,242 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 85, in + start_bot = bot.polling() + ^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1045, in polling + self.__threaded_polling(non_stop=non_stop, interval=interval, timeout=timeout, long_polling_timeout=long_polling_timeout, + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1120, in __threaded_polling + raise e + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1082, in __threaded_polling + self.worker_pool.raise_exceptions() + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 147, in raise_exceptions + raise self.exception_info + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 90, in run + task(*args, **kwargs) + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 6793, in _run_middlewares_and_handler + result = handler['function'](message) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 55, in handle_message + asyncio.create_task(main(message.text)) + File "/usr/lib/python3.11/asyncio/tasks.py", line 381, in create_task + loop = events.get_running_loop() + ^^^^^^^^^^^^^^^^^^^^^^^^^ +RuntimeError: no running event loop +2024-01-25 23:53:09,851 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 85, in + start_bot = bot.polling() + ^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1045, in polling + self.__threaded_polling(non_stop=non_stop, interval=interval, timeout=timeout, long_polling_timeout=long_polling_timeout, + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1120, in __threaded_polling + raise e + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1082, in __threaded_polling + self.worker_pool.raise_exceptions() + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 147, in raise_exceptions + raise self.exception_info + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 90, in run + task(*args, **kwargs) + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 6793, in _run_middlewares_and_handler + result = handler['function'](message) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 68, in handle_message + asyncio.create_task(main(message.text)) + File "/usr/lib/python3.11/asyncio/tasks.py", line 381, in create_task + loop = events.get_running_loop() + ^^^^^^^^^^^^^^^^^^^^^^^^^ +RuntimeError: no running event loop +2024-01-25 23:54:16,131 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 85, in + start_bot = bot.polling() + ^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1045, in polling + self.__threaded_polling(non_stop=non_stop, interval=interval, timeout=timeout, long_polling_timeout=long_polling_timeout, + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1120, in __threaded_polling + raise e + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1082, in __threaded_polling + self.worker_pool.raise_exceptions() + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 147, in raise_exceptions + raise self.exception_info + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 90, in run + task(*args, **kwargs) + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 6793, in _run_middlewares_and_handler + result = handler['function'](message) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 68, in handle_message + asyncio.create_task(main(message)) + File "/usr/lib/python3.11/asyncio/tasks.py", line 381, in create_task + loop = events.get_running_loop() + ^^^^^^^^^^^^^^^^^^^^^^^^^ +RuntimeError: no running event loop +2024-01-25 23:55:01,975 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 63, in + asyncio.create_task(main(message)) + ^^^^^^^ +NameError: name 'message' is not defined +2024-01-26 00:00:55,900 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot +ImportError: cannot import name 'start_bot' from 'tele_bot' (/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py) +2024-01-26 00:04:54,067 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 79 + await bot_task + ^^^^^^^^^^^^^^ +SyntaxError: 'await' outside function +2024-01-26 09:49:32,924 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 09:51:40,331 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 09:52:46,045 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 09:53:07,578 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 09:54:07,093 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 09:54:45,693 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 09:54:45,695 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 51, in + start_bot = bot.polling() + ^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1045, in polling + self.__threaded_polling(non_stop=non_stop, interval=interval, timeout=timeout, long_polling_timeout=long_polling_timeout, + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1120, in __threaded_polling + raise e + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1082, in __threaded_polling + self.worker_pool.raise_exceptions() + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 147, in raise_exceptions + raise self.exception_info + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 90, in run + task(*args, **kwargs) + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 6793, in _run_middlewares_and_handler + result = handler['function'](message) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 41, in handle_message + open_ai(question) + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py", line 14, in open_ai + print(stream.choices[0]) + ^^^^^^^^^^^^^^ +AttributeError: 'Stream' object has no attribute 'choices' +2024-01-26 09:58:12,792 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 09:59:03,250 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 10:22:11,514 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 10:23:19,112 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 51, in + start_bot = bot.polling() + ^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1045, in polling + self.__threaded_polling(non_stop=non_stop, interval=interval, timeout=timeout, long_polling_timeout=long_polling_timeout, + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1120, in __threaded_polling + raise e + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1082, in __threaded_polling + self.worker_pool.raise_exceptions() + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 147, in raise_exceptions + raise self.exception_info + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 90, in run + task(*args, **kwargs) + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 6793, in _run_middlewares_and_handler + result = handler['function'](message) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +TypeError: handle_message() takes 0 positional arguments but 1 was given +2024-01-26 10:24:03,200 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 10:26:47,824 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 10:27:49,781 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 4, in + from open_ai import open_ai + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py", line 3, in + from tele_bot import question +ImportError: cannot import name 'question' from partially initialized module 'tele_bot' (most likely due to a circular import) (/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py) +2024-01-26 10:28:43,531 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 4, in + from open_ai import open_ai + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py", line 3, in + from tele_bot import quest +ImportError: cannot import name 'quest' from partially initialized module 'tele_bot' (most likely due to a circular import) (/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py) +2024-01-26 10:29:13,684 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 4, in + from open_ai import open_ai + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py", line 3, in + from tele_bot import quest +ImportError: cannot import name 'quest' from partially initialized module 'tele_bot' (most likely due to a circular import) (/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py) +2024-01-26 10:31:22,400 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 10:31:30,286 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 52, in + start_bot = bot.polling() + ^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1045, in polling + self.__threaded_polling(non_stop=non_stop, interval=interval, timeout=timeout, long_polling_timeout=long_polling_timeout, + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1120, in __threaded_polling + raise e + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1082, in __threaded_polling + self.worker_pool.raise_exceptions() + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 147, in raise_exceptions + raise self.exception_info + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 90, in run + task(*args, **kwargs) + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 6793, in _run_middlewares_and_handler + result = handler['function'](message) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 42, in handle_message + open_ai() +TypeError: open_ai() missing 1 required positional argument: 'quest' +2024-01-26 10:32:17,766 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 10:32:20,918 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 52, in + start_bot = bot.polling() + ^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1045, in polling + self.__threaded_polling(non_stop=non_stop, interval=interval, timeout=timeout, long_polling_timeout=long_polling_timeout, + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1120, in __threaded_polling + raise e + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1082, in __threaded_polling + self.worker_pool.raise_exceptions() + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 147, in raise_exceptions + raise self.exception_info + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 90, in run + task(*args, **kwargs) + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 6793, in _run_middlewares_and_handler + result = handler['function'](message) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 42, in handle_message + open_ai() +TypeError: open_ai() missing 1 required positional argument: 'quest' +2024-01-26 10:32:46,250 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 10:32:47,886 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 52, in + start_bot = bot.polling() + ^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1045, in polling + self.__threaded_polling(non_stop=non_stop, interval=interval, timeout=timeout, long_polling_timeout=long_polling_timeout, + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1120, in __threaded_polling + raise e + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1082, in __threaded_polling + self.worker_pool.raise_exceptions() + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 147, in raise_exceptions + raise self.exception_info + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 90, in run + task(*args, **kwargs) + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 6793, in _run_middlewares_and_handler + result = handler['function'](message) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 42, in handle_message + open_ai() +TypeError: open_ai() missing 1 required positional argument: 'quest' +2024-01-26 10:33:06,902 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 4, in + from open_ai import open_ai + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py", line 38, in + open_ai(quest) + ^^^^^ +NameError: name 'quest' is not defined +2024-01-26 10:33:26,802 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 4, in + from open_ai import open_ai + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py", line 38, in + open_ai(quest) + ^^^^^ +NameError: name 'quest' is not defined +2024-01-26 10:33:53,970 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 4, in + from open_ai import open_ai + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py", line 3, in + from tele_bot import quest +ImportError: cannot import name 'quest' from partially initialized module 'tele_bot' (most likely due to a circular import) (/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py) +2024-01-26 10:35:05,457 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 4, in + from open_ai import open_ai + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py", line 3, in + from tele_bot import quest +ImportError: cannot import name 'quest' from partially initialized module 'tele_bot' (most likely due to a circular import) (/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py) +2024-01-26 10:36:21,190 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 10:37:05,924 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 10:38:14,379 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 10:39:24,839 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 11:04:11,564 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 11:04:11,573 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 4, in + from open_ai import open_ai +ImportError: cannot import name 'open_ai' from 'open_ai' (/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py) +2024-01-26 11:14:30,263 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 4, in + from open_ai import open_ai +ImportError: cannot import name 'open_ai' from 'open_ai' (/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py) +2024-01-26 11:16:14,853 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 11:17:18,988 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 4, in + from open_ai import main, total_answer +ImportError: cannot import name 'total_answer' from 'open_ai' (/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py) +2024-01-26 11:18:18,872 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 4, in + from open_ai import main, total_answer +ImportError: cannot import name 'total_answer' from 'open_ai' (/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py) +2024-01-26 11:18:36,365 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 11:21:01,076 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 6, in + from open_ai import total_answer +ImportError: cannot import name 'total_answer' from 'open_ai' (/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py) +2024-01-26 11:36:18,668 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 6, in + from open_ai import total_answer +ImportError: cannot import name 'total_answer' from 'open_ai' (/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py) +2024-01-26 11:36:51,858 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 11:37:13,011 - openai._base_client - INFO - Retrying request to /chat/completions in 0.867927 seconds +2024-01-26 11:38:21,521 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 11:38:29,023 - openai._base_client - INFO - Retrying request to /chat/completions in 0.948170 seconds +2024-01-26 11:39:44,572 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 11:39:51,694 - openai._base_client - INFO - Retrying request to /chat/completions in 0.951211 seconds +2024-01-26 11:41:14,237 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 11:41:21,515 - openai._base_client - INFO - Retrying request to /chat/completions in 0.828195 seconds +2024-01-26 11:42:14,557 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 5, in + from open_ai import main #, total_answer + ^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py", line 28, in + asyncio.run(main()) + ^^^^^^ +TypeError: main() missing 1 required positional argument: 'question' +2024-01-26 11:42:18,412 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 5, in + from open_ai import main #, total_answer + ^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py", line 28, in + asyncio.run(main()) + ^^^^^^ +TypeError: main() missing 1 required positional argument: 'question' +2024-01-26 11:42:38,978 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 11:46:36,523 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 52, in + start_bot = bot.polling() + ^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1045, in polling + self.__threaded_polling(non_stop=non_stop, interval=interval, timeout=timeout, long_polling_timeout=long_polling_timeout, + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1120, in __threaded_polling + raise e + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1082, in __threaded_polling + self.worker_pool.raise_exceptions() + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 147, in raise_exceptions + raise self.exception_info + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 90, in run + task(*args, **kwargs) + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 6793, in _run_middlewares_and_handler + result = handler['function'](message) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 47, in handle_message + loop = asyncio.get_event_loop() + ^^^^^^^^^^^^^^^^^^^^^^^^ + File "/usr/lib/python3.11/asyncio/events.py", line 677, in get_event_loop + raise RuntimeError('There is no current event loop in thread %r.' +RuntimeError: There is no current event loop in thread 'WorkerThread1'. +2024-01-26 11:48:28,994 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 11:48:33,671 - openai._base_client - INFO - Retrying request to /chat/completions in 0.858954 seconds +2024-01-26 11:48:35,953 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 11:49:05,181 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 11:49:47,483 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 11:50:35,026 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 11:52:35,512 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 11:53:46,287 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 11:54:15,200 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 11:56:10,968 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 11:59:23,060 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 12:00:54,956 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 12:09:27,300 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 12:13:32,584 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 12:14:34,094 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 12:16:06,606 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 12:19:32,161 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 12:21:18,821 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 12:21:18,834 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 52, in + start_bot = bot.polling() + ^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1045, in polling + self.__threaded_polling(non_stop=non_stop, interval=interval, timeout=timeout, long_polling_timeout=long_polling_timeout, + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1120, in __threaded_polling + raise e + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1082, in __threaded_polling + self.worker_pool.raise_exceptions() + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 147, in raise_exceptions + raise self.exception_info + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 90, in run + task(*args, **kwargs) + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 6793, in _run_middlewares_and_handler + result = handler['function'](message) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 49, in handle_message + loop.run_until_complete(run_main()) + File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete + return future.result() + ^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 45, in run_main + bot.reply_to(message, f"{result[0]}\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n**Версия модели**: {result[1]}\n*Завершенные* токены: {result[2]}\n_Подсказки токены_: {result[3]}\nВсего токенов: {result[4]}",'bold text and italic text and monospaced text', parse_mode='HTML') +TypeError: TeleBot.reply_to() takes 3 positional arguments but 4 were given +2024-01-26 12:22:13,260 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 12:23:55,003 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 12:24:53,428 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 12:24:53,652 - TeleBot - ERROR - Threaded polling exception: A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad Request: chat not found +2024-01-26 12:24:53,653 - TeleBot - ERROR - Exception traceback: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1082, in __threaded_polling + self.worker_pool.raise_exceptions() + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 147, in raise_exceptions + raise self.exception_info + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 90, in run + task(*args, **kwargs) + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 6793, in _run_middlewares_and_handler + result = handler['function'](message) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 50, in handle_message + loop.run_until_complete(run_main()) + File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete + return future.result() + ^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 46, in run_main + bot.send_message(message, 'bold text and italic text and monospaced text', parse_mode='HTML') + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1541, in send_message + apihelper.send_message( + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/apihelper.py", line 266, in send_message + return _make_request(token, method_url, params=payload, method='post') + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/apihelper.py", line 164, in _make_request + json_result = _check_result(method_name, result) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/apihelper.py", line 191, in _check_result + raise ApiTelegramException(method_name, result, result_json) +telebot.apihelper.ApiTelegramException: A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad Request: chat not found + +2024-01-26 12:24:53,653 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 10, in + start_bot(none_stop=True, timeout=60) +TypeError: 'NoneType' object is not callable +2024-01-26 12:25:30,301 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 12:28:36,480 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 12:34:12,759 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 12:36:31,218 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 12:36:31,234 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 56, in + start_bot = bot.polling() + ^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1045, in polling + self.__threaded_polling(non_stop=non_stop, interval=interval, timeout=timeout, long_polling_timeout=long_polling_timeout, + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1120, in __threaded_polling + raise e + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1082, in __threaded_polling + self.worker_pool.raise_exceptions() + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 147, in raise_exceptions + raise self.exception_info + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 90, in run + task(*args, **kwargs) + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 6793, in _run_middlewares_and_handler + result = handler['function'](message) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 53, in handle_message + loop.run_until_complete(run_main()) + File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete + return future.result() + ^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 47, in run_main + result[0] = 'bold text' + ~~~~~~^^^ +TypeError: 'tuple' object does not support item assignment +2024-01-26 12:37:51,268 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 12:38:50,216 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 12:41:23,710 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 12:44:52,050 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 12:52:52,876 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 12:59:06,490 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 12:59:51,536 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 12:59:51,762 - TeleBot - ERROR - Threaded polling exception: A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad Request: can't parse entities: Unsupported start tag "div" at byte offset 381 +2024-01-26 12:59:51,765 - TeleBot - ERROR - Exception traceback: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1082, in __threaded_polling + self.worker_pool.raise_exceptions() + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 147, in raise_exceptions + raise self.exception_info + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 90, in run + task(*args, **kwargs) + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 6793, in _run_middlewares_and_handler + result = handler['function'](message) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 58, in handle_message + loop.run_until_complete(run_main()) + File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete + return future.result() + ^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 54, in run_main + bot.reply_to(message, send, parse_mode='HTML') + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 4520, in reply_to + return self.send_message(message.chat.id, text, reply_to_message_id=message.message_id, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1541, in send_message + apihelper.send_message( + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/apihelper.py", line 266, in send_message + return _make_request(token, method_url, params=payload, method='post') + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/apihelper.py", line 164, in _make_request + json_result = _check_result(method_name, result) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/apihelper.py", line 191, in _check_result + raise ApiTelegramException(method_name, result, result_json) +telebot.apihelper.ApiTelegramException: A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad Request: can't parse entities: Unsupported start tag "div" at byte offset 381 + +2024-01-26 12:59:51,765 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 10, in + start_bot(none_stop=True, timeout=60) +TypeError: 'NoneType' object is not callable +2024-01-26 13:02:10,197 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 13:02:10,580 - TeleBot - ERROR - Threaded polling exception: A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad Request: can't parse entities: Unsupported start tag "div" at byte offset 604 +2024-01-26 13:02:10,581 - TeleBot - ERROR - Exception traceback: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1082, in __threaded_polling + self.worker_pool.raise_exceptions() + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 147, in raise_exceptions + raise self.exception_info + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 90, in run + task(*args, **kwargs) + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 6793, in _run_middlewares_and_handler + result = handler['function'](message) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 60, in handle_message + loop.run_until_complete(run_main()) + File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete + return future.result() + ^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 56, in run_main + bot.reply_to(message, send, parse_mode='HTML') + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 4520, in reply_to + return self.send_message(message.chat.id, text, reply_to_message_id=message.message_id, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1541, in send_message + apihelper.send_message( + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/apihelper.py", line 266, in send_message + return _make_request(token, method_url, params=payload, method='post') + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/apihelper.py", line 164, in _make_request + json_result = _check_result(method_name, result) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/apihelper.py", line 191, in _check_result + raise ApiTelegramException(method_name, result, result_json) +telebot.apihelper.ApiTelegramException: A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad Request: can't parse entities: Unsupported start tag "div" at byte offset 604 + +2024-01-26 13:02:10,581 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 10, in + start_bot(none_stop=True, timeout=60) +TypeError: 'NoneType' object is not callable +2024-01-26 13:05:46,112 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 13:07:03,814 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 13:07:04,077 - TeleBot - ERROR - Threaded polling exception: A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad Request: can't parse entities: Unsupported start tag "div" at byte offset 630 +2024-01-26 13:07:04,080 - TeleBot - ERROR - Exception traceback: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1082, in __threaded_polling + self.worker_pool.raise_exceptions() + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 147, in raise_exceptions + raise self.exception_info + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 90, in run + task(*args, **kwargs) + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 6793, in _run_middlewares_and_handler + result = handler['function'](message) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 59, in handle_message + loop.run_until_complete(run_main()) + File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete + return future.result() + ^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 55, in run_main + bot.reply_to(message, send, parse_mode='HTML') + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 4520, in reply_to + return self.send_message(message.chat.id, text, reply_to_message_id=message.message_id, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1541, in send_message + apihelper.send_message( + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/apihelper.py", line 266, in send_message + return _make_request(token, method_url, params=payload, method='post') + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/apihelper.py", line 164, in _make_request + json_result = _check_result(method_name, result) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/apihelper.py", line 191, in _check_result + raise ApiTelegramException(method_name, result, result_json) +telebot.apihelper.ApiTelegramException: A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad Request: can't parse entities: Unsupported start tag "div" at byte offset 630 + +2024-01-26 13:07:04,081 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 10, in + start_bot(none_stop=True, timeout=60) +TypeError: 'NoneType' object is not callable +2024-01-26 13:13:08,713 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 13:13:08,969 - TeleBot - ERROR - Threaded polling exception: A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad Request: can't parse entities: Character '>' is reserved and must be escaped with the preceding '\' +2024-01-26 13:13:08,970 - TeleBot - ERROR - Exception traceback: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1082, in __threaded_polling + self.worker_pool.raise_exceptions() + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 147, in raise_exceptions + raise self.exception_info + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 90, in run + task(*args, **kwargs) + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 6793, in _run_middlewares_and_handler + result = handler['function'](message) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 59, in handle_message + loop.run_until_complete(run_main()) + File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete + return future.result() + ^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 55, in run_main + bot.reply_to(message, send, parse_mode='MarkdownV2') + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 4520, in reply_to + return self.send_message(message.chat.id, text, reply_to_message_id=message.message_id, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1541, in send_message + apihelper.send_message( + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/apihelper.py", line 266, in send_message + return _make_request(token, method_url, params=payload, method='post') + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/apihelper.py", line 164, in _make_request + json_result = _check_result(method_name, result) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/apihelper.py", line 191, in _check_result + raise ApiTelegramException(method_name, result, result_json) +telebot.apihelper.ApiTelegramException: A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad Request: can't parse entities: Character '>' is reserved and must be escaped with the preceding '\' + +2024-01-26 13:13:08,970 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 10, in + start_bot(none_stop=True, timeout=60) +TypeError: 'NoneType' object is not callable +2024-01-26 13:16:47,627 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 13:16:47,896 - TeleBot - ERROR - Threaded polling exception: A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad Request: can't parse entities: Character '>' is reserved and must be escaped with the preceding '\' +2024-01-26 13:16:47,899 - TeleBot - ERROR - Exception traceback: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1082, in __threaded_polling + self.worker_pool.raise_exceptions() + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 147, in raise_exceptions + raise self.exception_info + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 90, in run + task(*args, **kwargs) + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 6793, in _run_middlewares_and_handler + result = handler['function'](message) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 59, in handle_message + loop.run_until_complete(run_main()) + File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete + return future.result() + ^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 55, in run_main + bot.reply_to(message, send, parse_mode='MarkdownV2') + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 4520, in reply_to + return self.send_message(message.chat.id, text, reply_to_message_id=message.message_id, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1541, in send_message + apihelper.send_message( + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/apihelper.py", line 266, in send_message + return _make_request(token, method_url, params=payload, method='post') + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/apihelper.py", line 164, in _make_request + json_result = _check_result(method_name, result) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/apihelper.py", line 191, in _check_result + raise ApiTelegramException(method_name, result, result_json) +telebot.apihelper.ApiTelegramException: A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad Request: can't parse entities: Character '>' is reserved and must be escaped with the preceding '\' + +2024-01-26 13:16:47,900 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 10, in + start_bot(none_stop=True, timeout=60) +TypeError: 'NoneType' object is not callable +2024-01-26 13:18:55,478 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 13:18:55,738 - TeleBot - ERROR - Threaded polling exception: A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad Request: can't parse entities: Character '-' is reserved and must be escaped with the preceding '\' +2024-01-26 13:18:55,741 - TeleBot - ERROR - Exception traceback: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1082, in __threaded_polling + self.worker_pool.raise_exceptions() + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 147, in raise_exceptions + raise self.exception_info + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 90, in run + task(*args, **kwargs) + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 6793, in _run_middlewares_and_handler + result = handler['function'](message) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 55, in handle_message + loop.run_until_complete(run_main()) + File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete + return future.result() + ^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 51, in run_main + bot.reply_to(message, send, parse_mode='MarkdownV2') + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 4520, in reply_to + return self.send_message(message.chat.id, text, reply_to_message_id=message.message_id, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1541, in send_message + apihelper.send_message( + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/apihelper.py", line 266, in send_message + return _make_request(token, method_url, params=payload, method='post') + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/apihelper.py", line 164, in _make_request + json_result = _check_result(method_name, result) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/apihelper.py", line 191, in _check_result + raise ApiTelegramException(method_name, result, result_json) +telebot.apihelper.ApiTelegramException: A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad Request: can't parse entities: Character '-' is reserved and must be escaped with the preceding '\' + +2024-01-26 13:18:55,741 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 10, in + start_bot(none_stop=True, timeout=60) +TypeError: 'NoneType' object is not callable +2024-01-26 13:20:12,538 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 13:20:12,769 - TeleBot - ERROR - Threaded polling exception: A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad Request: can't parse entities: Unsupported start tag "div" at byte offset 461 +2024-01-26 13:20:12,770 - TeleBot - ERROR - Exception traceback: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1082, in __threaded_polling + self.worker_pool.raise_exceptions() + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 147, in raise_exceptions + raise self.exception_info + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 90, in run + task(*args, **kwargs) + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 6793, in _run_middlewares_and_handler + result = handler['function'](message) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 55, in handle_message + loop.run_until_complete(run_main()) + File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete + return future.result() + ^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 51, in run_main + bot.reply_to(message, send, parse_mode='HTML') + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 4520, in reply_to + return self.send_message(message.chat.id, text, reply_to_message_id=message.message_id, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1541, in send_message + apihelper.send_message( + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/apihelper.py", line 266, in send_message + return _make_request(token, method_url, params=payload, method='post') + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/apihelper.py", line 164, in _make_request + json_result = _check_result(method_name, result) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/apihelper.py", line 191, in _check_result + raise ApiTelegramException(method_name, result, result_json) +telebot.apihelper.ApiTelegramException: A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad Request: can't parse entities: Unsupported start tag "div" at byte offset 461 + +2024-01-26 13:20:12,770 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 10, in + start_bot(none_stop=True, timeout=60) +TypeError: 'NoneType' object is not callable +2024-01-26 13:20:57,439 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 13:20:57,646 - TeleBot - ERROR - Threaded polling exception: A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad Request: unsupported parse_mode +2024-01-26 13:20:57,647 - TeleBot - ERROR - Exception traceback: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1082, in __threaded_polling + self.worker_pool.raise_exceptions() + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 147, in raise_exceptions + raise self.exception_info + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 90, in run + task(*args, **kwargs) + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 6793, in _run_middlewares_and_handler + result = handler['function'](message) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 55, in handle_message + loop.run_until_complete(run_main()) + File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete + return future.result() + ^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 51, in run_main + bot.reply_to(message, send, parse_mode='text') #parse_mode='HTML' + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 4520, in reply_to + return self.send_message(message.chat.id, text, reply_to_message_id=message.message_id, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1541, in send_message + apihelper.send_message( + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/apihelper.py", line 266, in send_message + return _make_request(token, method_url, params=payload, method='post') + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/apihelper.py", line 164, in _make_request + json_result = _check_result(method_name, result) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/apihelper.py", line 191, in _check_result + raise ApiTelegramException(method_name, result, result_json) +telebot.apihelper.ApiTelegramException: A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad Request: unsupported parse_mode + +2024-01-26 13:20:57,647 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 10, in + start_bot(none_stop=True, timeout=60) +TypeError: 'NoneType' object is not callable +2024-01-26 13:22:22,920 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 13:22:35,442 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 13:22:35,752 - TeleBot - ERROR - Threaded polling exception: A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad Request: can't parse entities: Unsupported start tag "div" at byte offset 223 +2024-01-26 13:22:35,754 - TeleBot - ERROR - Exception traceback: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1082, in __threaded_polling + self.worker_pool.raise_exceptions() + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 147, in raise_exceptions + raise self.exception_info + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 90, in run + task(*args, **kwargs) + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 6793, in _run_middlewares_and_handler + result = handler['function'](message) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 51, in handle_message + loop.run_until_complete(run_main()) + File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete + return future.result() + ^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 47, in run_main + bot.reply_to(message, send, parse_mode='HTML') + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 4520, in reply_to + return self.send_message(message.chat.id, text, reply_to_message_id=message.message_id, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1541, in send_message + apihelper.send_message( + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/apihelper.py", line 266, in send_message + return _make_request(token, method_url, params=payload, method='post') + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/apihelper.py", line 164, in _make_request + json_result = _check_result(method_name, result) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/apihelper.py", line 191, in _check_result + raise ApiTelegramException(method_name, result, result_json) +telebot.apihelper.ApiTelegramException: A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad Request: can't parse entities: Unsupported start tag "div" at byte offset 223 + +2024-01-26 13:22:35,755 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 10, in + start_bot(none_stop=True, timeout=60) +TypeError: 'NoneType' object is not callable +2024-01-26 13:22:58,376 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 13:22:58,592 - TeleBot - ERROR - Threaded polling exception: A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad Request: unsupported parse_mode +2024-01-26 13:22:58,594 - TeleBot - ERROR - Exception traceback: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1082, in __threaded_polling + self.worker_pool.raise_exceptions() + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 147, in raise_exceptions + raise self.exception_info + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 90, in run + task(*args, **kwargs) + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 6793, in _run_middlewares_and_handler + result = handler['function'](message) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 51, in handle_message + loop.run_until_complete(run_main()) + File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete + return future.result() + ^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 47, in run_main + bot.reply_to(message, send, parse_mode='text') + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 4520, in reply_to + return self.send_message(message.chat.id, text, reply_to_message_id=message.message_id, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1541, in send_message + apihelper.send_message( + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/apihelper.py", line 266, in send_message + return _make_request(token, method_url, params=payload, method='post') + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/apihelper.py", line 164, in _make_request + json_result = _check_result(method_name, result) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/apihelper.py", line 191, in _check_result + raise ApiTelegramException(method_name, result, result_json) +telebot.apihelper.ApiTelegramException: A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad Request: unsupported parse_mode + +2024-01-26 13:22:58,595 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 10, in + start_bot(none_stop=True, timeout=60) +TypeError: 'NoneType' object is not callable +2024-01-26 13:23:27,597 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 13:23:44,871 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 13:24:47,999 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 13:25:02,507 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 13:25:54,808 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 13:26:09,523 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 13:45:11,382 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 13:45:56,860 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 13:45:57,070 - TeleBot - ERROR - Threaded polling exception: A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad Request: can't parse entities: Unsupported start tag "div" at byte offset 3 +2024-01-26 13:45:57,072 - TeleBot - ERROR - Exception traceback: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1082, in __threaded_polling + self.worker_pool.raise_exceptions() + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 147, in raise_exceptions + raise self.exception_info + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 90, in run + task(*args, **kwargs) + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 6793, in _run_middlewares_and_handler + result = handler['function'](message) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 53, in handle_message + loop.run_until_complete(run_main()) + File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete + return future.result() + ^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 48, in run_main + bot.reply_to(message, send, parse_mode='HTML') + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 4520, in reply_to + return self.send_message(message.chat.id, text, reply_to_message_id=message.message_id, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1541, in send_message + apihelper.send_message( + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/apihelper.py", line 266, in send_message + return _make_request(token, method_url, params=payload, method='post') + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/apihelper.py", line 164, in _make_request + json_result = _check_result(method_name, result) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/apihelper.py", line 191, in _check_result + raise ApiTelegramException(method_name, result, result_json) +telebot.apihelper.ApiTelegramException: A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad Request: can't parse entities: Unsupported start tag "div" at byte offset 3 + +2024-01-26 13:45:57,073 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 10, in + start_bot(none_stop=True, timeout=60) +TypeError: 'NoneType' object is not callable +2024-01-26 13:46:39,823 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 13:46:40,025 - TeleBot - ERROR - Threaded polling exception: A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad Request: can't parse entities: Unsupported start tag "div" at byte offset 9 +2024-01-26 13:46:40,026 - TeleBot - ERROR - Exception traceback: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1082, in __threaded_polling + self.worker_pool.raise_exceptions() + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 147, in raise_exceptions + raise self.exception_info + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 90, in run + task(*args, **kwargs) + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 6793, in _run_middlewares_and_handler + result = handler['function'](message) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 53, in handle_message + loop.run_until_complete(run_main()) + File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete + return future.result() + ^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 48, in run_main + bot.reply_to(message, send, parse_mode='HTML') + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 4520, in reply_to + return self.send_message(message.chat.id, text, reply_to_message_id=message.message_id, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1541, in send_message + apihelper.send_message( + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/apihelper.py", line 266, in send_message + return _make_request(token, method_url, params=payload, method='post') + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/apihelper.py", line 164, in _make_request + json_result = _check_result(method_name, result) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/apihelper.py", line 191, in _check_result + raise ApiTelegramException(method_name, result, result_json) +telebot.apihelper.ApiTelegramException: A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad Request: can't parse entities: Unsupported start tag "div" at byte offset 9 + +2024-01-26 13:46:40,026 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 10, in + start_bot(none_stop=True, timeout=60) +TypeError: 'NoneType' object is not callable +2024-01-26 13:46:59,394 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 13:47:58,708 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 13:47:58,929 - TeleBot - ERROR - Threaded polling exception: A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad Request: can't parse entities: Unsupported start tag "div" at byte offset 12 +2024-01-26 13:47:58,932 - TeleBot - ERROR - Exception traceback: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1082, in __threaded_polling + self.worker_pool.raise_exceptions() + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 147, in raise_exceptions + raise self.exception_info + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 90, in run + task(*args, **kwargs) + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 6793, in _run_middlewares_and_handler + result = handler['function'](message) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 53, in handle_message + loop.run_until_complete(run_main()) + File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete + return future.result() + ^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 48, in run_main + bot.reply_to(message, send, parse_mode='HTML') + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 4520, in reply_to + return self.send_message(message.chat.id, text, reply_to_message_id=message.message_id, **kwargs) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1541, in send_message + apihelper.send_message( + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/apihelper.py", line 266, in send_message + return _make_request(token, method_url, params=payload, method='post') + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/apihelper.py", line 164, in _make_request + json_result = _check_result(method_name, result) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/apihelper.py", line 191, in _check_result + raise ApiTelegramException(method_name, result, result_json) +telebot.apihelper.ApiTelegramException: A request to the Telegram API was unsuccessful. Error code: 400. Description: Bad Request: can't parse entities: Unsupported start tag "div" at byte offset 12 + +2024-01-26 13:47:58,933 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 10, in + start_bot(none_stop=True, timeout=60) +TypeError: 'NoneType' object is not callable +2024-01-26 13:50:55,042 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 13:52:08,194 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 14:02:06,461 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 14:02:47,881 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 16:00:04,693 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 16:04:06,051 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 17:23:01,679 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 17:35:42,527 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 17:46:23,295 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 17:49:25,856 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 17:49:34,271 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 18:09:53,367 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 57, in + start_bot = bot.polling() + ^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1045, in polling + self.__threaded_polling(non_stop=non_stop, interval=interval, timeout=timeout, long_polling_timeout=long_polling_timeout, + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1120, in __threaded_polling + raise e + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1082, in __threaded_polling + self.worker_pool.raise_exceptions() + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 147, in raise_exceptions + raise self.exception_info + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 90, in run + task(*args, **kwargs) + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 6793, in _run_middlewares_and_handler + result = handler['function'](message) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 54, in handle_message + loop.run_until_complete(run_main()) + File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete + return future.result() + ^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 47, in run_main + result = await main(question) + ^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py", line 12, in main + all_in = all_in.append(all_in) + ^^^^^^ +UnboundLocalError: cannot access local variable 'all_in' where it is not associated with a value +2024-01-26 18:11:00,621 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 18:11:20,687 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 18:17:42,738 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 18:17:53,031 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 18:24:00,705 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 18:26:29,688 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 400 Bad Request" +2024-01-26 18:26:29,699 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 57, in + start_bot = bot.polling() + ^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1045, in polling + self.__threaded_polling(non_stop=non_stop, interval=interval, timeout=timeout, long_polling_timeout=long_polling_timeout, + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1120, in __threaded_polling + raise e + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1082, in __threaded_polling + self.worker_pool.raise_exceptions() + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 147, in raise_exceptions + raise self.exception_info + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 90, in run + task(*args, **kwargs) + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 6793, in _run_middlewares_and_handler + result = handler['function'](message) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 54, in handle_message + loop.run_until_complete(run_main()) + File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete + return future.result() + ^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 47, in run_main + result = await main(question) + ^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py", line 17, in main + chat_completion = await client.chat.completions.create( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/resources/chat/completions.py", line 1291, in create + return await self._post( + ^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/_base_client.py", line 1578, in post + return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/_base_client.py", line 1339, in request + return await self._request( + ^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/_base_client.py", line 1429, in _request + raise self._make_status_error_from_response(err.response) from None +openai.BadRequestError: Error code: 400 - {'error': {'message': "'$.messages[0].content' is invalid. Please check the API reference: https://platform.openai.com/docs/api-reference.", 'type': 'invalid_request_error', 'param': None, 'code': None}} +2024-01-26 19:25:33,464 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 19:25:59,862 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 19:26:14,081 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 19:26:35,647 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 19:26:53,573 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 19:32:43,789 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 19:33:03,018 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 19:33:42,331 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 19:35:13,100 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 19:35:51,127 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 19:39:38,884 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 19:39:50,748 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 19:42:04,773 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 19:42:31,267 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 19:43:09,379 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 19:44:50,282 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 19:45:03,289 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 19:45:16,187 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 19:45:41,836 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK" +2024-01-26 20:18:14,031 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 404 Not Found" +2024-01-26 20:18:14,034 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 57, in + start_bot = bot.polling() + ^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1045, in polling + self.__threaded_polling(non_stop=non_stop, interval=interval, timeout=timeout, long_polling_timeout=long_polling_timeout, + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1120, in __threaded_polling + raise e + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1082, in __threaded_polling + self.worker_pool.raise_exceptions() + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 147, in raise_exceptions + raise self.exception_info + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 90, in run + task(*args, **kwargs) + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 6793, in _run_middlewares_and_handler + result = handler['function'](message) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 54, in handle_message + loop.run_until_complete(run_main()) + File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete + return future.result() + ^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 47, in run_main + result = await main(question) + ^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py", line 18, in main + chat_completion = await client.chat.completions.create( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/resources/chat/completions.py", line 1291, in create + return await self._post( + ^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/_base_client.py", line 1578, in post + return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/_base_client.py", line 1339, in request + return await self._request( + ^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/_base_client.py", line 1429, in _request + raise self._make_status_error_from_response(err.response) from None +openai.NotFoundError: Error code: 404 - {'error': {'message': 'The model `text-davinci-002` has been deprecated, learn more here: https://platform.openai.com/docs/deprecations', 'type': 'invalid_request_error', 'param': None, 'code': 'model_not_found'}} +2024-01-26 20:18:54,861 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 404 Not Found" +2024-01-26 20:18:54,864 - logging_bot - ERROR - Произошла непредвиденная ошибка: +Traceback (most recent call last): + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/run_bot.py", line 9, in + from tele_bot import start_bot + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 57, in + start_bot = bot.polling() + ^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1045, in polling + self.__threaded_polling(non_stop=non_stop, interval=interval, timeout=timeout, long_polling_timeout=long_polling_timeout, + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1120, in __threaded_polling + raise e + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 1082, in __threaded_polling + self.worker_pool.raise_exceptions() + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 147, in raise_exceptions + raise self.exception_info + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/util.py", line 90, in run + task(*args, **kwargs) + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/telebot/__init__.py", line 6793, in _run_middlewares_and_handler + result = handler['function'](message) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 54, in handle_message + loop.run_until_complete(run_main()) + File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete + return future.result() + ^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/tele_bot.py", line 47, in run_main + result = await main(question) + ^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/app/open_ai.py", line 18, in main + chat_completion = await client.chat.completions.create( + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/resources/chat/completions.py", line 1291, in create + return await self._post( + ^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/_base_client.py", line 1578, in post + return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls) + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/_base_client.py", line 1339, in request + return await self._request( + ^^^^^^^^^^^^^^^^^^^^ + File "/home/shliamb/Desktop/WORK_FOLDER/chatgpt/myvenv/lib/python3.11/site-packages/openai/_base_client.py", line 1429, in _request + raise self._make_status_error_from_response(err.response) from None +openai.NotFoundError: Error code: 404 - {'error': {'message': 'The model `text-curie-003` does not exist', 'type': 'invalid_request_error', 'param': None, 'code': 'model_not_found'}} +2024-01-26 20:58:38,928 - httpx - INFO - HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK"