Coder Social home page Coder Social logo

1999azzar / stability_chat_bot Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 157 KB

"Flask app with chat bot & image generation. Engage with AI, generate images from text prompts. Easy setup & customization."

License: The Unlicense

Python 60.08% JavaScript 18.79% CSS 14.77% HTML 6.36%
chatbot gemini image-generation llm stability-ai

stability_chat_bot's Introduction

Stability Chat Bot

Overview:

This Flask application serves as a chat bot interface integrated with an image generation feature. Users can interact with the chat bot, which responds using Gemini AI, a powerful language generation model. Additionally, users can generate images based on text prompts provided to the bot.

Features:

  • Chat Bot Interface: Users can engage in conversations with the chat bot, which operates under the persona of "Frea," a friendly and intelligent AI assistant.

  • Image Generation: Users can request the generation of images based on text prompts. The generated images are crafted using the Stability AI API, incorporating the provided prompt to create unique visuals.

  • Image Logging: The application logs generated images, storing metadata such as filename and creation time in a SQLite database.

  • Security Measures: The application includes security measures to prevent bot activity detection and incorporates safety settings to filter out harmful content in chat responses.

Prerequisites:

  • Python 3.x installed on your system.
  • Access to the Stability AI API for image generation.
  • A Google Cloud Platform account with access to the Gemini AI API.
  • Installation of necessary Python packages (specified in requirements.txt).

Setup:

  1. Clone this repository to your local machine.

  2. Install the required Python packages using pip install -r requirements.txt.

  3. Obtain API keys for the Stability AI API and the Gemini AI API.

  4. Create a .env file in the web directory and add the API keys:

    STABILITY_API_KEY=your_stability_api_key
    GEMINI_API_KEY=your_gemini_api_key
    

Usage:

  1. Navigate to the web directory.
  2. Run the Flask application by executing python app.py in the terminal.
  3. Access the application in your web browser by navigating to http://localhost:2500.
  4. Interact with the chat bot by typing messages in the input field and pressing "Send".
  5. To generate an image, start your message with "imagine" followed by a prompt (e.g., "imagine a serene landscape").
  6. The generated images will be displayed in the chat interface, and metadata will be logged in the database.

Below is a screenshot of how the application interface may look while running:

Demo Screenshot

Additional Notes:

  • The application includes a mechanism to delete old images from both the filesystem and the database to manage storage efficiently.
  • Customize the chat bot's behavior, appearance, and personality by modifying the response.py and iresponse.py files.
  • Further enhancements and integrations, such as user authentication and persistent user sessions, can be implemented to extend the application's functionality.

Contributing:

Contributions to this project are welcome. Please submit pull requests or open issues for any improvements, bug fixes, or feature requests.

License:

This project is licensed under the MIT License. See the LICENSE file for more details.

stability_chat_bot's People

Contributors

1999azzar avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.