dictionary / intext.py
pythondikry's picture
Create intext.py
c329cfb verified
raw
history blame contribute delete
908 Bytes
input = input("Введите описание или название товара")
print(input)
prediction = input
print(prediction)
#-*- coding: utf-8 -*-
from gigachat import GigaChat
import telebot
TOKEN = "Ваш токен"
bot = telebot.TeleBot(TOKEN)
@bot.message_handler(content_types=["text"])
def start_text(message):
print(message)
#bot.send_message(message.chat.id,message.text)
#bot.send_message(message.chat.id, message)
# Укажите ключ авторизации, полученный в личном кабинете, в интерфейсе проекта GigaChat API
with GigaChat(credentials="Ключик со Сбера", verify_ssl_certs=False) as giga:
response = giga.chat(message.text)
print(response.choices[0].message.content)
bot.send_message(message.chat.id, response.choices[0].message.content)
bot.infinity_polling()