Spaces:
Sleeping
Sleeping
| import streamlit as st | |
| import requests | |
| st.title("How AI Thinks: Step-by-Step Math Reasoning") | |
| # Input field | |
| math_problem = st.text_input("Enter a math problem:", "What is 25 + 47?") | |
| # Backend URL (Replace with your actual Replit URL) | |
| BACKEND_URL = "https://your-replit-name.repl.co/solve_math/" | |
| if st.button("Solve"): | |
| with st.spinner("Thinking..."): | |
| response = requests.post(BACKEND_URL, json={"problem": math_problem}) | |
| if response.status_code == 200: | |
| result = response.json() | |
| st.subheader("AI's Reasoning:") | |
| st.write(result) | |
| else: | |
| st.error("Error: Unable to fetch response.") | |