Welcome to the Symphonic, an interactive platform designed to explore the beauty of words, poetry, and literature. With the power of AI, users can query a vast range of topics in their chosen language and receive expertly crafted responses in prose or poetry, with customizable tones.
The Symphonic offers users the ability to:
- Select from a variety of languages (Odia, Hindi, English).
- Choose between prose and poetry formats.
- Set the tone of the response (Neutral, Formal, Casual).
- Receive responses to user queries based on preloaded literary works or custom topics.
This project integrates LangChain for dynamic prompt generation and the Gemini API to generate rich literary responses.
- Customizable Response Style: Prose or poetry with tone control.
- Multi-language Support: Odia, Hindi, and English.
- Famous Works: Preloaded literary works for quick access.
- Interactive Interface: Built with Streamlit for a smooth user experience.
Follow these steps to set up the project on your local machine:
-
Clone the repository:
git clone https://github.com/CYBERBULL123/Symphonic.git cd Symphonic
-
Create a virtual environment (optional but recommended):
python -m venv venv
-
Activate the virtual environment:
- On Windows:
.\venv\Scripts\activate
- On macOS/Linux:
source venv/bin/activate
- On Windows:
-
Install dependencies:
pip install -r requirements.txt
To use the API keys securely and configure the environment, follow the steps below:
-
Create a
secrets.toml
file:-
After cloning the repository, navigate to the
.streamlit
folder. -
Copy the
secrets.toml.sample
file and rename it tosecrets.toml
.cp .streamlit/secrets.toml.sample .streamlit/secrets.toml
-
-
Edit the
secrets.toml
file:- Open the
secrets.toml
file in a text editor and replace the placeholders with your actual API keys and secrets.
Example
secrets.toml
file:# secrets.toml.sample # Sample API Key for Gemini (users should replace this with their actual API key) [api_keys] gemini = "your-gemini-api-key-here"
- Open the
-
Ensure that the
.gitignore
file is configured: The.gitignore
file should already include the following line to ignore thesecrets.toml
file from being committed to version control.# Ignore the secrets file .streamlit/secrets.toml
-
Load Secrets in Your App: The
secrets.toml
file will automatically be loaded by Streamlit. You can access these secrets in your app as shown
-
Running the app:
- After setting up your environment and secrets, run the app using the following command:
streamlit run app.py
- After setting up your environment and secrets, run the app using the following command:
-
Interacting with the app:
- Language Selection: Choose between Odia, Hindi, or English.
- Response Style: Select between Prose or Poetry.
- Tone: Set the tone of the response (Neutral, Formal, Casual).
- Query Input: Enter your query (e.g., a theme, topic, or famous work).
The app will generate a literary response based on your inputs, returning either prose or poetry with the selected tone.
We welcome contributions to this project! If you'd like to contribute, follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Make your changes and commit them.
- Push your changes to your forked repository.
- Open a pull request with a clear description of your changes.
This project is licensed under the MIT License - see the LICENSE file for details.
Here's the directory structure of the project:
Symphonic
│
├── app.py # Main Streamlit app
├── requirements.txt # Python dependencies
├── .gitignore # Git ignore configuration
├── .streamlit/
│ └── secrets.toml.sample # Sample secrets file
└── backend/
├── gemini_api.py # API integration for Gemini
├── langchain.py # LangChain prompt generation
└── __pycache__/ # Compiled Python files