Content AI is a Large Language Model (LLM) application designed to provide users with contextual answers based on web content. By leveraging the Serper API, the application searches the web to gather relevant information, which is then processed and presented to users through an intuitive interface. The project comprises a Flask API as the backend service and a Streamlit-based frontend for user interaction.
You can clone and deploy this application with changes on any cloud service
- Web-Powered Responses: Utilizes the Serper API to fetch and scrape content from the internet.
- Flask Backend: A robust API that processes user queries and communicates with the LLM.
- Streamlit Frontend: A user-friendly interface for seamless interaction with the application.
compressd.1.mp4
-
User Input via Streamlit Interface:
- Users enter their queries in a simple and engaging Streamlit-based front end.
-
Query Handling by Flask Backend:
- The input query is sent to the Flask backend via an API call for processing.
-
Web Search and Content Retrieval:
- The backend uses the Serper API to search the internet and retrieve relevant articles based on the user's query.
-
Content Processing:
- The fetched content is processed to extract useful information, including headings and text snippets.
-
LLM Response Generation:
- The processed content, along with the user's query, is passed to the LLM to generate an informative response.
-
Response Display:
- The generated answer is returned to the Streamlit interface, where it is displayed to the user.
- Python 3.8 or above
git clone https://github.com/your-repo-url.git
cd project_nameUse either venv or conda to create an isolated environment for the project.
python -m venv env
source env/bin/activate # On Windows, use `env\Scripts\activate`conda create --name project_env python=3.8
conda activate project_envpip install -r requirements.txtCreate a .env file in the root directory and add your API keys to ensure they can be accessed by the application.
Navigate to the flask_app directory and start the Flask server:
cd flask_app
python app.pyIn a new terminal, run the Streamlit app:
cd streamlit_app
streamlit run app.pyOpen your web browser and navigate to http://localhost:8501 to interact with the application.
- flask_app/: Contains the backend Flask API and utility functions.
- streamlit_app/: Contains the Streamlit front-end code.
- .env: Stores API keys (ensure this file is excluded from version control).
- requirements.txt: Lists the project dependencies.
You are encouraged to:
- Implement functionality to fetch, process, and generate responses using the Serper API.
- Integrate the APIs effectively within the Flask backend.
- Ensure a smooth user experience in the Streamlit frontend.