File size: 664 Bytes
86f6634
b280ffb
 
86f6634
38aef23
86f6634
38aef23
 
86f6634
 
 
b280ffb
 
 
 
 
 
 
 
 
 
 
86f6634
b280ffb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import streamlit as st
import subprocess
import json

st.title('AutoGen MathChat')

api_key = st.text_input("Enter your API Key:",type="password")
math_problem = st.text_input("Enter your math problem:", "integrate x^2 from 0 to 5")

if st.button('Solve'):
    if api_key and math_problem:
        input_data = {
            "math_problem": math_problem,
            "api_key": api_key
        }

        result = subprocess.check_output(
            ["python", "query_solver.py"],
            input=json.dumps(input_data),
            text=True
        )
        st.write(result.strip())
    else:
        st.write("Please provide both API key and math problem.")