Spaces:
Sleeping
Sleeping
Separate Init_agent from run_GAIA...
Browse files- simuGAIA.py +13 -5
simuGAIA.py
CHANGED
@@ -83,6 +83,17 @@ SAMPLE_QUESTIONS_OUT = [
|
|
83 |
]
|
84 |
|
85 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
def save_test_file(task_id: str, content: str) -> str:
|
87 |
"""Save a test file to a temporary location."""
|
88 |
temp_dir = tempfile.gettempdir()
|
@@ -100,12 +111,9 @@ def run_GAIA_questions_simu():
|
|
100 |
Used only during development for test that simulate GAIA questions.
|
101 |
"""
|
102 |
# 1. Instantiate Agent
|
103 |
-
|
104 |
-
agent = QAgent()
|
105 |
-
except Exception as e:
|
106 |
-
print(f"Error instantiating agent for GAIA simulation: {e}")
|
107 |
-
return f"Error initializing agent for GAIA simulation: {e}", None
|
108 |
|
|
|
109 |
results = []
|
110 |
correct_count = 0
|
111 |
total_count = len(SAMPLE_QUESTIONS)
|
|
|
83 |
]
|
84 |
|
85 |
|
86 |
+
def init_agent(): -> QAgent:
|
87 |
+
"""Initialize the QAgent."""
|
88 |
+
print("Initializing QAgent...")
|
89 |
+
try:
|
90 |
+
agent = QAgent()
|
91 |
+
return agent
|
92 |
+
except Exception as e:
|
93 |
+
print(f"Error instantiating agent for GAIA simulation: {e}")
|
94 |
+
return None
|
95 |
+
|
96 |
+
|
97 |
def save_test_file(task_id: str, content: str) -> str:
|
98 |
"""Save a test file to a temporary location."""
|
99 |
temp_dir = tempfile.gettempdir()
|
|
|
111 |
Used only during development for test that simulate GAIA questions.
|
112 |
"""
|
113 |
# 1. Instantiate Agent
|
114 |
+
agent = init_agent()
|
|
|
|
|
|
|
|
|
115 |
|
116 |
+
|
117 |
results = []
|
118 |
correct_count = 0
|
119 |
total_count = len(SAMPLE_QUESTIONS)
|