A strip down version of SakuraAi-Bloom but with more fluid conversational behavior.
This Telegram chat bot is designed to provide users with a variety of functionalities, including generating chat responses, creating images based on prompts, and resetting conversation histories. The bot integrates two main components: Gemini Chat, which generates text-based responses, and Stability Image Generator, which creates images based on textual prompts.
- Chat Responses: Users can engage in text-based conversations with the bot, receiving responses generated by the Gemini Chat model. The responses aim to simulate conversation with an AI entity named Sakura, characterized by a friendly and eager-to-please demeanor.
- Image Generation: Users can prompt the bot to generate images based on provided textual prompts. The Stability Image Generator utilizes an AI model to create images corresponding to the input prompts, adding a watermark for authenticity.
- Conversation Reset: Users have the option to reset the conversation history, clearing previous interactions with the bot.
To run this Telegram chat bot, follow these steps:
-
Prerequisites:
- Ensure you have Python installed on your system (version 3.6 or higher).
- Set up a Telegram bot and obtain the API token.
- Obtain API keys for Gemini Chat and Stability Image Generator by signing up for the respective services.
-
Environment Setup:
-
Clone or download the repository containing the bot's code files.
-
Install the required Python packages by running:
pip install -r requirements.txt
-
-
Configuration:
-
Create a
.env
file in the project directory and add the following environment variables:TELEGRAM_KEY=your_telegram_bot_api_token GEMINI_API_KEY=your_gemini_chat_api_key STABILITY_API_KEY=your_stability_image_generator_api_key
-
Ensure that the
.env
file is properly configured with the correct API keys.
-
-
Change the response behavior(optional):
- open the
gemini_res.py
file. - on the
chat_instruction
part u can change the instruction as u like. - save the file and done, you have successfully change the generated response behavior.
- or u can just leave it as it is, but i need to remind u that the instruction for now can make the behavior to be to lewd.
- open the
-
Run the Bot:
-
Execute the
main.py
script to start the bot:python main.py
-
Once the bot is running, it will be active on Telegram and ready to respond to user interactions.
-
- Gemini Chat: This component simulates conversation with an AI entity named Sakura, adhering to specific personality traits and conversation guidelines. It utilizes the GenAI API for text generation.
- Stability Image Generator: This component generates images based on textual prompts provided by users. It utilizes an AI model to create images and adds a watermark for authenticity.
- Conversation History: The bot maintains a conversation history to track user interactions and generate contextually relevant responses.
- Error Handling: The bot includes error handling mechanisms to gracefully handle exceptions and provide informative error messages to users.
- Security: Ensure that API keys and sensitive information are kept secure and not shared publicly. Implement best practices for securing bot interactions and user data.
- Maintainer: This bot is maintained by azzar. For inquiries or support, please contact me.
This bot is provided as-is and may undergo updates or changes over time. Use it responsibly and adhere to Telegram's terms of service and guidelines for bot development and usage.
Special thanks to the developers and contributors of the GenAI API, Gemini Chat, and Stability Image Generator for their innovative technologies and services.