Skip to main content

antigravitystreaming

Stream text from the Google Antigravity CLI (agy). This library is a text-completion alternative to agentmake: you pass chat messages, and it yields response text as the CLI produces it.

Authentication is the signed-in session managed by agy (under ~/.gemini/antigravity-cli). The child process does not receive GEMINI_API_KEY or GOOGLE_API_KEY. No API key is read or sent.

Install

pip install antigravitystreaming

Requires the agy executable on PATH, at ~/.local/bin/agy, or at ~/.gemini/antigravity-cli/bin/agy, and a completed agy sign-in.

Stream

import asyncio
from antigravitystreaming import stream_text

async def main():
    messages = [
        {"role": "system", "content": "You are a concise Bible study assistant."},
        {"role": "user", "content": "What is John 3:16 about?"},
        {"role": "assistant", "content": "It states God's love for the world."},
    ]
    async for chunk in stream_text(messages, follow_up="Quote it briefly."):
        print(chunk, end="", flush=True)

asyncio.run(main())

messages use role and content, the same shape agentmake accepts. follow_up is the newest user turn. An explicit system argument or system messages in messages are combined with the prompt under text-only guidance so instructions stay intact. Each call is a new headless process: the library does not resume a previous Antigravity session.

The process is text-only. It runs non-interactively with --output-format stream-json, --dangerously-skip-permissions, and --disable-slash-commands, in a temporary working directory outside the caller's project. Cancel an in-flight stream by setting the asyncio.Event passed as cancel_event.

model defaults to the CLI's configured model (e.g. Gemini 3.8 Flash (High)), so the library follows whatever agy is signed in and set up to run. Pass model="gemini-3.8-flash-high" or another model name to pin one. Pass effort="high" (or low, medium, xhigh, max) to configure reasoning effort.

collect_text returns the whole reply:

from antigravitystreaming import collect_text

text = await collect_text(follow_up="Reply with exactly: pong")

Metadata

Release files for antigravitystreaming 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for antigravitystreaming 0.1.0
File Size Uploaded
antigravitystreaming-0.1.0.tar.gz 8.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for antigravitystreaming 0.1.0
File Interpreter ABI Platform
antigravitystreaming-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 15.4 kB

Release files / antigravitystreaming-0.1.0.tar.gz

Download URL antigravitystreaming-0.1.0.tar.gz
Size 8.0 kB
Tags Source
SHA-256 checksum
How to use checksums
48529716474e795aedd09214f918e398c324f6dd1c3411169adcfbf522665162
BLAKE2b-256 checksum
How to use checksums
6e856be46f85db94384f581ec20703289e870bf9889acaad212a94e6b8950d27
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release files / antigravitystreaming-0.1.0-py3-none-any.whl

Download URL antigravitystreaming-0.1.0-py3-none-any.whl
Size 7.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
79667339833a49b784c04bf0fdcf37162683d0dbdbf97e0c2ce28a8a416834be
BLAKE2b-256 checksum
How to use checksums
f5e30dd8f028a7aa7251d6d1d2d4337eac75ccababbbdce1a737ce8a9fdc4d46
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.13

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page