HF_Agents_Final_Project / utilities /random_question.py
Yago Bolivar
feat: add basic API utilities
58b2d80
raw
history blame contribute delete
389 Bytes
import requests
BASE_URL = "https://agents-course-unit4-scoring.hf.space"
def get_random_question():
response = requests.get(f"{BASE_URL}/random-question")
return response.json()
def get_all_questions():
response = requests.get(f"{BASE_URL}/questions")
return response.json()
# Fetch one random question to test quickly
question = get_random_question()
print(question)