How chakradhar080/simple_chatbot works
This is a multi-provider AI chatbot: users chat through a Streamlit interface, which posts messages to a FastAPI endpoint; the endpoint dispatches requests to OpenAI, Gemini, or Groq wrappers and returns a response. The interface keeps chat messages in session state. The README also describes environment-based API keys and provider extensibility. The frontend currently selects OpenAI explicitly, while the backend supports all three providers. Connections are limited to relationships shown in the excerpts or documented in the README.
Main entry points: main.py Chat endpoint · .env API key configuration · streamlit_app.py Chat interface · bots.py OpenAI wrapper
Components 11
Chat interface
- Chat interface
frontend/streamlit_app.py - Session messages
frontend/streamlit_app.py
Chat API
- Chat endpoint
backend/main.py
AI providers
- OpenAI wrapper
backend/bots.py - Gemini wrapper
backend/bots.py - Groq wrapper
backend/bots.py
Other components
- User
- OpenAI API
- Gemini API
- Groq API
- API key configuration
.env
Connections 12
- User → Chat interface: sends prompt
README.md - Chat interface → Session messages: updates history
frontend/streamlit_app.py - Chat interface → Chat endpoint: posts message
frontend/streamlit_app.py - Chat endpoint → OpenAI wrapper: dispatches OpenAI
backend/main.py - Chat endpoint → Gemini wrapper: dispatches Gemini
backend/main.py - Chat endpoint → Groq wrapper: dispatches Groq
backend/main.py - OpenAI wrapper → OpenAI API: requests completion
backend/bots.py - Gemini wrapper → Gemini API: generates content
backend/bots.py - Groq wrapper → Groq API: requests completion
backend/bots.py - API key configuration → OpenAI wrapper: provides key
backend/bots.py - API key configuration → Gemini wrapper: provides key
backend/bots.py - API key configuration → Groq wrapper: provides key
backend/bots.py