Spaces:
Runtime error
Runtime error
| import gradio as gr | |
| import wolframalpha | |
| app = gr.App(title="Math Teacher", description="A simple math teacher that can help you solve math problems.") | |
| def solve_math_problem(math_problem): | |
| """Solve a math problem using Wolfram Alpha.""" | |
| app_id = "" # Your Wolfram Alpha App ID token here | |
| client = wolframalpha.Client(app_id) | |
| try: | |
| result = client.query(math_problem) | |
| return result.pods[0].text | |
| except Exception: | |
| return "Sorry, I couldn't solve your math problem." | |
| app.launch() | |