An open API service indexing awesome lists of open source software.

https://github.com/1999azzar/sakurav2

Heavily stripped-down version of my original SakuraAI-Bloom Telegram bot, powered by Gemini and stability AI.
https://github.com/1999azzar/sakurav2

gemini-api llm stability-ai telegram-bot

Last synced: about 1 month ago
JSON representation

Heavily stripped-down version of my original SakuraAI-Bloom Telegram bot, powered by Gemini and stability AI.

Awesome Lists containing this project

README

          

# Sakura V2

A strip down version of [SakuraAi-Bloom](https://github.com/1999AZZAR/sakuraAI_Bloom) but with more fluid conversational behavior.

## Overview

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.

## Functionality

1. **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.
2. **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.
3. **Conversation Reset:** Users have the option to reset the conversation history, clearing previous interactions with the bot.

## How to Run

To run this Telegram chat bot, follow these steps:

1. **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.

2. **Environment Setup:**
- Clone or download the repository containing the bot's code files.
- Install the required Python packages by running:

```sh
pip install -r requirements.txt
```

3. **Configuration:**
- Create a `.env` file in the project directory and add the following environment variables:

```text
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.

4. **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.

5. **Run the Bot:**
- Execute the `main.py` script to start the bot:

```text
python main.py
```

- Once the bot is running, it will be active on Telegram and ready to respond to user interactions.

## Other Details

- **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](https://github.com/1999AZZAR/). For inquiries or support, please contact me.

## Disclaimer

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.

## Acknowledgments

Special thanks to the developers and contributors of the GenAI API, Gemini Chat, and Stability Image Generator for their innovative technologies and services.