Blog Writer is a Streamlit-based web application that generates blog using the Gemini LLM API. Users can input a topic and specify the content length to generate relevant content in English.
- Generate content based on a user-provided topic
- Specify the desired length of the generated content
- Display the generated content in a user-friendly interface
- Python 3.7 or higher
- A Google Generative AI API key
-
Clone the repository:
git clone https://github.com/aditya190803/blog-generation.git cd blog-generation
-
Create and activate a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
-
Set up your Google Generative AI API key:
- Create a file named
.streamlit/secrets.toml
in the root directory of your project:
mkdir -p .streamlit nano .streamlit/secrets.toml # You can use any text editor to create this file
- Add your API key to the
secrets.toml
file:
[secrets] GOOGLE_API_KEY = "your-google-api-key"
- Create a file named
-
Run the Streamlit app:
streamlit run app.py
-
Open your web browser and navigate to
http:https://localhost:8501
to access the application. -
Generate content:
- Enter a topic in the text input box.
- Specify the desired content length (in words).
- Click the "Generate Content" button to generate and display the content.
- Ensure that your API key is correct and has the necessary permissions.
- Make sure you have a stable internet connection to interact with the Google Generative AI API.