Skip to content

Latest commit

 

History

History
103 lines (78 loc) · 1.84 KB

File metadata and controls

103 lines (78 loc) · 1.84 KB

ACP - Google Apps Script Deployment

One-Click Deploy

Method 1: Copy & Paste (Easiest)

  1. Open Google Apps Script

  2. Copy Code

    • Delete everything in the editor
    • Copy entire contents of Code.gs
    • Paste into editor
    • Save (Ctrl+S)
  3. Set API Key

    • Click ⚙️ "Project Settings"
    • Scroll to "Script Properties"
    • Click "Add script property"
    • Name: OPENROUTER_API_KEY
    • Value: Your OpenRouter key from openrouter.ai/keys
  4. Deploy

    • Click "Deploy" → "New deployment"
    • Type: "Web app"
    • Execute as: "Me"
    • Who has access: "Anyone"
    • Click "Deploy"
    • Copy your URL!

Method 2: clasp CLI (For Developers)

# Install clasp
npm install -g @google/clasp

# Login
clasp login

# Create project
clasp create --type webapp --title "ACP Consensus"

# Push code
clasp push

# Deploy
clasp deploy

Usage

Test Endpoint

curl "YOUR_WEBAPP_URL"

Response:

{
  "service": "ACP Consensus API",
  "version": "1.0.0",
  "status": "healthy"
}

Run Consensus

curl -X POST "YOUR_WEBAPP_URL" \
  -H "Content-Type: application/json" \
  -d '{"query": "What is the speed of light?"}'

Response:

{
  "query": "What is the speed of light?",
  "consensus_reached": true,
  "final_D": 0.08,
  "final_answer": "299,792,458 meters per second",
  "confidence": 0.92,
  "votes": 3
}

Limits

  • 6 min execution timeout
  • 20k URL fetch calls/day
  • Free tier sufficient for testing

Troubleshooting

"OPENROUTER_API_KEY not configured" → Add key in Project Settings → Script Properties

"Exceeded maximum execution time" → Reduce MAX_ITERATIONS in CONFIG

"UrlFetchApp returned 429" → Rate limited, wait a minute