File size: 908 Bytes
c329cfb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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()