Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
# app.py โ BizIntelย AIย Ultra (Geminiโฏ1.5ย Pro, date
|
2 |
|
3 |
import os
|
4 |
import tempfile
|
@@ -8,7 +8,7 @@ import google.generativeai as genai
|
|
8 |
|
9 |
from tools.csv_parser import parse_csv_tool
|
10 |
from tools.plot_generator import plot_sales_tool
|
11 |
-
from tools.forecaster import forecast_tool #
|
12 |
|
13 |
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
14 |
# 1. GEMINI CONFIG (1.5โPro, temperature 0.7)
|
@@ -19,7 +19,8 @@ gemini = genai.GenerativeModel(
|
|
19 |
generation_config={
|
20 |
"temperature": 0.7,
|
21 |
"top_p": 0.9,
|
22 |
-
|
|
|
23 |
},
|
24 |
)
|
25 |
|
@@ -56,7 +57,7 @@ with st.spinner("๐ Parsing CSVโฆ"):
|
|
56 |
summary_text = parse_csv_tool(csv_path)
|
57 |
|
58 |
with st.spinner("๐ Generating sales trend chartโฆ"):
|
59 |
-
_ = plot_sales_tool(csv_path) #
|
60 |
|
61 |
with st.spinner("๐ฎ Forecasting future metricsโฆ"):
|
62 |
forecast_text = forecast_tool(csv_path, date_col=date_col) # uses chosen column
|
|
|
1 |
+
# app.py โ BizIntelย AIย Ultra (Geminiโฏ1.5ย Pro, selectable date column)
|
2 |
|
3 |
import os
|
4 |
import tempfile
|
|
|
8 |
|
9 |
from tools.csv_parser import parse_csv_tool
|
10 |
from tools.plot_generator import plot_sales_tool
|
11 |
+
from tools.forecaster import forecast_tool # must accept date_col
|
12 |
|
13 |
# โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
14 |
# 1. GEMINI CONFIG (1.5โPro, temperature 0.7)
|
|
|
19 |
generation_config={
|
20 |
"temperature": 0.7,
|
21 |
"top_p": 0.9,
|
22 |
+
# Allowed types: text/plain, application/json, etc.
|
23 |
+
"response_mime_type": "text/plain",
|
24 |
},
|
25 |
)
|
26 |
|
|
|
57 |
summary_text = parse_csv_tool(csv_path)
|
58 |
|
59 |
with st.spinner("๐ Generating sales trend chartโฆ"):
|
60 |
+
_ = plot_sales_tool(csv_path) # generates sales_plot.png
|
61 |
|
62 |
with st.spinner("๐ฎ Forecasting future metricsโฆ"):
|
63 |
forecast_text = forecast_tool(csv_path, date_col=date_col) # uses chosen column
|