הקצאת סוכנים באמצעות Terraform

אתם יכולים להשתמש ב-Terraform כדי להקצות ולנהל מכונות של Agent Runtime באופן הצהרתי. כשפורסים נציגים באמצעות Terraform, מנהלים את המשאב google_vertex_ai_reasoning_engine באמצעות ספק Terraform הרשמי ( Google Cloud ספק GA או ספק בטא).

ההוראות בדף הזה תואמות להטמעה לדוגמה של סוכן בקונטיינר, שמתוארת ב-Codelab בנושא פריסת סוכן בקונטיינר באמצעות Agent Runtime.

דרישות מוקדמות

לפני שמשתמשים ב-Terraform כדי לפרוס סוכן, צריך לוודא שהשלמתם את ההגדרה הבאה:

  1. מתקינים את Terraform (גרסה 1.5.0 ואילך) וקוראים את המאמר הרשמי של HashiCorp Terraform Registry בנושא המשאב google_vertex_ai_reasoning_engine (ספק GA וספק בטא).
  2. מגדירים את הסביבה של Google Cloud ומפעילים את Agent Platform API (aiplatform.googleapis.com),‏ Artifact Registry API (artifactregistry.googleapis.com) ו-Cloud Build API (cloudbuild.googleapis.com).
  3. מאמתים את הסביבה המקומית באמצעות פרטי הכניסה של Google Cloud :

    gcloud auth application-default login
  4. כדי להפריד בין קוד האפליקציה לבין ניהול התשתית, כדאי לארגן את סביבת העבודה של הנציג בספריות ייעודיות לאפליקציה ול-Terraform:

    weather-agent-byoc/
    ├── main.py                # Python ADK agent entrypoint
    ├── requirements.txt       # Python dependencies
    ├── Dockerfile             # Container build definition
    └── terraform/             # Terraform configuration directory
        ├── main.tf            # Agent Runtime resources and specifications
        ├── variables.tf       # Project, region, and container variables
        └── outputs.tf         # Resource name outputs
    
    • קובצי אפליקציה (main.py,‏ requirements.txt,‏ Dockerfile): מכילים את הלוגיקה של הנציג, מעטפת של מסגרת אינטרנט (כמו FastAPI או ADK App), יחסי תלות של Python והוראות ליצירת קונטיינר.

    • ספריית Terraform‏ (terraform/): מכילה את כל קובצי התצורה של Terraform שמשמשים להקצאת משאבים:

      • ‫variables.tf: מצהיר על משתני קלט כמו project_id,‏ location,‏ repository_name ו-image_tag.
      • ‫main.tf: הצהרה על הגדרות הספק, משתנים מקומיים, קישורי תפקידים ב-IAM ומפרטי המשאבים של google_vertex_ai_reasoning_engine.
      • ‫outputs.tf: מייצא את מאפייני המשאבים שהוקצו, כמו מזהה Agent Runtime ושם המשאב המלא, אחרי הפריסה.
  5. מקצים את התפקידים המתאימים ב-IAM בהתאם למי שמבצע את הפריסה:

    • מפתח אנושי או חשבון שירות של CI/CD שמריץ את terraform apply ופקודות build מקומיות.

    • סוכן שירות של AI Platform Reasoning Engine שמנוהל על ידי המערכת (service-PROJECT_NUMBER@gcp-sa-aiplatform-re.iam.gserviceaccount.com).

הכנה לפריסה

ב-Terraform אפשר לפרוס את Agent Runtime בדרכים הבאות:

  • פריסה מקובץ אימג' של קונטיינר שנוצר מראש: יוצרים מראש קובץ אימג' של קונטיינר, מעבירים אותו בדחיפה ל-Artifact Registry ({region}-docker.pkg.dev/...) ופורסים אותו באמצעות container_spec. כדאי להשתמש בשיטה הזו כשאתם צריכים שליטה מלאה על תהליך ה-build של הקונטיינר, קובצי אימג' בסיסיים בהתאמה אישית או זמן אחזור קצר יותר בפריסה.
  • ‫Deploy from source files or Dockerfile: פריסת הנציג ישירות מקובצי מקור מקומיים או מקובץ Docker. ‫Agent Runtime יוצר ומקצה את קובץ האימג' של הקונטיינר באופן אוטומטי, בלי צורך בניהול ידני של קובץ האימג'.
  • פריסה באמצעות מפרטים של חבילת Python פריסה באמצעות (package_spec) שהועלה ל-Cloud Storage. ‫Agent Runtime יוצר ומקצה את קובץ האימג' של הקונטיינר באופן אוטומטי, בלי צורך בניהול ידני של קובץ האימג'.

פריסה מקובץ אימג' של קונטיינר שנוצר מראש

אם אתם יוצרים מראש קובצי אימג' של קונטיינרים ודוחפים אותם ל-Artifact Registry (לדוגמה, כדי לכלול ספריות מערכת בהתאמה אישית, לבצע אופטימיזציה של ביצועי ההפעלה הראשונית או לאכוף אמצעי בקרה ארגוניים ליצירת קובצי אימג'), אתם יכולים לפרוס באמצעות container_spec. לפרטים על הדרישות לגבי קובצי אימג', קראו את המאמר פריסה מקובץ אימג' של קונטיינר.

קובצי אימג' של קונטיינרים חייבים להיות מאוחסנים ב-Artifact Registry‏ ({LOCATION}-docker.pkg.dev/{PROJECT_ID}/{REPOSITORY}/{IMAGE}:{TAG}), להאזין ליציאה 8080 (או ליציאה בהתאמה אישית שצוינה ב-container_spec) ולעמוד בדרישות של חוזה זמן הריצה.

  1. יוצרים את קובץ האימג' של הקונטיינר באופן מקומי ומעבירים אותו למאגר ב-Artifact Registry:

    # 1. Authenticate Docker with your Artifact Registry region
    gcloud auth configure-docker us-central1-docker.pkg.dev
    # 2. Build the container image from your application root directory
    cd weather-agent-byoc
    docker build -t us-central1-docker.pkg.dev/PROJECT_ID/agents-repo/weather-agent-image:latest .
    # 3. Push the container image to Artifact Registry
    docker push us-central1-docker.pkg.dev/PROJECT_ID/agents-repo/weather-agent-image:latest
  2. מגדירים את קובץ האימג' של הקונטיינר שנוצר מראש לפריסה של Terraform. ההגדרות הבאות מדגימות פריסה של קובץ אימג' של קונטיינר שנוצר מראש ומארח ב-Artifact Registry, על ידי יצירת הקבצים variables.tf,‏ main.tf ו-outputs.tf בספרייה terraform/:

    משתני קלט (terraform/variables.tf)

    variable "project_id" {
      type        = string
      description = "The Google Cloud Project ID"
    }
    
    variable "project_number" {
      type        = string
      description = "The Google Cloud Project Number"
    }
    
    variable "location" {
      type        = string
      default     = "us-central1"
      description = "The region to deploy Agent Runtime"
    }
    
    variable "repository_name" {
      type        = string
      default     = "agents-repo"
      description = "The Artifact Registry repository name"
    }
    
    variable "image_tag" {
      type        = string
      default     = "latest"
      description = "The tag of the container image to deploy"
    }
    

    מפרטי משאבים (terraform/main.tf)

    terraform {
      required_providers {
        google = {
          source  = "hashicorp/google"
          version = ">= 5.28.0"
        }
      }
    }
    
    provider "google" {
      project = var.project_id
      region  = var.location
    }
    
    locals {
      class_methods = [
        { "name" = "get_session", "api_mode" = "" },
        { "name" = "list_sessions", "api_mode" = "" },
        { "name" = "create_session", "api_mode" = "" },
        { "name" = "delete_session", "api_mode" = "" },
        { "name" = "async_get_session", "api_mode" = "async" },
        { "name" = "async_list_sessions", "api_mode" = "async" },
        { "name" = "async_create_session", "api_mode" = "async" },
        { "name" = "async_delete_session", "api_mode" = "async" },
        { "name" = "async_add_session_to_memory", "api_mode" = "async" },
        { "name" = "async_search_memory", "api_mode" = "async" },
        { "name" = "stream_query", "api_mode" = "stream" },
        { "name" = "async_stream_query", "api_mode" = "async_stream" },
        { "name" = "streaming_agent_run_with_events", "api_mode" = "async_stream" }
      ]
    }
    
    # Grant Artifact Registry Reader permission to the Agent Runtime Service Agent
    resource "google_project_iam_member" "re_service_agent_ar_reader" {
      project = var.project_id
      role    = "roles/artifactregistry.reader"
      member  = "serviceAccount:service-${var.project_number}@gcp-sa-aiplatform-re.iam.gserviceaccount.com"
    }
    
    # Define the Agent Runtime resource with BYOC container configuration
    resource "google_vertex_ai_reasoning_engine" "byoc_weather_agent" {
      display_name = "byoc_weather_agent_tf"
      description  = "BYOC weather agent deployed using Terraform"
      project      = var.project_id
      region       = var.location
    
      spec {
        agent_framework = "google-adk"
    
        container_spec {
          image_uri = "${var.location}-docker.pkg.dev/${var.project_id}/${var.repository_name}/weather-agent-image:${var.image_tag}"
        }
    
        class_methods = jsonencode(local.class_methods)
      }
    
      # Ensure service agent permission exists before provisioning to prevent IMAGE_PULL_BACKOFF
      depends_on = [google_project_iam_member.re_service_agent_ar_reader]
    }
    

    פלט של משאבים (terraform/outputs.tf)

    output "reasoning_engine_id" {
      value       = google_vertex_ai_reasoning_engine.byoc_weather_agent.id
      description = "The ID of the deployed Agent Runtime instance"
    }
    
    output "reasoning_engine_resource_name" {
      value       = google_vertex_ai_reasoning_engine.byoc_weather_agent.name
      description = "The resource name of the deployed Agent Runtime instance"
    }
    

פריסה מקובץ Docker או ממאגר קוד מקור

כשפורסים מקובץ Docker, מציינים את ארכיון המקור ב-source_code_spec ומגדירים בלוק image_spec {} ריק כדי להורות ל-Agent Runtime ליצור את קובץ האימג' של הקונטיינר באמצעות קובץ ה-Docker. הקונטיינר שנוצר מקובץ ה-Docker חייב לעמוד בחוזה זמן הריצה.

למידע נוסף על אופן הפריסה, ראו פריסה מקובץ Docker או פריסה מקובצי מקור.

  1. דוחסים את קוד האפליקציה (main.py), את מניפסט התלות של Python‏ (requirements.txt) ואת הוראות ה-build של הקונטיינר (Dockerfile) לקובץ ארכיון מסוג gzipped tar.

  2. מריצים את הפקודה הבאה מתיקיית השורש של האפליקציה (בדוגמה נעשה שימוש בתיקיית השורש weather-agent-byoc/ ובארכיון קובץ ה-tar‏ weather_agent_source.tar.gz):

    cd weather-agent-byoc
    tar -czvf terraform/weather_agent_source.tar.gz main.py requirements.txt Dockerfile
  3. יוצרים את הקבצים variables.tf,‏ main.tf ו-outputs.tf בספרייה terraform/:

    משתני קלט (terraform/variables.tf)
    variable "project_id" {
      type        = string
      description = "The Google Cloud Project ID"
    }
    
    variable "location" {
      type        = string
      default     = "us-central1"
      description = "The region to deploy Agent Runtime"
    }
    

    מפרטי משאבים (terraform/main.tf)

    terraform {
      required_providers {
        google = {
          source  = "hashicorp/google"
          version = ">= 5.28.0"
        }
      }
    }
    
    provider "google" {
      project = var.project_id
      region  = var.location
    }
    
    resource "google_vertex_ai_reasoning_engine" "dockerfile_agent" {
      display_name = "dockerfile_weather_agent_tf"
      description  = "BYOC weather agent deployed using Dockerfile"
      project      = var.project_id
      region       = var.location
    
      spec {
        agent_framework = "google-adk"
    
        source_code_spec {
          inline_source {
            source_archive = filebase64("weather_agent_source.tar.gz")
          }
    
          # Empty image_spec instructs the runtime to build using the Dockerfile
          image_spec {}
        }
    
        class_methods = jsonencode([
          { "name" = "get_session", "api_mode" = "" },
          { "name" = "list_sessions", "api_mode" = "" },
          { "name" = "create_session", "api_mode" = "" },
          { "name" = "delete_session", "api_mode" = "" },
          { "name" = "async_get_session", "api_mode" = "async" },
          { "name" = "async_list_sessions", "api_mode" = "async" },
          { "name" = "async_create_session", "api_mode" = "async" },
          { "name" = "async_delete_session", "api_mode" = "async" },
          { "name" = "async_add_session_to_memory", "api_mode" = "async" },
          { "name" = "async_search_memory", "api_mode" = "async" },
          { "name" = "stream_query", "api_mode" = "stream" },
          { "name" = "async_stream_query", "api_mode" = "async_stream" },
          { "name" = "streaming_agent_run_with_events", "api_mode" = "async_stream" }
        ])
      }
    }
    

    פלט של משאבים (terraform/outputs.tf)

    output "dockerfile_agent_id" {
      value       = google_vertex_ai_reasoning_engine.dockerfile_agent.id
      description = "Resource ID of the deployed Dockerfile agent"
    }
    

פריסה באמצעות מפרט חבילת Python

אם הנציג שלכם נוצר באמצעות אובייקטים של Python SDK או אפליקציות שעברו פיקלינג (כמו ADK,‏ LangChain או נציגי Python בהתאמה אישית), אתם יכולים להעביר את הנציג שעבר סריאליזציה (.pkl) ואת הגדרת התלות (requirements.txt) לקטגוריה של Cloud Storage ולהפנות אליהם באמצעות package_spec.

למידע נוסף על אופן הפריסה, ראו פריסה מאובייקט Python.

  1. מריצים את הסקריפט הבא ב-Python כדי להפוך את הנציג לסדרה ולהעביר את פריטי המידע שנוצרו בתהליך הפיתוח (Artifact) של הפריסה ל-Cloud Storage:

    import cloudpickle
    from google.adk.agents import Agent
    from google.cloud import storage
    from vertexai.agent_engines import AdkApp
    PROJECT_ID = "PROJECT_ID"
    BUCKET_NAME = "BUCKET_NAME"
    GCS_DIR = "agents/weather_agent"
    
    # 1. Define agent logic
    root_agent = Agent(
        model="gemini-3.1-flash-lite",
        name="weather_agent",
        description="Agent deployed using Terraform package_spec.",
    )
    local_app = AdkApp(agent=root_agent)
    
    # 2. Upload pickle to Cloud Storage
    storage_client = storage.Client(project=PROJECT_ID)
    bucket = storage_client.bucket(BUCKET_NAME)
    
    pkl_blob = bucket.blob(f"{GCS_DIR}/agent.pkl")
    with pkl_blob.open("wb") as f:
        cloudpickle.dump(local_app, f)
    
    # 3. Upload requirements.txt
    requirements_content = """google-cloud-aiplatform[agent_engines,adk]>=1.144
    cloudpickle==3.0.0
    """
    req_blob = bucket.blob(f"{GCS_DIR}/requirements.txt")
    req_blob.upload_from_string(requirements_content)
    
    print(f"Artifacts uploaded to gs://{BUCKET_NAME}/{GCS_DIR}/")
    
  2. יוצרים את הקבצים variables.tf,‏ main.tf ו-outputs.tf בספרייה terraform/, שמפנים למזהי ה-URI של Cloud Storage שהועברו:

    משתני קלט (terraform/variables.tf)
    variable "project_id" {
      type        = string
      description = "The Google Cloud Project ID"
    }
    
    variable "location" {
      type        = string
      default     = "us-central1"
      description = "The region to deploy Agent Runtime"
    }
    
    variable "bucket_name" {
      type        = string
      description = "Cloud Storage bucket name containing agent artifacts"
    }
    
    מפרטי משאבים (terraform/main.tf)
    terraform {
      required_providers {
        google = {
          source  = "hashicorp/google"
          version = ">= 5.28.0"
        }
      }
    }
    
    provider "google" {
      project = var.project_id
      region  = var.location
    }
    
    resource "google_vertex_ai_reasoning_engine" "package_agent" {
      display_name = "weather_agent_package_tf"
      description  = "Agent Runtime instance deployed using package_spec"
      project      = var.project_id
      region       = var.location
    
      spec {
        agent_framework = "google-adk"
        package_spec {
          python_version        = "3.11"
          pickle_object_gcs_uri = "gs://${var.bucket_name}/agents/weather_agent/agent.pkl"
          requirements_gcs_uri  = "gs://${var.bucket_name}/agents/weather_agent/requirements.txt"
        }
      }
    }
    
    פלט של משאבים (terraform/outputs.tf)
    output "package_agent_id" {
      value       = google_vertex_ai_reasoning_engine.package_agent.id
      description = "Resource ID of the deployed package agent"
    }
    

הגדרת משתני סביבה וסודות

לפני הפריסה, אתם יכולים לצרף לנציג חשבון שירות של סביבת זמן ריצה בהתאמה אישית ולהעביר משתני סביבה (env) או הפניות ל-Secret Manager‏ (secret_env).

בדוגמה הבאה מגדירים משתני סביבה (LOCATION,‏ MODEL,‏ MODEL_REGION) ומעבירים מפתח API באופן מאובטח מ-Secret Manager לחשבון השירות של זמן הריצה באמצעות הקובץ terraform/main.tf:

# 1. Dedicated Runtime Service Account
resource "google_service_account" "agent_runtime_sa" {
  account_id   = "agent-runtime-sa"
  display_name = "Agent Runtime Identity"
  project      = var.project_id
}

# 2. Secret Manager Secret for Agent Credentials
resource "google_secret_manager_secret" "api_key_secret" {
  secret_id = "agent-api-key"
  project   = var.project_id

  replication {
    auto {}
  }
}

resource "google_secret_manager_secret_version" "api_key_version" {
  secret      = google_secret_manager_secret.api_key_secret.id
  secret_data = var.api_key_value
}

# Grant Secret Accessor role to Runtime Service Account
resource "google_secret_manager_secret_iam_member" "secret_accessor" {
  secret_id = google_secret_manager_secret.api_key_secret.id
  role      = "roles/secretmanager.secretAccessor"
  member    = "serviceAccount:${google_service_account.agent_runtime_sa.email}"
}

# Grant Artifact Registry Reader permission to the Agent Runtime Service Agent
resource "google_project_iam_member" "re_service_agent_ar_reader" {
  project = var.project_id
  role    = "roles/artifactregistry.reader"
  member  = "serviceAccount:service-${var.project_number}@gcp-sa-aiplatform-re.iam.gserviceaccount.com"
}

# 3. Agent Runtime Resource with Environment Variables and Secret References
resource "google_vertex_ai_reasoning_engine" "advanced_weather_agent" {
  display_name = "byoc_weather_agent_advanced_tf"
  description  = "BYOC weather agent with custom service account and secrets"
  project      = var.project_id
  location     = var.location

  spec {
    agent_framework = "google-adk"
    service_account = google_service_account.agent_runtime_sa.email

    container_spec {
      image_uri = "${var.location}-docker.pkg.dev/${var.project_id}/${var.repository_name}/weather-agent-image:${var.image_tag}"
    }

    deployment_spec {
      env {
        name  = "LOCATION"
        value = var.location
      }
      env {
        name  = "MODEL"
        value = "gemini-3.1-flash-lite"
      }
      env {
        name  = "MODEL_REGION"
        value = "global"
      }

      secret_env {
        name = "API_KEY"
        secret_ref {
          secret  = google_secret_manager_secret.api_key_secret.secret_id
          version = "latest"
        }
      }
    }

    class_methods = jsonencode([
      { "name" = "get_session", "api_mode" = "" },
      { "name" = "create_session", "api_mode" = "" },
      { "name" = "stream_query", "api_mode" = "stream" },
      { "name" = "async_stream_query", "api_mode" = "async_stream" }
    ])
  }

  depends_on = [
    google_secret_manager_secret_iam_member.secret_accessor,
    google_project_iam_member.re_service_agent_ar_reader
  ]
}

הגדרת Agent Gateway

כדי לנתב את התנועה בין Agent Runtime לבין ממשקי API או לקוחות חיצוניים דרך Agent Gateway, מגדירים את הבלוק agent_gateway_config בתוך deployment_spec באמצעות הספק google-beta.

במאמר ניתוב תנועה בזמן ריצה דרך Agent Gateway מופיעות דוגמאות מלאות לפריסה ופרטים על הפרמטרים של ניתוב מסוג Agent-to-Anywhere (תנועה יוצאת) ו-Client-to-Agent (תנועה נכנסת).

ניהול שער מרכזי לכמה פרויקטים

בארכיטקטורות של כמה פרויקטים בארגון, אתם יכולים לנהל פרויקט פיקוח מרכזי שמארח את Agent Gateway, את Agent Registry ואת Model Armor, ובמקביל לפרוס עומסי עבודה של סביבת זמן ריצה בתיקיות נפרדות של פרויקטים בארגון באמצעות Terraform:

  • Agent Gateway מרכזי וכללי מדיניות הרשאה: מקצים את google_network_services_agent_gateway,‏ google_network_services_authz_extension ו-google_network_security_authz_policy בפרויקט הניהול המרכזי. הגדרת Agent Gateway
  • גישה לסוכן שירות בפרויקטים שונים: נותנים את ההרשאה ar_agw_cross_project_sa (google_project_iam_custom_role) בפרויקט של שער ה-API המרכזי לסוכן השירות של זמן הריצה בכל פרויקט של עומס עבודה, באמצעות google_project_iam_member. איך מנתבים את התנועה של סביבת זמן הריצה דרך Agent Gateway
  • מרשם מרכזי ומדיניות תעבורת נתונים יוצאת: רושמים סוכנים וכלים בפרויקטים שונים במרשם של הפרויקט המרכזי באמצעות google_agent_registry_service, ומעניקים גישה ל-roles/iap.egressor עם משאבי google_iap_agent_registry_*. יצירת כללי מדיניות של סוכני IAM
  • תבניות והגדרות מינימום של הגנה מוגברת על המודל: אכיפה של ספי בטיחות בארגון או בתיקיות באמצעות google_model_armor_floorsetting ו-google_model_armor_template. הענקת הרשאה ל-Model Armor

כדי לפרוס מערכת סוכנים מקצה לקצה עם כמה דיירים בפרויקטים מבודדים עם ניהול מרכזי, עיינו בארכיטקטורת העזר של מערכת AI אקטיבי עם כמה דיירים ופרסו את המודול terraform-google-multi-tenant-agentic-ai מ-GitHub.

ביצוע ומחזור חיים

מפעילים את מחזור החיים הרגיל של Terraform כדי לתכנן, לפרוס, להפעיל ולהשמיד את משאבי הנציג.

החלת ההגדרות של Terraform

פורסים את הנציג באמצעות החלת ההגדרות של Terraform:

  1. עוברים לספריית Terraform (לדוגמה, cd weather-agent-byoc/terraform):

    cd weather-agent-byoc/terraform
  2. מאתחלים את ספריית העבודה:

    terraform init
  3. צפייה בתצוגה מקדימה של תוכנית הפריסה:

    terraform plan -var="project_id=PROJECT_ID" -var="project_number=PROJECT_NUMBER"
  4. מחילים את ההגדרות כדי להקצות את הסוכן:

    terraform apply -var="project_id=PROJECT_ID" -var="project_number=PROJECT_NUMBER"

שליחת שאילתה לסוכן הפעיל

אחרי ש-Terraform מקצה את המשאב google_vertex_ai_reasoning_engine, שולחים בקשת HTTP POST לנקודת הקצה (endpoint) :streamQuery?alt=sse כדי להעביר בסטרימינג אירועי תגובה בזמן אמת באמצעות אירועים שנשלחו מהשרת (SSE):

LOCATION="LOCATION"
PROJECT_ID="PROJECT_ID"
REASONING_ENGINE_ID="REASONING_ENGINE_ID"
curl -X POST \
  -H "Authorization: Bearer $(gcloud auth print-access-token)" \
  -H "Content-Type: application/json; charset=utf-8" \
  -d '{
    "class_method": "async_stream_query",
    "input": {
      "user_id": "terraform_test_user",
      "message": "What is the temperature in Seattle?"
    }
  }' \
  "https://${LOCATION}-aiplatform.googleapis.com/v1/projects/${PROJECT_ID}/locations/${LOCATION}/reasoningEngines/${REASONING_ENGINE_ID}:streamQuery?alt=sse"
  • אסימון גישה מסוג OAuth: הכלי Authorization: Bearer $(gcloud auth print-access-token) יוצר אסימון גישה מסוג OAuth 2.0 עם תוקף קצר באמצעות פרטי הכניסה המקומיים של Google Cloud .
  • מעטפת JSON input: גוף הבקשה דורש מטען ייעודי (payload) של JSON שמכיל אובייקט input. כשמפעילים שיטות מפורשות של מחלקות (כמו async_stream_query), צריך לכלול את הפרמטר "class_method" לצד "input".
  • מטען ייעודי (payload) של התשובה: התשובות נשלחות באופן רציף כחלקים של אירועים שנשלחים מהשרת (SSE) של data: { ... }.

השמדת משאבי הסוכן

כדי לנקות משאבים ולמנוע חיובים לא צפויים, עוברים לספרייה terraform/ (לדוגמה, cd weather-agent-byoc/terraform) ומריצים את הפקודה terraform destroy:

cd weather-agent-byoc/terraform
terraform destroy -var="project_id=PROJECT_ID" -var="project_number=PROJECT_NUMBER"

המאמרים הבאים