Update src/main.py
Browse files- src/main.py +14 -17
src/main.py
CHANGED
|
@@ -143,21 +143,8 @@ class AICoScientist:
|
|
| 143 |
if "hypothesis" in h:
|
| 144 |
h["statement"] = h["hypothesis"]
|
| 145 |
|
| 146 |
-
#
|
| 147 |
-
valid_hypotheses = []
|
| 148 |
for h in hypotheses:
|
| 149 |
-
is_valid, issues = validate_hypothesis(h["statement"])
|
| 150 |
-
h["validation"] = {
|
| 151 |
-
"is_valid": is_valid,
|
| 152 |
-
"issues": issues
|
| 153 |
-
}
|
| 154 |
-
# Accept all, regardless of validation
|
| 155 |
-
valid_hypotheses.append(h)
|
| 156 |
-
if not is_valid:
|
| 157 |
-
self.logger.warning(f"Invalid area of interest: {h['statement']}\nIssues: {', '.join(issues)}")
|
| 158 |
-
|
| 159 |
-
# For each area of interest, generate multiple research questions (simple template for now)
|
| 160 |
-
for h in valid_hypotheses:
|
| 161 |
area = h["statement"]
|
| 162 |
# Simple transformation: create 2-3 research questions per area
|
| 163 |
h["research_questions"] = [
|
|
@@ -166,10 +153,10 @@ class AICoScientist:
|
|
| 166 |
f"What are the potential implications of {area} for future research or applications?"
|
| 167 |
]
|
| 168 |
|
| 169 |
-
self.hypotheses =
|
| 170 |
-
self.logger.info(f"Generated {len(
|
| 171 |
|
| 172 |
-
return
|
| 173 |
|
| 174 |
def rank_hypotheses(self) -> List[Dict[str, Any]]:
|
| 175 |
"""Rank the generated hypotheses by quality and relevance.
|
|
@@ -459,3 +446,13 @@ def main():
|
|
| 459 |
|
| 460 |
except Exception as e:
|
| 461 |
logger.error(f"Error in workflow execution: {str(e)}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 143 |
if "hypothesis" in h:
|
| 144 |
h["statement"] = h["hypothesis"]
|
| 145 |
|
| 146 |
+
# No validation or filtering: accept all generated areas of interest
|
|
|
|
| 147 |
for h in hypotheses:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 148 |
area = h["statement"]
|
| 149 |
# Simple transformation: create 2-3 research questions per area
|
| 150 |
h["research_questions"] = [
|
|
|
|
| 153 |
f"What are the potential implications of {area} for future research or applications?"
|
| 154 |
]
|
| 155 |
|
| 156 |
+
self.hypotheses = hypotheses
|
| 157 |
+
self.logger.info(f"Generated {len(hypotheses)} areas of interest")
|
| 158 |
|
| 159 |
+
return hypotheses
|
| 160 |
|
| 161 |
def rank_hypotheses(self) -> List[Dict[str, Any]]:
|
| 162 |
"""Rank the generated hypotheses by quality and relevance.
|
|
|
|
| 446 |
|
| 447 |
except Exception as e:
|
| 448 |
logger.error(f"Error in workflow execution: {str(e)}")
|
| 449 |
+
print(f"\nError: {str(e)}")
|
| 450 |
+
return 1
|
| 451 |
+
else:
|
| 452 |
+
parser.print_help()
|
| 453 |
+
|
| 454 |
+
return 0
|
| 455 |
+
|
| 456 |
+
|
| 457 |
+
if __name__ == "__main__":
|
| 458 |
+
main()
|