Spaces:
Paused
Paused
| # ResearchCopilot Deployment Script | |
| # Gradio MCP Hackathon 2025 - Track 3 | |
| echo "π€ ResearchCopilot Deployment Script" | |
| echo "====================================" | |
| # Check if Modal is installed | |
| if ! command -v modal &> /dev/null; then | |
| echo "β Modal CLI not found. Installing..." | |
| pip install modal | |
| echo "β Modal installed" | |
| fi | |
| # Check if user is authenticated with Modal | |
| if ! modal token list &> /dev/null; then | |
| echo "π Setting up Modal authentication..." | |
| modal setup | |
| fi | |
| # Create Modal secrets if they don't exist | |
| echo "π§ Setting up Modal secrets..." | |
| # Check if secrets exist | |
| if modal secret list | grep -q "research-copilot-secrets"; then | |
| echo "β Secrets already exist" | |
| else | |
| echo "π Creating new secrets..." | |
| echo "Please enter your API keys (press Enter to skip):" | |
| read -p "Perplexity API Key: " PERPLEXITY_KEY | |
| read -p "Google API Key: " GOOGLE_KEY | |
| read -p "Google Search Engine ID: " GOOGLE_ENGINE_ID | |
| read -p "Anthropic API Key: " ANTHROPIC_KEY | |
| read -p "OpenAI API Key (optional): " OPENAI_KEY | |
| # Create the secret | |
| modal secret create research-copilot-secrets \ | |
| ${PERPLEXITY_KEY:+PERPLEXITY_API_KEY="$PERPLEXITY_KEY"} \ | |
| ${GOOGLE_KEY:+GOOGLE_API_KEY="$GOOGLE_KEY"} \ | |
| ${GOOGLE_ENGINE_ID:+GOOGLE_SEARCH_ENGINE_ID="$GOOGLE_ENGINE_ID"} \ | |
| ${ANTHROPIC_KEY:+ANTHROPIC_API_KEY="$ANTHROPIC_KEY"} \ | |
| ${OPENAI_KEY:+OPENAI_API_KEY="$OPENAI_KEY"} | |
| echo "β Secrets created successfully" | |
| fi | |
| # Deploy to Modal | |
| echo "π Deploying ResearchCopilot to Modal..." | |
| modal deploy modal_app.py | |
| if [ $? -eq 0 ]; then | |
| echo "β Deployment successful!" | |
| echo "" | |
| echo "π ResearchCopilot is now live!" | |
| echo "π± Your app will be available at the URL provided by Modal" | |
| echo "π Monitor your app: modal app list" | |
| echo "π View logs: modal app logs research-copilot" | |
| echo "" | |
| echo "π Ready for Hackathon submission!" | |
| echo "π Don't forget to:" | |
| echo " 1. Create your demo video" | |
| echo " 2. Update README with live demo URL" | |
| echo " 3. Submit to Agents-MCP-Hackathon organization" | |
| else | |
| echo "β Deployment failed. Check the logs above for details." | |
| exit 1 | |
| fi |