pythondikry commited on
Commit
c329cfb
·
verified ·
1 Parent(s): a0d664f

Create intext.py

Browse files
Files changed (1) hide show
  1. intext.py +27 -0
intext.py ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ input = input("Введите описание или название товара")
2
+ print(input)
3
+ prediction = input
4
+ print(prediction)
5
+
6
+ #-*- coding: utf-8 -*-
7
+ from gigachat import GigaChat
8
+ import telebot
9
+ TOKEN = "Ваш токен"
10
+ bot = telebot.TeleBot(TOKEN)
11
+
12
+
13
+
14
+
15
+ @bot.message_handler(content_types=["text"])
16
+ def start_text(message):
17
+
18
+ print(message)
19
+ #bot.send_message(message.chat.id,message.text)
20
+ #bot.send_message(message.chat.id, message)
21
+ # Укажите ключ авторизации, полученный в личном кабинете, в интерфейсе проекта GigaChat API
22
+ with GigaChat(credentials="Ключик со Сбера", verify_ssl_certs=False) as giga:
23
+ response = giga.chat(message.text)
24
+ print(response.choices[0].message.content)
25
+ bot.send_message(message.chat.id, response.choices[0].message.content)
26
+
27
+ bot.infinity_polling()