ktakada/ai-coding-tutor
0
1import requests2 3# Replace this with your actual deployed Modal endpoint4BACKEND_URL = "https://kodyt--tinyllama-coding-tutor-flask-app.modal.run/api/ask"5 6# Example code + question payload7payload = {8 "code": """def factorial(n):9 if n == 0:10 return 111 return n * factorial(n - 1)""",12 "question": "What does this function do?"13}14 15# Send the POST request16response = requests.post(BACKEND_URL, json=payload)17 18# Handle response19if response.ok:20 print("✅ Response from model:")21 print(response.json()["answer"])22else:23 print("❌ Error:", response.status_code)24 print(response.text)25 