Forums

пишет ошибка сети

import openai import logging from aiogram import Bot, Dispatcher, executor, types logging.basicConfig(level=logging.INFO)

chat_api = "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" bot = Bot(token="5616066214:AAF2dYPLNclB4bQRXCURkNilT_dA5rF6JKA") dp = Dispatcher(bot) @dp.message_handler(commands = ['chat']) async def chat_cmd(message: types.Message): arg = message.get_args() openai.api_key = chat_api model_engine = "text-davinci-003" prompt = f"{arg}" completation = openai.Completion.create( engine = model_engine, prompt = prompt, max_tokens = 1024, n = 1, stop = None, temperature = 0.5

)
response = completation.choices[0].text
await message.reply(f"{response}")

if name == "main": executor.start_polling(dp, skip_updates=True)

See https://help.pythonanywhere.com/pages/403ForbiddenError/