Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -141,14 +141,14 @@ if st.session_state.df is not None:
|
|
| 141 |
|
| 142 |
analyze_data = Task(
|
| 143 |
description="Analyze the extracted data for query: {query}.",
|
| 144 |
-
expected_output="Analysis
|
| 145 |
agent=data_analyst,
|
| 146 |
context=[extract_data],
|
| 147 |
)
|
| 148 |
|
| 149 |
write_report = Task(
|
| 150 |
-
description="Summarize the analysis into
|
| 151 |
-
expected_output="Markdown report
|
| 152 |
agent=report_writer,
|
| 153 |
context=[analyze_data],
|
| 154 |
)
|
|
@@ -168,13 +168,13 @@ if st.session_state.df is not None:
|
|
| 168 |
query = st.text_area("Enter Query:", value="Provide insights into the salary of a Principal Data Scientist.")
|
| 169 |
if st.button("Submit Query"):
|
| 170 |
with st.spinner("Processing query..."):
|
| 171 |
-
# Step 1: Generate
|
| 172 |
-
report_prompt = f"{query} Provide
|
| 173 |
inputs = {"query": report_prompt}
|
| 174 |
report_result = crew.kickoff(inputs=inputs)
|
| 175 |
|
| 176 |
# Step 2: Generate ONLY the Conclusion
|
| 177 |
-
conclusion_prompt = f"{query} Provide
|
| 178 |
conclusion_inputs = {"query": conclusion_prompt}
|
| 179 |
conclusion_result = crew.kickoff(inputs=conclusion_inputs)
|
| 180 |
|
|
@@ -198,7 +198,7 @@ if st.session_state.df is not None:
|
|
| 198 |
title="Salary Distribution by Employment Type")
|
| 199 |
visualizations.append(fig_employment)
|
| 200 |
|
| 201 |
-
# Step 4: Display report without
|
| 202 |
st.markdown(report_result)
|
| 203 |
|
| 204 |
# Step 5: Insert Visual Insights
|
|
|
|
| 141 |
|
| 142 |
analyze_data = Task(
|
| 143 |
description="Analyze the extracted data for query: {query}.",
|
| 144 |
+
expected_output="Provide only the Introduction, Key Insights, and Analysis sections. Do NOT include any conclusion, summary, or closing remarks.",
|
| 145 |
agent=data_analyst,
|
| 146 |
context=[extract_data],
|
| 147 |
)
|
| 148 |
|
| 149 |
write_report = Task(
|
| 150 |
+
description="Summarize the analysis into a structured report with Introduction, Key Insights, and Analysis. DO NOT include any conclusion or summary.",
|
| 151 |
+
expected_output="Markdown report excluding Conclusion and Summary.",
|
| 152 |
agent=report_writer,
|
| 153 |
context=[analyze_data],
|
| 154 |
)
|
|
|
|
| 168 |
query = st.text_area("Enter Query:", value="Provide insights into the salary of a Principal Data Scientist.")
|
| 169 |
if st.button("Submit Query"):
|
| 170 |
with st.spinner("Processing query..."):
|
| 171 |
+
# Step 1: Generate the structured report (without Conclusion)
|
| 172 |
+
report_prompt = f"{query} Provide only the Introduction, Key Insights, and Analysis sections. Do NOT include Conclusion or Summary."
|
| 173 |
inputs = {"query": report_prompt}
|
| 174 |
report_result = crew.kickoff(inputs=inputs)
|
| 175 |
|
| 176 |
# Step 2: Generate ONLY the Conclusion
|
| 177 |
+
conclusion_prompt = f"{query} Provide ONLY the Conclusion for this analysis."
|
| 178 |
conclusion_inputs = {"query": conclusion_prompt}
|
| 179 |
conclusion_result = crew.kickoff(inputs=conclusion_inputs)
|
| 180 |
|
|
|
|
| 198 |
title="Salary Distribution by Employment Type")
|
| 199 |
visualizations.append(fig_employment)
|
| 200 |
|
| 201 |
+
# Step 4: Display report (without Conclusion)
|
| 202 |
st.markdown(report_result)
|
| 203 |
|
| 204 |
# Step 5: Insert Visual Insights
|