Conversational AI assistant powered by the Groq API. Features streaming responses and conversation memory.
pip install groq colorama SpeechRecognition pyttsx3 pyaudio
Note:
pyaudioneeds a C compiler on Windows (or Microsoft C++ Build Tools) to build from source if no prebuilt wheel exists for your Python version. Voice input (/voice) requires it; everything else, including voice output (/speak), works without it.
Set your API key (get one free at console.groq.com):
setx GROQ_API_KEY your_key_here # Windows (permanent)
$env:GROQ_API_KEY = "your_key_here" # Windows (current session)
Run:
python ai_assistant.py
/clear new conversation
/save [name] save conversation to conversations/<name>.json
/load [name] load a saved conversation
/role [name] switch system role: assistant | coder | translator | poet
/voice record a message from your microphone and send it
/speak toggle text-to-speech for AI responses
/help show help
/exit quit
- Streaming responses (token by token)
- Conversation memory (last 10 messages)
- Save/load conversations as JSON
- Colored terminal output (colorama)
- Token count and cost estimate per message
- Voice input via microphone (speech_recognition, Slovak language model)
- Voice output / text-to-speech (pyttsx3)
Python 3 β’ Groq API β’ llama-3.3-70b-versatile