import requests import json questions_url = "https://agents-course-unit4-scoring.hf.space/questions" print(f"Fetching questions from: {questions_url}") try: response = requests.get(questions_url, timeout=15) response.raise_for_status() questions_data = response.json() if not questions_data: print("Fetched questions list is empty.") else: print(f"Fetched {len(questions_data)} questions.") for sample in questions_data: print("="*20) print(f"Task ID: {sample['task_id']}") print(f"Origin GAIA File: {sample['file_name']}") print(f"Level: {sample['Level']}") print(f"Question: {sample['question']}") print("="*20) except requests.exceptions.RequestException as e: print(f"Error fetching questions: {e}") except requests.exceptions.JSONDecodeError as e: print(f"Error decoding JSON response from questions endpoint: {e}") print(f"Response text: {response.text[:500]}") except Exception as e: print(f"An unexpected error occurred fetching questions: {e}")