Spaces:
Sleeping
Sleeping
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,13 +1,39 @@
|
|
| 1 |
---
|
| 2 |
-
title: Data Analysis Agent
|
| 3 |
-
emoji:
|
| 4 |
colorFrom: blue
|
| 5 |
-
colorTo:
|
| 6 |
-
sdk:
|
| 7 |
-
sdk_version: 5.49.1
|
| 8 |
app_file: app.py
|
| 9 |
-
pinned: false
|
| 10 |
license: mit
|
| 11 |
---
|
| 12 |
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: Gemini Data Analysis Agent
|
| 3 |
+
emoji: π€π
|
| 4 |
colorFrom: blue
|
| 5 |
+
colorTo: indigo
|
| 6 |
+
sdk: streamlit
|
|
|
|
| 7 |
app_file: app.py
|
|
|
|
| 8 |
license: mit
|
| 9 |
---
|
| 10 |
|
| 11 |
+
# π€ Gemini Data Analysis Agent
|
| 12 |
+
|
| 13 |
+
This is a simple Streamlit application that uses the Google Gemini API and LangChain to create an AI agent.
|
| 14 |
+
|
| 15 |
+
You can upload any CSV file, and the agent will use a Gemini model to write and execute Python (Pandas) code to answer your questions about the data.
|
| 16 |
+
|
| 17 |
+
## π How to Use
|
| 18 |
+
|
| 19 |
+
1. **Upload a CSV file** using the file uploader.
|
| 20 |
+
2. The app will display the first few rows of your data.
|
| 21 |
+
3. **Ask a question** in the text box (e.g., "How many rows are there?" or "What is the average value in the 'sales' column?").
|
| 22 |
+
4. The agent will analyze the data and provide a plain-English answer.
|
| 23 |
+
|
| 24 |
+
## π οΈ Tech Stack
|
| 25 |
+
|
| 26 |
+
* **LLM (Brain):** Google Gemini (via `langchain-google-genai`)
|
| 27 |
+
* **Agent Framework:** LangChain (specifically `create_pandas_dataframe_agent`)
|
| 28 |
+
* **Frontend (UI):** Streamlit
|
| 29 |
+
* **Hosting:** Hugging Face Spaces
|
| 30 |
+
|
| 31 |
+
## π Setup
|
| 32 |
+
|
| 33 |
+
This app requires a Google Gemini API key to function.
|
| 34 |
+
|
| 35 |
+
1. Create a [Google AI Studio API key](https://aistudio.google.com/).
|
| 36 |
+
2. In your Hugging Face Space **Settings**, go to **Repository secrets**.
|
| 37 |
+
3. Add a new secret:
|
| 38 |
+
* **Name:** `GEMINI_API_KEY`
|
| 39 |
+
* **Value:** (Paste your API key)
|