Spaces:
Runtime error
Runtime error
| import streamlit as st | |
| import subprocess | |
| import json | |
| st.title('AutoGen MathChat') | |
| st.markdown('''To learn more join https://www.meetup.com/florence-aws-user-group-meetup/''') | |
| api_key = st.text_input("Enter your Openai API Key:",type="password") | |
| math_problem = st.text_area("Enter your math problem:", "integrate x^2 from 0 to 5", height=100) | |
| 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.") |