পরিচালিত এজেন্টদের মধ্যে পরিবেশ

এনভায়রনমেন্ট হলো পরিচালিত লিনাক্স স্যান্ডবক্স, যা এজেন্টদের কোড এক্সিকিউট করতে এবং ফাইল সংরক্ষণ করতে একটি বিচ্ছিন্ন জায়গা দেয়। এগুলো ইন্টারঅ্যাকশন কনটেক্সট থেকে বিচ্ছিন্ন থাকে, ফলে আপনি একাধিক ইন্টারঅ্যাকশনের জন্য একই এনভায়রনমেন্ট পুনরায় ব্যবহার করতে পারেন অথবা যেকোনো সময় নতুন করে শুরু করতে পারেন।

নিম্নলিখিত উদাহরণটি দেখায় কিভাবে একটি নতুন রিমোট এনভায়রনমেন্টের সাথে ইন্টারঅ্যাকশন তৈরি করতে হয় এবং এর আইডি পুনরুদ্ধার করতে হয়:

পাইথন

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" \
-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"