curl -X GET 'https://generativelanguage.googleapis.com/v1beta/environments/env_abc123/files/main.py' \
-H "x-goog-api-key: $GEMINI_API_KEY"
from google import genai
client = genai.Client()
response = client.environments.files.get(
environment=created.id,
path="main.py",
)
for file in response.files or []:
print(file.name, file.size_bytes)
import {GoogleGenAI} from '@google/genai';
const ai = new GoogleGenAI({});
const response = await ai.environments.files.list({
environment: created.id,
path: 'main.py',
});
for (const file of response.files ?? []) {
console.log(file.name, file.size_bytes);
}