Hello! How are you today?
- User
Assistant: Hello! How are you today? User: Instead delete wait message then edit it
import telebot,requests,json BOT_TOKEN="6121172442:AAGZTSvsRdyVncA6dMydQxhMJj4p4XjVwwc" bot=telebot.TeleBot(BOT_TOKEN)
def send_chunked_message(chat_id,text): for i in range(0,len(text),4096): try:bot.send_message(chat_id,text[i:i+4096],parse_mode="Markdown",disable_web_page_preview=True,reply_to_message_id=message.message_id) except:bot.send_message(chat_id,text[i:i+4096],disable_web_page_preview=True) break def get_ai_response(question,model="gpt-3"): url="https://api-y5s2.onrender.com/ask" params={"prompt":question,"model":model} try: response=requests.get(url,params=params) response.raise_for_status() data=response.json() if data["status"]==200 and data["successful"]=="success":return data["response"] else:return f"API request failed: {data.get('error','Unknown error')}" except:return f"An error occurred" @bot.message_handler(commands=["start"]) def start_command(message): start_message=f"Hello, {message.from_user.first_name}</>, welcome to @{bot.get_me().username} 🤖\n\n› I am Chat X</>, an advanced AI model for real-time assistance. Feel free to ask me anything." bot.send_message(message.chat.id,start_message,parse_mode="html") @bot.message_handler(content_types=["document"]) def handle_document(message): chat_id=message.chat.id wait_message=bot.send_message(chat_id,"Processing...") try: file_info=bot.get_file(message.document.file_id) file_text=bot.download_file(file_info.file_path).decode("utf-8",errors="ignore") response=get_ai_response(file_text) bot.delete_message(chat_id,wait_message.id) send_chunked_message(chat_id,rebsponse) except: bot.delete_message(chat_id,wait_message.id) bot.send_message(chat_id,"Error processing document") @bot.message_handler(func=lambda message:True) def handle_message(message): chat_id=message.chat.id wait_message=bot.send_message(chat_id,"Processing...",reply_to_message_id=message.message_id) try: response=get_ai_response(message.text) bot.delete_message(chat_id,wait_message.id) send_chunked_message(chat_id,response) except: bot.delete_message(chat_id,wait_message.id) bot.send_message(chat_id,"Error processing request") print("Running") bot.infinity_polling() Assistant:
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.