File size: 666 Bytes
8d32798
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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.")