Zarządzane agenty w Gemini API umożliwiają rozszerzenie agenta Antigravity o własne instrukcje, umiejętności i dane. Możesz dostosować agenta w trakcie interakcji lub zapisać konfigurację jako zarządzanego agenta, którego wywołujesz za pomocą identyfikatora.
Dostosowywanie agenta Antigravity
Najszybszym sposobem na utworzenie niestandardowego agenta jest przekazanie konfiguracji w treści podczas tworzenia nowej interakcji bez konieczności rejestracji. Możesz rozszerzyć agenta na kilka sposobów:
- Wybór modelu: wybierz model Gemini, klikając
agent_config(domyślnie jest to Gemini 3.6 Flash). - Instrukcje systemowe: przekazuj tekst wbudowany za pomocą
system_instruction, aby kształtować zachowanie. - Narzędzia: zastąp domyślne narzędzia (wykonywanie kodu, wyszukiwanie, kontekst adresu URL), zarejestruj zdalne serwery MCP lub zdefiniuj funkcje niestandardowe (wywoływanie funkcji).
- Pliki i umiejętności: montuj w środowisku pliki takie jak
AGENTS.mdiSKILL.md.
Oto przykład przekazywania wszystkich 3 parametrów w formie wbudowanej:
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."
}
]
}
}'
Wszystko jest definiowane w momencie interakcji. Nie musisz niczego rejestrować. Uprząż agenta Antigravity zapewnia środowisko wykonawcze (wykonywanie kodu, zarządzanie plikami, dostęp do internetu), a Ty możesz na nim umieścić warstwy konfiguracji.
Narzędzia i instrukcje systemowe
Możesz dostosować zachowanie i możliwości agenta w przypadku konkretnej interakcji za pomocą parametrów system_instruction i tools.
- Instrukcje systemowe: użyj parametru
system_instruction, aby przekazać tekst wbudowany, który kształtuje zachowanie agenta. To idealne rozwiązanie do szybkich zmian, które chcesz wprowadzać w przypadku poszczególnych połączeń.system_instructioniAGENTS.mdsumują się. Oba obowiązują, gdy są obecne. - Narzędzia: domyślnie agent Antigravity ma dostęp do
code_execution,google_searchiurl_context. Możesz zastąpić tę listę, przekazując parametrtoolsw momencie interakcji. Możesz też zarejestrować zdalne serwery MCP lub zdefiniować funkcje niestandardowe (wywoływanie funkcji), aby połączyć agenta z własnymi interfejsami API i bazami danych. Szczegółowe informacje o dostępnych narzędziach znajdziesz w artykule Antigravity Agent: obsługiwane narzędzia.
Dostosowywanie na podstawie plików
Struktura katalogu agenta
Konfigurację można przekazywać w wierszu, ale zalecamy uporządkowanie plików agenta w strukturalnym katalogu. Ułatwia to zarządzanie, kontrolowanie wersji i montowanie w środowisku agenta.
Typowy katalog projektu agenta wygląda tak:
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
Środowisko wykonawcze Antigravity skanuje .agents/ (i katalog główny środowiska) w poszukiwaniu tych plików.
AGENTS.md
Agent automatycznie wczytuje .agents/AGENTS.md (lub /.agents/AGENTS.md) ze środowiska jako instrukcje systemowe podczas uruchamiania. Używaj znaku AGENTS.md w przypadku długich definicji person, szczegółowych wytycznych i instrukcji, które chcesz kontrolować pod kątem wersji razem z kodem.
Zamontuj AGENTS.md za pomocą źródła wbudowanego:
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."
}
]
}
}'
Umiejętności: SKILL.md
Umiejętności to pliki, które rozszerzają możliwości agenta. Umieść je pod .agents/skills/<skill-name>/SKILL.md, a szelki automatycznie je wykryją i zarejestrują.
.agents/
├── AGENTS.md
└── skills/
└── slide-maker/
└── SKILL.md
Zamontuj umiejętność za pomocą źródła wbudowanego:
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"
}
]
}
}'
Umiejętności załadowane z usług .agents/skills/ i /.agents/skills/ są wykrywane automatycznie.
Tworzenie zarządzanego agenta
Po wprowadzeniu zmian w konfiguracji możesz utworzyć z niej zarządzanego agenta za pomocą agents.create. Dzięki temu możesz wywoływać agenta za pomocą identyfikatora bez konieczności powtarzania konfiguracji za każdym razem.
Wartość id podana podczas tworzenia agenta zarządzanego musi być unikalna w Twoim projekcie i nie może zaczynać się od zarezerwowanych prefiksów (np. google-, gemini-). Pełną listę zastrzeżonych prefiksów znajdziesz w ograniczeniach dotyczących identyfikatora agenta.
Ze źródeł
Określ base_agent, id, agent_config, system_instruction i base_environment wraz ze źródłami. Przy każdym wywołaniu platforma udostępnia nowe środowisko testowe z Twoimi plikami. Dostępne typy źródeł (Git, GCS, wbudowane) znajdziesz w sekcji Środowiska.
Python
from google import genai
client = genai.Client()
agent = client.agents.create(
id="data-analyst",
base_agent="antigravity-preview-05-2026",
agent_config={
"type": "antigravity",
"model": "gemini-3.6-flash",
},
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",
agent_config: {
type: "antigravity",
model: "gemini-3.6-flash",
},
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",
"agent_config": {
"type": "antigravity",
"model": "gemini-3.6-flash"
},
"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"
}
]
}
}'
Z istniejącego środowiska (fork)
Powtarzaj działania z podstawowym agentem Antigravity, aż środowisko będzie odpowiednie (zainstalowane pakiety, pliki na miejscu), a następnie utwórz z niego rozwidlenie w postaci zarządzanego agenta.
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"
}'
Z regułami sieciowymi
Podczas zapisywania zarządzanego agenta możesz zablokować dostęp wychodzący lub wstawić dane logowania. Pełny schemat listy dozwolonych, wzorce danych logowania i symbole wieloznaczne znajdziesz w sekcji Środowiska: konfiguracja sieci.
W tym przykładzie tworzymy agenta issue-resolver, który ma dostęp tylko do GitHuba i PyPI, a dane logowania do GitHuba są wstrzykiwane:
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"}
]
}
}
}'
Wywołaj agenta
Zadzwoń do swojego agenta zarządzanego, podając jego identyfikator, tworząc nową interakcję. Każde wywołanie rozwidla środowisko bazowe, więc każde uruchomienie zaczyna się od czystego stanu.
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"
}'
Więcej informacji o rozmowach wieloetapowych i przesyłaniu strumieniowym znajdziesz w krótkim wprowadzeniu. Te same wzorce previous_interaction_id i environment obowiązują w przypadku agentów zarządzanych.
Agenci zarządzani obsługują też wykonywanie w tle i anulowanie. Szczegółowe informacje i przykłady kodu znajdziesz w artykule Antigravity Agent: Background execution (Antigravity Agent: wykonywanie w tle).
Zastępowanie konfiguracji podczas wywołania
Podczas tworzenia interakcji możesz zastąpić domyślną konfigurację sieci agenta system_instruction, tools i environment. Dzięki temu możesz modyfikować zachowanie, możliwości lub dane logowania agenta w przypadku konkretnego uruchomienia bez zmiany zapisanej definicji agenta.
Zastępowanie instrukcji systemowych i narzędzi
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"
}'
Zastępowanie konfiguracji sieci (odświeżanie danych logowania)
Jeśli Twój agent zarządzany ma dane logowania do sieci wbudowane w base_environment, możesz je zastąpić w momencie wywołania, aby odświeżyć wygasłe tokeny lub zmienić klucze API. Przekaż obiekt environment z nową konfiguracją network. Nowe reguły sieciowe całkowicie zastępują poprzednie w przypadku danej interakcji. Źródła środowiska podstawowego (pliki, repozytoria) zostaną zachowane.
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"}
]
}
}
}'
Zarządzaj agentami
Możesz wyświetlać, pobierać i usuwać agentów.
Wyświetlenie listy agentów
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"
Uzyskiwanie dostępu do agenta
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"
Usuwanie agenta
Usunięcie powoduje usunięcie konfiguracji. Nie ma to wpływu na istniejące środowiska i interakcje utworzone przez agenta.
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"
Dokumentacja definicji agenta
| Pole | Typ | Wymagane | Opis |
|---|---|---|---|
id |
ciąg znaków | Tak | Unikalny identyfikator agenta w projekcie w chmurze Google. Służy do wywoływania agenta. Nie może używać zarezerwowanych prefiksów. Zobacz ograniczenia dotyczące identyfikatora agenta. |
description |
ciąg znaków | Nie | Zrozumiały dla człowieka opis agenta. |
base_agent |
ciąg znaków | Tak | Identyfikator agenta podstawowego (np. antigravity-preview-05-2026). |
agent_config |
obiekt | Nie | Konfiguracja agenta podstawowego, w tym wybór modelu ({"type": "antigravity", "model": "gemini-3.6-flash"}). Jeśli ta opcja zostanie pominięta, domyślnie używany jest model gemini-3.6-flash. Nie można go zastąpić w momencie interakcji w przypadku nazwanych agentów. |
system_instruction |
ciąg znaków | Nie | Prompt systemowy określający zachowanie i osobowość. |
tools |
tablica | Nie | Narzędzia, których może używać agent. Jeśli zostanie pominięty, domyślnie używane są wartości code_execution, google_search i url_context. Obsługiwane narzędzia to code_execution, google_search, url_context, mcp_server i niestandardowe definicje function. |
base_environment |
ciąg znaków lub obiekt. | Nie | "remote", environment_id lub obiekt konfiguracji z właściwościami sources i network. Zobacz Środowiska. |
Ograniczenia dotyczące identyfikatora agenta
Podczas tworzenia zarządzanego agenta określony przez Ciebie adres id musi być zgodny z tymi regułami:
- Musi być unikalny w Twoim projekcie Google Cloud.
- Nie może się zaczynać od żadnego z tych zarezerwowanych prefiksów (bez względu na wielkość liter), w przeciwnym razie utworzenie się nie powiedzie:
antigravity-veo-omni-lyria-imagen-gemma-gemini-google-youtube-android-chrome-pixel-waze-fitbit-nest-kaggle-
Przepływ pracy iteracji
- Prototyp z podstawowym agentem Antigravity. Przekazywanie instrukcji systemowych i źródeł środowiska w formie wbudowanej. Interaktywne testowanie instrukcji, umiejętności i konfiguracji środowiska.
- Ustabilizuj środowisko. Zainstaluj pakiety, zamontuj źródła i sprawdź, czy wszystko działa.
- Utrzymuj agenta zarządzanego, tworząc nowego agenta ze źródeł lub przez rozwidlenie środowiska.
- Zaktualizuj definicję agenta. Zmień instrukcję systemową, zamień umiejętności lub dodaj źródła. Następne wywołanie będzie korzystać z nowej konfiguracji.
Ograniczenia
- Stan wersji przedpremierowej: agenci zarządzani są w wersji przedpremierowej. Funkcje i schematy mogą ulec zmianie.
- Podstawowy agent i modele: jako
base_agentobsługiwany jest tylko modelantigravity-preview-05-2026. Obsługiwane opcje modelu w przypadku ścieżkiagent_configtogemini-3.5-flash,gemini-3.6-flash(domyślna) igemini-3.5-flash-lite. W przypadku agentów z nazwą nie można zastąpić modelu w momencie interakcji. - Brak obsługi wersji: obsługa wersji agenta i przywracanie nie są jeszcze dostępne.
- Brak zagnieżdżania subagentów: delegowanie subagentów nie jest jeszcze obsługiwane.
- Możesz mieć maksymalnie 1000 zarządzanych agentów.
Co dalej?
- Omówienie agentów: poznaj podstawowe koncepcje dotyczące zarządzanych agentów.
- Krótkie wprowadzenie: zacznij tworzyć aplikacje z wieloetapowymi rozmowami i strumieniowaniem.
- Antigravity Agent: poznaj możliwości, narzędzia i cennik domyślnego agenta.
- Środowiska agentów: konfigurowanie piaskownic, źródeł i sieci.
- Interfejs Managed Agents API w usłudze Agent Platform: do tworzenia zarządzanych agentów z wbudowanymi narzędziami do zarządzania organizacją.