MathAid.Live / app.py
NeuralJunkie's picture
Update app.py
2d420ee
raw
history blame contribute delete
578 Bytes
import gradio as gr
import wolframalpha
app = gr.App(title="Math Teacher", description="A simple math teacher that can help you solve math problems.")
@app.callback(
output="text",
inputs="text",
)
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()