diff --git a/examples/launchmybakery/README.md b/examples/launchmybakery/README.md index 93cea11..5103356 100644 --- a/examples/launchmybakery/README.md +++ b/examples/launchmybakery/README.md @@ -113,13 +113,13 @@ python3 -m venv .venv source .venv/bin/activate # Install ADK -pip install google-adk +pip install google-adk==1.28.0 # Navigate to the app directory cd adk_agent/ # Run the ADK web interface -adk web +adk web --allow_origins 'regex:https://.*\.cloudshell\.dev' ``` ### 6. Chat with the Agent @@ -134,6 +134,8 @@ Open the link provided by `adk web` in your browser. You can now chat with the a * "Now I want a revenue projection for December 2025. Look at my sales history and take data from my best performing store for the 'Sourdough Loaf'. Run a forecast for December 2025 to estimate the quantity I'll sell. Then, calculate the projected total revenue using just under the premium price we found (let's use $18)" * "That'll cover my rent. Lastly, let's verify logistics. Find the closest "Restaurant Depot" to the proposed area and make sure that drive time is under 30 minutes for daily restocking." +To abort the ADK session in Cloud Shell, press `Ctrl+C`. + ### 7. Cleanup To avoid incurring ongoing costs for BigQuery storage or other Google Cloud resources, you can run the cleanup script. This script will delete the BigQuery dataset, the Cloud Storage bucket, and the API keys created during setup. Navigate back to the root directory of the repository and run the following command: diff --git a/examples/launchmybakery/cleanup/cleanup_env.sh b/examples/launchmybakery/cleanup/cleanup_env.sh index 1a39711..d2b480b 100644 --- a/examples/launchmybakery/cleanup/cleanup_env.sh +++ b/examples/launchmybakery/cleanup/cleanup_env.sh @@ -5,10 +5,18 @@ # ========================================== # 1. Configuration & Project Detection -PROJECT_ID=$(gcloud config get-value project 2>/dev/null) -DATASET_NAME="mcp_bakery" SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" ENV_FILE="$SCRIPT_DIR/../adk_agent/mcp_bakery_app/.env" +DATASET_NAME="mcp_bakery" + +# Attempt to load Project ID from local .env if available (supports multi-session/cloud shell) +if [ -f "$ENV_FILE" ]; then + PROJECT_ID=$(grep -E "^GOOGLE_CLOUD_PROJECT=" "$ENV_FILE" | cut -d'=' -f2) +fi + +if [ -z "$PROJECT_ID" ]; then + PROJECT_ID=$(gcloud config get-value project 2>/dev/null) +fi if [ -z "$PROJECT_ID" ]; then echo "Error: Could not determine Google Cloud Project ID." diff --git a/examples/launchmybakery/setup/setup_env.sh b/examples/launchmybakery/setup/setup_env.sh index 63eef01..b123624 100755 --- a/examples/launchmybakery/setup/setup_env.sh +++ b/examples/launchmybakery/setup/setup_env.sh @@ -16,12 +16,13 @@ echo "Enabling APIs.." gcloud services enable aiplatform.googleapis.com --project=$PROJECT_ID gcloud services enable apikeys.googleapis.com --project=$PROJECT_ID gcloud services enable mapstools.googleapis.com --project=$PROJECT_ID +gcloud services enable bigquery.googleapis.com --project=$PROJECT_ID ENABLED_SERVICES=$(gcloud beta services mcp list --enabled --format="value(name.basename())" --project=$PROJECT_ID) if [[ ! "$ENABLED_SERVICES" == *"mapstools.googleapis.com"* ]]; then - gcloud beta services mcp enable mapstools.googleapis.com --project=$PROJECT_ID + gcloud --quiet beta services mcp enable mapstools.googleapis.com --project=$PROJECT_ID fi if [[ ! "$ENABLED_SERVICES" == *"bigquery.googleapis.com"* ]]; then - gcloud beta services mcp enable bigquery.googleapis.com --project=$PROJECT_ID + gcloud --quiet beta services mcp enable bigquery.googleapis.com --project=$PROJECT_ID fi # Create API Key