-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·66 lines (60 loc) · 2.33 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·66 lines (60 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/usr/bin/env bash
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Setup for the skill-evolution lab:
# 1. Resolve the GCP project + region and write .env.
# 2. (Optional) register the V0 skill in the Skill Registry.
#
# Usage:
# ./setup.sh [PROJECT_ID] [REGION]
# WITH_REGISTRY=1 SKILL_ID=skill-lab-policy ./setup.sh # also create V0 skill
#
# Required IAM: roles/aiplatform.user (Gemini + Skill Registry). Authenticate
# with: gcloud auth application-default login
set -euo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")"
PROJECT_ID="${1:-${PROJECT_ID:-$(gcloud config get-value project 2>/dev/null)}}"
REGION="${2:-${REGION:-us-central1}}"
if [ -z "$PROJECT_ID" ] || [ "$PROJECT_ID" = "(unset)" ]; then
echo "ERROR: no project. Pass it: ./setup.sh my-project [region]" >&2
exit 1
fi
if ! gcloud auth application-default print-access-token >/dev/null 2>&1; then
echo "ERROR: no ADC. Run: gcloud auth application-default login" >&2
exit 1
fi
cat > .env <<EOF
PROJECT_ID="$PROJECT_ID"
GOOGLE_CLOUD_PROJECT="$PROJECT_ID"
REGION="$REGION"
GOOGLE_GENAI_USE_VERTEXAI=True
# Models (override before run_e2e_demo.sh if desired):
AGENT_MODEL="gemini-3.5-flash"
ANALYST_MODEL="gemini-3.1-pro-preview"
JUDGE_MODEL="gemini-2.5-flash"
JUDGE_LOCATION="$REGION"
EOF
echo "Wrote .env (project=$PROJECT_ID region=$REGION)."
# Ensure the working copy starts at the flawed V0.
cp skills/SKILL.v0.md skills/SKILL.md
echo "Reset working copy skills/SKILL.md to V0."
if [ "${WITH_REGISTRY:-0}" = "1" ]; then
: "${SKILL_ID:?set SKILL_ID with WITH_REGISTRY=1}"
echo "Creating V0 skill '$SKILL_ID' in the Skill Registry ($REGION)..."
GOOGLE_CLOUD_PROJECT="$PROJECT_ID" uv run python registry_cli.py create \
--skill-id "$SKILL_ID" --skill-dir skills --location "$REGION"
fi
echo ""
echo "Setup complete. Run the demo with: ./run_e2e_demo.sh"