Spaces:
Sleeping
Sleeping
Rajendra Prasad commited on
Commit ·
8430d1f
1
Parent(s): 5a3e65a
Add requirements.txt file
Browse files
.env
ADDED
|
File without changes
|
app.py
CHANGED
|
@@ -35,7 +35,7 @@ def analyze_csv_with_gemini(csv_file, analysis_request):
|
|
| 35 |
return None
|
| 36 |
|
| 37 |
genai.configure(api_key=api_key)
|
| 38 |
-
model = genai.GenerativeModel('gemini-
|
| 39 |
|
| 40 |
prompt_content = f"""
|
| 41 |
You are a data analysis expert. Analyze the following CSV data and provide insights based on the user's request.
|
|
@@ -97,22 +97,9 @@ st.sidebar.markdown(
|
|
| 97 |
|
| 98 |
**API Key Setup:**
|
| 99 |
|
| 100 |
-
To use this application, you need a Google Gemini API key. You can obtain one from [Google AI Studio](https://makersuite.google.com/app/apikey).
|
| 101 |
-
|
| 102 |
-
**You can set up the API key in two ways:**
|
| 103 |
-
|
| 104 |
-
* **Option 1: Streamlit Secrets (Recommended for security):**
|
| 105 |
-
- Go to your Streamlit app's settings (usually in the cloud platform where you deploy it).
|
| 106 |
-
- Add a secret named `GOOGLE_API_KEY` and paste your API key as its value.
|
| 107 |
-
|
| 108 |
-
* **Option 2: Environment Variable (Less secure for public apps):**
|
| 109 |
-
- Create a `.env` file in the same directory as your Python script.
|
| 110 |
-
- Add the line: `GOOGLE_API_KEY=YOUR_API_KEY_HERE` (replace `YOUR_API_KEY_HERE` with your actual key).
|
| 111 |
-
- Ensure you have `python-dotenv` installed (`pip install python-dotenv`).
|
| 112 |
-
|
| 113 |
**Important Notes:**
|
| 114 |
|
| 115 |
-
* This application uses the
|
| 116 |
* The performance depends on the complexity of your data and analysis request.
|
| 117 |
* For very large CSV files, consider sampling or preprocessing the data before analysis for faster results on CPU-only machines.
|
| 118 |
"""
|
|
|
|
| 35 |
return None
|
| 36 |
|
| 37 |
genai.configure(api_key=api_key)
|
| 38 |
+
model = genai.GenerativeModel('gemini-2.0-flash-thinking-exp-01-21')
|
| 39 |
|
| 40 |
prompt_content = f"""
|
| 41 |
You are a data analysis expert. Analyze the following CSV data and provide insights based on the user's request.
|
|
|
|
| 97 |
|
| 98 |
**API Key Setup:**
|
| 99 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 100 |
**Important Notes:**
|
| 101 |
|
| 102 |
+
* This application uses the gemini-2.0-flash-thinking-exp-01-21 model.
|
| 103 |
* The performance depends on the complexity of your data and analysis request.
|
| 104 |
* For very large CSV files, consider sampling or preprocessing the data before analysis for faster results on CPU-only machines.
|
| 105 |
"""
|