How harshar-ctrl/bot_workshop works
This is a small teaching chatbot with two user-facing workflows: terminal input and a Gradio browser chat. Both load a Groq API key and system prompt from .env, construct conversation context, and request replies from Groq through the OpenAI-compatible client. The terminal version keeps history in a list and prints complete replies; the web version uses Gradio history and streams incremental replies. The graph reflects the sampled scripts and README; no separate persistence layer is present.
Main entry points: chatbot_web.py Web context builder · chatbot.py Groq API client
Components 8
Terminal chat
- Terminal loop
chatbot.py - Conversation history
chatbot.py
Browser chat
- Chat interface
chatbot_web.py - Web context builder
chatbot_web.py
Model access
- Environment settings
chatbot.py - Groq API client
chatbot.py
Other components
- Chat user
- Groq service
Connections 12
- Chat user → Terminal loop: types messages
README.md - Terminal loop → Conversation history: calls ask_ai
chatbot.py - Conversation history → Groq API client: sends context
chatbot.py - Groq API client → Groq service: requests completion
chatbot.py - Groq service → Groq API client: returns reply
chatbot.py - Terminal loop → Chat user: prints reply
chatbot.py - Chat user → Chat interface: chats in browser
README.md - Chat interface → Web context builder: calls respond
chatbot_web.py - Web context builder → Groq service: streams completion
chatbot_web.py - Groq service → Web context builder: returns chunks
chatbot_web.py - Environment settings → Groq API client: supplies key
chatbot.py - Web context builder → Environment settings: uses prompt
chatbot_web.py