এনভায়রনমেন্ট হলো পরিচালিত লিনাক্স স্যান্ডবক্স, যা এজেন্টদের কোড এক্সিকিউট করতে এবং ফাইল সংরক্ষণ করতে একটি বিচ্ছিন্ন জায়গা দেয়। এগুলো ইন্টারঅ্যাকশন কনটেক্সট থেকে বিচ্ছিন্ন থাকে, ফলে আপনি একাধিক ইন্টারঅ্যাকশনের জন্য একই এনভায়রনমেন্ট পুনরায় ব্যবহার করতে পারেন অথবা যেকোনো সময় নতুন করে শুরু করতে পারেন।
নিম্নলিখিত উদাহরণটি দেখায় কিভাবে একটি নতুন রিমোট এনভায়রনমেন্টের সাথে ইন্টারঅ্যাকশন তৈরি করতে হয় এবং এর আইডি পুনরুদ্ধার করতে হয়:
পাইথন
from google import genai
client = genai.Client()
interaction = client.interactions.create(
agent="antigravity-preview-05-2026",
input="Install pandas and matplotlib, verify the imports, and print the versions.",
environment="remote",
)
print(f"Environment ID: {interaction.environment_id}")
জাভাস্ক্রিপ্ট
import { GoogleGenAI } from "@google/genai";
const client = new GoogleGenAI({});
const interaction = await client.interactions.create({
agent: "antigravity-preview-05-2026",
input: "Install pandas and matplotlib, verify the imports, and print the versions.",
environment: "remote",
});
console.log(`Environment ID: ${interaction.environment_id}`);
বিশ্রাম
curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
-H "Content-Type: application/json" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H "Api-Revision: 2026-05-20" \
-d '{
"agent": "antigravity-preview-05-2026",
"input": "Install pandas and matplotlib, verify the imports, and print the versions.",
"environment": "remote"
}'
environment পরামিতি
environment প্যারামিটারটি তিনটি রূপ গ্রহণ করে:
| ফর্ম | উদাহরণ | কখন ব্যবহার করবেন |
|---|---|---|
"remote" | environment="remote" | একটি নতুন স্যান্ডবক্স প্রস্তুত করুন। |
| পরিবেশ আইডি | environment="env_abc123" | বিদ্যমান স্যান্ডবক্সটিকে তার সমস্ত ফাইল ও প্যাকেজসহ পুনরায় ব্যবহার করুন। |
| কনফিগারেশন অবজেক্ট | environment={...} | সোর্স, নেটওয়ার্ক রুল অথবা উভয়ই দিয়ে একটি নতুন স্যান্ডবক্স প্রস্তুত করুন। |
নিম্নলিখিত উদাহরণগুলিতে environment প্যারামিটার ব্যবহারের তিনটি পদ্ধতি দেখানো হয়েছে।
পাইথন
from google import genai
client = genai.Client()
# Fresh sandbox
interaction = client.interactions.create(
agent="antigravity-preview-05-2026",
input="Write a hello world script.",
environment="remote",
)
# Reuse an existing sandbox
interaction_2 = client.interactions.create(
agent="antigravity-preview-05-2026",
input="Modify the script to accept a name argument.",
environment=interaction.environment_id,
previous_interaction_id=interaction.id,
)
# New sandbox with sources
interaction_3 = client.interactions.create(
agent="antigravity-preview-05-2026",
input="List all files and summarize the project.",
environment={
"type": "remote",
"sources": [
{
"type": "repository",
"source": "https://github.com/octocat/Spoon-Knife",
"target": "/workspace/spoon-knife",
}
],
},
)
print(interaction.output_text)
জাভাস্ক্রিপ্ট
import { GoogleGenAI } from "@google/genai";
const client = new GoogleGenAI({});
// Fresh sandbox
const interaction = await client.interactions.create({
agent: "antigravity-preview-05-2026",
input: "Write a hello world script.",
environment: "remote",
});
// Reuse an existing sandbox
const interaction2 = await client.interactions.create({
agent: "antigravity-preview-05-2026",
input: "Modify the script to accept a name argument.",
environment: interaction.environment_id,
previous_interaction_id: interaction.id,
});
// New sandbox with sources
const interaction3 = await client.interactions.create({
agent: "antigravity-preview-05-2026",
input: "List all files and summarize the project.",
environment: {
type: "remote",
sources: [
{
type: "repository",
source: "https://github.com/octocat/Spoon-Knife",
target: "/workspace/spoon-knife",
},
],
},
});
console.log(interaction.output_text);
বিশ্রাম
# Fresh sandbox
curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
-H "Content-Type: application/json" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H "Api-Revision: 2026-05-20" \
-d '{
"agent": "antigravity-preview-05-2026",
"input": [{"type": "text", "text": "Write a hello world script."}],
"environment": "remote"
}'
# Reuse an existing sandbox (replace $ENV_ID and $INTERACTION_ID with values from the previous response)
curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
-H "Content-Type: application/json" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H "Api-Revision: 2026-05-20" \
-d "{
\"agent\": \"antigravity-preview-05-2026\",
\"input\": [{\"type\": \"text\", \"text\": \"Modify the script to accept a name argument.\"}],
\"environment\": \"$ENV_ID\",
\"previous_interaction_id\": \"$INTERACTION_ID\"
}"
# New sandbox with sources
curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
-H "Content-Type: application/json" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H "Api-Revision: 2026-05-20" \
-d '{
"agent": "antigravity-preview-05-2026",
"input": [{"type": "text", "text": "List all files and summarize the project."}],
"environment": {
"type": "remote",
"sources": [
{
"type": "repository",
"source": "https://github.com/octocat/Spoon-Knife",
"target": "/workspace/spoon-knife"
}
]
}
}'
একটি পরিবেশ কনফিগার করুন
একটি এনভায়রনমেন্ট সেট আপ করার একটি উপায় হলো এজেন্টকে জানিয়ে দেওয়া যে আপনার কী কী ইনস্টল করা প্রয়োজন। এটি ডিপেন্ডেন্সি রেজোলিউশন এবং ট্রাবলশুটিং পরিচালনা করে। এনভায়রনমেন্ট প্রস্তুত হয়ে গেলে, environment_id সেভ করে রাখুন এবং পুনরায় ব্যবহার করুন।
পাইথন
from google import genai
client = genai.Client()
interaction = client.interactions.create(
agent="antigravity-preview-05-2026",
input="Install pandas, matplotlib, and seaborn. Verify all imports work and print the installed versions.",
environment="remote",
)
# Reuse the configured environment
interaction_2 = client.interactions.create(
agent="antigravity-preview-05-2026",
input="Clone https://github.com/octocat/Spoon-Knife into /workspace/tools. Run the test suite and fix any missing dependencies.",
environment=interaction.environment_id,
previous_interaction_id=interaction.id,
)
# Reuse the configured environment
interaction_3 = client.interactions.create(
agent="antigravity-preview-05-2026",
input="Using the tools in /workspace/tools, list the files.",
environment=interaction.environment_id,
previous_interaction_id=interaction_2.id,
)
print(interaction.output_text)
জাভাস্ক্রিপ্ট
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. Verify all imports work and print the installed versions.",
environment: "remote",
});
const interaction2 = await client.interactions.create({
agent: "antigravity-preview-05-2026",
input: "Clone https://github.com/octocat/Spoon-Knife into /workspace/tools. Run the test suite and fix any missing dependencies.",
environment: interaction.environment_id,
previous_interaction_id: interaction.id,
});
const interaction3 = await client.interactions.create({
agent: "antigravity-preview-05-2026",
input: "Using the tools in /workspace/tools, list the files.",
environment: interaction.environment_id,
previous_interaction_id: interaction2.id,
});
console.log(interaction.output_text);
বিশ্রাম
# Create interaction
curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
-H "Content-Type: application/json" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H "Api-Revision: 2026-05-20" \
-d '{
"agent": "antigravity-preview-05-2026",
"input": "Install pandas, matplotlib, and seaborn. Verify all imports work and print the installed versions.",
"environment": "remote"
}'
একটি উৎস থেকে মাউন্ট করুন
এজেন্টের ঠিক কোন ফাইলগুলো প্রয়োজন তা যদি আপনি জানেন, তবে বারবার না করে একটিমাত্র কলে সেগুলোকে মাউন্ট করুন। environment কনফিগ অবজেক্টটি তিন ধরনের sources অ্যারে গ্রহণ করে:
| উৎস প্রকার | type মান | বর্ণনা | সীমা |
|---|---|---|---|
| গিট রিপোজিটরি | repository | একটি URL থেকে রিপোজিটরিকে target -এর স্যান্ডবক্সে ক্লোন করে। | ৫০০ এমবি |
| ক্লাউড স্টোরেজ | gcs | ক্লাউড স্টোরেজ থেকে কোনো ফাইল বা ডিরেক্টরি target -এর স্যান্ডবক্সে কপি করে। | ২ জিবি |
| ইনলাইন কন্টেন্ট | inline | target -এ অবস্থিত স্যান্ডবক্সের একটি ফাইলে মূল টেক্সট কন্টেন্ট লেখে। | প্রতি ফাইলে ১ এমবি, মোট ২ এমবি |
পাইথন
from google import genai
client = genai.Client()
interaction = client.interactions.create(
agent="antigravity-preview-05-2026",
input="List all files under /workspace and describe what you find.",
environment={
"type": "remote",
"sources": [
{
"type": "repository",
"source": "https://github.com/octocat/Spoon-Knife",
"target": "/workspace/spoon-knife",
},
{
"type": "gcs",
"source": "gs://cloud-samples-data/bigquery/us-states/",
"target": "/workspace/gcs-data",
},
{
"type": "inline",
"content": "# Project Notes\n\n- Analyze state population data\n- Create visualizations\n",
"target": "/workspace/notes/readme.md",
},
],
},
)
print(interaction.output_text)
জাভাস্ক্রিপ্ট
import { GoogleGenAI } from "@google/genai";
const client = new GoogleGenAI({});
const interaction = await client.interactions.create({
agent: "antigravity-preview-05-2026",
input: "List all files under /workspace and describe what you find.",
environment: {
type: "remote",
sources: [
{
type: "repository",
source: "https://github.com/octocat/Spoon-Knife",
target: "/workspace/spoon-knife",
},
{
type: "gcs",
source: "gs://cloud-samples-data/bigquery/us-states/",
target: "/workspace/gcs-data",
},
{
type: "inline",
content: "# Project Notes\n\n- Analyze state population data\n- Create visualizations\n",
target: "/workspace/notes/readme.md",
},
],
},
});
console.log(interaction.output_text);
বিশ্রাম
# Create interaction with sources
curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
-H "Content-Type: application/json" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H "Api-Revision: 2026-05-20" \
-d '{
"agent": "antigravity-preview-05-2026",
"input": "List all files under /workspace and describe what you find.",
"environment": {
"type": "remote",
"sources": [
{
"type": "repository",
"source": "https://github.com/octocat/Spoon-Knife",
"target": "/workspace/spoon-knife"
},
{
"type": "gcs",
"source": "gs://cloud-samples-data/bigquery/us-states/",
"target": "/workspace/gcs-data"
},
{
"type": "inline",
"content": "# Project Notes\n\n- Analyze state population data\n- Create visualizations\n",
"target": "/workspace/notes/readme.md"
}
]
}
}'
আপনি উভয় পদ্ধতিই একত্রিত করতে পারেন: পরিচিত সোর্সগুলোকে ডিক্লারেটিভভাবে মাউন্ট করুন, তারপর প্যাকেজ ইনস্টল করতে বা সেটআপ স্ক্রিপ্ট চালাতে ফলো-আপ ইন্টারঅ্যাকশনের মাধ্যমে পুনরাবৃত্তি করুন। কাস্টম সোর্স যোগ করার সময় আপনি রুট ( / ) কে টার্গেট হিসেবে সেট করতে পারবেন না, আপনাকে সর্বদা একটি সাব-ডিরেক্টরি নির্দিষ্ট করতে হবে।
ব্যক্তিগত সূত্র
আপনি নেটওয়ার্ক কনফিগারেশনে ক্রেডেনশিয়াল যোগ করে ব্যক্তিগত গিটহাব রিপোজিটরি বা ব্যক্তিগত ক্লাউড স্টোরেজ বাকেট থেকেও ডাউনলোড করতে পারেন:
ব্যক্তিগত গিট রিপোজিটরিগুলির জন্য, আপনার গিটহাব পার্সোনাল অ্যাক্সেস টোকেন (PAT) দিয়ে Basic অথেন্টিকেশন ব্যবহার করুন। ইউজারনেম হিসেবে x-oauth-basic ব্যবহার করে টোকেনটি এনকোড করুন:
echo -n "x-oauth-basic:ghp_YourPATHere" | base64
পাইথন
interaction = client.interactions.create(
agent="antigravity-preview-05-2026",
input="Run the test for my backend app and fix any issue.",
environment={
"type": "remote",
"sources": [
{
"type": "repository",
"source": "https://github.com/your-org/backend",
"target": "/backend-app"
}
],
"network": {
"allowlist": [
{
"domain": "github.com",
"transform": {
"Authorization": "Basic YOUR_BASE64_TOKEN"
}
},
{
"domain": "*"
}
]
}
}
)
জাভাস্ক্রিপ্ট
const interaction = await client.interactions.create({
agent: "antigravity-preview-05-2026",
input: "Run the test for my backend app and fix any issue.",
environment: {
type: "remote",
sources: [
{
type: "repository",
source: "https://github.com/your-org/backend",
target: "/backend-app"
}
],
network: {
allowlist: [
{
domain: "github.com",
transform: {
"Authorization": "Basic YOUR_BASE64_TOKEN"
}
},
{
domain: "*"
}
]
}
},
});
বিশ্রাম
curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
-H "Content-Type: application/json" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H "Api-Revision: 2026-05-20" \
-d '{
"agent": "antigravity-preview-05-2026",
"input": "Run the test for my backend app and fix any issue.",
"environment": {
"type": "remote",
"sources": [
{
"type": "repository",
"source": "https://github.com/your-org/backend",
"target": "/backend-app"
}
],
"network": {
"allowlist": [
{
"domain": "github.com",
"transform": {
"Authorization": "Basic YOUR_BASE64_TOKEN"
}
},
{
"domain": "*"
}
]
}
}
}'
ব্যক্তিগত ক্লাউড স্টোরেজ বাকেটগুলির জন্য, একটি স্ট্যান্ডার্ড OAuth 2.0 বেয়ারার টোকেন ব্যবহার করুন:
gcloud auth print-access-token
পাইথন
interaction = client.interactions.create(
agent="antigravity-preview-05-2026",
input="Analyze the discrepancies across the data in workspace",
environment={
"type": "remote",
"sources": [
{
"type": "gcs",
"source": "gs://my-private-bucket/data",
"target": "/workspace",
}
],
"network": {
"allowlist": [
{
"domain": "*.googleapis.com",
"transform": {
"Authorization": "Bearer YOUR_GCS_TOKEN"
}
},
{
"domain": "*"
}
]
}
},
)
জাভাস্ক্রিপ্ট
const interaction = await client.interactions.create({
agent: "antigravity-preview-05-2026",
input: "Analyze the discrepancies across the data in workspace",
environment: {
type: "remote",
sources: [
{
type: "gcs",
source: "gs://my-private-bucket/data",
target: "/workspace",
}
],
network: {
allowlist: [
{
domain: "storage.googleapis.com",
transform: {
"Authorization": "Bearer YOUR_GCS_TOKEN"
}
},
{
domain: "*"
}
]
}
},
});
বিশ্রাম
curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
-H "Content-Type: application/json" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H "Api-Revision: 2026-05-20" \
-d '{
"agent": "antigravity-preview-05-2026",
"input": "Analyze the discrepancies across the data in workspace",
"environment": {
"type": "remote",
"sources": [
{
"type": "gcs",
"source": "gs://my-private-bucket/data",
"target": "/workspace"
}
],
"network": {
"allowlist": [
{
"domain": "storage.googleapis.com",
"transform": {
"Authorization": "Bearer YOUR_GCS_TOKEN"
}
},
{
"domain": "*"
}
]
}
}
}'
আগে থেকে ইনস্টল করা সফটওয়্যার
স্যান্ডবক্সটি উবুন্টুতে চলে এবং এতে রানটাইম ও সাধারণ প্যাকেজগুলো আগে থেকেই ইনস্টল করা থাকে। এজেন্টটি রানটাইমে pip install বা npm install ব্যবহার করে অতিরিক্ত প্যাকেজ ইনস্টল করতে পারে। কোনো ইন্টারঅ্যাকশনের সময় ইনস্টল করা প্যাকেজগুলো একই environment_id পুনরায় ব্যবহার করলেও থেকে যায়।
| বিভাগ | আগে থেকে ইনস্টল করা প্যাকেজগুলি |
|---|---|
| ইউনিক্স টুলস | curl , wget , git , rsync , unzip , ripgrep , fd-find , gawk , bc , tree , which , lsof , htop , jq , iproute2 , procps , gcloud CLI |
| পাইথন ৩.১২ | numpy , pandas , requests , google-genai , beautifulsoup4 , pyyaml , ast-grep-cli |
| নোড.জেএস ২২ | create-next-app , create-vite , typescript |
নেটওয়ার্ক কনফিগারেশন
ডিফল্টরূপে, এনভায়রনমেন্টগুলোর জন্য অবাধ আউটবাউন্ড নেটওয়ার্ক অ্যাক্সেস থাকে। নির্দিষ্ট ডোমেইনে আউটবাউন্ড ট্র্যাফিক সীমাবদ্ধ করতে network ফিল্ডটি ব্যবহার করুন। প্রতিটি নিয়মে একটি domain এবং একটি ঐচ্ছিক transform অবজেক্ট নির্দিষ্ট করা থাকে, যা সংশ্লিষ্ট রিকোয়েস্টগুলোতে হেডার ইনজেক্ট করে। এই হেডারগুলো প্রতিটি ইন্টারঅ্যাকশনের জন্য স্বতন্ত্র হতে পারে এবং আপনি একই এনভায়রনমেন্টের জন্য এগুলো আপডেট করতে পারেন।
| মাঠ | প্রকার | বর্ণনা |
|---|---|---|
domain | string | ডোমেইন অবশ্যই মেলাতে হবে। সমস্ত ডোমেইনের জন্য সঠিক হোস্টনেম অথবা * ব্যবহার করুন। |
transform | object | সংশ্লিষ্ট অনুরোধগুলিতে ইনজেক্ট করার জন্য হেডারগুলির প্রতিনিধিত্বকারী ফ্ল্যাট কী-ভ্যালু পেয়ার ধারণকারী অবজেক্ট, যেমন {"Authorization": "Bearer ..."} । |
পাইথন
from google import genai
client = genai.Client()
interaction = client.interactions.create(
agent="antigravity-preview-05-2026",
input="Fetch the latest issues from the GitHub API for my-org/my-repo.",
environment={
"type": "remote",
"network": {
"allowlist": [
{
"domain": "api.github.com",
"transform": {
"Authorization": "Bearer ghp_your_github_token"
},
},
{"domain": "pypi.org"},
{"domain": "*"},
]
},
},
)
print(interaction.output_text)
জাভাস্ক্রিপ্ট
import { GoogleGenAI } from "@google/genai";
const client = new GoogleGenAI({});
const interaction = await client.interactions.create({
agent: "antigravity-preview-05-2026",
input: "Fetch the latest issues from the GitHub API for my-org/my-repo.",
environment: {
type: "remote",
network: {
allowlist: [
{
domain: "api.github.com",
transform: {
"Authorization": "Bearer ghp_your_github_token"
},
},
{ domain: "pypi.org" },
{ domain: "*" },
]
}
},
});
console.log(interaction.output_text);
বিশ্রাম
curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
-H "Content-Type: application/json" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H "Api-Revision: 2026-05-20" \
-d '{
"agent": "antigravity-preview-05-2026",
"input": [{"type": "text", "text": "Fetch the latest issues from the GitHub API for my-org/my-repo."}],
"environment": {
"type": "remote",
"network": {
"allowlist": [
{
"domain": "api.github.com",
"transform": {
"Authorization": "Bearer ghp_your_github_token"
}
},
{"domain": "pypi.org"},
{"domain": "*"}
]
}
}
}'
যখন একটি অ্যালাওলিস্ট সেট করা হয়, তখন শুধুমাত্র স্পষ্টভাবে তালিকাভুক্ত ডোমেইনগুলিতে করা অনুরোধগুলিই অনুমোদিত হয়। আপনি সাবডোমেইন মেলানোর জন্য ওয়াইল্ডকার্ড ব্যবহার করতে পারেন (যেমন, {"domain": "*.example.com"} ), কিন্তু মনে রাখবেন যে এটি রুট ডোমেইন example.com কে মেলায় না, যা আলাদাভাবে যোগ করতে হবে। অন্য সব ট্র্যাফিককে অনুমতি দেওয়ার জন্য, যেমন ইনজেক্টেড হেডার ছাড়া তালিকাভুক্ত নয় এমন ডোমেইন রাউটিং করার জন্য, {"domain": "*"} একটি ক্যাচ-অল এন্ট্রি হিসেবে যোগ করুন।
যোগ্যতা
হেডার ট্রান্সফরমেশন যোগ করার মাধ্যমে আপনি আপনার এজেন্টের ব্যবহারের জন্য ক্রেডেনশিয়াল যুক্ত করতে পারেন। এই ক্রেডেনশিয়ালগুলো একটি ইগ্রেস প্রক্সির মাধ্যমে সংশ্লিষ্ট HTTP হেডারে ইনজেক্ট করা হয়; এগুলো স্যান্ডবক্সের ভেতরে এনভায়রনমেন্ট ভেরিয়েবল বা ফাইল হিসেবে কখনোই প্রকাশ করা হয় না।
পাইথন
import subprocess
from google import genai
# Fetch a short-lived access token from your local gcloud CLI
gcloud_token = subprocess.check_output(
["gcloud", "auth", "print-access-token"], text=True
).strip()
client = genai.Client()
interaction = client.interactions.create(
agent="antigravity-preview-05-2026",
input="List the files in gs://my-bucket/reports/ using the GCS JSON API.",
environment={
"type": "remote",
"network": {
"allowlist": [
{
"domain": "storage.googleapis.com",
"transform": {
"Authorization": f"Bearer {gcloud_token}"
},
}
]
},
},
)
print(interaction.output_text)
জাভাস্ক্রিপ্ট
import { GoogleGenAI } from "@google/genai";
import { execSync } from "child_process";
const gcloudToken = execSync("gcloud auth print-access-token").toString().trim();
const client = new GoogleGenAI({});
const interaction = await client.interactions.create({
agent: "antigravity-preview-05-2026",
input: "List the files in gs://my-bucket/reports/ using the GCS JSON API.",
environment: {
type: "remote",
network: {
allowlist: [
{
domain: "storage.googleapis.com",
transform: {
"Authorization": `Bearer ${gcloudToken}`
},
}
]
}
},
});
console.log(interaction.output_text);
বিশ্রাম
curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
-H "Content-Type: application/json" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H "Api-Revision: 2026-05-20" \
-d '{
"agent": "antigravity-preview-05-2026",
"input": "List the files in gs://my-bucket/reports/ using the GCS JSON API.",
"environment": {
"type": "remote",
"network": {
"allowlist": [
{
"domain": "storage.googleapis.com",
"transform": {
"Authorization": "Bearer <YOUR_GCLOUD_TOKEN>"
}
}
]
}
}
}'
নেটওয়ার্ক অ্যাক্সেস নিষ্ক্রিয় করুন
সমস্ত বহির্গামী নেটওয়ার্ক অ্যাক্সেস ব্লক করতে, network disabled করুন:
পাইথন
from google import genai
client = genai.Client()
interaction = client.interactions.create(
agent="antigravity-preview-05-2026",
input="Analyze the local files only.",
environment={
"type": "remote",
"network": "disabled",
},
)
print(interaction.output_text)
জাভাস্ক্রিপ্ট
import { GoogleGenAI } from "@google/genai";
const client = new GoogleGenAI({});
const interaction = await client.interactions.create({
agent: "antigravity-preview-05-2026",
input: "Analyze the local files only.",
environment: {
type: "remote",
network: "disabled",
},
});
console.log(interaction.output_text);
বিশ্রাম
curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
-H "Content-Type: application/json" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H "Api-Revision: 2026-05-20" \
-d '{
"agent": "antigravity-preview-05-2026",
"input": "Analyze the local files only.",
"environment": {
"type": "remote",
"network": "disabled"
}
}'
পরিবেশের জীবনচক্র
পরিবেশসমূহ এই জীবনচক্র অনুসরণ করে:
| রাজ্য | আচরণ |
|---|---|
| তৈরি করা হয়েছে | যখন কোনো ইন্টারঅ্যাকশনে environment: "remote" বা একটি কনফিগ অবজেক্ট নির্দিষ্ট করা থাকে, তখন এটি সরবরাহ করা হয়। |
| সক্রিয় | কোনো মিথস্ক্রিয়া চলাকালীন চলছে। |
| নিষ্ক্রিয় | স্বয়ংক্রিয়ভাবে ছবি তোলা শুরু হয় এবং ১৫ মিনিট নিষ্ক্রিয় থাকার পর তা বন্ধ হয়ে যায়। |
| অফলাইন | শেষবার সক্রিয় হওয়ার পর থেকে ৭ দিনের জন্য সংরক্ষিত। এর আইডি দিয়ে পুনরায় চালু করা যাবে। |
| মুছে ফেলা হয়েছে | সিস্টেম থেকে মুছে ফেলা হয়েছে। |
পরিবেশ থেকে ফাইল ডাউনলোড করুন
এজেন্টটি এক্সিকিউশনের সময় স্যান্ডবক্সের ভিতরে ফাইল তৈরি করে। আপনি ফাইলস এপিআই (Files API) ব্যবহার করে সম্পূর্ণ এনভায়রনমেন্ট স্ন্যাপশটটি একটি ট্যার (tar) ফাইল হিসাবে ডাউনলোড করতে পারেন:
পাইথন
import os
import requests
import tarfile
from google import genai
client = genai.Client()
interaction = client.interactions.create(
agent="antigravity-preview-05-2026",
input="Write a file environments_test.txt with content 'Environments' inside the sandbox.",
environment="remote",
)
env_id = interaction.environment_id
api_key = os.environ.get("GEMINI_API_KEY")
response = requests.get(
f"https://generativelanguage.googleapis.com/v1beta/files/environment-{env_id}:download",
params={"alt": "media"},
headers={"x-goog-api-key": api_key},
allow_redirects=True,
)
with open("snapshot_env.tar", "wb") as f:
f.write(response.content)
os.makedirs("extracted_env_snapshot", exist_ok=True)
with tarfile.open("snapshot_env.tar") as tar:
tar.extractall(path="extracted_env_snapshot")
print(os.listdir("extracted_env_snapshot"))
জাভাস্ক্রিপ্ট
import { GoogleGenAI } from "@google/genai";
import { execSync } from "child_process";
import * as fs from "fs";
const client = new GoogleGenAI({});
const interaction = await client.interactions.create({
agent: "antigravity-preview-05-2026",
input: "Write a file environments_test.txt with content 'Environments' inside the sandbox.",
environment: "remote",
});
const envId = interaction.environment_id;
const apiKey = process.env.GEMINI_API_KEY || "";
const url = `https://generativelanguage.googleapis.com/v1beta/files/environment-${envId}:download?alt=media`;
const response = await fetch(url, {
headers: {
"x-goog-api-key": apiKey,
},
});
if (!response.ok) {
throw new Error(`Failed to download file: ${response.statusText}`);
}
const buffer = Buffer.from(await response.arrayBuffer());
fs.writeFileSync("snapshot_env.tar", buffer);
if (!fs.existsSync("extracted_env_snapshot")) {
fs.mkdirSync("extracted_env_snapshot");
}
execSync("tar -xf snapshot_env.tar -C extracted_env_snapshot");
console.log(fs.readdirSync("extracted_env_snapshot"));
বিশ্রাম
curl -X POST "https://generativelanguage.googleapis.com/v1beta/interactions" \
-H "Content-Type: application/json" \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H "Api-Revision: 2026-05-20" \
-d '{
"agent": "antigravity-preview-05-2026",
"input": "Write a file environments_test.txt with content '\''Environments'\'' inside the sandbox.",
"environment": "remote"
}'
# Step 2: Download snapshot (reusing environment ID from Step 1)
# curl -L -X GET "https://generativelanguage.googleapis.com/v1beta/files/environment-$ENV_ID:download?alt=media" \
# -H "x-goog-api-key: $API_KEY" \
# -o snapshot.tar
মূল্য নির্ধারণ এবং সম্পদ
প্রতিটি পরিবেশ নির্দিষ্ট সম্পদ বরাদ্দ নিয়ে চলে:
| সম্পদ | মূল্য |
|---|---|
| সিপিইউ | ৪ কোর |
| স্মৃতি | ১৬ জিবি |
প্রিভিউ সময়কালে এনভায়রনমেন্ট কম্পিউট (সিপিইউ, মেমরি, স্যান্ডবক্স এক্সিকিউশন)-এর জন্য বিল করা হয় না । এজেন্ট টোকেন খরচের জন্য প্রাইসিং দেখুন।
সীমাবদ্ধতা
- প্রিভিউ স্ট্যাটাস: এনভায়রনমেন্ট এবং ম্যানেজড এজেন্টগুলো প্রিভিউ পর্যায়ে রয়েছে। ফিচার ও স্কিমা পরিবর্তিত হতে পারে।
- ইনলাইন সোর্সের আকার: ইনলাইন সোর্স প্রতি ফাইলে ১ মেগাবাইট এবং সমস্ত ফাইল মিলিয়ে মোট ২ মেগাবাইটে সীমাবদ্ধ।
- সোর্স সাইজ : গিট রিপোজিটরি ৫০০ এমবি এবং ক্লাউড স্টোরেজ রিপোজিটরি ২ জিবি পর্যন্ত সীমাবদ্ধ।
- এনভায়রনমেন্ট চালু করা: একটি নতুন এনভায়রনমেন্ট প্রস্তুত করতে প্রায় ৫ সেকেন্ড পর্যন্ত সময় লাগে। বড় সোর্স রিপোজিটরি এই সময় বাড়িয়ে দিতে পারে।
- ফাইল সমর্থন: এজেন্টটি বর্তমানে শুধুমাত্র টেক্সট এবং ইমেজ ফাইল পড়তে পারে। বাইনারি ফাইল সমর্থন এখনও উপলব্ধ নয়।
- রুট থেকে মাউন্ট করা যাবে না: কাস্টম সোর্স যোগ করার সময় আপনি রুট (
/) কে টার্গেট হিসেবে সেট করতে পারবেন না, আপনাকে সর্বদা একটি সাব-ডিরেক্টরি নির্দিষ্ট করতে হবে।
এরপর কী?
- এজেন্টদের সংক্ষিপ্ত বিবরণ : পরিচালিত এজেন্টদের মূল ধারণাগুলো সম্পর্কে জানুন।
- কুইকস্টার্ট : একাধিক পালায় কথোপকথন এবং স্ট্রিমিংয়ের মাধ্যমে নির্মাণ শুরু করুন।
- অ্যান্টিগ্র্যাভিটি এজেন্ট : ডিফল্ট এজেন্টের সক্ষমতা, টুল এবং মূল্য সম্পর্কে জানুন।
- কাস্টম এজেন্ট তৈরি করা :
AGENTS.mdএবংSKILL.mdব্যবহার করে আপনার নিজস্ব এজেন্ট সংজ্ঞায়িত করুন।