AI_Agent_Project/
├── app.py # Main application file for Streamlit
├── requirements.txt # Dependencies for the project
├── config.py # Configuration for API keys and environment variables
├── .env # API keys and credentials (not uploaded to GitHub)
├── utils/ # Utility modules
│ ├── data_handler.py # Handles CSV and Google Sheets data
│ ├── search_api.py # Handles web search API integration
│ ├── llm_processing.py # Processes data with OpenAI GPT
│ └── utils.py # Additional helper functions
├── README.md # Project documentation
└── .gitignore # Files/folders to ignore (e.g., .env, __pycache__)
The README.md file is the most important part of your repository. It provides an overview of the project, setup instructions, usage details, and features.
Here’s a template for your README.md:
This project is a Streamlit-based AI application that allows users to:
- Upload a CSV file or connect to a Google Sheet.
- Use a custom prompt to search and retrieve information for each entity (e.g., companies).
- Process search results with OpenAI GPT (e.g., extract emails or other data).
- View and download structured results.
- Upload CSV files or connect to Google Sheets.
- Perform automated web searches for entities using a custom prompt.
- Extract information using OpenAI GPT-3.5/4.
- View and download the results in CSV format.
- Python 3.8 or above.
- API keys for:
- OpenAI: Sign up.
- SerpAPI (or another search API): Sign up.
- Google Sheets API: Guide to create credentials.
-
Clone the repository:
git clone https://github.com/your_username/AI_Agent_Project.git cd AI_Agent_Project -
Install dependencies:
pip install -r requirements.txt
-
Create a
.envfile in the project root and add your credentials:OPENAI_API_KEY=your_openai_api_key SEARCH_API_KEY=your_search_api_key GOOGLE_CREDENTIALS_FILE=path_to_your_google_service_account.json -
Run the app:
streamlit run app.py
- Open the app in your browser (e.g.,
http://localhost:8501). - Upload a CSV file with entities (e.g., company names).
- Enter a custom prompt (e.g., "Get me the email address of {entity}").
- Click "Run Search and Extraction."
- View the extracted data and download it as a CSV file.
| File/Folder | Description |
|---|---|
app.py |
Main application file for Streamlit. |
config.py |
Loads API keys and configuration from .env. |
requirements.txt |
Lists all Python dependencies required for the project. |
.env |
Stores sensitive API keys (ignored in .gitignore). |
utils/data_handler.py |
Functions to handle CSV uploads and Google Sheets integration. |
utils/search_api.py |
Handles integration with SerpAPI or another web search API. |
utils/llm_processing.py |
Uses OpenAI GPT to process search results and extract relevant information. |
utils/utils.py |
Contains helper functions for error handling or formatting. |
- Python Libraries:
streamlit: For building the dashboard interface.pandas: For handling CSV and structured data.openai: For interacting with OpenAI GPT.google-auth,google-auth-oauthlib,google-api-python-client: For Google Sheets integration.requests: For working with web APIs.python-dotenv: For managing environment variables.
- OpenAI for GPT-3.5/4.
- SerpAPI for search engine result extraction.
- Google Sheets API for data integration.
Ensure your sensitive files (like .env) and unnecessary files (e.g., __pycache__) are not pushed to GitHub.
Example .gitignore:
.env
__pycache__/
*.pyc
*.pyo
*.log
*.json
-
Initialize Git:
git init
-
Add Files and Commit:
git add . git commit -m "Initial commit for AI Agent Project"
-
Push to GitHub: Create a new repository on GitHub (e.g.,
AI_Agent_Project) and push the code:git remote add origin https://github.com/your_username/AI_Agent_Project.git git branch -M main git push -u origin main
- Confirm the repository is accessible on GitHub.
- Share the link to your repository for others to test or evaluate.
Let me know if you have further questions!!!!!!