gemini-2.0-flash Fast responses, everyday coding tasks gemini-1.5-pro Complex reasoning, large context windows gemini-1.5-flash Balanced speed and capability.env file in the project root:.env file, or enter it directly in the sidebarstreamlit run app.pyinitialize_session_state() Sets up all session variables with defaults generate_response(prompt, api_key) Calls Gemini API with full conversation history format_response_with_mode(prompt) Prepends system instructions based on active modes save_conversation() Persists current chat with timestamp and metadata load_conversation(conv_id) Restores a saved conversation by ID export_conversation() Serializes current chat to a JSON string create_sidebar() Renders the full sidebar UI and returns the API key display_message(message) Renders a chat message with syntax-highlighted code blocksmessages List[Dict] Full chat history with role, content, id, timestamp current_model str Active Gemini model identifier conversation_title str Title of the current session saved_conversations Dict All persisted conversations keyed by ID user_preferences Dict Theme, response style, and auto-save settings code_gen_mode bool Code Generation mode toggle explain_mode bool Explanation mode toggle debug_mode bool Debug mode toggle response_style str "Concise" / "Balanced" / "Detailed"Invalid API key Verify the key at Google AI Studio and ensure it's active Package conflicts Use a fresh virtual environment Slow responses Switch to gemini-2.0-flash in the sidebar App crashes on start Ensure Python 3.8+ and all dependencies are installedPosted Mar 17, 2026
Streamlit AI coding companion powered by Google Gemini with code generation, debug, and explanation modes, persistent sessions, and multi-turn chat history.