Spaces:
Runtime error
Runtime error
Multi-Language Chat Agent
A Flask-based chat agent that supports multiple programming languages with Python as the default. The agent maintains proper chat history, integrates with Groq LangChain API for LLM capabilities, and provides language-specific assistance to students learning to code.
Project Structure
chat_agent/
├── chat_agent/ # Main application package
│ ├── __init__.py
│ ├── api/ # REST API endpoints
│ ├── models/ # Data models
│ ├── services/ # Business logic services
│ ├── utils/ # Utility functions
│ └── websocket/ # WebSocket handlers
├── static/ # Static assets (CSS, JS)
│ ├── css/
│ └── js/
├── templates/ # HTML templates
├── tests/ # Test suite
│ ├── unit/ # Unit tests
│ └── integration/ # Integration tests
├── app.py # Application entry point
├── config.py # Configuration management
├── requirements.txt # Python dependencies
└── .env.example # Environment variables template
Setup Instructions
Clone and navigate to the project directory
Create a virtual environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activateInstall dependencies
pip install -r requirements.txtSet up environment variables
cp .env.example .env # Edit .env with your actual configuration valuesSet up databases
- Install and start PostgreSQL
- Install and start Redis
- Update database connection strings in .env
Run the application
python app.py
Environment Variables
Copy .env.example to .env and configure the following:
GROQ_API_KEY: Your Groq API key for LLM integrationDATABASE_URL: PostgreSQL connection stringREDIS_URL: Redis connection stringSECRET_KEY: Flask secret key for sessions
Features
- Multi-language programming support (Python, JavaScript, Java, C++, etc.)
- Real-time chat with WebSocket communication
- Persistent chat history with Redis caching
- Groq LangChain API integration
- Session management for concurrent users
- Language context switching mid-conversation
Development
This project follows the spec-driven development methodology. See the implementation tasks in .kiro/specs/multi-language-chat-agent/tasks.md for detailed development steps.
Testing
Run tests with:
pytest tests/
License
MIT License