Example Request
curl -X POST https://generativelanguage.googleapis.com/v1beta/interactions \
-H "x-goog-api-key: $GEMINI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"agent": "antigravity-preview-05-2026",
"input": "List all files under /workspace and summarize what you find.",
"environment": {
"type": "remote",
"sources": [
{
"type": "repository",
"source": "https://github.com/octocat/Spoon-Knife",
"target": "/workspace/repo"
},
{
"type": "inline",
"content": "Focus on Python files only.",
"target": "/workspace/notes.txt"
}
]
}
}'
from google import genai
client = genai.Client()
interaction = client.interactions.create(
agent="antigravity-preview-05-2026",
input="List all files under /workspace and summarize what you find.",
environment={
"type": "remote",
"sources": [
{
"type": "repository",
"source": "https://github.com/octocat/Spoon-Knife",
"target": "/workspace/repo",
},
{
"type": "inline",
"content": "Focus on Python files only.",
"target": "/workspace/notes.txt",
},
],
},
)
print(interaction.output_text)
import {GoogleGenAI} from '@google/genai';
const ai = new GoogleGenAI({});
const interaction = await ai.interactions.create({
agent: 'antigravity-preview-05-2026',
input: 'List all files under /workspace and summarize what you find.',
environment: {
type: 'remote',
sources: [
{
type: 'repository',
source: 'https://github.com/octocat/Spoon-Knife',
target: '/workspace/repo',
},
{
type: 'inline',
content: 'Focus on Python files only.',
target: '/workspace/notes.txt',
},
],
},
});
console.log(interaction.output_text);
import com.google.genai.gaos.models.interactions.AgentOption;
import com.google.genai.Client;
import com.google.genai.gaos.models.interactions.CreateAgentInteraction;
import com.google.genai.gaos.models.interactions.CreateAgentInteractionEnvironment;
import com.google.genai.gaos.models.operations.CreateInteractionRequestBody;
import com.google.genai.gaos.models.operations.CreateInteractionResponse;
import com.google.genai.gaos.models.environments.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;
Client client = new Client();
com.google.genai.gaos.models.interactions.Environment env =
com.google.genai.gaos.models.interactions.Environment.builder()
.sources(
List.of(
Source.builder()
.type(SourceType.REPOSITORY)
.source("https://github.com/octocat/Spoon-Knife")
.target("/workspace/repo")
.build(),
Source.builder()
.type(SourceType.INLINE)
.content("Focus on Python files only.")
.target("/workspace/notes.txt")
.build()))
.build();
CreateAgentInteraction params =
CreateAgentInteraction.builder()
.agent(AgentOption.of("antigravity-preview-05-2026"))
.input(
InteractionsInput.of(
"List all files under /workspace and summarize what you find."))
.environment(CreateAgentInteractionEnvironment.of(env))
.build();
CreateInteractionResponse response =
client.interactions.create(CreateInteractionRequestBody.of(params));
Interaction interaction =
response.interaction().orElseThrow(() -> new RuntimeException("No interaction returned"));
System.out.println(interaction.outputText().orElse(""));
package main
import (
"context"
"fmt"
"log"
"google.golang.org/genai"
gaos_interactions "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 := gaos_interactions.Environment{
Sources: []gaos_interactions.Source{
{
Type: genai.Ptr(gaos_interactions.SourceTypeRepository),
Source: genai.Ptr("https://github.com/octocat/Spoon-Knife"),
Target: genai.Ptr("/workspace/repo"),
},
{
Type: genai.Ptr(gaos_interactions.SourceTypeInline),
Content: genai.Ptr("Focus on Python files only."),
Target: genai.Ptr("/workspace/notes.txt"),
},
},
}
body := operations.NewCreateInteractionRequestBody(gaos_interactions.CreateAgentInteraction{
Agent: gaos_interactions.AgentOption("antigravity-preview-05-2026"),
Input: genai.Ptr(gaos_interactions.NewInteractionsInput("List all files under /workspace and summarize what you find.")),
Environment: genai.Ptr(gaos_interactions.NewCreateAgentInteractionEnvironment(env)),
})
res, err := client.Interactions.Create(ctx, operations.CreateInteractionRequest{Body: body})
if err != nil {
log.Fatal(err)
}
if res.Interaction != nil && res.Interaction.OutputText != nil {
fmt.Println(*res.Interaction.OutputText)
}
}