관리 에이전트 빠른 시작

이 가이드에서는 Antigravity 에이전트를 사용하여 Gemini API에서 관리형 에이전트를 만들고 사용하는 방법을 안내합니다. 첫 번째 에이전트 호출을 하고, 멀티턴 대화를 계속하고, 응답을 스트리밍하고, 샌드박스에서 파일을 다운로드하고, Antigravity 관리형 에이전트를 사용합니다.

첫 번째 에이전트 상호작용 실행

Interactions API를 한 번 호출하면 Linux 샌드박스가 프로비저닝되고, 에이전트 루프가 실행되고, 결과가 반환됩니다. 다음 세 가지 매개변수를 정의합니다.

  • 미리 정의된 범용 관리형 에이전트의 현재 버전인 agent"antigravity-preview-05-2026",으로 전달합니다.
  • 새 샌드박스 환경을 프로비저닝하려면 environment="remote"를 정의합니다.
  • 에이전트가 수행할 작업을 정의하는 입력을 만듭니다.

Python

from google import genai

client = genai.Client()

interaction = client.interactions.create(
    agent="antigravity-preview-05-2026",
    input="Write a Python script that generates the first 20 Fibonacci numbers and saves them to fibonacci.txt. Then read the file and print its contents.",
    environment="remote",
)

# Print the agent's final output
print(f"Interaction ID: {interaction.id}")
print(f"Environment ID: {interaction.environment_id}")
print(f"Output: