Spaces:
Build error
Build error
A newer version of the Streamlit SDK is available:
1.54.0
metadata
title: Math Problem Solver
emoji: ๐งฎ
colorFrom: blue
colorTo: indigo
sdk: streamlit
sdk_version: 1.32.2
app_file: app.py
pinned: false
๐งฎ Math Problem Solver
Overview
Math Problem Solver is an AI-powered Streamlit application that helps users solve mathematical problems with step-by-step explanations. The application uses Groq's AI models (including Google Gemma 2) to provide detailed solutions to a wide range of mathematical topics.
Getting Started
Prerequisites
- Python 3.8+
- Groq API key (get one at console.groq.com)
Installation
Clone this repository:
git clone https://github.com/yourusername/math-problem-solver.git cd math-problem-solverInstall dependencies:
pip install -r requirements.txtCreate a
.envfile in the project root and add your Groq API key:GROQ_API_KEY=your_api_key_hereRun the application:
streamlit run app.pyOpen your browser and navigate to
http://localhost:8501
Usage
- Enter your Groq API key in the sidebar (if not already set in
.env) - Select your preferred AI model
- Type your math problem in the text area or choose from the example problems
- Click "Solve Problem" to get a detailed solution
- Review the step-by-step explanation
Example Problems
- Solve for x: 2x + 5 = 15
- Find the area of a circle with radius 4 cm
- If a train travels at 60 mph and takes 3 hours to reach its destination, how far did it travel?
- Word problems involving multiple operations and conversions
Technical Details
This application uses:
- Streamlit: For the web interface
- LangChain: For agent orchestration and tool integration
- Groq API: For AI model inference
- Google Gemma 2: Primary AI model for solving math problems
- Wikipedia API: For foundational knowledge
- arXiv API: For academic mathematical concepts
- DuckDuckGo Search: For web search capabilities
The application uses a zero-shot agent that strategically chooses which tool to use based on the problem type.
Advanced Configuration
In the "Advanced Options" section of the sidebar, you can:
- Adjust the temperature (creativity) of the AI responses
- Toggle the visibility of AI reasoning steps
- Select different models for different types of problems
Development
Project Structure
math-problem-solver/
โโโ app.py # Main application file
โโโ .env # Environment variables (git-ignored)
โโโ requirements.txt # Dependencies
โโโ README.md # Project documentation
โโโ LICENSE # MIT License
โโโ screenshots/ # App screenshots
โ โโโ app_screenshot.png # Main app screenshot
โโโ .gitignore # Git ignore configuration