ashishja commited on
Commit
31ef6a9
·
verified ·
1 Parent(s): 889bc88

Update agent.py

Browse files
Files changed (1) hide show
  1. agent.py +8 -5
agent.py CHANGED
@@ -182,7 +182,7 @@ root_agent = LlmAgent(
182
  "invoke your tool 'responses_api' to retrieve the questions data. "
183
  "The questions data will be a list of dictionaries, each containing 'task_id', 'question', and 'file_name' fields. "
184
  "For each question in the data: "
185
- "1. If file_name is not empty, the file can be accessed at https://agents-course-unit4-scoring.hf.space/files/{task_id} "
186
  "2. Use appropriate sub-agents based on question type (code_agent for coding, search_agent for web search, etc.) "
187
  "3. Provide a concise, direct answer for each question "
188
  "4. Return a dictionary with keys 'task_id' and 'submitted_answer' for each answer "
@@ -217,11 +217,14 @@ root_agent = LlmAgent(
217
  # )
218
 
219
  session_service = InMemorySessionService()
220
- # Create the default session synchronously
 
221
  try:
222
- session = session_service.create_session(app_name=APP_NAME,
223
- user_id=USER_ID,
224
- session_id=SESSION_ID)
 
 
225
  print(f"✅ Default session created: {SESSION_ID}")
226
  except Exception as e:
227
  print(f"⚠️ Error creating default session: {e}")
 
182
  "invoke your tool 'responses_api' to retrieve the questions data. "
183
  "The questions data will be a list of dictionaries, each containing 'task_id', 'question', and 'file_name' fields. "
184
  "For each question in the data: "
185
+ "1. If file_name is not empty, the file can be accessed at https://agents-course-unit4-scoring.hf.space/files/[TASK_ID] "
186
  "2. Use appropriate sub-agents based on question type (code_agent for coding, search_agent for web search, etc.) "
187
  "3. Provide a concise, direct answer for each question "
188
  "4. Return a dictionary with keys 'task_id' and 'submitted_answer' for each answer "
 
217
  # )
218
 
219
  session_service = InMemorySessionService()
220
+
221
+ # Create the default session synchronously (create_session is not async)
222
  try:
223
+ session = session_service.create_session(
224
+ app_name=APP_NAME,
225
+ user_id=USER_ID,
226
+ session_id=SESSION_ID
227
+ )
228
  print(f"✅ Default session created: {SESSION_ID}")
229
  except Exception as e:
230
  print(f"⚠️ Error creating default session: {e}")