Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -272,15 +272,15 @@ class ResearchWorkflow:
|
|
272 |
def validate_output(self, state: AgentState) -> Dict:
|
273 |
analysis = state["messages"][-1].content
|
274 |
validation_prompt = f"""Validate research analysis:
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
|
285 |
response = self.processor.process_query(validation_prompt)
|
286 |
return {
|
@@ -289,12 +289,12 @@ class ResearchWorkflow:
|
|
289 |
|
290 |
def refine_results(self, state: AgentState) -> Dict:
|
291 |
refinement_prompt = f"""Refine this analysis:
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
|
299 |
response = self.processor.process_query(refinement_prompt)
|
300 |
return {
|
@@ -410,11 +410,11 @@ class ResearchInterface:
|
|
410 |
st.success("✅ Analysis Completed Successfully")
|
411 |
except Exception as e:
|
412 |
st.error(f"""**Analysis Failed**
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
|
419 |
def _render_event(self, event: Dict):
|
420 |
if 'ingest' in event:
|
@@ -449,4 +449,4 @@ class ResearchInterface:
|
|
449 |
st.markdown(content)
|
450 |
|
451 |
if __name__ == "__main__":
|
452 |
-
ResearchInterface()
|
|
|
272 |
def validate_output(self, state: AgentState) -> Dict:
|
273 |
analysis = state["messages"][-1].content
|
274 |
validation_prompt = f"""Validate research analysis:
|
275 |
+
{analysis}
|
276 |
+
|
277 |
+
Check for:
|
278 |
+
1. Technical accuracy
|
279 |
+
2. Citation support
|
280 |
+
3. Logical consistency
|
281 |
+
4. Methodological soundness
|
282 |
+
|
283 |
+
Respond with 'VALID' or 'INVALID'"""
|
284 |
|
285 |
response = self.processor.process_query(validation_prompt)
|
286 |
return {
|
|
|
289 |
|
290 |
def refine_results(self, state: AgentState) -> Dict:
|
291 |
refinement_prompt = f"""Refine this analysis:
|
292 |
+
{state["messages"][-1].content}
|
293 |
+
|
294 |
+
Improve:
|
295 |
+
1. Technical precision
|
296 |
+
2. Empirical grounding
|
297 |
+
3. Theoretical coherence"""
|
298 |
|
299 |
response = self.processor.process_query(refinement_prompt)
|
300 |
return {
|
|
|
410 |
st.success("✅ Analysis Completed Successfully")
|
411 |
except Exception as e:
|
412 |
st.error(f"""**Analysis Failed**
|
413 |
+
{str(e)}
|
414 |
+
Potential issues:
|
415 |
+
- Complex query structure
|
416 |
+
- Document correlation failure
|
417 |
+
- Temporal processing constraints""")
|
418 |
|
419 |
def _render_event(self, event: Dict):
|
420 |
if 'ingest' in event:
|
|
|
449 |
st.markdown(content)
|
450 |
|
451 |
if __name__ == "__main__":
|
452 |
+
ResearchInterface()
|