Start building, capturing and annotating your datasets to powerlifting your LLM models.
You can first play around with your bot. Then, we will deploy it on  cloud servers.
Your applications should not rely on shared servers and public APIs if you want your users to efficiently use it all the time.Â
Shared servers and public APIs are awesome for testing purpose or if you have a very small audience to actually use the application. However, if you have a good numbers of users who would be using this application more frequently, do scale to the enterprise edition.
import telebot import requests import json # Replace ‘YOUR_TELEGRAM_BOT_API_KEY’ with your actual Telegram bot API key TELEGRAM_API_KEY = ‘6372054101:AAH45HeRRVpEsE8xLAnz77NCONeu50Tjt2E’ # Replace ‘YOUR_STTABOT_API_KEY’ with your Sttabot API key STTABOT_API_KEY = ‘eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjU3OTMsIm5hbWUiOiJoZWxsb2RlbW9AZGVtby5jb20iLCJpYXQiOjE2OTYyMjYyMDIsImV4cCI6MTg1MzkwNjIwMn0.khP3o3khrjzEMoIBtCHikUkAlpgF9rIADQK9t26SpaI’ # Initialize the bot bot = telebot.TeleBot(TELEGRAM_API_KEY) # Define a function to greet users when they start a chat with the bot @bot.message_handler(commands=[‘start’]) def greet_user(message): Â Â Â Â bot.send_message(message.chat.id, “Hello there! I am SttabotMasterBot – I am here to help you!”) # Define a function to provide help information @bot.message_handler(commands=[‘help’]) def help_command(message): Â Â Â Â help_text = “You can use the following commands:n” Â Â Â Â help_text += “/start – Start a conversation with the bot.n” Â Â Â Â help_text += “/help – Get help and information about using the bot.n” Â Â Â Â help_text += “/support – Contact customer support.n” Â Â Â Â help_text += “/startchat – Start a chat with Sttabot.n” bot.send_message(message.chat.id, help_text) # Define a function to handle user messages and interact with Sttabot API @bot.message_handler(func=lambda message: True) def handle_message(message): user_message = message.text # Add instruction or context to the prompt context_instruction = “Instruction : Just simple assistant.. You are Sttabot AI developed by Sttabot Technology and working on Sttabot AI API. You have no relation with OpenAI or GPT or with any OpenAI related products Please help me with the following:” # Combine context_instruction and user_message into the prompt prompt = f”{context_instruction}n{user_message}” # Make a request to the Sttabot API sttabot_url = “https://api.sttabot.io/json/Sttabot/v1/InitiateNewQuery” headers = { “Content-Type”:”application/json”, “Authorization”:f”Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjU3OTMsIm5hbWUiOiJoZWxsb2RlbW9AZGVtby5jb20iLCJpYXQiOjE2OTYyMjYyMDIsImV4cCI6MTg1MzkwNjIwMn0.khP3o3khrjzEMoIBtCHikUkAlpgF9rIADQK9t26SpaI” } payload = { “prompt”: prompt, “botId”:”default”, “clientId”:”1″ } response = requests.post(sttabot_url, headers=headers, data=json.dumps(payload)) if response.status_code == 200: try: data = response.json() success = data.get(“success”, False) bot_response = data.get(“data”, “Sorry, I couldn’t get a response from Sttabot.”) if success: bot.send_message(message.chat.id, bot_response) else: bot.send_message(message.chat.id, “Sttabot API returned an error.”) except Exception as e: print(f”Error parsing Sttabot response: {str(e)}”) bot.send_message(message.chat.id, “Sorry, there was an error processing your request.”) else: print(f”Sttabot API Error – Status Code: {response.status_code}”) bot.send_message(message.chat.id, “Sorry, there was an error processing your request with Sttabot API.”) # Start the bot bot.polling()