A smart home assistant powered by Azure OpenAI and Semantic Kernel that can control lights through natural language commands.
- Natural language processing for smart home control
- Light control functionality (turn on/off lights in specific rooms)
- Conversational AI interface using Azure OpenAI
- Function calling capabilities with Semantic Kernel
- Python 3.8 or higher
- Azure OpenAI account and API key
- pip (Python package installer)
git clone https://github.com/BachEndDeveloper/python-ai-console.git
cd python-ai-consolepython -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activatepip install -r requirements.txtcp .env.example .envEdit the .env file with your Azure OpenAI credentials:
AZURE_OPENAI_API_KEY: Your Azure OpenAI API keyAZURE_OPENAI_ENDPOINT: Your Azure OpenAI endpoint URLAZURE_OPENAI_DEPLOYMENT_NAME: Your deployment name (e.g., "gpt-4")
python main.pyOnce the application is running, you can interact with it using natural language:
User > Turn on the lights in the living room
Assistant > The lights in the living room have been turned on.
User > Turn off the bedroom lights
Assistant > The lights in the bedroom have been turned off.
User > exit
python-ai-console/
├── main.py # Main application entry point
├── requirements.txt # Python dependencies
├── .env.example # Environment variables template
├── .gitignore # Git ignore rules
└── README.md # This file
This project uses:
blackfor code formattingflake8for lintingisortfor import sorting
Run formatting:
black main.py
isort main.py
flake8 main.pyRun tests using pytest:
pytestThe application can be configured through environment variables or by directly editing the configuration in main.py.
- Azure OpenAI Deployment: Change the
deployment_nameparameter - Logging Level: Modify the logging configuration in the
main()function - Plugin Functions: Add new functions to the
LightsPluginclass
- Authentication Error: Ensure your Azure OpenAI API key and endpoint are correct
- Module Not Found: Make sure you've activated your virtual environment and installed dependencies
- Connection Error: Check your internet connection and Azure service status
- Check the Semantic Kernel documentation
- Review Azure OpenAI service documentation
- Create an issue in this repository
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.