Spaces:
Runtime error
Runtime error
Sigrid De los Santos
commited on
Commit
·
4b24cc9
1
Parent(s):
48a2803
App is ready
Browse files- src/main.py +10 -0
src/main.py
CHANGED
|
@@ -147,6 +147,16 @@ def build_company_insights(company_data):
|
|
| 147 |
# === Pipeline ===
|
| 148 |
def run_pipeline(csv_path, tavily_api_key, progress_callback=None):
|
| 149 |
os.environ["TAVILY_API_KEY"] = tavily_api_key
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 150 |
all_articles, company_data = run_value_investing_analysis(csv_path, progress_callback)
|
| 151 |
|
| 152 |
html_paths = []
|
|
|
|
| 147 |
# === Pipeline ===
|
| 148 |
def run_pipeline(csv_path, tavily_api_key, progress_callback=None):
|
| 149 |
os.environ["TAVILY_API_KEY"] = tavily_api_key
|
| 150 |
+
|
| 151 |
+
# === Clean old reports (MD and HTML) ===
|
| 152 |
+
for file in os.listdir(DATA_DIR):
|
| 153 |
+
if file.endswith(".md"):
|
| 154 |
+
os.remove(os.path.join(DATA_DIR, file))
|
| 155 |
+
for file in os.listdir(HTML_DIR):
|
| 156 |
+
if file.endswith(".html"):
|
| 157 |
+
os.remove(os.path.join(HTML_DIR, file))
|
| 158 |
+
|
| 159 |
+
# === Run the new analysis ===
|
| 160 |
all_articles, company_data = run_value_investing_analysis(csv_path, progress_callback)
|
| 161 |
|
| 162 |
html_paths = []
|