יצירת סוכנים מנוהלים

סוכנים מנוהלים ב-Gemini API מאפשרים להרחיב את סוכן Antigravity עם הוראות, מיומנויות ונתונים משלכם. אתם יכולים להתאים אישית את הסוכן בתוך השיחה בזמן האינטראקציה, או לשמור את ההגדרה כסוכן מנוהל שמופעל באמצעות מזהה.

התאמה אישית של סוכן Antigravity

הדרך הכי מהירה ליצור סוכן בהתאמה אישית היא להעביר את ההגדרה בשורה בזמן יצירת אינטראקציה חדשה, בלי שנדרש שלב הרשמה. יש שלוש דרכים להרחיב את יכולות הסוכן:

  • הוראות מערכת: העברת טקסט מוטבע באמצעות system_instruction להתנהגות הצורה.
  • כלים: שינוי ברירת המחדל של הכלים (הפעלת קוד, חיפוש, הקשר של כתובת URL), רישום של שרתי MCP מרוחקים או הגדרה של פונקציות בהתאמה אישית (הפעלת פונקציות).
  • קבצים ומיומנויות: העלאת קבצים כמו AGENTS.md ו-SKILL.md לסביבה.

דוגמה להעברת כל שלושת הפרמטרים בתוך התג:

Python

from google import genai

client = genai.Client()

interaction = client.interactions.create(
    agent="antigravity-preview-05-2026",
    input="Analyze the Q1 revenue data and create a slide deck.",
    system_instruction="You are a data analyst. Always include visualizations and export results as PDF.",        
    environment={
        "type": "remote",
        "sources": [
            {
                "type": "inline",
                "target": ".agents/AGENTS.md",
                "content": "Always use matplotlib for charts. Include a summary table in every report.",
            },
            {
                "type": "inline",
                "target": ".agents/skills/slide-maker/SKILL.md",
                "content": "---\nname: slide-maker\n---\n# Slide Maker\nCreate HTML slide decks from data analysis results.",
            },
        ],
    },
)

print(interaction.output_text)

JavaScript

import { GoogleGenAI } from "@google/genai";

const client = new GoogleGenAI({});

const interaction = await client.interactions.create({
    agent: "antigravity-preview-05-2026",
    input: "Analyze the Q1 revenue data and create a slide deck.",
    system_instruction: "You are a data analyst. Always include visualizations and export results as PDF.",        
    environment: {
        type: "remote",
        sources: [
            {
                type: "inline",
                target: ".agents/AGENTS.md",
                content: "Always use matplotlib for charts. Include a summary table in every report.",
            },
            {
                type: "inline",
                target: ".agents/skills/slide-maker/SKILL.md",
                content: "---\nname: slide-maker\n---\n# Slide Maker\nCreate HTML slide decks from data analysis results.",
            },
        ],
    },
}, { timeout: 300000 });

console.log(interaction.output_text);

REST

curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
-H "Content-Type: application/json" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-d '{
    "agent": "antigravity-preview-05-2026",
    "input": "Analyze the Q1 revenue data and create a slide deck.",
    "system_instruction": "You are a data analyst. Always include visualizations and export results as PDF.",
    "environment": {
        "type": "remote",
        "sources": [
            {
                "type": "inline",
                "target": ".agents/AGENTS.md",
                "content": "Always use matplotlib for charts. Include a summary table in every report."
            },
            {
                "type": "inline",
                "target": ".agents/skills/slide-maker/SKILL.md",
                "content": "---\nname: slide-maker\n---\n# Slide Maker\nCreate HTML slide decks from data analysis results."
            }
        ]
    }
}'

הכול מוגדר בזמן האינטראקציה. אין צורך לרשום משהו קודם. ה-Antigravity agent harness מספק את זמן הריצה (הרצת קוד, ניהול קבצים, גישה לאינטרנט) ואת שכבות ההגדרה שלכם מעל.

כלים והוראות למערכת

אתם יכולים להתאים אישית את ההתנהגות והיכולות של סוכן המכירות הווירטואלי לאינטראקציה ספציפית באמצעות הפרמטרים system_instruction ו-tools.

  • הוראות למערכת: משתמשים בפרמטר system_instruction כדי להעביר טקסט מוטבע שמשפיע על התנהגות הסוכן. האפשרות הזו מתאימה לשינויים קלים שרוצים לבצע בכל שיחה. system_instruction ו-AGENTS.md הם מאפיינים מצטברים, שניהם חלים אם הם קיימים.
  • כלים: כברירת מחדל, לסוכן Antigravity יש גישה אל code_execution,‏ google_search ו-url_context. אפשר לשנות את הרשימה הזו על ידי העברת הפרמטר tools בזמן האינטראקציה. אפשר גם לרשום שרתי MCP מרוחקים או להגדיר פונקציות בהתאמה אישית (קריאה לפונקציות) כדי לחבר את הסוכן לממשקי ה-API ולמסדי הנתונים שלכם. פרטים מלאים על הכלים הזמינים מופיעים במאמר Antigravity Agent: Supported tools.

התאמה אישית מבוססת-קובץ

מבנה ספריית הסוכנים

אפשר להעביר את ההגדרה בשורה, אבל מומלץ לארגן את הקבצים של הסוכן בספרייה מובנית. כך קל יותר לנהל את הקבצים, לשלוט בגרסאות שלהם ולצרף אותם לסביבת הסוכן.

ספריית פרויקט טיפוסית של סוכן נראית כך:

my-agent/
├── AGENTS.md        # Instructions on how the agent should operate
├── skills/          # Custom skills (subfolders and SKILL.md files)
│   └── slide-maker/
│       └── SKILL.md
└── workspace/       # Initial data files and knowledge

זמן הריצה של Antigravity סורק את .agents/ (ואת שורש הסביבה) כדי למצוא את הקבצים האלה.

AGENTS.md

הסוכן טוען אוטומטית את .agents/AGENTS.md (או /.agents/AGENTS.md) מהסביבה כהוראות מערכת בזמן ההפעלה. מומלץ להשתמש ב-AGENTS.md להגדרות ארוכות של פרסונות, להנחיות מפורטות ולהוראות שרוצים לשמור בבקרה על גרסאות לצד הקוד.

הוספת AGENTS.md באמצעות מקור מוטבע:

Python

from google import genai

client = genai.Client()

interaction = client.interactions.create(
    agent="antigravity-preview-05-2026",
    input="Analyze the Q1 revenue data and create a report.",
    system_instruction="You are a data analyst. Always include visualizations and export results as PDF.",
    environment={
        "type": "remote",
        "sources": [
            {
                "type": "inline",
                "target": ".agents/AGENTS.md",
                "content": "Always use matplotlib for charts. Include a summary table in every report.",
            },
        ],
    },
)

print(interaction.output_text)

JavaScript

import { GoogleGenAI } from "@google/genai";

const client = new GoogleGenAI({});

const interaction = await client.interactions.create({
    agent: "antigravity-preview-05-2026",
    input: "Analyze the Q1 revenue data and create a report.",
    system_instruction: "You are a data analyst. Always include visualizations and export results as PDF.",
    environment: {
        type: "remote",
        sources: [
            {
                type: "inline",
                target: ".agents/AGENTS.md",
                content: "Always use matplotlib for charts. Include a summary table in every report.",
            },
        ],
    },
}, { timeout: 300000 });

console.log(interaction.output_text);

REST

curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
  -H "Content-Type: application/json" \
  -H "x-goog-api-key: $GEMINI_API_KEY" \
  -d '{
      "agent": "antigravity-preview-05-2026",
      "input": "Analyze the Q1 revenue data and create a report.",
      "system_instruction": "You are a data analyst. Always include visualizations and export results as PDF.",
      "environment": {
          "type": "remote",
          "sources": [
              {
                  "type": "inline",
                  "target": ".agents/AGENTS.md",
                  "content": "Always use matplotlib for charts. Include a summary table in every report."
              }
          ]
      }
  }'

מיומנויות: SKILL.md

מיומנויות הן קבצים שמרחיבים את היכולות של הסוכן. ממקמים אותם מתחת ל-.agents/skills/<skill-name>/SKILL.md והרכיב Harness מזהה אותם באופן אוטומטי ורושם אותם.

.agents/
├── AGENTS.md
└── skills/
    └── slide-maker/
        └── SKILL.md

הוספת מיומנות באמצעות מקור מוטבע:

Python

from google import genai

client = genai.Client()

interaction = client.interactions.create(
    agent="antigravity-preview-05-2026",
    input="Create a presentation about our Q1 results.",
    system_instruction="You create presentations from data.",
    environment={
        "type": "remote",
        "sources": [
            {
                "type": "inline",
                "target": ".agents/skills/slide-maker/SKILL.md",
                "content": "---\nname: slide-maker\ndescription: Create HTML slide decks\n---\n# Slide Maker\n\nWhen asked to create a presentation:\n1. Analyze the input data\n2. Create an HTML slide deck with reveal.js\n3. Save to /workspace/output/slides.html",
            },
        ],
    },
)

print(interaction.output_text)

JavaScript

import { GoogleGenAI } from "@google/genai";

const client = new GoogleGenAI({});

const interaction = await client.interactions.create({
    agent: "antigravity-preview-05-2026",
    input: "Create a presentation about our Q1 results.",
    system_instruction: "You create presentations from data.",
    environment: {
        type: "remote",
        sources: [
            {
                type: "inline",
                target: ".agents/skills/slide-maker/SKILL.md",
                content: "---\nname: slide-maker\ndescription: Create HTML slide decks\n---\n# Slide Maker\n\nWhen asked to create a presentation:\n1. Analyze the input data\n2. Create an HTML slide deck with reveal.js\n3. Save to /workspace/output/slides.html",
            },
        ],
    },
}, { timeout: 300000 });

console.log(interaction.output_text);

REST

curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
  -H "Content-Type: application/json" \
  -H "x-goog-api-key: $GEMINI_API_KEY" \
  -d '{
      "agent": "antigravity-preview-05-2026",
      "input": "Create a presentation about our Q1 results.",
      "system_instruction": "You create presentations from data.",
      "environment": {
          "type": "remote",
          "sources": [
              {
                  "type": "inline",
                  "target": ".agents/skills/slide-maker/SKILL.md",
                  "content": "---\nname: slide-maker\ndescription: Create HTML slide decks\n---\n# Slide Maker\n\nWhen asked to create a presentation:\n1. Analyze the input data\n2. Create an HTML slide deck with reveal.js\n3. Save to /workspace/output/slides.html"
              }
          ]
      }
  }'

הכישורים שנטענו מ-.agents/skills/ ומ-/.agents/skills/ מזוהים באופן אוטומטי.

יצירת סוכן מנוהל

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

ממקורות

מציינים את base_agent, ‏ id, ‏ system_instruction ו-base_environment עם מקורות. בכל הפעלה, הפלטפורמה מספקת ארגז חול חדש עם הקבצים שלכם. במאמר סביבות מפורטים סוגי המקורות שזמינים (Git, ‏ GCS, ‏ inline).

Python

from google import genai

client = genai.Client()

agent = client.agents.create(
    id="data-analyst",
    base_agent="antigravity-preview-05-2026",
    system_instruction="You are a data analyst. Always include visualizations and export results as PDF.",
    base_environment={
        "type": "remote",
        "sources": [
            {
                "type": "inline",
                "target": ".agents/AGENTS.md",
                "content": "Always use matplotlib for charts. Include a summary table in every report.",
            },
            {
                "type": "inline",
                "target": ".agents/skills/slide-maker/SKILL.md",
                "content": "---\nname: slide-maker\n---\n# Slide Maker\nCreate HTML slide decks from data analysis results.",
            },
            {
                "type": "repository",
                "source": "https://github.com/my-org/analysis-templates",
                "target": "/workspace/templates",
            },
        ],
    },
)

print(f"Created agent: {agent.id}")

JavaScript

import { GoogleGenAI } from "@google/genai";

const client = new GoogleGenAI({});

const agent = await client.agents.create({
    id: "data-analyst",
    base_agent: "antigravity-preview-05-2026",
    system_instruction: "You are a data analyst. Always include visualizations and export results as PDF.",
    base_environment: {
        type: "remote",
        sources: [
            {
                type: "inline",
                target: ".agents/AGENTS.md",
                content: "Always use matplotlib for charts. Include a summary table in every report.",
            },
            {
                type: "inline",
                target: ".agents/skills/slide-maker/SKILL.md",
                content: "---\nname: slide-maker\n---\n# Slide Maker\nCreate HTML slide decks from data analysis results.",
            },
            {
                type: "repository",
                source: "https://github.com/my-org/analysis-templates",
                target: "/workspace/templates",
            },
        ],
    },
});

console.log(`Created agent: ${agent.id}`);

REST

curl -X POST "https://generativelanguage.googleapis.com/v1beta/agents" \
-H "Content-Type: application/json" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-d '{
    "id": "data-analyst",
    "base_agent": "antigravity-preview-05-2026",
    "system_instruction": "You are a data analyst. Always include visualizations and export results as PDF.",
    "base_environment": {
        "type": "remote",
        "sources": [
            {
                "type": "inline",
                "target": ".agents/AGENTS.md",
                "content": "Always use matplotlib for charts. Include a summary table in every report."
            },
            {
                "type": "inline",
                "target": ".agents/skills/slide-maker/SKILL.md",
                "content": "---\nname: slide-maker\n---\n# Slide Maker\nCreate HTML slide decks from data analysis results."
            },
            {
                "type": "repository",
                "source": "https://github.com/my-org/analysis-templates",
                "target": "/workspace/templates"
            }
        ]
    }
}'

מסביבה קיימת (fork)

מבצעים איטרציה עם סוכן הבסיס של Antigravity עד שהסביבה מתאימה (החבילות מותקנות, הקבצים במקום), ואז יוצרים ממנו עותק (fork) לסוכן מנוהל.

Python

from google import genai

client = genai.Client()

# Step 1: set up the environment interactively
interaction = client.interactions.create(
    agent="antigravity-preview-05-2026",
    input="Install pandas, matplotlib, and seaborn. Create an analysis template at /workspace/template.py.",
    environment="remote",
)

# Step 2: fork that environment into a managed agent

agent = client.agents.create(
    id="my-data-analyst",
    base_agent="antigravity-preview-05-2026",
    system_instruction="You are a data analyst. Use the template at /workspace/template.py for all reports.",
    base_environment=interaction.environment_id,
)

print(f"Forked agent successfully: {agent.id}")

JavaScript

import { GoogleGenAI } from "@google/genai";

const client = new GoogleGenAI({});

const interaction = await client.interactions.create({
    agent: "antigravity-preview-05-2026",
    input: "Install pandas, matplotlib, and seaborn. Create an analysis template at /workspace/template.py.",
    environment: "remote",
}, { timeout: 300000 });

const agent = await client.agents.create({
    id: "my-data-analyst",
    base_agent: "antigravity-preview-05-2026",
    system_instruction: "You are a data analyst. Use the template at /workspace/template.py for all reports.",
    base_environment: interaction.environment_id,
});

console.log(`Forked agent successfully: ${agent.id}`);

REST

curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
  -H "Content-Type: application/json" \
  -H "x-goog-api-key: $GEMINI_API_KEY" \
  -d '{
      "agent": "antigravity-preview-05-2026",
      "input": "Install pandas, matplotlib, and seaborn. Create an analysis template at /workspace/template.py.",
      "environment": "remote"
  }'

עם כללי רשת

כששומרים סוכן מנוהל, אפשר לנעול את הגישה היוצאת או להוסיף פרטי כניסה. למידע על הסכימה המלאה של רשימת ההיתרים, על תבניות של פרטי כניסה ועל תווים כלליים, אפשר לעיין במאמר סביבות: הגדרת רשת.

בדוגמה הבאה נוצר סוכן issue-resolver שיכול לגשת רק ל-GitHub ול-PyPI, עם פרטי כניסה שמוזרקים ל-GitHub:

Python

from google import genai

client = genai.Client()

agent = client.agents.create(
    id="issue-resolver",
    base_agent="antigravity-preview-05-2026",
    system_instruction="You resolve GitHub issues. Clone the repo, find the bug, write the fix, run the tests, and open a PR.",
    base_environment={
        "type": "remote",
        "sources": [
            {
                "type": "repository",
                "source": "https://github.com/my-org/backend",
                "target": "/workspace/repo",
            }
        ],
        "network": {
            "allowlist": [
                {
                    "domain": "api.github.com",
                    "transform": {
                        "Authorization": "Basic YOUR_BASE64_TOKEN"
                    },
                },
                {"domain": "pypi.org"},
            ]
        },
    },
)

print(f"Created issue-resolver agent successfully: {agent.id}")

JavaScript

import { GoogleGenAI } from "@google/genai";

const client = new GoogleGenAI({});

const agent = await client.agents.create({
    id: "issue-resolver",
    base_agent: "antigravity-preview-05-2026",
    system_instruction: "You resolve GitHub issues. Clone the repo, find the bug, write the fix, run the tests, and open a PR.",
    base_environment: {
        type: "remote",
        sources: [
            {
                type: "repository",
                source: "https://github.com/my-org/backend",
                target: "/workspace/repo",
            }
        ],
        network: {
            allowlist: [
                {
                    domain: "api.github.com",
                    transform: {
                        "Authorization": "Basic YOUR_BASE64_TOKEN"
                    },
                },
                { domain: "pypi.org" },
            ]
        }
    },
});

console.log(`Created issue-resolver agent successfully: ${agent.id}`);

REST

curl -X POST "https://generativelanguage.googleapis.com/v1beta/agents" \
  -H "Content-Type: application/json" \
  -H "x-goog-api-key: $GEMINI_API_KEY" \
  -d '{
      "id": "issue-resolver",
      "base_agent": "antigravity-preview-05-2026",
      "system_instruction": "You resolve GitHub issues. Clone the repo, find the bug, write the fix, run the tests, and open a PR.",
      "base_environment": {
          "type": "remote",
          "sources": [
              {
                  "type": "repository",
                  "source": "https://github.com/my-org/backend",
                  "target": "/workspace/repo"
              }
          ],
          "network": {
              "allowlist": [
                  {
                      "domain": "api.github.com",
                      "transform": {
                          "Authorization": "Basic YOUR_BASE64_TOKEN"
                      }
                  },
                  {"domain": "pypi.org"}
              ]
          }
      }
  }'

הפעלת הסוכן

כדי להתקשר לסוכן המנוהל באמצעות מזהה הסוכן, צריך ליצור אינטראקציה חדשה. כל הפעלה יוצרת עותק של סביבת הבסיס, כך שכל הרצה מתחילה בצורה נקייה.

Python

result = client.interactions.create(
    agent="data-analyst",
    input="Analyze Q1 revenue data from /workspace/templates/sample.csv and create a slide deck.",
    environment="remote",
)

print(result.output_text)

JavaScript

const result = await client.interactions.create({
    agent: "data-analyst",
    input: "Analyze Q1 revenue data from /workspace/templates/sample.csv and create a slide deck.",
    environment: "remote",
}, { timeout: 300000 });

console.log(result.output_text);

REST

curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
  -H "Content-Type: application/json" \
  -H "x-goog-api-key: $GEMINI_API_KEY" \
  -d '{
      "agent": "data-analyst",
      "input": "Analyze Q1 revenue data from /workspace/templates/sample.csv and create a slide deck.",
      "environment": "remote"
  }'

למידע על שיחות מרובות תורות וסטרימינג, אפשר לעיין במדריך למתחילים. אותם דפוסי previous_interaction_id ו-environment חלים על סוכנים מנוהלים.

נציגים מנוהלים תומכים גם בהפעלה ברקע וביטול. פרטים ודוגמאות קוד זמינים במאמר Antigravity Agent: Background execution.

שינוי ההגדרה בזמן ההפעלה

כשיוצרים אינטראקציה, אפשר לשנות את הגדרות הרשת שמוגדרות כברירת מחדל לסוכן system_instruction, tools ו-environment. כך תוכלו לשנות את ההתנהגות, היכולות או פרטי הכניסה של הסוכן להרצה ספציפית בלי לשנות את הגדרת הסוכן ששמורה.

ביטול ההוראות והכלים של המערכת

Python

result = client.interactions.create(
    agent="data-analyst",
    input="Analyze Q1 revenue data, but do not create a slide deck. Just output a summary table.",
    system_instruction="You are a data analyst. Focus ONLY on summary tables. Ignore default instructions about slides.",
    tools=[{"type": "code_execution"}], # Override to only use code execution
    environment="remote",
)
print(result.output_text)

JavaScript

const result = await client.interactions.create({
    agent: "data-analyst",
    input: "Analyze Q1 revenue data, but do not create a slide deck. Just output a summary table.",
    system_instruction: "You are a data analyst. Focus ONLY on summary tables. Ignore default instructions about slides.",
    tools: [{ type: "code_execution" }], // Override to only use code execution
    environment: "remote",
}, { timeout: 300000 });

console.log(result.output_text);

REST

curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
  -H "Content-Type: application/json" \
  -H "x-goog-api-key: $GEMINI_API_KEY" \
  -d '{
      "agent": "data-analyst",
      "input": "Analyze Q1 revenue data, but do not create a slide deck. Just output a summary table.",
      "system_instruction": "You are a data analyst. Focus ONLY on summary tables. Ignore default instructions about slides.",
      "tools": [{"type": "code_execution"}],
      "environment": "remote"
  }'

שינוי הגדרת הרשת (רענון פרטי הכניסה)

אם לסוכן המנוהל שלכם יש פרטי כניסה לרשת שמוטמעים ב-base_environment, אתם יכולים לבטל אותם בזמן ההפעלה כדי לרענן טוקנים שתוקפם פג או להחליף מפתחות API. מעבירים אובייקט environment עם הגדרה חדשה של network. הכללים החדשים של הרשת מחליפים באופן מלא את הכללים הקודמים לגבי האינטראקציה הזו. המקורות של סביבת הבסיס (קבצים, מאגרים) נשמרים.

Python

# Invoke the agent with a fresh token, overriding the base_environment credentials
result = client.interactions.create(
    agent="issue-resolver",
    input="Fix issue #42 and open a PR.",
    environment={
        "type": "remote",
        "network": {
            "allowlist": [
                {
                    "domain": "api.github.com",
                    "transform": {
                        "Authorization": "Bearer ghp_REFRESHED_TOKEN"
                    },
                },
                {"domain": "pypi.org"},
            ]
        },
    },
)

print(result.output_text)

JavaScript

// Invoke the agent with a fresh token, overriding the base_environment credentials
const result = await client.interactions.create({
    agent: "issue-resolver",
    input: "Fix issue #42 and open a PR.",
    environment: {
        type: "remote",
        network: {
            allowlist: [
                {
                    domain: "api.github.com",
                    transform: {
                        "Authorization": "Bearer ghp_REFRESHED_TOKEN"
                    },
                },
                { domain: "pypi.org" },
            ]
        },
    },
}, { timeout: 300000 });

console.log(result.output_text);

REST

curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
  -H "Content-Type: application/json" \
  -H "x-goog-api-key: $GEMINI_API_KEY" \
  -d '{
      "agent": "issue-resolver",
      "input": "Fix issue #42 and open a PR.",
      "environment": {
          "type": "remote",
          "network": {
              "allowlist": [
                  {
                      "domain": "api.github.com",
                      "transform": {
                          "Authorization": "Bearer ghp_REFRESHED_TOKEN"
                      }
                  },
                  {"domain": "pypi.org"}
              ]
          }
      }
  }'

ניהול הסוכנים

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

הצגת רשימה של סוכנים

Python

agents = client.agents.list()
for a in agents.agents:
    print(f"{a.id}: {a.description}")

JavaScript

const agents = await client.agents.list();
if (agents.agents) {
    for (const a of agents.agents) {
        console.log(`${a.id}: ${a.description}`);
    }
}

REST

curl -X GET "https://generativelanguage.googleapis.com/v1beta/agents" \
  -H "x-goog-api-key: $GEMINI_API_KEY"

קבלת נציג

Python

agent = client.agents.get(id="data-analyst")
print(agent)

JavaScript

const agent = await client.agents.get("data-analyst");
console.log(agent);

REST

curl -X GET "https://generativelanguage.googleapis.com/v1beta/agents/data-analyst" \
  -H "x-goog-api-key: $GEMINI_API_KEY"

מחיקת סוכן

המחיקה מסירה את ההגדרה. הסביבות הקיימות והאינטראקציות שנוצרו על ידי הסוכן לא יושפעו.

Python

client.agents.delete(id="data-analyst")

JavaScript

await client.agents.delete("data-analyst");

REST

curl -X DELETE "https://generativelanguage.googleapis.com/v1beta/agents/data-analyst" \
  -H "x-goog-api-key: $GEMINI_API_KEY"

הסבר על הגדרת הסוכן

שדה סוג נדרש תיאור
id מחרוזת כן מזהה סוכן ייחודי. משמש להפעלת הסוכן.
description מחרוזת לא תיאור של הסוכן שכתוב בצורה שקריאה לאנשים.
base_agent מחרוזת כן מזהה הסוכן הבסיסי (לדוגמה, antigravity-preview-05-2026).
system_instruction מחרוזת לא הנחיה למערכת שמגדירה את ההתנהגות והאישיות.
tools מערך לא כלים שהסוכן יכול להשתמש בהם. אם לא מציינים ערך, ברירת המחדל היא code_execution, ‏google_search ו-url_context. הכלים הנתמכים כוללים את code_execution,‏ google_search,‏ url_context,‏ mcp_server והגדרות מותאמות אישית של function.
base_environment מחרוזת או אובייקט לא "remote",‏ environment_id או אובייקט הגדרה עם sources ו-network. ראו סביבות.

תהליך עבודה של איטרציה

  1. אב טיפוס עם סוכן Antigravity בסיסי. העברת הוראות למערכת ומקורות סביבה מוטבעים. בדיקה אינטראקטיבית של הוראות, מיומנויות והגדרת הסביבה.
  2. מייצבים את הסביבה. מתקינים חבילות, מטמיעים מקורות ומוודאים שהכול פועל.
  3. שמירה כסוכן מנוהל על ידי יצירת סוכן חדש, ממקורות או על ידי פיצול הסביבה.
  4. מעדכנים את הגדרת הסוכן. לשנות את ההוראה למערכת, להחליף מיומנויות או להוסיף מקורות. ההפעלה הבאה תשתמש בהגדרה החדשה.

מגבלות

  • סטטוס התצוגה המקדימה: סוכנים מנוהלים נמצאים בתצוגה מקדימה. יכולים להיות שינויים בתכונות ובסכימות.
  • סוכן בסיסי: יש תמיכה רק ב-antigravity-preview-05-2026 בתור base_agent.
  • אין ניהול גרסאות: עדיין אין אפשרות לנהל גרסאות של סוכנים ולחזור לגרסה קודמת.
  • אין קינון של סוכני משנה: עדיין אין תמיכה בהעברת הרשאות לסוכני משנה.
  • אפשר להוסיף עד 1,000 סוכנים מנוהלים.

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