Gemini API-তে ম্যানেজ করা এজেন্ট আপনাকে নিজের নির্দেশাবলী, দক্ষতা ও ডেটা দিয়ে Antigravity এজেন্টকে আরও উন্নত করতে দেয়। আপনি ইন্টার্যাকশনের সময় ইনলাইন এজেন্ট কাস্টমাইজ করতে অথবা আইডি দিয়ে ইনভোক করা ম্যানেজড এজেন্ট হিসেবে কনফিগারেশন সেভ করতে পারবেন।
Antigravity এজেন্ট কাস্টমাইজ করা
কাস্টম এজেন্ট তৈরি করার সবচেয়ে দ্রুত উপায় হল, নতুন ইন্ট্যার্যাকশন তৈরি করার সময় আপনার কনফিগারেশন ইনলাইন হিসেবে পাস করা, এর জন্য কোনও রেজিস্ট্রেশন ধাপের প্রয়োজন হয় না। আপনি বিভিন্ন উপায়ে এজেন্টকে আরও উন্নত করতে পারেন:
- মডেল বেছে নেওয়া:
agent_config-এর মাধ্যমে অন্তর্নিহিত Gemini মডেল বেছে নিন (ডিফল্ট হিসেবে Gemini 3.8 Flash বেছে নেওয়া হয়)। - সিস্টেম নির্দেশাবলী:
system_instruction-এর মাধ্যমে ইনলাইন টেক্সট পাস করে আচরণকে আকার দিন। - টুল: ডিফল্ট টুল (কোড এক্সিকিউশন, সার্চ, URL কনটেক্সট) ওভাররাইড করুন, রিমোট MCP সার্ভার রেজিস্টার করুন বা কাস্টম ফাংশন (ফাংশন কলিং) নির্ধারণ করুন।
- ফাইল ও স্কিল:
AGENTS.mdওSKILL.md-এর মতো ফাইল এনভায়রনমেন্টে মাউন্ট করুন।
তিনটি ইনলাইন প্যারামিটারই পাস করার একটি উদাহরণ এখানে দেওয়া হল:
Python
from google import genai
client = genai.Client()
interaction = client.interactions.create(
agent="antigravity-preview-09-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)
জাভাস্ক্রিপ্ট
import { GoogleGenAI } from "@google/genai";
const client = new GoogleGenAI({});
const interaction = await client.interactions.create({
agent: "antigravity-preview-09-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);
Java
import com.google.genai.Client;
import com.google.genai.gaos.models.interactions.AgentOption;
import com.google.genai.gaos.models.interactions.CreateAgentInteraction;
import com.google.genai.gaos.models.interactions.CreateAgentInteractionEnvironment;
import com.google.genai.gaos.models.interactions.Environment;
import com.google.genai.gaos.models.interactions.Interaction;
import com.google.genai.gaos.models.interactions.InteractionsInput;
import com.google.genai.gaos.models.interactions.Source;
import com.google.genai.gaos.models.interactions.SourceType;
import com.google.genai.gaos.models.operations.CreateInteractionRequestBody;
import java.util.List;
Client client = new Client();
Environment env = Environment.builder()
.sources(List.of(
Source.builder()
.type(SourceType.INLINE)
.target(".agents/AGENTS.md")
.content("Always use matplotlib for charts. Include a summary table in every report.")
.build(),
Source.builder()
.type(SourceType.INLINE)
.target(".agents/skills/slide-maker/SKILL.md")
.content("---\nname: slide-maker\n---\n# Slide Maker\nCreate HTML slide decks from data analysis results.")
.build()
))
.build();
CreateAgentInteraction params = CreateAgentInteraction.builder()
.agent(AgentOption.of("antigravity-preview-09-2026"))
.input(InteractionsInput.of("Analyze the Q1 revenue data and create a slide deck."))
.systemInstruction("You are a data analyst. Always include visualizations and export results as PDF.")
.environment(CreateAgentInteractionEnvironment.of(env))
.build();
Interaction interaction = client.interactions.create(CreateInteractionRequestBody.of(params)).interaction().get();
System.out.println(interaction.outputText().orElse(""));
খুলুন
package main
import (
"context"
"fmt"
"log"
"google.golang.org/genai"
"google.golang.org/genai/interactions/models/interactions"
"google.golang.org/genai/interactions/models/operations"
)
func main() {
ctx := context.Background()
client, err := genai.NewClient(ctx, nil)
if err != nil {
log.Fatal(err)
}
env := interactions.Environment{
Sources: []interactions.Source{
{
Type: interactions.SourceTypeInline.ToPointer(),
Target: genai.Ptr(".agents/AGENTS.md"),
Content: genai.Ptr("Always use matplotlib for charts. Include a summary table in every report."),
},
{
Type: interactions.SourceTypeInline.ToPointer(),
Target: genai.Ptr(".agents/skills/slide-maker/SKILL.md"),
Content: genai.Ptr("---\nname: slide-maker\n---\n# Slide Maker\nCreate HTML slide decks from data analysis results."),
},
},
}
res, err := client.Interactions.Create(ctx, operations.CreateInteractionRequest{
Body: operations.NewCreateInteractionRequestBody(interactions.CreateAgentInteraction{
Agent: interactions.AgentOption("antigravity-preview-09-2026"),
Input: interactions.NewInteractionsInput("Analyze the Q1 revenue data and create a slide deck."),
SystemInstruction: genai.Ptr("You are a data analyst. Always include visualizations and export results as PDF."),
Environment: genai.Ptr(interactions.NewCreateAgentInteractionEnvironment(env)),
}),
})
if err != nil {
log.Fatal(err)
}
if res.Interaction.OutputText != nil {
fmt.Println(*res.Interaction.OutputText)
}
}
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-09-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 এজেন্ট হার্নেস রানটাইম (কোড এক্সিকিউশন, ফাইল ম্যানেজমেন্ট, ওয়েব অ্যাক্সেস) প্রদান করে এবং আপনার কনফিগারেশন লেয়ার উপরে থাকে।
টুল ও সিস্টেম সংক্রান্ত নির্দেশাবলী
system_instruction ও tools প্যারামিটার ব্যবহার করে নির্দিষ্ট ইন্টার্যাকশনের জন্য এজেন্টের আচরণ ও ক্ষমতা কাস্টমাইজ করতে পারবেন।
- সিস্টেম নির্দেশাবলী: এজেন্টের আচরণকে আকার দেয় এমন ইনলাইন টেক্সট পাস করতে
system_instructionপ্যারামিটার ব্যবহার করুন। প্রতিটি কলের জন্য আপনি যে দ্রুত পরিবর্তন করতে চান তার জন্য এটি আদর্শ।system_instructionওAGENTS.mdহল অ্যাড-অন; দু'টিই উপলভ্য থাকলে প্রযোজ্য হবে। - টুল: ডিফল্ট হিসেবে, Antigravity এজেন্টের
code_execution,google_searchওurl_context-এ অ্যাক্সেস থাকে। ইন্টার্যাকশনের সময়toolsপ্যারামিটার পাস করে আপনি এই তালিকা ওভাররাইড করতে পারবেন। এছাড়াও, আপনার নিজস্ব API ও ডেটাবেসের সাথে এজেন্টকে কানেক্ট করতে, আপনি রিমোট MCP সার্ভার রেজিস্টার করতে পারেন অথবা কাস্টম ফাংশন (ফাংশন কলিং) নির্ধারণ করতে পারেন। উপলভ্য টুলের সম্পূর্ণ বিবরণ পেতে, Antigravity এজেন্ট: কাজ করে এমন টুল দেখুন।
ফাইল-ভিত্তিক কাস্টমাইজেশন
এজেন্ট ডিরেক্টরি স্ট্রাকচার
আপনি ইনলাইন কনফিগারেশন পাস করতে পারলেও, আমরা সাজেস্ট করি যে আপনার এজেন্টের ফাইলগুলি একটি সুগঠিত ডিরেক্টরিতে সাজান। এর ফলে, ম্যানেজ করা, ভার্সন কন্ট্রোল করা এবং এজেন্টের এনভায়রনমেন্টে মাউন্ট করা সহজ হয়।
একটি সাধারণ এজেন্ট প্রোজেক্ট ডিরেক্টরি এইরকম দেখতে হয়:
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-09-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)
জাভাস্ক্রিপ্ট
import { GoogleGenAI } from "@google/genai";
const client = new GoogleGenAI({});
const interaction = await client.interactions.create({
agent: "antigravity-preview-09-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);
Java
import com.google.genai.Client;
import com.google.genai.gaos.models.interactions.AgentOption;
import com.google.genai.gaos.models.interactions.CreateAgentInteraction;
import com.google.genai.gaos.models.interactions.CreateAgentInteractionEnvironment;
import com.google.genai.gaos.models.interactions.Environment;
import com.google.genai.gaos.models.interactions.Interaction;
import com.google.genai.gaos.models.interactions.InteractionsInput;
import com.google.genai.gaos.models.interactions.Source;
import com.google.genai.gaos.models.interactions.SourceType;
import com.google.genai.gaos.models.operations.CreateInteractionRequestBody;
import java.util.List;
Client client = new Client();
Environment env = Environment.builder()
.sources(List.of(
Source.builder()
.type(SourceType.INLINE)
.target(".agents/AGENTS.md")
.content("Always use matplotlib for charts. Include a summary table in every report.")
.build()
))
.build();
CreateAgentInteraction params = CreateAgentInteraction.builder()
.agent(AgentOption.of("antigravity-preview-09-2026"))
.input(InteractionsInput.of("Analyze the Q1 revenue data and create a report."))
.systemInstruction("You are a data analyst. Always include visualizations and export results as PDF.")
.environment(CreateAgentInteractionEnvironment.of(env))
.build();
Interaction interaction = client.interactions.create(CreateInteractionRequestBody.of(params)).interaction().get();
System.out.println(interaction.outputText().orElse(""));
খুলুন
package main
import (
"context"
"fmt"
"log"
"google.golang.org/genai"
"google.golang.org/genai/interactions/models/interactions"
"google.golang.org/genai/interactions/models/operations"
)
func main() {
ctx := context.Background()
client, err := genai.NewClient(ctx, nil)
if err != nil {
log.Fatal(err)
}
env := interactions.Environment{
Sources: []interactions.Source{
{
Type: interactions.SourceTypeInline.ToPointer(),
Target: genai.Ptr(".agents/AGENTS.md"),
Content: genai.Ptr("Always use matplotlib for charts. Include a summary table in every report."),
},
},
}
res, err := client.Interactions.Create(ctx, operations.CreateInteractionRequest{
Body: operations.NewCreateInteractionRequestBody(interactions.CreateAgentInteraction{
Agent: interactions.AgentOption("antigravity-preview-09-2026"),
Input: interactions.NewInteractionsInput("Analyze the Q1 revenue data and create a report."),
SystemInstruction: genai.Ptr("You are a data analyst. Always include visualizations and export results as PDF."),
Environment: genai.Ptr(interactions.NewCreateAgentInteractionEnvironment(env)),
}),
})
if err != nil {
log.Fatal(err)
}
if res.Interaction.OutputText != nil {
fmt.Println(*res.Interaction.OutputText)
}
}
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-09-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-এর নিচে রাখুন এবং হার্নেস অটোমেটিক শনাক্ত করে রেজিস্টার করে নেবে।
.agents/
├── AGENTS.md
└── skills/
└── slide-maker/
└── SKILL.md
ইনলাইন সোর্স ব্যবহার করে স্কিল মাউন্ট করা:
Python
from google import genai
client = genai.Client()
interaction = client.interactions.create(
agent="antigravity-preview-09-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)
জাভাস্ক্রিপ্ট
import { GoogleGenAI } from "@google/genai";
const client = new GoogleGenAI({});
const interaction = await client.interactions.create({
agent: "antigravity-preview-09-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);
Java
import com.google.genai.Client;
import com.google.genai.gaos.models.interactions.AgentOption;
import com.google.genai.gaos.models.interactions.CreateAgentInteraction;
import com.google.genai.gaos.models.interactions.CreateAgentInteractionEnvironment;
import com.google.genai.gaos.models.interactions.Environment;
import com.google.genai.gaos.models.interactions.Interaction;
import com.google.genai.gaos.models.interactions.InteractionsInput;
import com.google.genai.gaos.models.interactions.Source;
import com.google.genai.gaos.models.interactions.SourceType;
import com.google.genai.gaos.models.operations.CreateInteractionRequestBody;
import java.util.List;
Client client = new Client();
Environment env = Environment.builder()
.sources(List.of(
Source.builder()
.type(SourceType.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")
.build()
))
.build();
CreateAgentInteraction params = CreateAgentInteraction.builder()
.agent(AgentOption.of("antigravity-preview-09-2026"))
.input(InteractionsInput.of("Create a presentation about our Q1 results."))
.systemInstruction("You create presentations from data.")
.environment(CreateAgentInteractionEnvironment.of(env))
.build();
Interaction interaction = client.interactions.create(CreateInteractionRequestBody.of(params)).interaction().get();
System.out.println(interaction.outputText().orElse(""));
খুলুন
package main
import (
"context"
"fmt"
"log"
"google.golang.org/genai"
"google.golang.org/genai/interactions/models/interactions"
"google.golang.org/genai/interactions/models/operations"
)
func main() {
ctx := context.Background()
client, err := genai.NewClient(ctx, nil)
if err != nil {
log.Fatal(err)
}
env := interactions.Environment{
Sources: []interactions.Source{
{
Type: interactions.SourceTypeInline.ToPointer(),
Target: genai.Ptr(".agents/skills/slide-maker/SKILL.md"),
Content: genai.Ptr("---\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"),
},
},
}
res, err := client.Interactions.Create(ctx, operations.CreateInteractionRequest{
Body: operations.NewCreateInteractionRequestBody(interactions.CreateAgentInteraction{
Agent: interactions.AgentOption("antigravity-preview-09-2026"),
Input: interactions.NewInteractionsInput("Create a presentation about our Q1 results."),
SystemInstruction: genai.Ptr("You create presentations from data."),
Environment: genai.Ptr(interactions.NewCreateAgentInteractionEnvironment(env)),
}),
})
if err != nil {
log.Fatal(err)
}
if res.Interaction.OutputText != nil {
fmt.Println(*res.Interaction.OutputText)
}
}
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-09-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 ব্যবহার করে এটিকে ম্যানেজ করা এজেন্ট হিসেবে তৈরি করতে পারবেন। এর ফলে, প্রতিবার কনফিগারেশন না করেই আপনি আইডি দিয়ে এজেন্টকে ইনভোক করতে পারবেন।
ম্যানেজ করা এজেন্ট তৈরি করার সময় আপনি যে id নির্দিষ্ট করেন সেটি আপনার প্রোজেক্টের জন্য অনন্য হতে হবে এবং রিজার্ভ করা প্রিফিক্স (যেমন, google-, gemini-) দিয়ে শুরু করা যাবে না। রিজার্ভ করা প্রিফিক্সের সম্পূর্ণ তালিকা দেখতে এজেন্ট আইডি সংক্রান্ত বিধিনিষেধ দেখুন।
সোর্স থেকে
সোর্স সহ base_agent, id, agent_config, system_instruction ও base_environment উল্লেখ করুন। প্রতিবার ইনভোক করার সময় প্ল্যাটফর্ম আপনার ফাইল সহ একটি নতুন স্যান্ডবক্স প্রদান করে। উপলভ্য সোর্সের ধরন (Git, GCS, ইনলাইন) সম্পর্কে জানতে এনভায়রনমেন্ট দেখুন।
Python
from google import genai
client = genai.Client()
agent = client.agents.create(
id="data-analyst",
base_agent="antigravity-preview-09-2026",
agent_config={
"type": "antigravity",
"model": "gemini-3.8-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}")
জাভাস্ক্রিপ্ট
import { GoogleGenAI } from "@google/genai";
const client = new GoogleGenAI({});
const agent = await client.agents.create({
id: "data-analyst",
base_agent: "antigravity-preview-09-2026",
agent_config: {
type: "antigravity",
model: "gemini-3.8-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}`);
Java
import com.google.genai.Client;
import com.google.genai.gaos.models.agents.Agent;
import com.google.genai.gaos.models.agents.AgentConfig;
import com.google.genai.gaos.models.agents.BaseEnvironment;
import com.google.genai.gaos.models.interactions.AntigravityAgentConfig;
import com.google.genai.gaos.models.interactions.Environment;
import com.google.genai.gaos.models.interactions.Source;
import com.google.genai.gaos.models.interactions.SourceType;
import java.util.List;
Client client = new Client();
Environment env = Environment.builder()
.sources(List.of(
Source.builder()
.type(SourceType.INLINE)
.target(".agents/AGENTS.md")
.content("Always use matplotlib for charts. Include a summary table in every report.")
.build(),
Source.builder()
.type(SourceType.INLINE)
.target(".agents/skills/slide-maker/SKILL.md")
.content("---\nname: slide-maker\n---\n# Slide Maker\nCreate HTML slide decks from data analysis results.")
.build(),
Source.builder()
.type(SourceType.REPOSITORY)
.source("https://github.com/my-org/analysis-templates")
.target("/workspace/templates")
.build()
))
.build();
Agent agentParams = Agent.builder()
.id("data-analyst")
.baseAgent("antigravity-preview-09-2026")
.agentConfig(AgentConfig.of(
AntigravityAgentConfig.builder()
.model("gemini-3.8-flash")
.build()
))
.systemInstruction("You are a data analyst. Always include visualizations and export results as PDF.")
.baseEnvironment(BaseEnvironment.of(env))
.build();
Agent agent = client.agents.create(agentParams).agent().get();
System.out.println("Created agent: " + agent.id().orElse(""));
খুলুন
package main
import (
"context"
"fmt"
"log"
"google.golang.org/genai"
"google.golang.org/genai/interactions/models/agents"
"google.golang.org/genai/interactions/models/interactions"
"google.golang.org/genai/interactions/models/operations"
)
func main() {
ctx := context.Background()
client, err := genai.NewClient(ctx, nil)
if err != nil {
log.Fatal(err)
}
env := interactions.Environment{
Sources: []interactions.Source{
{
Type: interactions.SourceTypeInline.ToPointer(),
Target: genai.Ptr(".agents/AGENTS.md"),
Content: genai.Ptr("Always use matplotlib for charts. Include a summary table in every report."),
},
{
Type: interactions.SourceTypeInline.ToPointer(),
Target: genai.Ptr(".agents/skills/slide-maker/SKILL.md"),
Content: genai.Ptr("---\nname: slide-maker\n---\n# Slide Maker\nCreate HTML slide decks from data analysis results."),
},
{
Type: interactions.SourceTypeRepository.ToPointer(),
Source: genai.Ptr("https://github.com/my-org/analysis-templates"),
Target: genai.Ptr("/workspace/templates"),
},
},
}
res, err := client.Agents.Create(ctx, operations.CreateAgentRequest{
Body: agents.Agent{
ID: genai.Ptr("data-analyst"),
BaseAgent: genai.Ptr("antigravity-preview-09-2026"),
AgentConfig: genai.Ptr(agents.NewAgentConfig(interactions.AntigravityAgentConfig{
Model: genai.Ptr("gemini-3.8-flash"),
})),
SystemInstruction: genai.Ptr("You are a data analyst. Always include visualizations and export results as PDF."),
BaseEnvironment: genai.Ptr(agents.NewBaseEnvironment(env)),
},
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("Created agent: %s\n", *res.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-09-2026",
"agent_config": {
"type": "antigravity",
"model": "gemini-3.8-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"
}
]
}
}'
আগে থেকে থাকা এনভায়রনমেন্ট থেকে (ফর্ক করা)
পরিবেশ সঠিক না হওয়া পর্যন্ত (প্যাকেজ ইনস্টল করা, ফাইল সঠিক জায়গায় রাখা) বেস অ্যান্টিগ্র্যাভিটি এজেন্টের সাথে ইটারেট করুন, তারপর এটিকে ম্যানেজড এজেন্টে ফর্ক করুন।
Python
from google import genai
client = genai.Client()
# Step 1: set up the environment interactively
interaction = client.interactions.create(
agent="antigravity-preview-09-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-09-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}")
জাভাস্ক্রিপ্ট
import { GoogleGenAI } from "@google/genai";
const client = new GoogleGenAI({});
const interaction = await client.interactions.create({
agent: "antigravity-preview-09-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-09-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}`);
Java
import com.google.genai.Client;
import com.google.genai.gaos.models.agents.Agent;
import com.google.genai.gaos.models.agents.BaseEnvironment;
import com.google.genai.gaos.models.interactions.AgentOption;
import com.google.genai.gaos.models.interactions.CreateAgentInteraction;
import com.google.genai.gaos.models.interactions.CreateAgentInteractionEnvironment;
import com.google.genai.gaos.models.interactions.Interaction;
import com.google.genai.gaos.models.interactions.InteractionsInput;
import com.google.genai.gaos.models.operations.CreateInteractionRequestBody;
Client client = new Client();
// Step 1: set up the environment interactively
CreateAgentInteraction params = CreateAgentInteraction.builder()
.agent(AgentOption.of("antigravity-preview-09-2026"))
.input(InteractionsInput.of("Install pandas, matplotlib, and seaborn. Create an analysis template at /workspace/template.py."))
.environment(CreateAgentInteractionEnvironment.of("remote"))
.build();
Interaction interaction = client.interactions.create(CreateInteractionRequestBody.of(params)).interaction().get();
// Step 2: fork that environment into a managed agent
Agent agentParams = Agent.builder()
.id("my-data-analyst")
.baseAgent("antigravity-preview-09-2026")
.systemInstruction("You are a data analyst. Use the template at /workspace/template.py for all reports.")
.baseEnvironment(BaseEnvironment.of(interaction.environmentId().orElse("")))
.build();
Agent agent = client.agents.create(agentParams).agent().get();
System.out.println("Forked agent successfully: " + agent.id().orElse(""));
খুলুন
package main
import (
"context"
"fmt"
"log"
"google.golang.org/genai"
"google.golang.org/genai/interactions/models/agents"
"google.golang.org/genai/interactions/models/interactions"
"google.golang.org/genai/interactions/models/operations"
)
func main() {
ctx := context.Background()
client, err := genai.NewClient(ctx, nil)
if err != nil {
log.Fatal(err)
}
// Step 1: set up the environment interactively
intRes, err := client.Interactions.Create(ctx, operations.CreateInteractionRequest{
Body: operations.NewCreateInteractionRequestBody(interactions.CreateAgentInteraction{
Agent: interactions.AgentOption("antigravity-preview-09-2026"),
Input: interactions.NewInteractionsInput("Install pandas, matplotlib, and seaborn. Create an analysis template at /workspace/template.py."),
Environment: genai.Ptr(interactions.NewCreateAgentInteractionEnvironment("remote")),
}),
})
if err != nil {
log.Fatal(err)
}
interaction := intRes.Interaction
// Step 2: fork that environment into a managed agent
agentRes, err := client.Agents.Create(ctx, operations.CreateAgentRequest{
Body: agents.Agent{
ID: genai.Ptr("my-data-analyst"),
BaseAgent: genai.Ptr("antigravity-preview-09-2026"),
SystemInstruction: genai.Ptr("You are a data analyst. Use the template at /workspace/template.py for all reports."),
BaseEnvironment: genai.Ptr(agents.NewBaseEnvironment(*interaction.EnvironmentID)),
},
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("Forked agent successfully: %s\n", *agentRes.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-09-2026",
"input": "Install pandas, matplotlib, and seaborn. Create an analysis template at /workspace/template.py.",
"environment": "remote"
}'
নেটওয়ার্ক সংক্রান্ত নিয়মের সাথে
ম্যানেজ করা এজেন্ট সেভ করার সময় আপনি আউটবাউন্ড অ্যাক্সেস লক করতে বা ক্রেডেনশিয়াল ইনজেক্ট করতে পারবেন। সম্পূর্ণ অনুমোদিত তালিকার স্কিমা, ক্রেডেনশিয়াল প্যাটার্ন ও ওয়াইল্ডকার্ডের জন্য, এনভায়রনমেন্ট: নেটওয়ার্ক কনফিগারেশন দেখুন।
অনুমতিপ্রাপ্ত তালিকার নিয়মে ("credential": "github-production") আইডি দিয়ে সেভ করা ক্রেডেনশিয়াল রেফার করুন এবং অনুরোধ করার সময় এগ্রেস প্রক্সি সিক্রেট ইনজেক্ট করে, তাই এটি কখনও আপনার এজেন্ট ডেফিনিশনে আসে না। এই উদাহরণে, transform-এর পরিবর্তে হেডার ইনলাইন হিসেবে সেট করা হয়েছে। প্রক্সি দুটি ফর্ম একই উপায়ে প্রয়োগ করে, অতিরিক্ত ক্রেডেনশিয়াল আপনাকে এজেন্ট জুড়ে সিক্রেট আবার ব্যবহার করতে এবং এটি এক জায়গায় রোটেট করতে দেয়।
নিম্নলিখিত উদাহরণে এমন একটি issue-resolver এজেন্ট তৈরি করা হয়েছে যা শুধুমাত্র GitHub এবং PyPI অ্যাক্সেস করতে পারে, GitHub-এর জন্য ক্রেডেনশিয়াল ইনজেক্ট করা হয়েছে:
Python
from google import genai
client = genai.Client()
agent = client.agents.create(
id="issue-resolver",
base_agent="antigravity-preview-09-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}")
জাভাস্ক্রিপ্ট
import { GoogleGenAI } from "@google/genai";
const client = new GoogleGenAI({});
const agent = await client.agents.create({
id: "issue-resolver",
base_agent: "antigravity-preview-09-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}`);
Java
import com.google.genai.Client;
import com.google.genai.gaos.models.agents.Agent;
import com.google.genai.gaos.models.agents.BaseEnvironment;
import com.google.genai.gaos.models.interactions.Allowlist;
import com.google.genai.gaos.models.interactions.AllowlistEntry;
import com.google.genai.gaos.models.interactions.Environment;
import com.google.genai.gaos.models.interactions.EnvironmentNetworkEgressAllowlist;
import com.google.genai.gaos.models.interactions.Network;
import com.google.genai.gaos.models.interactions.Source;
import com.google.genai.gaos.models.interactions.SourceType;
import com.google.genai.gaos.models.interactions.Transform;
import java.util.List;
import java.util.Map;
Client client = new Client();
Environment env = Environment.builder()
.sources(List.of(
Source.builder()
.type(SourceType.REPOSITORY)
.source("https://github.com/my-org/backend")
.target("/workspace/repo")
.build()
))
.network(Network.of(
EnvironmentNetworkEgressAllowlist.builder()
.allowlist(Allowlist.of(List.of(
AllowlistEntry.builder()
.domain("api.github.com")
.transform(Transform.of(Map.of(
"Authorization", "Basic YOUR_BASE64_TOKEN"
)))
.build(),
AllowlistEntry.builder().domain("pypi.org").build()
)))
.build()
))
.build();
Agent agentParams = Agent.builder()
.id("issue-resolver")
.baseAgent("antigravity-preview-09-2026")
.systemInstruction("You resolve GitHub issues. Clone the repo, find the bug, write the fix, run the tests, and open a PR.")
.baseEnvironment(BaseEnvironment.of(env))
.build();
Agent agent = client.agents.create(agentParams).agent().get();
System.out.println("Created issue-resolver agent successfully: " + agent.id().orElse(""));
খুলুন
package main
import (
"context"
"fmt"
"log"
"google.golang.org/genai"
"google.golang.org/genai/interactions/models/agents"
"google.golang.org/genai/interactions/models/interactions"
"google.golang.org/genai/interactions/models/operations"
)
func main() {
ctx := context.Background()
client, err := genai.NewClient(ctx, nil)
if err != nil {
log.Fatal(err)
}
env := interactions.Environment{
Sources: []interactions.Source{
{
Type: interactions.SourceTypeRepository.ToPointer(),
Source: genai.Ptr("https://github.com/my-org/backend"),
Target: genai.Ptr("/workspace/repo"),
},
},
Network: genai.Ptr(interactions.NewNetwork(interactions.EnvironmentNetworkEgressAllowlist{
Allowlist: genai.Ptr(interactions.NewAllowlist([]interactions.AllowlistEntry{
{
Domain: "api.github.com",
Transform: genai.Ptr(interactions.NewTransform(map[string]string{
"Authorization": "Basic YOUR_BASE64_TOKEN",
})),
},
{
Domain: "pypi.org",
},
})),
})),
}
res, err := client.Agents.Create(ctx, operations.CreateAgentRequest{
Body: agents.Agent{
ID: genai.Ptr("issue-resolver"),
BaseAgent: genai.Ptr("antigravity-preview-09-2026"),
SystemInstruction: genai.Ptr("You resolve GitHub issues. Clone the repo, find the bug, write the fix, run the tests, and open a PR."),
BaseEnvironment: genai.Ptr(agents.NewBaseEnvironment(env)),
},
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("Created issue-resolver agent successfully: %s\n", *res.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-09-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)
জাভাস্ক্রিপ্ট
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);
Java
import com.google.genai.Client;
import com.google.genai.gaos.models.interactions.AgentOption;
import com.google.genai.gaos.models.interactions.CreateAgentInteraction;
import com.google.genai.gaos.models.interactions.CreateAgentInteractionEnvironment;
import com.google.genai.gaos.models.interactions.Interaction;
import com.google.genai.gaos.models.interactions.InteractionsInput;
import com.google.genai.gaos.models.operations.CreateInteractionRequestBody;
Client client = new Client();
CreateAgentInteraction params = CreateAgentInteraction.builder()
.agent(AgentOption.of("data-analyst"))
.input(InteractionsInput.of("Analyze Q1 revenue data from /workspace/templates/sample.csv and create a slide deck."))
.environment(CreateAgentInteractionEnvironment.of("remote"))
.build();
Interaction result = client.interactions.create(CreateInteractionRequestBody.of(params)).interaction().get();
System.out.println(result.outputText().orElse(""));
খুলুন
package main
import (
"context"
"fmt"
"log"
"google.golang.org/genai"
"google.golang.org/genai/interactions/models/interactions"
"google.golang.org/genai/interactions/models/operations"
)
func main() {
ctx := context.Background()
client, err := genai.NewClient(ctx, nil)
if err != nil {
log.Fatal(err)
}
res, err := client.Interactions.Create(ctx, operations.CreateInteractionRequest{
Body: operations.NewCreateInteractionRequestBody(interactions.CreateAgentInteraction{
Agent: interactions.AgentOption("data-analyst"),
Input: interactions.NewInteractionsInput("Analyze Q1 revenue data from /workspace/templates/sample.csv and create a slide deck."),
Environment: genai.Ptr(interactions.NewCreateAgentInteractionEnvironment("remote")),
}),
})
if err != nil {
log.Fatal(err)
}
if res.Interaction.OutputText != nil {
fmt.Println(*res.Interaction.OutputText)
}
}
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: ব্যাকগ্রাউন্ড এক্সিকিউশন দেখুন।
ইনভোকেশনের সময় কনফিগারেশন ওভাররাইড করা
ইন্টার্যাকশন তৈরি করার সময় আপনি এজেন্টের ডিফল্ট 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)
জাভাস্ক্রিপ্ট
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);
Java
import com.google.genai.Client;
import com.google.genai.gaos.models.interactions.AgentOption;
import com.google.genai.gaos.models.interactions.CodeExecution;
import com.google.genai.gaos.models.interactions.CreateAgentInteraction;
import com.google.genai.gaos.models.interactions.CreateAgentInteractionEnvironment;
import com.google.genai.gaos.models.interactions.Interaction;
import com.google.genai.gaos.models.interactions.InteractionsInput;
import com.google.genai.gaos.models.operations.CreateInteractionRequestBody;
import java.util.List;
Client client = new Client();
CreateAgentInteraction params = CreateAgentInteraction.builder()
.agent(AgentOption.of("data-analyst"))
.input(InteractionsInput.of("Analyze Q1 revenue data, but do not create a slide deck. Just output a summary table."))
.systemInstruction("You are a data analyst. Focus ONLY on summary tables. Ignore default instructions about slides.")
.tools(List.of(CodeExecution.builder().build())) // Override to only use code execution
.environment(CreateAgentInteractionEnvironment.of("remote"))
.build();
Interaction result = client.interactions.create(CreateInteractionRequestBody.of(params)).interaction().get();
System.out.println(result.outputText().orElse(""));
খুলুন
package main
import (
"context"
"fmt"
"log"
"google.golang.org/genai"
"google.golang.org/genai/interactions/models/interactions"
"google.golang.org/genai/interactions/models/operations"
)
func main() {
ctx := context.Background()
client, err := genai.NewClient(ctx, nil)
if err != nil {
log.Fatal(err)
}
res, err := client.Interactions.Create(ctx, operations.CreateInteractionRequest{
Body: operations.NewCreateInteractionRequestBody(interactions.CreateAgentInteraction{
Agent: interactions.AgentOption("data-analyst"),
Input: interactions.NewInteractionsInput("Analyze Q1 revenue data, but do not create a slide deck. Just output a summary table."),
SystemInstruction: genai.Ptr("You are a data analyst. Focus ONLY on summary tables. Ignore default instructions about slides."),
Tools: []interactions.Tool{interactions.NewTool(interactions.CodeExecution{})}, // Override to only use code execution
Environment: genai.Ptr(interactions.NewCreateAgentInteractionEnvironment("remote")),
}),
})
if err != nil {
log.Fatal(err)
}
if res.Interaction.OutputText != nil {
fmt.Println(*res.Interaction.OutputText)
}
}
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
কী পরিবর্তন করতে পারবেন। নতুন network কনফিগারেশন সহ একটি environment অবজেক্ট পাস করুন। নতুন
নেটওয়ার্ক সংক্রান্ত নিয়ম সেই ইন্টার্যাকশনের জন্য আগের নিয়মকে সম্পূর্ণভাবে সরিয়ে দেয়। বেস
এনভায়রনমেন্টের সোর্স (ফাইল, রেপোজিটরি) সংরক্ষিত থাকে।
ইনলাইন টোকেনের পরিবর্তে base_environment কোনও সেভ করা
ক্রেডেনশিয়াল রেফার করলে, আপনাকে
কিছু ওভাররাইড করতে হবে না। PATCH দিয়ে ক্রেডেনশিয়াল রোটেট করুন এবং প্রতিটি
এজেন্ট এটি রেফার করলে, পরের বার রান করার সময় নতুন সিক্রেট বেছে নেয়।
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)
জাভাস্ক্রিপ্ট
// 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);
Java
import com.google.genai.Client;
import com.google.genai.gaos.models.interactions.AgentOption;
import com.google.genai.gaos.models.interactions.Allowlist;
import com.google.genai.gaos.models.interactions.AllowlistEntry;
import com.google.genai.gaos.models.interactions.CreateAgentInteraction;
import com.google.genai.gaos.models.interactions.CreateAgentInteractionEnvironment;
import com.google.genai.gaos.models.interactions.Environment;
import com.google.genai.gaos.models.interactions.EnvironmentNetworkEgressAllowlist;
import com.google.genai.gaos.models.interactions.Interaction;
import com.google.genai.gaos.models.interactions.InteractionsInput;
import com.google.genai.gaos.models.interactions.Network;
import com.google.genai.gaos.models.interactions.Transform;
import com.google.genai.gaos.models.operations.CreateInteractionRequestBody;
import java.util.List;
import java.util.Map;
Client client = new Client();
// Invoke the agent with a fresh token, overriding the base_environment credentials
Environment env = Environment.builder()
.network(Network.of(
EnvironmentNetworkEgressAllowlist.builder()
.allowlist(Allowlist.of(List.of(
AllowlistEntry.builder()
.domain("api.github.com")
.transform(Transform.of(Map.of(
"Authorization", "Bearer ghp_REFRESHED_TOKEN"
)))
.build(),
AllowlistEntry.builder().domain("pypi.org").build()
)))
.build()
))
.build();
CreateAgentInteraction params = CreateAgentInteraction.builder()
.agent(AgentOption.of("issue-resolver"))
.input(InteractionsInput.of("Fix issue #42 and open a PR."))
.environment(CreateAgentInteractionEnvironment.of(env))
.build();
Interaction result = client.interactions.create(CreateInteractionRequestBody.of(params)).interaction().get();
System.out.println(result.outputText().orElse(""));
খুলুন
package main
import (
"context"
"fmt"
"log"
"google.golang.org/genai"
"google.golang.org/genai/interactions/models/interactions"
"google.golang.org/genai/interactions/models/operations"
)
func main() {
ctx := context.Background()
client, err := genai.NewClient(ctx, nil)
if err != nil {
log.Fatal(err)
}
// Invoke the agent with a fresh token, overriding the base_environment credentials
env := interactions.Environment{
Network: genai.Ptr(interactions.NewNetwork(interactions.EnvironmentNetworkEgressAllowlist{
Allowlist: genai.Ptr(interactions.NewAllowlist([]interactions.AllowlistEntry{
{
Domain: "api.github.com",
Transform: genai.Ptr(interactions.NewTransform(map[string]string{
"Authorization": "Bearer ghp_REFRESHED_TOKEN",
})),
},
{
Domain: "pypi.org",
},
})),
})),
}
res, err := client.Interactions.Create(ctx, operations.CreateInteractionRequest{
Body: operations.NewCreateInteractionRequestBody(interactions.CreateAgentInteraction{
Agent: interactions.AgentOption("issue-resolver"),
Input: interactions.NewInteractionsInput("Fix issue #42 and open a PR."),
Environment: genai.Ptr(interactions.NewCreateAgentInteractionEnvironment(env)),
}),
})
if err != nil {
log.Fatal(err)
}
if res.Interaction.OutputText != nil {
fmt.Println(*res.Interaction.OutputText)
}
}
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}")
জাভাস্ক্রিপ্ট
const agents = await client.agents.list();
if (agents.agents) {
for (const a of agents.agents) {
console.log(`${a.id}: ${a.description}`);
}
}
Java
import com.google.genai.Client;
import com.google.genai.gaos.models.agents.Agent;
import java.util.List;
Client client = new Client();
List<Agent> agents = client.agents.listDirect().agentListResponse().get().agents().orElse(List.of());
for (Agent a : agents) {
System.out.println(a.id().orElse("") + ": " + a.description().orElse(""));
}
খুলুন
package main
import (
"context"
"fmt"
"log"
"google.golang.org/genai"
"google.golang.org/genai/interactions/models/operations"
)
func main() {
ctx := context.Background()
client, err := genai.NewClient(ctx, nil)
if err != nil {
log.Fatal(err)
}
res, err := client.Agents.List(ctx, operations.ListAgentsRequest{})
if err != nil {
log.Fatal(err)
}
if res.AgentListResponse != nil {
for _, a := range res.AgentListResponse.Agents {
fmt.Printf("%s: %v\n", *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)
জাভাস্ক্রিপ্ট
const agent = await client.agents.get("data-analyst");
console.log(agent);
Java
import com.google.genai.Client;
import com.google.genai.gaos.models.agents.Agent;
Client client = new Client();
Agent agent = client.agents.get("data-analyst").agent().get();
System.out.println(agent);
খুলুন
package main
import (
"context"
"fmt"
"log"
"google.golang.org/genai"
"google.golang.org/genai/interactions/models/operations"
)
func main() {
ctx := context.Background()
client, err := genai.NewClient(ctx, nil)
if err != nil {
log.Fatal(err)
}
res, err := client.Agents.Get(ctx, operations.GetAgentRequest{
ID: "data-analyst",
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%+v\n", res.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")
জাভাস্ক্রিপ্ট
await client.agents.delete("data-analyst");
Java
import com.google.genai.Client;
Client client = new Client();
client.agents.delete("data-analyst");
খুলুন
package main
import (
"context"
"log"
"google.golang.org/genai"
"google.golang.org/genai/interactions/models/operations"
)
func main() {
ctx := context.Background()
client, err := genai.NewClient(ctx, nil)
if err != nil {
log.Fatal(err)
}
_, err = client.Agents.Delete(ctx, operations.DeleteAgentRequest{
ID: "data-analyst",
})
if err != nil {
log.Fatal(err)
}
}
REST
curl -X DELETE "https://generativelanguage.googleapis.com/v1beta/agents/data-analyst" \
-H "x-goog-api-key: $GEMINI_API_KEY"
এজেন্ট সংজ্ঞা রেফারেন্স
| ফিল্ড | ধরন | প্রয়োজনীয় | বিবরণ |
|---|---|---|---|
id |
স্ট্রিং | হ্যাঁ | Google Cloud প্রোজেক্টের মধ্যে অনন্য এজেন্ট শনাক্তকারী। এজেন্টকে ইনভোক করতে ব্যবহার করা হয়। রিজার্ভ করা প্রিফিক্স ব্যবহার করা যাবে না। এজেন্ট আইডি সংক্রান্ত বিধিনিষেধ দেখুন। |
description |
স্ট্রিং | না | এজেন্টের মানুষের-পঠনযোগ্য বিবরণ। |
base_agent |
স্ট্রিং | হ্যাঁ | বেস এজেন্ট আইডি (যেমন, antigravity-preview-09-2026)। |
agent_config |
অবজেক্ট | না | মডেল বেছে নেওয়া ({"type": "antigravity", "model": "gemini-3.8-flash"}) সহ বেস এজেন্টের কনফিগারেশন। উল্লেখ না করা হলে gemini-3.8-flash ডিফল্ট হিসেবে সেট করা হয়। নামযুক্ত এজেন্টের ক্ষেত্রে ইন্টার্যাকশনের সময় ওভাররাইড করা যায় না। |
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 সহ কনফিগারেশন অবজেক্ট। এনভায়রনমেন্ট দেখুন। |
এজেন্ট আইডি সংক্রান্ত বিধিনিষেধ
ম্যানেজ করা এজেন্ট তৈরি করার সময়, আপনার উল্লেখ করা id-কে এইসব নিয়ম মেনে চলতে হবে:
- এটি আপনার Google Cloud প্রোজেক্টের জন্য অনন্য হতে হবে।
- এটি নিম্নলিখিত সংরক্ষিত প্রিফিক্স (কেস-ইনসেনসিটিভ) দিয়ে শুরু করা যাবে না, অন্যথায় তৈরি করা যাবে না:
antigravity-veo-omni-lyria-imagen-gemma-gemini-google-youtube-android-chrome-pixel-waze-fitbit-nest-kaggle-
ইটেরেশন ওয়ার্কফ্লো
- বেস Antigravity এজেন্টের সাথে প্রোটোটাইপ তৈরি করুন। সিস্টেম নির্দেশাবলী ও এনভায়রনমেন্ট সোর্স ইনলাইন হিসেবে পাস করুন। নির্দেশাবলী, দক্ষতা ও এনভায়রনমেন্ট সেট-আপ ইন্ট্যার্যাক্টিভভাবে পরীক্ষা করুন।
- পরিবেশ স্থিতিশীল করুন। প্যাকেজ ইনস্টল করুন, সোর্স মাউন্ট করুন, সবকিছু কাজ করছে কিনা তা যাচাই করুন।
- সোর্স থেকে অথবা এনভায়রনমেন্ট ফর্ক করার মাধ্যমে নতুন এজেন্ট তৈরি করে ম্যানেজ করা এজেন্ট হিসেবে পারসিস্ট করুন।
- এজেন্টের সংজ্ঞা আপডেট করুন। সিস্টেম নির্দেশাবলী পরিবর্তন করুন, দক্ষতা অদল-বদল করুন বা সোর্স যোগ করুন। পরবর্তী ইনভোকেশন নতুন কনফিগারেশন বেছে নেয়।
সীমাবদ্ধতা
- প্রিভিউ স্ট্যাটাস: ম্যানেজ করা এজেন্ট প্রিভিউতে আছে। ফিচার ও স্কিমা পরিবর্তন হতে পারে।
- বেস এজেন্ট ও মডেল: শুধুমাত্র
antigravity-preview-09-2026কাজ করেbase_agent।agent_config-এ কাজ করে এমন মডেলের বিকল্পগুলি হলgemini-3.8-flash(ডিফল্ট),gemini-3.6-flashএবংgemini-3.5-flash-lite। নামযুক্ত এজেন্টের ক্ষেত্রে, ইন্টার্যাকশন চলাকালীন মডেল ওভাররাইড করা যাবে না। - কোনও ভার্সনিং নেই: এজেন্ট ভার্সনিং ও রোলব্যাক এখনও উপলভ্য নেই।
- সাব-এজেন্ট নেস্টিং নেই: সাব-এজেন্ট ডেলিগেশন এখনও কাজ করে না।
- আপনার সর্বাধিক ১০০০টি ম্যানেজ করা এজেন্ট থাকতে পারে।
এর পরে কী করতে হবে
- এজেন্ট ওভারভিউ: ম্যানেজ করা এজেন্টদের মূল ধারণা সম্পর্কে জানুন।
- দ্রুত শুরু করা: একাধিক কথোপকথন ও স্ট্রিমিংয়ের মাধ্যমে তৈরি করা শুরু করুন।
- Antigravity এজেন্ট: ডিফল্ট এজেন্টের ক্ষমতা, টুল ও দাম এক্সপ্লোর করুন।
- এজেন্ট এনভায়র্নমেন্ট: স্যান্ডবক্স, সোর্স ও নেটওয়ার্কিং কনফিগার করুন।
- এজেন্ট প্ল্যাটফর্মে ম্যানেজ করা এজেন্ট API: বিল্ট-ইন সাংগঠনিক তত্ত্বাবধান সহ এজেন্ট তৈরি করার জন্য।