Pipeline Cleanup on Delete:
- Notebook deletion now cleans up LlamaCloud resources
- Deletes pipeline from LlamaCloud first
- Then deletes from database
- Prevents orphaned pipelines accumulating
- Saves storage costs and quota limits
- Shows progress: "Cleaning up LlamaCloud resources..."
- Graceful handling if pipeline already deleted
One-Time Cleanup Script:
- Created cleanup_llamacloud.py
- Deletes ALL pipelines from LlamaCloud account
- Safety prompt: Must type "DELETE ALL" to proceed
- Shows count of found vs deleted pipelines
- Lists all deleted pipeline IDs
- Use after deleting test notebooks
Usage:
python cleanup_llamacloud.py
Warning System:
- Clear warnings about what will be deleted
- Confirmation required
- Shows exactly what was cleaned up
- Error handling for safety
Benefits:
- Prevent orphaned resources in LlamaCloud
- Clean up quota limits
- Save costs
- Keep cloud account tidy
- Easy maintenance
Files Modified:
- pages/1_My_Notebooks.py (delete function)
- pipeline_manager.py (delete_pipeline, cleanup_all_orphaned_pipelines)
- cleanup_llamacloud.py (new script)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Gemini Integration:
- Added Google Gemini 2.0 Flash as alternative to OpenAI GPT-4
- Per-notebook model selection (choose when creating)
- Model type stored in notebooks.model_type column
- Complete support for chat, synthesis, and podcasts
LLM Factory:
- Created llm_factory.py module
- get_llm_by_type('openai' | 'gemini')
- get_structured_llm() for pydantic outputs
- Model display names and emojis
- Cost information
Model Selection UI:
- Dropdown in notebook creation form
- Options: OpenAI GPT-4 or Gemini 2.0 Flash
- Shows cost comparison
- Model badge in notebook detail header
- Displays: "🤖 Using OpenAI GPT-4" or "✨ Using Gemini 2.0 Flash"
Integration Points:
- pipeline_manager.py: Query engine uses selected model
- notebook_synthesis.py: Synthesis uses selected model
- background_tasks.py: Podcasts use selected model
- pages/3_Notebook_Chat.py: Chat uses selected model
- All functions pass model_type parameter
Cost Savings:
- Gemini 2.0 Flash: FREE tier available
- OpenAI GPT-4: ~$0.03/1K tokens
- Users can choose based on budget/quality needs
Dependencies Added:
- llama-index-llms-gemini>=0.3.0
- google-generativeai>=0.8.0
Note: Requires GOOGLE_API_KEY in .env (optional)
- If not set, Gemini notebooks will error
- OpenAI notebooks continue to work
Database:
- Added model_type VARCHAR(50) DEFAULT 'openai'
- Indexed for performance
- Existing notebooks default to 'openai'
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Chat System Complete:
- Fixed function name conflict (chat → query_chat)
- Private chats show "🤝 Share" button (action to take)
- Shared chats show "🔒 Make Private" button (action to take)
- Button text now shows the ACTION not the current state
- New Chat button works perfectly
- Chat sessions listed in sidebar
- Multiple chats per notebook per user
- Rename chat functionality
- Delete chat functionality
- Share/unshare toggle
- Privacy by default
Features Working:
✅ Create new chat (fresh context)
✅ Switch between chat sessions
✅ Rename any chat
✅ Share chat with collaborators
✅ Unshare (make private again)
✅ Delete chat sessions
✅ View shared chats from others
✅ Chat history persistence
✅ Private by default
✅ Per-notebook pipeline isolation
Bug Fixes:
- Renamed chat() function to avoid shadowing by loop variable
- Fixed shared chat actions menu (⋮ now visible)
- Added extensive debug logging
- Better error handling in pipeline queries
- Fixed button text logic (show action, not state)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>